@7pmlabs/design-system 0.6.2 → 0.6.4

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 (436) hide show
  1. package/README.md +1 -0
  2. package/dist/design-system.mjs +46 -48
  3. package/dist/design-system.mjs.map +1 -1
  4. package/dist/design-system10.mjs +56 -83
  5. package/dist/design-system10.mjs.map +1 -1
  6. package/dist/design-system100.mjs +67 -16
  7. package/dist/design-system100.mjs.map +1 -1
  8. package/dist/design-system101.mjs +6 -67
  9. package/dist/design-system101.mjs.map +1 -1
  10. package/dist/design-system102.mjs +18 -68
  11. package/dist/design-system102.mjs.map +1 -1
  12. package/dist/design-system103.mjs +24 -5
  13. package/dist/design-system103.mjs.map +1 -1
  14. package/dist/design-system104.mjs +2172 -18
  15. package/dist/design-system104.mjs.map +1 -1
  16. package/dist/design-system105.mjs +13 -24
  17. package/dist/design-system105.mjs.map +1 -1
  18. package/dist/design-system106.mjs +34 -2169
  19. package/dist/design-system106.mjs.map +1 -1
  20. package/dist/design-system107.mjs +28 -14
  21. package/dist/design-system107.mjs.map +1 -1
  22. package/dist/design-system108.mjs +20 -37
  23. package/dist/design-system108.mjs.map +1 -1
  24. package/dist/design-system109.mjs +20 -28
  25. package/dist/design-system109.mjs.map +1 -1
  26. package/dist/design-system11.mjs +19 -52
  27. package/dist/design-system11.mjs.map +1 -1
  28. package/dist/design-system110.mjs +11 -18
  29. package/dist/design-system110.mjs.map +1 -1
  30. package/dist/design-system111.mjs +22 -16
  31. package/dist/design-system111.mjs.map +1 -1
  32. package/dist/design-system112.mjs +28 -13
  33. package/dist/design-system112.mjs.map +1 -1
  34. package/dist/design-system113.mjs +5 -26
  35. package/dist/design-system113.mjs.map +1 -1
  36. package/dist/design-system114.mjs +95 -27
  37. package/dist/design-system114.mjs.map +1 -1
  38. package/dist/design-system115.mjs +4 -5
  39. package/dist/design-system115.mjs.map +1 -1
  40. package/dist/design-system116.mjs +2 -96
  41. package/dist/design-system116.mjs.map +1 -1
  42. package/dist/design-system117.mjs +2 -4
  43. package/dist/design-system117.mjs.map +1 -1
  44. package/dist/design-system118.mjs +20 -2
  45. package/dist/design-system118.mjs.map +1 -1
  46. package/dist/design-system119.mjs +1 -1
  47. package/dist/design-system12.mjs +95 -15
  48. package/dist/design-system12.mjs.map +1 -1
  49. package/dist/design-system120.mjs +2 -6
  50. package/dist/design-system120.mjs.map +1 -1
  51. package/dist/design-system121.mjs +2 -4
  52. package/dist/design-system121.mjs.map +1 -1
  53. package/dist/design-system122.mjs +2 -2
  54. package/dist/design-system123.mjs +58 -20
  55. package/dist/design-system123.mjs.map +1 -1
  56. package/dist/design-system124.mjs +2 -2
  57. package/dist/design-system125.mjs +4 -2
  58. package/dist/design-system125.mjs.map +1 -1
  59. package/dist/design-system126.mjs +8 -2
  60. package/dist/design-system126.mjs.map +1 -1
  61. package/dist/design-system127.mjs +7 -2
  62. package/dist/design-system127.mjs.map +1 -1
  63. package/dist/design-system128.mjs +62 -57
  64. package/dist/design-system128.mjs.map +1 -1
  65. package/dist/design-system129.mjs +4 -2
  66. package/dist/design-system129.mjs.map +1 -1
  67. package/dist/design-system13.mjs +14 -100
  68. package/dist/design-system13.mjs.map +1 -1
  69. package/dist/design-system130.mjs +8 -3
  70. package/dist/design-system130.mjs.map +1 -1
  71. package/dist/design-system131.mjs +6 -7
  72. package/dist/design-system131.mjs.map +1 -1
  73. package/dist/design-system132.mjs +3 -6
  74. package/dist/design-system132.mjs.map +1 -1
  75. package/dist/design-system133.mjs +3 -63
  76. package/dist/design-system133.mjs.map +1 -1
  77. package/dist/design-system134.mjs +5 -3
  78. package/dist/design-system134.mjs.map +1 -1
  79. package/dist/design-system135.mjs +10 -9
  80. package/dist/design-system135.mjs.map +1 -1
  81. package/dist/design-system136.mjs +4 -6
  82. package/dist/design-system136.mjs.map +1 -1
  83. package/dist/design-system137.mjs +5 -4
  84. package/dist/design-system137.mjs.map +1 -1
  85. package/dist/design-system138.mjs +4 -3
  86. package/dist/design-system138.mjs.map +1 -1
  87. package/dist/design-system139.mjs +2 -4
  88. package/dist/design-system139.mjs.map +1 -1
  89. package/dist/design-system14.mjs +18 -15
  90. package/dist/design-system14.mjs.map +1 -1
  91. package/dist/design-system140.mjs +11 -9
  92. package/dist/design-system140.mjs.map +1 -1
  93. package/dist/design-system141.mjs +27 -5
  94. package/dist/design-system141.mjs.map +1 -1
  95. package/dist/design-system142.mjs +6 -5
  96. package/dist/design-system142.mjs.map +1 -1
  97. package/dist/design-system143.mjs +6 -4
  98. package/dist/design-system143.mjs.map +1 -1
  99. package/dist/design-system144.mjs +7 -3
  100. package/dist/design-system144.mjs.map +1 -1
  101. package/dist/design-system145.mjs +4 -11
  102. package/dist/design-system145.mjs.map +1 -1
  103. package/dist/design-system146.mjs +6 -27
  104. package/dist/design-system146.mjs.map +1 -1
  105. package/dist/design-system147.mjs +6 -5
  106. package/dist/design-system147.mjs.map +1 -1
  107. package/dist/design-system148.mjs +6 -6
  108. package/dist/design-system148.mjs.map +1 -1
  109. package/dist/design-system149.mjs +10 -8
  110. package/dist/design-system149.mjs.map +1 -1
  111. package/dist/design-system15.mjs +23 -17
  112. package/dist/design-system15.mjs.map +1 -1
  113. package/dist/design-system150.mjs +6 -5
  114. package/dist/design-system150.mjs.map +1 -1
  115. package/dist/design-system151.mjs +7 -6
  116. package/dist/design-system151.mjs.map +1 -1
  117. package/dist/design-system152.mjs +9 -6
  118. package/dist/design-system152.mjs.map +1 -1
  119. package/dist/design-system153.mjs +6 -5
  120. package/dist/design-system153.mjs.map +1 -1
  121. package/dist/design-system154.mjs +18 -10
  122. package/dist/design-system154.mjs.map +1 -1
  123. package/dist/design-system155.mjs +7 -6
  124. package/dist/design-system155.mjs.map +1 -1
  125. package/dist/design-system156.mjs +12 -6
  126. package/dist/design-system156.mjs.map +1 -1
  127. package/dist/design-system157.mjs +3 -9
  128. package/dist/design-system157.mjs.map +1 -1
  129. package/dist/design-system158.mjs +7 -6
  130. package/dist/design-system158.mjs.map +1 -1
  131. package/dist/design-system159.mjs +9 -17
  132. package/dist/design-system159.mjs.map +1 -1
  133. package/dist/design-system16.mjs +60 -25
  134. package/dist/design-system16.mjs.map +1 -1
  135. package/dist/design-system160.mjs +11 -6
  136. package/dist/design-system160.mjs.map +1 -1
  137. package/dist/design-system161.mjs +5 -12
  138. package/dist/design-system161.mjs.map +1 -1
  139. package/dist/design-system162.mjs +10 -4
  140. package/dist/design-system162.mjs.map +1 -1
  141. package/dist/design-system163.mjs +15 -7
  142. package/dist/design-system163.mjs.map +1 -1
  143. package/dist/design-system164.mjs +5 -9
  144. package/dist/design-system164.mjs.map +1 -1
  145. package/dist/design-system165.mjs +5 -11
  146. package/dist/design-system165.mjs.map +1 -1
  147. package/dist/design-system166.mjs +8 -5
  148. package/dist/design-system166.mjs.map +1 -1
  149. package/dist/design-system167.mjs +7 -10
  150. package/dist/design-system167.mjs.map +1 -1
  151. package/dist/design-system168.mjs +5 -15
  152. package/dist/design-system168.mjs.map +1 -1
  153. package/dist/design-system169.mjs +5 -5
  154. package/dist/design-system169.mjs.map +1 -1
  155. package/dist/design-system17.mjs +244 -52
  156. package/dist/design-system17.mjs.map +1 -1
  157. package/dist/design-system170.mjs +6 -5
  158. package/dist/design-system170.mjs.map +1 -1
  159. package/dist/design-system171.mjs +6 -8
  160. package/dist/design-system171.mjs.map +1 -1
  161. package/dist/design-system172.mjs +5 -6
  162. package/dist/design-system172.mjs.map +1 -1
  163. package/dist/design-system173.mjs +39 -5
  164. package/dist/design-system173.mjs.map +1 -1
  165. package/dist/design-system174.mjs +6 -5
  166. package/dist/design-system174.mjs.map +1 -1
  167. package/dist/design-system175.mjs +5 -6
  168. package/dist/design-system175.mjs.map +1 -1
  169. package/dist/design-system176.mjs +16 -7
  170. package/dist/design-system176.mjs.map +1 -1
  171. package/dist/design-system177.mjs +7 -5
  172. package/dist/design-system177.mjs.map +1 -1
  173. package/dist/design-system178.mjs +3 -40
  174. package/dist/design-system178.mjs.map +1 -1
  175. package/dist/design-system179.mjs +4 -7
  176. package/dist/design-system179.mjs.map +1 -1
  177. package/dist/design-system18.mjs +107 -239
  178. package/dist/design-system18.mjs.map +1 -1
  179. package/dist/design-system180.mjs +12 -5
  180. package/dist/design-system180.mjs.map +1 -1
  181. package/dist/design-system181.mjs +5 -16
  182. package/dist/design-system181.mjs.map +1 -1
  183. package/dist/design-system182.mjs +4 -8
  184. package/dist/design-system182.mjs.map +1 -1
  185. package/dist/design-system183.mjs +5 -3
  186. package/dist/design-system183.mjs.map +1 -1
  187. package/dist/design-system184.mjs +5 -4
  188. package/dist/design-system184.mjs.map +1 -1
  189. package/dist/design-system185.mjs +5 -13
  190. package/dist/design-system185.mjs.map +1 -1
  191. package/dist/design-system186.mjs +5 -5
  192. package/dist/design-system186.mjs.map +1 -1
  193. package/dist/design-system187.mjs +5 -4
  194. package/dist/design-system187.mjs.map +1 -1
  195. package/dist/design-system188.mjs +15 -5
  196. package/dist/design-system188.mjs.map +1 -1
  197. package/dist/design-system189.mjs +14 -5
  198. package/dist/design-system189.mjs.map +1 -1
  199. package/dist/design-system19.mjs +113 -113
  200. package/dist/design-system19.mjs.map +1 -1
  201. package/dist/design-system190.mjs +9 -5
  202. package/dist/design-system190.mjs.map +1 -1
  203. package/dist/design-system191.mjs +4 -5
  204. package/dist/design-system191.mjs.map +1 -1
  205. package/dist/design-system192.mjs +6 -5
  206. package/dist/design-system192.mjs.map +1 -1
  207. package/dist/design-system193.mjs +5 -14
  208. package/dist/design-system193.mjs.map +1 -1
  209. package/dist/design-system194.mjs +5 -13
  210. package/dist/design-system194.mjs.map +1 -1
  211. package/dist/design-system195.mjs +6 -7
  212. package/dist/design-system195.mjs.map +1 -1
  213. package/dist/design-system196.mjs +18 -4
  214. package/dist/design-system196.mjs.map +1 -1
  215. package/dist/design-system197.mjs +9 -4
  216. package/dist/design-system197.mjs.map +1 -1
  217. package/dist/design-system198.mjs +4 -4
  218. package/dist/design-system198.mjs.map +1 -1
  219. package/dist/design-system199.mjs +4 -5
  220. package/dist/design-system199.mjs.map +1 -1
  221. package/dist/design-system2.mjs +52 -40
  222. package/dist/design-system2.mjs.map +1 -1
  223. package/dist/design-system20.mjs +193 -113
  224. package/dist/design-system20.mjs.map +1 -1
  225. package/dist/design-system200.mjs +4 -7
  226. package/dist/design-system200.mjs.map +1 -1
  227. package/dist/design-system201.mjs +5 -17
  228. package/dist/design-system201.mjs.map +1 -1
  229. package/dist/design-system202.mjs +6 -10
  230. package/dist/design-system202.mjs.map +1 -1
  231. package/dist/design-system203.mjs +11 -6
  232. package/dist/design-system203.mjs.map +1 -1
  233. package/dist/design-system204.mjs +6 -4
  234. package/dist/design-system204.mjs.map +1 -1
  235. package/dist/design-system205.mjs +17 -4
  236. package/dist/design-system205.mjs.map +1 -1
  237. package/dist/design-system206.mjs +4 -5
  238. package/dist/design-system206.mjs.map +1 -1
  239. package/dist/design-system207.mjs +4 -6
  240. package/dist/design-system207.mjs.map +1 -1
  241. package/dist/design-system208.mjs +4 -11
  242. package/dist/design-system208.mjs.map +1 -1
  243. package/dist/design-system209.mjs +3 -6
  244. package/dist/design-system209.mjs.map +1 -1
  245. package/dist/design-system21.mjs +62 -188
  246. package/dist/design-system21.mjs.map +1 -1
  247. package/dist/design-system210.mjs +13 -16
  248. package/dist/design-system210.mjs.map +1 -1
  249. package/dist/design-system211.mjs +9 -5
  250. package/dist/design-system211.mjs.map +1 -1
  251. package/dist/design-system212.mjs +5 -4
  252. package/dist/design-system212.mjs.map +1 -1
  253. package/dist/design-system213.mjs +5 -3
  254. package/dist/design-system213.mjs.map +1 -1
  255. package/dist/design-system214.mjs +5 -3
  256. package/dist/design-system214.mjs.map +1 -1
  257. package/dist/design-system215.mjs +5 -14
  258. package/dist/design-system215.mjs.map +1 -1
  259. package/dist/design-system216.mjs +6 -9
  260. package/dist/design-system216.mjs.map +1 -1
  261. package/dist/design-system217.mjs +4 -6
  262. package/dist/design-system217.mjs.map +1 -1
  263. package/dist/design-system218.mjs +16 -4
  264. package/dist/design-system218.mjs.map +1 -1
  265. package/dist/design-system219.mjs +5 -5
  266. package/dist/design-system219.mjs.map +1 -1
  267. package/dist/design-system22.mjs +37 -69
  268. package/dist/design-system22.mjs.map +1 -1
  269. package/dist/design-system220.mjs +3 -5
  270. package/dist/design-system220.mjs.map +1 -1
  271. package/dist/design-system221.mjs +3 -5
  272. package/dist/design-system221.mjs.map +1 -1
  273. package/dist/design-system222.mjs +10 -4
  274. package/dist/design-system222.mjs.map +1 -1
  275. package/dist/design-system223.mjs +5 -17
  276. package/dist/design-system223.mjs.map +1 -1
  277. package/dist/design-system224.mjs +4 -5
  278. package/dist/design-system224.mjs.map +1 -1
  279. package/dist/design-system225.mjs +5 -3
  280. package/dist/design-system225.mjs.map +1 -1
  281. package/dist/design-system226.mjs +4 -4
  282. package/dist/design-system226.mjs.map +1 -1
  283. package/dist/design-system227.mjs +4 -9
  284. package/dist/design-system227.mjs.map +1 -1
  285. package/dist/design-system228.mjs +4 -5
  286. package/dist/design-system228.mjs.map +1 -1
  287. package/dist/design-system229.mjs +10 -4
  288. package/dist/design-system229.mjs.map +1 -1
  289. package/dist/design-system23.mjs +38 -34
  290. package/dist/design-system23.mjs.map +1 -1
  291. package/dist/design-system230.mjs +6 -5
  292. package/dist/design-system230.mjs.map +1 -1
  293. package/dist/design-system231.mjs +7 -4
  294. package/dist/design-system231.mjs.map +1 -1
  295. package/dist/design-system232.mjs +3 -3
  296. package/dist/design-system232.mjs.map +1 -1
  297. package/dist/design-system233.mjs +7 -4
  298. package/dist/design-system233.mjs.map +1 -1
  299. package/dist/design-system234.mjs +4 -11
  300. package/dist/design-system234.mjs.map +1 -1
  301. package/dist/design-system24.mjs +133 -42
  302. package/dist/design-system24.mjs.map +1 -1
  303. package/dist/design-system25.mjs +550 -129
  304. package/dist/design-system25.mjs.map +1 -1
  305. package/dist/design-system26.mjs +5 -557
  306. package/dist/design-system26.mjs.map +1 -1
  307. package/dist/design-system27.mjs +6 -5
  308. package/dist/design-system27.mjs.map +1 -1
  309. package/dist/design-system28.mjs +5 -6
  310. package/dist/design-system28.mjs.map +1 -1
  311. package/dist/design-system29.mjs +10 -5
  312. package/dist/design-system29.mjs.map +1 -1
  313. package/dist/design-system30.mjs +5 -10
  314. package/dist/design-system30.mjs.map +1 -1
  315. package/dist/design-system31.mjs +5 -5
  316. package/dist/design-system32.mjs +10 -5
  317. package/dist/design-system32.mjs.map +1 -1
  318. package/dist/design-system33.mjs +7 -7
  319. package/dist/design-system34.mjs +7 -7
  320. package/dist/design-system35.mjs +8 -8
  321. package/dist/design-system36.mjs +5 -10
  322. package/dist/design-system36.mjs.map +1 -1
  323. package/dist/design-system37.mjs +11 -5
  324. package/dist/design-system37.mjs.map +1 -1
  325. package/dist/design-system38.mjs +5 -11
  326. package/dist/design-system38.mjs.map +1 -1
  327. package/dist/design-system39.mjs +5 -5
  328. package/dist/design-system40.mjs +76 -5
  329. package/dist/design-system40.mjs.map +1 -1
  330. package/dist/design-system41.mjs +5 -76
  331. package/dist/design-system41.mjs.map +1 -1
  332. package/dist/design-system42.mjs +10 -5
  333. package/dist/design-system42.mjs.map +1 -1
  334. package/dist/design-system43.mjs +13 -8
  335. package/dist/design-system43.mjs.map +1 -1
  336. package/dist/design-system44.mjs +5 -15
  337. package/dist/design-system44.mjs.map +1 -1
  338. package/dist/design-system45.mjs +61 -5
  339. package/dist/design-system45.mjs.map +1 -1
  340. package/dist/design-system46.mjs +5 -61
  341. package/dist/design-system46.mjs.map +1 -1
  342. package/dist/design-system47.mjs +5 -5
  343. package/dist/design-system48.mjs +8 -5
  344. package/dist/design-system48.mjs.map +1 -1
  345. package/dist/design-system49.mjs +861 -8
  346. package/dist/design-system49.mjs.map +1 -1
  347. package/dist/design-system50.mjs +2 -862
  348. package/dist/design-system50.mjs.map +1 -1
  349. package/dist/design-system51.mjs +127 -2
  350. package/dist/design-system51.mjs.map +1 -1
  351. package/dist/design-system52.mjs +2 -127
  352. package/dist/design-system52.mjs.map +1 -1
  353. package/dist/design-system53.mjs +7 -2
  354. package/dist/design-system53.mjs.map +1 -1
  355. package/dist/design-system54.mjs +23 -7
  356. package/dist/design-system54.mjs.map +1 -1
  357. package/dist/design-system55.mjs +2 -23
  358. package/dist/design-system55.mjs.map +1 -1
  359. package/dist/design-system57.mjs +65 -2
  360. package/dist/design-system57.mjs.map +1 -1
  361. package/dist/design-system58.mjs +2 -65
  362. package/dist/design-system58.mjs.map +1 -1
  363. package/dist/design-system59.mjs +2 -2
  364. package/dist/design-system64.mjs +28 -2
  365. package/dist/design-system64.mjs.map +1 -1
  366. package/dist/design-system65.mjs +2 -28
  367. package/dist/design-system65.mjs.map +1 -1
  368. package/dist/design-system66.mjs +58 -2
  369. package/dist/design-system66.mjs.map +1 -1
  370. package/dist/design-system67.mjs +2 -58
  371. package/dist/design-system67.mjs.map +1 -1
  372. package/dist/design-system68.mjs +2 -2
  373. package/dist/design-system7.mjs +2 -11
  374. package/dist/design-system7.mjs.map +1 -1
  375. package/dist/design-system72.mjs +79 -2
  376. package/dist/design-system72.mjs.map +1 -1
  377. package/dist/design-system73.mjs +2 -79
  378. package/dist/design-system73.mjs.map +1 -1
  379. package/dist/design-system74.mjs +2 -2
  380. package/dist/design-system75.mjs +2 -2
  381. package/dist/design-system76.mjs +81 -2
  382. package/dist/design-system76.mjs.map +1 -1
  383. package/dist/design-system77.mjs +2 -81
  384. package/dist/design-system77.mjs.map +1 -1
  385. package/dist/design-system78.mjs +2 -2
  386. package/dist/design-system79.mjs +119 -2
  387. package/dist/design-system79.mjs.map +1 -1
  388. package/dist/design-system8.mjs +86 -2
  389. package/dist/design-system8.mjs.map +1 -1
  390. package/dist/design-system80.mjs +2 -119
  391. package/dist/design-system80.mjs.map +1 -1
  392. package/dist/design-system81.mjs +2 -2
  393. package/dist/design-system82.mjs +1 -1
  394. package/dist/design-system83.mjs +102 -2
  395. package/dist/design-system83.mjs.map +1 -1
  396. package/dist/design-system84.mjs +2 -102
  397. package/dist/design-system84.mjs.map +1 -1
  398. package/dist/design-system85.mjs +190 -2
  399. package/dist/design-system85.mjs.map +1 -1
  400. package/dist/design-system86.mjs +2 -190
  401. package/dist/design-system86.mjs.map +1 -1
  402. package/dist/design-system87.mjs +2 -2
  403. package/dist/design-system88.mjs +142 -2
  404. package/dist/design-system88.mjs.map +1 -1
  405. package/dist/design-system89.mjs +2 -142
  406. package/dist/design-system89.mjs.map +1 -1
  407. package/dist/design-system9.mjs +54 -54
  408. package/dist/design-system90.mjs +49 -2
  409. package/dist/design-system90.mjs.map +1 -1
  410. package/dist/design-system91.mjs +2 -49
  411. package/dist/design-system91.mjs.map +1 -1
  412. package/dist/design-system92.mjs +2 -2
  413. package/dist/design-system95.mjs +140 -2
  414. package/dist/design-system95.mjs.map +1 -1
  415. package/dist/design-system96.mjs +1068 -117
  416. package/dist/design-system96.mjs.map +1 -1
  417. package/dist/design-system97.mjs +959 -1048
  418. package/dist/design-system97.mjs.map +1 -1
  419. package/dist/design-system98.mjs +16 -1001
  420. package/dist/design-system98.mjs.map +1 -1
  421. package/dist/design-system99.mjs +63 -1360
  422. package/dist/design-system99.mjs.map +1 -1
  423. package/dist/types/composables/Date.d.ts +2 -0
  424. package/dist/types/helpers/DateHelper.d.ts +5 -1
  425. package/dist/types/index.d.ts +0 -1
  426. package/package.json +14 -13
  427. package/dist/design-system235.mjs +0 -10
  428. package/dist/design-system235.mjs.map +0 -1
  429. package/dist/design-system236.mjs +0 -10
  430. package/dist/design-system236.mjs.map +0 -1
  431. package/dist/design-system237.mjs +0 -8
  432. package/dist/design-system237.mjs.map +0 -1
  433. package/dist/design-system238.mjs +0 -11
  434. package/dist/design-system238.mjs.map +0 -1
  435. package/dist/design-system239.mjs +0 -7
  436. package/dist/design-system239.mjs.map +0 -1
@@ -1,2175 +1,40 @@
1
- (function(p, m) {
2
- typeof exports == "object" && typeof module < "u" ? m(exports) : typeof define == "function" && define.amd ? define(["exports"], m) : (p = typeof globalThis < "u" ? globalThis : p || self, m(p.IMask = {}));
3
- })(globalThis, function(p) {
4
- function m(n) {
5
- return typeof n == "string" || n instanceof String;
6
- }
7
- function P(n) {
8
- var t;
9
- return typeof n == "object" && n != null && (n == null || (t = n.constructor) == null ? void 0 : t.name) === "Object";
10
- }
11
- function U(n, t) {
12
- return Array.isArray(t) ? U(n, (e, s) => t.includes(s)) : Object.entries(n).reduce((e, s) => {
13
- let [i, u] = s;
14
- return t(u, i) && (e[i] = u), e;
15
- }, {});
16
- }
17
- const h = {
18
- NONE: "NONE",
19
- LEFT: "LEFT",
20
- FORCE_LEFT: "FORCE_LEFT",
21
- RIGHT: "RIGHT",
22
- FORCE_RIGHT: "FORCE_RIGHT"
23
- };
24
- function j(n) {
25
- switch (n) {
26
- case h.LEFT:
27
- return h.FORCE_LEFT;
28
- case h.RIGHT:
29
- return h.FORCE_RIGHT;
30
- default:
31
- return n;
32
- }
33
- }
34
- function y(n) {
35
- return n.replace(/([.*+?^=!:${}()|[\]/\\])/g, "\\$1");
36
- }
37
- function b(n, t) {
38
- if (t === n)
39
- return !0;
40
- const e = Array.isArray(t), s = Array.isArray(n);
41
- let i;
42
- if (e && s) {
43
- if (t.length != n.length)
44
- return !1;
45
- for (i = 0; i < t.length; i++)
46
- if (!b(t[i], n[i]))
47
- return !1;
48
- return !0;
49
- }
50
- if (e != s)
51
- return !1;
52
- if (t && n && typeof t == "object" && typeof n == "object") {
53
- const u = t instanceof Date, a = n instanceof Date;
54
- if (u && a)
55
- return t.getTime() == n.getTime();
56
- if (u != a)
57
- return !1;
58
- const r = t instanceof RegExp, l = n instanceof RegExp;
59
- if (r && l)
60
- return t.toString() == n.toString();
61
- if (r != l)
62
- return !1;
63
- const d = Object.keys(t);
64
- for (i = 0; i < d.length; i++)
65
- if (!Object.prototype.hasOwnProperty.call(n, d[i]))
66
- return !1;
67
- for (i = 0; i < d.length; i++)
68
- if (!b(n[d[i]], t[d[i]]))
69
- return !1;
70
- return !0;
71
- } else if (t && n && typeof t == "function" && typeof n == "function")
72
- return t.toString() === n.toString();
73
- return !1;
74
- }
75
- class Z {
76
- /** Current input value */
77
- /** Current cursor position */
78
- /** Old input value */
79
- /** Old selection */
80
- constructor(t) {
81
- for (Object.assign(this, t); this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos); )
82
- --this.oldSelection.start;
83
- }
84
- /** Start changing position */
85
- get startChangePos() {
86
- return Math.min(this.cursorPos, this.oldSelection.start);
87
- }
88
- /** Inserted symbols count */
89
- get insertedCount() {
90
- return this.cursorPos - this.startChangePos;
91
- }
92
- /** Inserted symbols */
93
- get inserted() {
94
- return this.value.substr(this.startChangePos, this.insertedCount);
95
- }
96
- /** Removed symbols count */
97
- get removedCount() {
98
- return Math.max(this.oldSelection.end - this.startChangePos || // for Delete
99
- this.oldValue.length - this.value.length, 0);
100
- }
101
- /** Removed symbols */
102
- get removed() {
103
- return this.oldValue.substr(this.startChangePos, this.removedCount);
104
- }
105
- /** Unchanged head symbols */
106
- get head() {
107
- return this.value.substring(0, this.startChangePos);
108
- }
109
- /** Unchanged tail symbols */
110
- get tail() {
111
- return this.value.substring(this.startChangePos + this.insertedCount);
112
- }
113
- /** Remove direction */
114
- get removeDirection() {
115
- return !this.removedCount || this.insertedCount ? h.NONE : (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace)
116
- this.oldSelection.end === this.oldSelection.start ? h.RIGHT : h.LEFT;
117
- }
118
- }
119
- function o(n, t) {
120
- return new o.InputMask(n, t);
121
- }
122
- function H(n) {
123
- if (n == null)
124
- throw new Error("mask property should be defined");
125
- return n instanceof RegExp ? o.MaskedRegExp : m(n) ? o.MaskedPattern : n === Date ? o.MaskedDate : n === Number ? o.MaskedNumber : Array.isArray(n) || n === Array ? o.MaskedDynamic : o.Masked && n.prototype instanceof o.Masked ? n : o.Masked && n instanceof o.Masked ? n.constructor : n instanceof Function ? o.MaskedFunction : (console.warn("Mask not found for mask", n), o.Masked);
126
- }
127
- function x(n) {
128
- if (!n)
129
- throw new Error("Options in not defined");
130
- if (o.Masked) {
131
- if (n.prototype instanceof o.Masked)
132
- return {
133
- mask: n
134
- };
135
- const {
136
- mask: t = void 0,
137
- ...e
138
- } = n instanceof o.Masked ? {
139
- mask: n
140
- } : P(n) && n.mask instanceof o.Masked ? n : {};
141
- if (t) {
142
- const s = t.mask;
143
- return {
144
- ...U(t, (i, u) => !u.startsWith("_")),
145
- mask: t.constructor,
146
- _mask: s,
147
- ...e
148
- };
149
- }
150
- }
151
- return P(n) ? {
152
- ...n
153
- } : {
154
- mask: n
1
+ import { defineComponent as b, openBlock as d, createElementBlock as a, createElementVNode as i, Fragment as u, renderList as m, unref as o, toDisplayString as g, normalizeClass as h } from "vue";
2
+ import { useDate as k } from "./design-system2.mjs";
3
+ import l from "./design-system115.mjs";
4
+ const x = { class: "b-date-picker__grid-date ds-space-y-3" }, v = { class: "ds-grid ds-w-full ds-grid-cols-7 ds-gap-1 ds-text-xs ds-text-gray-400" }, D = { class: "ds-grid ds-w-full ds-grid-cols-7 ds-gap-1" }, C = ["disabled", "onClick"], B = /* @__PURE__ */ b({
5
+ __name: "BDatePickerGridDate",
6
+ props: {
7
+ date: {},
8
+ dates: {}
9
+ },
10
+ emits: ["select:date"],
11
+ setup(p, { emit: y }) {
12
+ const t = p, f = y, { dayShortNames: n } = k(), c = ({ year: s, month: r, date: e }) => l(t.date.year) || l(t.date.month) || l(t.date.date) ? !1 : s === t.date.year && r === t.date.month && e === t.date.date, _ = ({ year: s, month: r, date: e }) => {
13
+ f("select:date", { year: s, month: r, date: e });
155
14
  };
15
+ return (s, r) => (d(), a("div", x, [
16
+ i("div", v, [
17
+ (d(!0), a(u, null, m(Object.keys(o(n)).length, (e) => (d(), a("div", {
18
+ key: e,
19
+ class: "ds-flex ds-justify-center"
20
+ }, g(e - 1 === 6 ? o(n)[0] : o(n)[e]), 1))), 128))
21
+ ]),
22
+ i("div", D, [
23
+ (d(!0), a(u, null, m(s.dates, (e) => (d(), a("button", {
24
+ key: `${e.date}${e.month}${e.year}`,
25
+ class: h([{
26
+ "enabled:hover:ds-bg-gray-150": !c(e),
27
+ "enabled:ds-text-gray-400": e.secondary,
28
+ "--selected ds-bg-primary-t ds-text-white": c(e)
29
+ }, "ds-flex ds-aspect-square ds-cursor-pointer ds-items-center ds-justify-center ds-rounded-lg ds-transition-all focus-visible:ds-bg-gray-150 disabled:ds-text-gray-200"]),
30
+ disabled: e.disabled,
31
+ onClick: (S) => _(e)
32
+ }, g(e.date), 11, C))), 128))
33
+ ])
34
+ ]));
156
35
  }
157
- function A(n) {
158
- if (o.Masked && n instanceof o.Masked)
159
- return n;
160
- const t = x(n), e = H(t.mask);
161
- if (!e)
162
- throw new Error("Masked class is not found for provided mask, appropriate module needs to be imported manually before creating mask.");
163
- return t.mask === e && delete t.mask, t._mask && (t.mask = t._mask, delete t._mask), new e(t);
164
- }
165
- o.createMask = A;
166
- class I {
167
- /** */
168
- /** */
169
- /** */
170
- /** Safely returns selection start */
171
- get selectionStart() {
172
- let t;
173
- try {
174
- t = this._unsafeSelectionStart;
175
- } catch {
176
- }
177
- return t ?? this.value.length;
178
- }
179
- /** Safely returns selection end */
180
- get selectionEnd() {
181
- let t;
182
- try {
183
- t = this._unsafeSelectionEnd;
184
- } catch {
185
- }
186
- return t ?? this.value.length;
187
- }
188
- /** */
189
- get isActive() {
190
- return !1;
191
- }
192
- /** Safely sets element selection */
193
- select(t, e) {
194
- if (!(t == null || e == null || t === this.selectionStart && e === this.selectionEnd))
195
- try {
196
- this._unsafeSelect(t, e);
197
- } catch {
198
- }
199
- }
200
- /** */
201
- /** */
202
- /** */
203
- }
204
- o.MaskElement = I;
205
- class F extends I {
206
- /** HTMLElement to use mask on */
207
- constructor(t) {
208
- super(), this.input = t, this._handlers = {};
209
- }
210
- get rootElement() {
211
- var t, e, s;
212
- return (t = (e = (s = this.input).getRootNode) == null ? void 0 : e.call(s)) != null ? t : document;
213
- }
214
- /**
215
- Is element in focus
216
- */
217
- get isActive() {
218
- return this.input === this.rootElement.activeElement;
219
- }
220
- /**
221
- Binds HTMLElement events to mask internal events
222
- */
223
- bindEvents(t) {
224
- Object.keys(t).forEach((e) => this._toggleEventHandler(F.EVENTS_MAP[e], t[e]));
225
- }
226
- /**
227
- Unbinds HTMLElement events to mask internal events
228
- */
229
- unbindEvents() {
230
- Object.keys(this._handlers).forEach((t) => this._toggleEventHandler(t));
231
- }
232
- _toggleEventHandler(t, e) {
233
- this._handlers[t] && (this.input.removeEventListener(t, this._handlers[t]), delete this._handlers[t]), e && (this.input.addEventListener(t, e), this._handlers[t] = e);
234
- }
235
- }
236
- F.EVENTS_MAP = {
237
- selectionChange: "keydown",
238
- input: "input",
239
- drop: "drop",
240
- click: "click",
241
- focus: "focus",
242
- commit: "blur"
243
- }, o.HTMLMaskElement = F;
244
- class z extends F {
245
- /** InputElement to use mask on */
246
- constructor(t) {
247
- super(t), this.input = t, this._handlers = {};
248
- }
249
- /** Returns InputElement selection start */
250
- get _unsafeSelectionStart() {
251
- return this.input.selectionStart != null ? this.input.selectionStart : this.value.length;
252
- }
253
- /** Returns InputElement selection end */
254
- get _unsafeSelectionEnd() {
255
- return this.input.selectionEnd;
256
- }
257
- get value() {
258
- return this.input.value;
259
- }
260
- set value(t) {
261
- this.input.value = t;
262
- }
263
- /** Sets InputElement selection */
264
- _unsafeSelect(t, e) {
265
- this.input.setSelectionRange(t, e);
266
- }
267
- }
268
- o.HTMLMaskElement = F;
269
- class w extends F {
270
- /** Returns HTMLElement selection start */
271
- get _unsafeSelectionStart() {
272
- const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
273
- return i == null || s == null || s < i ? s : i;
274
- }
275
- /** Returns HTMLElement selection end */
276
- get _unsafeSelectionEnd() {
277
- const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, i = e && e.focusOffset;
278
- return i == null || s == null || s > i ? s : i;
279
- }
280
- /** HTMLElement value */
281
- get value() {
282
- return this.input.textContent || "";
283
- }
284
- set value(t) {
285
- this.input.textContent = t;
286
- }
287
- /** Sets HTMLElement selection */
288
- _unsafeSelect(t, e) {
289
- if (!this.rootElement.createRange)
290
- return;
291
- const s = this.rootElement.createRange();
292
- s.setStart(this.input.firstChild || this.input, t), s.setEnd(this.input.lastChild || this.input, e);
293
- const i = this.rootElement, u = i.getSelection && i.getSelection();
294
- u && (u.removeAllRanges(), u.addRange(s));
295
- }
296
- }
297
- o.HTMLContenteditableMaskElement = w;
298
- class G {
299
- /**
300
- View element
301
- */
302
- /** Internal {@link Masked} model */
303
- constructor(t, e) {
304
- this.el = t instanceof I ? t : t.isContentEditable && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" ? new w(t) : new z(t), this.masked = A(e), this._listeners = {}, this._value = "", this._unmaskedValue = "", this._saveSelection = this._saveSelection.bind(this), this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this), this._onDrop = this._onDrop.bind(this), this._onFocus = this._onFocus.bind(this), this._onClick = this._onClick.bind(this), this.alignCursor = this.alignCursor.bind(this), this.alignCursorFriendly = this.alignCursorFriendly.bind(this), this._bindEvents(), this.updateValue(), this._onChange();
305
- }
306
- /** Masked */
307
- get mask() {
308
- return this.masked.mask;
309
- }
310
- set mask(t) {
311
- if (this.maskEquals(t))
312
- return;
313
- if (!(t instanceof o.Masked) && this.masked.constructor === H(t)) {
314
- this.masked.updateOptions({
315
- mask: t
316
- });
317
- return;
318
- }
319
- const e = t instanceof o.Masked ? t : A({
320
- mask: t
321
- });
322
- e.unmaskedValue = this.masked.unmaskedValue, this.masked = e;
323
- }
324
- /** Raw value */
325
- get value() {
326
- return this._value;
327
- }
328
- set value(t) {
329
- this.value !== t && (this.masked.value = t, this.updateControl(), this.alignCursor());
330
- }
331
- /** Unmasked value */
332
- get unmaskedValue() {
333
- return this._unmaskedValue;
334
- }
335
- set unmaskedValue(t) {
336
- this.unmaskedValue !== t && (this.masked.unmaskedValue = t, this.updateControl(), this.alignCursor());
337
- }
338
- /** Typed unmasked value */
339
- get typedValue() {
340
- return this.masked.typedValue;
341
- }
342
- set typedValue(t) {
343
- this.masked.typedValueEquals(t) || (this.masked.typedValue = t, this.updateControl(), this.alignCursor());
344
- }
345
- /** Display value */
346
- get displayValue() {
347
- return this.masked.displayValue;
348
- }
349
- /** Current selection start */
350
- get selectionStart() {
351
- return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;
352
- }
353
- /** Current cursor position */
354
- get cursorPos() {
355
- return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;
356
- }
357
- set cursorPos(t) {
358
- !this.el || !this.el.isActive || (this.el.select(t, t), this._saveSelection());
359
- }
360
- maskEquals(t) {
361
- var e;
362
- return t == null || ((e = this.masked) == null ? void 0 : e.maskEquals(t));
363
- }
364
- /** Starts listening to element events */
365
- _bindEvents() {
366
- this.el.bindEvents({
367
- selectionChange: this._saveSelection,
368
- input: this._onInput,
369
- drop: this._onDrop,
370
- click: this._onClick,
371
- focus: this._onFocus,
372
- commit: this._onChange
373
- });
374
- }
375
- /** Stops listening to element events */
376
- _unbindEvents() {
377
- this.el && this.el.unbindEvents();
378
- }
379
- /** Fires custom event */
380
- _fireEvent(t, e) {
381
- const s = this._listeners[t];
382
- s && s.forEach((i) => i(e));
383
- }
384
- /** Stores current selection */
385
- _saveSelection() {
386
- this.displayValue !== this.el.value && console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."), this._selection = {
387
- start: this.selectionStart,
388
- end: this.cursorPos
389
- };
390
- }
391
- /** Syncronizes model value from view */
392
- updateValue() {
393
- this.masked.value = this.el.value, this._value = this.masked.value;
394
- }
395
- /** Syncronizes view from model value, fires change events */
396
- updateControl() {
397
- const t = this.masked.unmaskedValue, e = this.masked.value, s = this.displayValue, i = this.unmaskedValue !== t || this.value !== e;
398
- this._unmaskedValue = t, this._value = e, this.el.value !== s && (this.el.value = s), i && this._fireChangeEvents();
399
- }
400
- /** Updates options with deep equal check, recreates {@link Masked} model if mask type changes */
401
- updateOptions(t) {
402
- const {
403
- mask: e,
404
- ...s
405
- } = t, i = !this.maskEquals(e), u = !b(this.masked, s);
406
- i && (this.mask = e), u && this.masked.updateOptions(s), (i || u) && this.updateControl();
407
- }
408
- /** Updates cursor */
409
- updateCursor(t) {
410
- t != null && (this.cursorPos = t, this._delayUpdateCursor(t));
411
- }
412
- /** Delays cursor update to support mobile browsers */
413
- _delayUpdateCursor(t) {
414
- this._abortUpdateCursor(), this._changingCursorPos = t, this._cursorChanging = setTimeout(() => {
415
- this.el && (this.cursorPos = this._changingCursorPos, this._abortUpdateCursor());
416
- }, 10);
417
- }
418
- /** Fires custom events */
419
- _fireChangeEvents() {
420
- this._fireEvent("accept", this._inputEvent), this.masked.isComplete && this._fireEvent("complete", this._inputEvent);
421
- }
422
- /** Aborts delayed cursor update */
423
- _abortUpdateCursor() {
424
- this._cursorChanging && (clearTimeout(this._cursorChanging), delete this._cursorChanging);
425
- }
426
- /** Aligns cursor to nearest available position */
427
- alignCursor() {
428
- this.cursorPos = this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos, h.LEFT));
429
- }
430
- /** Aligns cursor only if selection is empty */
431
- alignCursorFriendly() {
432
- this.selectionStart === this.cursorPos && this.alignCursor();
433
- }
434
- /** Adds listener on custom event */
435
- on(t, e) {
436
- return this._listeners[t] || (this._listeners[t] = []), this._listeners[t].push(e), this;
437
- }
438
- /** Removes custom event listener */
439
- off(t, e) {
440
- if (!this._listeners[t])
441
- return this;
442
- if (!e)
443
- return delete this._listeners[t], this;
444
- const s = this._listeners[t].indexOf(e);
445
- return s >= 0 && this._listeners[t].splice(s, 1), this;
446
- }
447
- /** Handles view input event */
448
- _onInput(t) {
449
- if (this._inputEvent = t, this._abortUpdateCursor(), !this._selection)
450
- return this.updateValue();
451
- const e = new Z({
452
- // new state
453
- value: this.el.value,
454
- cursorPos: this.cursorPos,
455
- // old state
456
- oldValue: this.displayValue,
457
- oldSelection: this._selection
458
- }), s = this.masked.rawInputValue, i = this.masked.splice(e.startChangePos, e.removed.length, e.inserted, e.removeDirection, {
459
- input: !0,
460
- raw: !0
461
- }).offset, u = s === this.masked.rawInputValue ? e.removeDirection : h.NONE;
462
- let a = this.masked.nearestInputPos(e.startChangePos + i, u);
463
- u !== h.NONE && (a = this.masked.nearestInputPos(a, h.NONE)), this.updateControl(), this.updateCursor(a), delete this._inputEvent;
464
- }
465
- /** Handles view change event and commits model value */
466
- _onChange() {
467
- this.displayValue !== this.el.value && this.updateValue(), this.masked.doCommit(), this.updateControl(), this._saveSelection();
468
- }
469
- /** Handles view drop event, prevents by default */
470
- _onDrop(t) {
471
- t.preventDefault(), t.stopPropagation();
472
- }
473
- /** Restore last selection on focus */
474
- _onFocus(t) {
475
- this.alignCursorFriendly();
476
- }
477
- /** Restore last selection on focus */
478
- _onClick(t) {
479
- this.alignCursorFriendly();
480
- }
481
- /** Unbind view events and removes element reference */
482
- destroy() {
483
- this._unbindEvents(), this._listeners.length = 0, delete this.el;
484
- }
485
- }
486
- o.InputMask = G;
487
- class c {
488
- /** Inserted symbols */
489
- /** Can skip chars */
490
- /** Additional offset if any changes occurred before tail */
491
- constructor(t) {
492
- Object.assign(this, {
493
- inserted: "",
494
- rawInserted: "",
495
- skip: !1,
496
- tailShift: 0
497
- }, t);
498
- }
499
- /** Total offset considering all changes */
500
- get offset() {
501
- return this.tailShift + this.inserted.length;
502
- }
503
- /** Raw inserted is used by dynamic mask */
504
- static normalize(t) {
505
- return Array.isArray(t) ? t : [t, new c()];
506
- }
507
- /** Aggregate changes */
508
- aggregate(t) {
509
- return this.rawInserted += t.rawInserted, this.skip = this.skip || t.skip, this.inserted += t.inserted, this.tailShift += t.tailShift, this;
510
- }
511
- }
512
- o.ChangeDetails = c;
513
- class E {
514
- /** Tail value as string */
515
- /** Tail start position */
516
- /** Start position */
517
- constructor(t, e, s) {
518
- t === void 0 && (t = ""), e === void 0 && (e = 0), this.value = t, this.from = e, this.stop = s;
519
- }
520
- get state() {
521
- return {
522
- value: this.value,
523
- from: this.from,
524
- stop: this.stop
525
- };
526
- }
527
- set state(t) {
528
- Object.assign(this, t);
529
- }
530
- toString() {
531
- return this.value;
532
- }
533
- extend(t) {
534
- this.value += String(t);
535
- }
536
- appendTo(t) {
537
- return t.append(this.toString(), {
538
- tail: !0
539
- }).aggregate(t._appendPlaceholder());
540
- }
541
- unshift(t) {
542
- if (!this.value.length || t != null && this.from >= t)
543
- return "";
544
- const e = this.value[0];
545
- return this.value = this.value.slice(1), e;
546
- }
547
- shift() {
548
- if (!this.value.length)
549
- return "";
550
- const t = this.value[this.value.length - 1];
551
- return this.value = this.value.slice(0, -1), t;
552
- }
553
- }
554
- class f {
555
- /** */
556
- /** */
557
- /** Transforms value before mask processing */
558
- /** Transforms each char before mask processing */
559
- /** Validates if value is acceptable */
560
- /** Does additional processing at the end of editing */
561
- /** Format typed value to string */
562
- /** Parse string to get typed value */
563
- /** Enable characters overwriting */
564
- /** */
565
- /** */
566
- /** */
567
- constructor(t) {
568
- this._value = "", this._update({
569
- ...f.DEFAULTS,
570
- ...t
571
- }), this._initialized = !0;
572
- }
573
- /** Mask state */
574
- get state() {
575
- return {
576
- _value: this.value,
577
- _rawInputValue: this.rawInputValue
578
- };
579
- }
580
- set state(t) {
581
- this._value = t._value;
582
- }
583
- get value() {
584
- return this._value;
585
- }
586
- set value(t) {
587
- this.resolve(t, {
588
- input: !0
589
- });
590
- }
591
- get unmaskedValue() {
592
- return this.value;
593
- }
594
- set unmaskedValue(t) {
595
- this.resolve(t, {});
596
- }
597
- get typedValue() {
598
- return this.parse ? this.parse(this.value, this) : this.unmaskedValue;
599
- }
600
- set typedValue(t) {
601
- this.format ? this.value = this.format(t, this) : this.unmaskedValue = String(t);
602
- }
603
- /** Value that includes raw user input */
604
- get rawInputValue() {
605
- return this.extractInput(0, this.displayValue.length, {
606
- raw: !0
607
- });
608
- }
609
- set rawInputValue(t) {
610
- this.resolve(t, {
611
- raw: !0
612
- });
613
- }
614
- get displayValue() {
615
- return this.value;
616
- }
617
- get isComplete() {
618
- return !0;
619
- }
620
- get isFilled() {
621
- return this.isComplete;
622
- }
623
- /** Sets and applies new options */
624
- updateOptions(t) {
625
- Object.keys(t).length && this.withValueRefresh(this._update.bind(this, t));
626
- }
627
- /** Sets new options */
628
- _update(t) {
629
- Object.assign(this, t);
630
- }
631
- /** Resets value */
632
- reset() {
633
- this._value = "";
634
- }
635
- /** Resolve new value */
636
- resolve(t, e) {
637
- e === void 0 && (e = {
638
- input: !0
639
- }), this.reset(), this.append(t, e, ""), this.doCommit();
640
- }
641
- /** Finds nearest input position in direction */
642
- nearestInputPos(t, e) {
643
- return t;
644
- }
645
- totalInputPositions(t, e) {
646
- return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), Math.min(this.displayValue.length, e - t);
647
- }
648
- /** Extracts value in range considering flags */
649
- extractInput(t, e, s) {
650
- return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this.displayValue.slice(t, e);
651
- }
652
- /** Extracts tail in range */
653
- extractTail(t, e) {
654
- return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), new E(this.extractInput(t, e), t);
655
- }
656
- /** Appends tail */
657
- appendTail(t) {
658
- return m(t) && (t = new E(String(t))), t.appendTo(this);
659
- }
660
- /** Appends char */
661
- _appendCharRaw(t, e) {
662
- return t ? (this._value += t, new c({
663
- inserted: t,
664
- rawInserted: t
665
- })) : new c();
666
- }
667
- /** Appends char */
668
- _appendChar(t, e, s) {
669
- e === void 0 && (e = {});
670
- const i = this.state;
671
- let u;
672
- if ([t, u] = this.doPrepareChar(t, e), u = u.aggregate(this._appendCharRaw(t, e)), u.inserted) {
673
- let a, r = this.doValidate(e) !== !1;
674
- if (r && s != null) {
675
- const l = this.state;
676
- this.overwrite === !0 && (a = s.state, s.unshift(this.displayValue.length - u.tailShift));
677
- let d = this.appendTail(s);
678
- r = d.rawInserted === s.toString(), !(r && d.inserted) && this.overwrite === "shift" && (this.state = l, a = s.state, s.shift(), d = this.appendTail(s), r = d.rawInserted === s.toString()), r && d.inserted && (this.state = l);
679
- }
680
- r || (u = new c(), this.state = i, s && a && (s.state = a));
681
- }
682
- return u;
683
- }
684
- /** Appends optional placeholder at the end */
685
- _appendPlaceholder() {
686
- return new c();
687
- }
688
- /** Appends optional eager placeholder at the end */
689
- _appendEager() {
690
- return new c();
691
- }
692
- /** Appends symbols considering flags */
693
- append(t, e, s) {
694
- if (!m(t))
695
- throw new Error("value should be string");
696
- const i = m(s) ? new E(String(s)) : s;
697
- e != null && e.tail && (e._beforeTailState = this.state);
698
- let u;
699
- [t, u] = this.doPrepare(t, e);
700
- for (let a = 0; a < t.length; ++a) {
701
- const r = this._appendChar(t[a], e, i);
702
- if (!r.rawInserted && !this.doSkipInvalid(t[a], e, i))
703
- break;
704
- u.aggregate(r);
705
- }
706
- return (this.eager === !0 || this.eager === "append") && e != null && e.input && t && u.aggregate(this._appendEager()), i != null && (u.tailShift += this.appendTail(i).tailShift), u;
707
- }
708
- remove(t, e) {
709
- return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), this._value = this.displayValue.slice(0, t) + this.displayValue.slice(e), new c();
710
- }
711
- /** Calls function and reapplies current value */
712
- withValueRefresh(t) {
713
- if (this._refreshing || !this._initialized)
714
- return t();
715
- this._refreshing = !0;
716
- const e = this.rawInputValue, s = this.value, i = t();
717
- return this.rawInputValue = e, this.value && this.value !== s && s.indexOf(this.value) === 0 && this.append(s.slice(this.displayValue.length), {}, ""), delete this._refreshing, i;
718
- }
719
- runIsolated(t) {
720
- if (this._isolated || !this._initialized)
721
- return t(this);
722
- this._isolated = !0;
723
- const e = this.state, s = t(this);
724
- return this.state = e, delete this._isolated, s;
725
- }
726
- doSkipInvalid(t, e, s) {
727
- return !!this.skipInvalid;
728
- }
729
- /** Prepares string before mask processing */
730
- doPrepare(t, e) {
731
- return e === void 0 && (e = {}), c.normalize(this.prepare ? this.prepare(t, this, e) : t);
732
- }
733
- /** Prepares each char before mask processing */
734
- doPrepareChar(t, e) {
735
- return e === void 0 && (e = {}), c.normalize(this.prepareChar ? this.prepareChar(t, this, e) : t);
736
- }
737
- /** Validates if value is acceptable */
738
- doValidate(t) {
739
- return (!this.validate || this.validate(this.value, this, t)) && (!this.parent || this.parent.doValidate(t));
740
- }
741
- /** Does additional processing at the end of editing */
742
- doCommit() {
743
- this.commit && this.commit(this.value, this);
744
- }
745
- splice(t, e, s, i, u) {
746
- i === void 0 && (i = h.NONE), u === void 0 && (u = {
747
- input: !0
748
- });
749
- const a = t + e, r = this.extractTail(a), l = this.eager === !0 || this.eager === "remove";
750
- let d;
751
- l && (i = j(i), d = this.extractInput(0, a, {
752
- raw: !0
753
- }));
754
- let v = t;
755
- const _ = new c();
756
- if (i !== h.NONE && (v = this.nearestInputPos(t, e > 1 && t !== 0 && !l ? h.NONE : i), _.tailShift = v - t), _.aggregate(this.remove(v)), l && i !== h.NONE && d === this.rawInputValue)
757
- if (i === h.FORCE_LEFT) {
758
- let S;
759
- for (; d === this.rawInputValue && (S = this.displayValue.length); )
760
- _.aggregate(new c({
761
- tailShift: -1
762
- })).aggregate(this.remove(S - 1));
763
- } else
764
- i === h.FORCE_RIGHT && r.unshift();
765
- return _.aggregate(this.append(s, u, r));
766
- }
767
- maskEquals(t) {
768
- return this.mask === t;
769
- }
770
- typedValueEquals(t) {
771
- const e = this.typedValue;
772
- return t === e || f.EMPTY_VALUES.includes(t) && f.EMPTY_VALUES.includes(e) || (this.format ? this.format(t, this) === this.format(this.typedValue, this) : !1);
773
- }
774
- }
775
- f.DEFAULTS = {
776
- skipInvalid: !0
777
- }, f.EMPTY_VALUES = [void 0, null, ""], o.Masked = f;
778
- class C {
779
- /** */
780
- constructor(t, e) {
781
- t === void 0 && (t = []), e === void 0 && (e = 0), this.chunks = t, this.from = e;
782
- }
783
- get state() {
784
- return {
785
- chunks: this.chunks.map((t) => t.state),
786
- from: this.from,
787
- stop: this.stop,
788
- blockIndex: this.blockIndex
789
- };
790
- }
791
- set state(t) {
792
- const {
793
- chunks: e,
794
- ...s
795
- } = t;
796
- Object.assign(this, s), this.chunks = e.map((i) => {
797
- const u = "chunks" in i ? new C() : new E();
798
- return u.state = i, u;
799
- });
800
- }
801
- toString() {
802
- return this.chunks.map(String).join("");
803
- }
804
- extend(t) {
805
- if (!String(t))
806
- return;
807
- t = m(t) ? new E(String(t)) : t;
808
- const e = this.chunks[this.chunks.length - 1], s = e && // if stops are same or tail has no stop
809
- (e.stop === t.stop || t.stop == null) && // if tail chunk goes just after last chunk
810
- t.from === e.from + e.toString().length;
811
- if (t instanceof E)
812
- s ? e.extend(t.toString()) : this.chunks.push(t);
813
- else if (t instanceof C) {
814
- if (t.stop == null) {
815
- let i;
816
- for (; t.chunks.length && t.chunks[0].stop == null; )
817
- i = t.chunks.shift(), i.from += t.from, this.extend(i);
818
- }
819
- t.toString() && (t.stop = t.blockIndex, this.chunks.push(t));
820
- }
821
- }
822
- appendTo(t) {
823
- if (!(t instanceof o.MaskedPattern))
824
- return new E(this.toString()).appendTo(t);
825
- const e = new c();
826
- for (let s = 0; s < this.chunks.length && !e.skip; ++s) {
827
- const i = this.chunks[s], u = t._mapPosToBlock(t.displayValue.length), a = i.stop;
828
- let r;
829
- if (a != null && // if block not found or stop is behind lastBlock
830
- (!u || u.index <= a)) {
831
- if (i instanceof C || // for continuous block also check if stop is exist
832
- t._stops.indexOf(a) >= 0) {
833
- const l = t._appendPlaceholder(a);
834
- e.aggregate(l);
835
- }
836
- r = i instanceof C && t._blocks[a];
837
- }
838
- if (r) {
839
- const l = r.appendTail(i);
840
- l.skip = !1, e.aggregate(l), t._value += l.inserted;
841
- const d = i.toString().slice(l.rawInserted.length);
842
- d && e.aggregate(t.append(d, {
843
- tail: !0
844
- }));
845
- } else
846
- e.aggregate(t.append(i.toString(), {
847
- tail: !0
848
- }));
849
- }
850
- return e;
851
- }
852
- unshift(t) {
853
- if (!this.chunks.length || t != null && this.from >= t)
854
- return "";
855
- const e = t != null ? t - this.from : t;
856
- let s = 0;
857
- for (; s < this.chunks.length; ) {
858
- const i = this.chunks[s], u = i.unshift(e);
859
- if (i.toString()) {
860
- if (!u)
861
- break;
862
- ++s;
863
- } else
864
- this.chunks.splice(s, 1);
865
- if (u)
866
- return u;
867
- }
868
- return "";
869
- }
870
- shift() {
871
- if (!this.chunks.length)
872
- return "";
873
- let t = this.chunks.length - 1;
874
- for (; 0 <= t; ) {
875
- const e = this.chunks[t], s = e.shift();
876
- if (e.toString()) {
877
- if (!s)
878
- break;
879
- --t;
880
- } else
881
- this.chunks.splice(t, 1);
882
- if (s)
883
- return s;
884
- }
885
- return "";
886
- }
887
- }
888
- class X {
889
- constructor(t, e) {
890
- this.masked = t, this._log = [];
891
- const {
892
- offset: s,
893
- index: i
894
- } = t._mapPosToBlock(e) || (e < 0 ? (
895
- // first
896
- {
897
- index: 0,
898
- offset: 0
899
- }
900
- ) : (
901
- // last
902
- {
903
- index: this.masked._blocks.length,
904
- offset: 0
905
- }
906
- ));
907
- this.offset = s, this.index = i, this.ok = !1;
908
- }
909
- get block() {
910
- return this.masked._blocks[this.index];
911
- }
912
- get pos() {
913
- return this.masked._blockStartPos(this.index) + this.offset;
914
- }
915
- get state() {
916
- return {
917
- index: this.index,
918
- offset: this.offset,
919
- ok: this.ok
920
- };
921
- }
922
- set state(t) {
923
- Object.assign(this, t);
924
- }
925
- pushState() {
926
- this._log.push(this.state);
927
- }
928
- popState() {
929
- const t = this._log.pop();
930
- return t && (this.state = t), t;
931
- }
932
- bindBlock() {
933
- this.block || (this.index < 0 && (this.index = 0, this.offset = 0), this.index >= this.masked._blocks.length && (this.index = this.masked._blocks.length - 1, this.offset = this.block.displayValue.length));
934
- }
935
- _pushLeft(t) {
936
- for (this.pushState(), this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((e = this.block) == null ? void 0 : e.displayValue.length) || 0) {
937
- var e;
938
- if (t())
939
- return this.ok = !0;
940
- }
941
- return this.ok = !1;
942
- }
943
- _pushRight(t) {
944
- for (this.pushState(), this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0)
945
- if (t())
946
- return this.ok = !0;
947
- return this.ok = !1;
948
- }
949
- pushLeftBeforeFilled() {
950
- return this._pushLeft(() => {
951
- if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, h.FORCE_LEFT), this.offset !== 0))
952
- return !0;
953
- });
954
- }
955
- pushLeftBeforeInput() {
956
- return this._pushLeft(() => {
957
- if (!this.block.isFixed)
958
- return this.offset = this.block.nearestInputPos(this.offset, h.LEFT), !0;
959
- });
960
- }
961
- pushLeftBeforeRequired() {
962
- return this._pushLeft(() => {
963
- if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
964
- return this.offset = this.block.nearestInputPos(this.offset, h.LEFT), !0;
965
- });
966
- }
967
- pushRightBeforeFilled() {
968
- return this._pushRight(() => {
969
- if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(this.offset, h.FORCE_RIGHT), this.offset !== this.block.value.length))
970
- return !0;
971
- });
972
- }
973
- pushRightBeforeInput() {
974
- return this._pushRight(() => {
975
- if (!this.block.isFixed)
976
- return this.offset = this.block.nearestInputPos(this.offset, h.NONE), !0;
977
- });
978
- }
979
- pushRightBeforeRequired() {
980
- return this._pushRight(() => {
981
- if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
982
- return this.offset = this.block.nearestInputPos(this.offset, h.NONE), !0;
983
- });
984
- }
985
- }
986
- class R {
987
- /** */
988
- /** */
989
- /** */
990
- /** */
991
- /** */
992
- /** */
993
- constructor(t) {
994
- Object.assign(this, t), this._value = "", this.isFixed = !0;
995
- }
996
- get value() {
997
- return this._value;
998
- }
999
- get unmaskedValue() {
1000
- return this.isUnmasking ? this.value : "";
1001
- }
1002
- get rawInputValue() {
1003
- return this._isRawInput ? this.value : "";
1004
- }
1005
- get displayValue() {
1006
- return this.value;
1007
- }
1008
- get isComplete() {
1009
- return !0;
1010
- }
1011
- get isFilled() {
1012
- return !!this._value;
1013
- }
1014
- get state() {
1015
- return {
1016
- _value: this._value,
1017
- _rawInputValue: this.rawInputValue
1018
- };
1019
- }
1020
- set state(t) {
1021
- this._value = t._value, this._isRawInput = !!t._rawInputValue;
1022
- }
1023
- reset() {
1024
- this._isRawInput = !1, this._value = "";
1025
- }
1026
- remove(t, e) {
1027
- return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._value = this._value.slice(0, t) + this._value.slice(e), this._value || (this._isRawInput = !1), new c();
1028
- }
1029
- nearestInputPos(t, e) {
1030
- e === void 0 && (e = h.NONE);
1031
- const s = 0, i = this._value.length;
1032
- switch (e) {
1033
- case h.LEFT:
1034
- case h.FORCE_LEFT:
1035
- return s;
1036
- case h.NONE:
1037
- case h.RIGHT:
1038
- case h.FORCE_RIGHT:
1039
- default:
1040
- return i;
1041
- }
1042
- }
1043
- totalInputPositions(t, e) {
1044
- return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), this._isRawInput ? e - t : 0;
1045
- }
1046
- extractInput(t, e, s) {
1047
- return t === void 0 && (t = 0), e === void 0 && (e = this._value.length), s === void 0 && (s = {}), s.raw && this._isRawInput && this._value.slice(t, e) || "";
1048
- }
1049
- _appendChar(t, e) {
1050
- e === void 0 && (e = {});
1051
- const s = new c();
1052
- if (this.isFilled)
1053
- return s;
1054
- const i = this.eager === !0 || this.eager === "append", a = this.char === t && (this.isUnmasking || e.input || e.raw) && (!e.raw || !i) && !e.tail;
1055
- return a && (s.rawInserted = this.char), this._value = s.inserted = this.char, this._isRawInput = a && (e.raw || e.input), s;
1056
- }
1057
- _appendEager() {
1058
- return this._appendChar(this.char, {
1059
- tail: !0
1060
- });
1061
- }
1062
- _appendPlaceholder() {
1063
- const t = new c();
1064
- return this.isFilled || (this._value = t.inserted = this.char), t;
1065
- }
1066
- extractTail() {
1067
- return new E("");
1068
- }
1069
- appendTail(t) {
1070
- return m(t) && (t = new E(String(t))), t.appendTo(this);
1071
- }
1072
- append(t, e, s) {
1073
- const i = this._appendChar(t[0], e);
1074
- return s != null && (i.tailShift += this.appendTail(s).tailShift), i;
1075
- }
1076
- doCommit() {
1077
- }
1078
- }
1079
- class M {
1080
- /** */
1081
- /** */
1082
- /** */
1083
- /** */
1084
- /** */
1085
- /** */
1086
- /** */
1087
- /** */
1088
- constructor(t) {
1089
- const {
1090
- parent: e,
1091
- isOptional: s,
1092
- placeholderChar: i,
1093
- displayChar: u,
1094
- lazy: a,
1095
- eager: r,
1096
- ...l
1097
- } = t;
1098
- this.masked = A(l), Object.assign(this, {
1099
- parent: e,
1100
- isOptional: s,
1101
- placeholderChar: i,
1102
- displayChar: u,
1103
- lazy: a,
1104
- eager: r
1105
- });
1106
- }
1107
- get value() {
1108
- return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : "");
1109
- }
1110
- get unmaskedValue() {
1111
- return this.masked.unmaskedValue;
1112
- }
1113
- get rawInputValue() {
1114
- return this.masked.rawInputValue;
1115
- }
1116
- get displayValue() {
1117
- return this.masked.value && this.displayChar || this.value;
1118
- }
1119
- get isComplete() {
1120
- return !!this.masked.value || this.isOptional;
1121
- }
1122
- get state() {
1123
- return {
1124
- _value: this.value,
1125
- _rawInputValue: this.rawInputValue,
1126
- masked: this.masked.state,
1127
- isFilled: this.isFilled
1128
- };
1129
- }
1130
- set state(t) {
1131
- this.masked.state = t.masked, this.isFilled = t.isFilled;
1132
- }
1133
- reset() {
1134
- this.isFilled = !1, this.masked.reset();
1135
- }
1136
- remove(t, e) {
1137
- return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), t === 0 && e >= 1 ? (this.isFilled = !1, this.masked.remove(t, e)) : new c();
1138
- }
1139
- _appendChar(t, e) {
1140
- if (e === void 0 && (e = {}), this.isFilled)
1141
- return new c();
1142
- const s = this.masked.state, i = this.masked._appendChar(t, this.currentMaskFlags(e));
1143
- return i.inserted && this.doValidate(e) === !1 && (i.inserted = i.rawInserted = "", this.masked.state = s), !i.inserted && !this.isOptional && !this.lazy && !e.input && (i.inserted = this.placeholderChar), i.skip = !i.inserted && !this.isOptional, this.isFilled = !!i.inserted, i;
1144
- }
1145
- append(t, e, s) {
1146
- return this.masked.append(t, this.currentMaskFlags(e), s);
1147
- }
1148
- _appendPlaceholder() {
1149
- const t = new c();
1150
- return this.isFilled || this.isOptional || (this.isFilled = !0, t.inserted = this.placeholderChar), t;
1151
- }
1152
- _appendEager() {
1153
- return new c();
1154
- }
1155
- extractTail(t, e) {
1156
- return this.masked.extractTail(t, e);
1157
- }
1158
- appendTail(t) {
1159
- return this.masked.appendTail(t);
1160
- }
1161
- extractInput(t, e, s) {
1162
- return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.masked.extractInput(t, e, s);
1163
- }
1164
- nearestInputPos(t, e) {
1165
- e === void 0 && (e = h.NONE);
1166
- const s = 0, i = this.value.length, u = Math.min(Math.max(t, s), i);
1167
- switch (e) {
1168
- case h.LEFT:
1169
- case h.FORCE_LEFT:
1170
- return this.isComplete ? u : s;
1171
- case h.RIGHT:
1172
- case h.FORCE_RIGHT:
1173
- return this.isComplete ? u : i;
1174
- case h.NONE:
1175
- default:
1176
- return u;
1177
- }
1178
- }
1179
- totalInputPositions(t, e) {
1180
- return t === void 0 && (t = 0), e === void 0 && (e = this.value.length), this.value.slice(t, e).length;
1181
- }
1182
- doValidate(t) {
1183
- return this.masked.doValidate(this.currentMaskFlags(t)) && (!this.parent || this.parent.doValidate(this.currentMaskFlags(t)));
1184
- }
1185
- doCommit() {
1186
- this.masked.doCommit();
1187
- }
1188
- currentMaskFlags(t) {
1189
- var e;
1190
- return {
1191
- ...t,
1192
- _beforeTailState: (t == null || (e = t._beforeTailState) == null ? void 0 : e.masked) || (t == null ? void 0 : t._beforeTailState)
1193
- };
1194
- }
1195
- }
1196
- M.DEFAULT_DEFINITIONS = {
1197
- 0: /\d/,
1198
- a: /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
1199
- // http://stackoverflow.com/a/22075070
1200
- "*": /./
1201
- };
1202
- class q extends f {
1203
- /** */
1204
- /** Enable characters overwriting */
1205
- /** */
1206
- /** */
1207
- updateOptions(t) {
1208
- super.updateOptions(t);
1209
- }
1210
- _update(t) {
1211
- const e = t.mask;
1212
- e && (t.validate = (s) => s.search(e) >= 0), super._update(t);
1213
- }
1214
- }
1215
- o.MaskedRegExp = q;
1216
- class k extends f {
1217
- /** */
1218
- /** */
1219
- /** Single char for empty input */
1220
- /** Single char for filled input */
1221
- /** Show placeholder only when needed */
1222
- /** Enable characters overwriting */
1223
- /** */
1224
- /** */
1225
- constructor(t) {
1226
- super({
1227
- ...k.DEFAULTS,
1228
- ...t,
1229
- definitions: Object.assign({}, M.DEFAULT_DEFINITIONS, t == null ? void 0 : t.definitions)
1230
- });
1231
- }
1232
- get state() {
1233
- return {
1234
- ...super.state,
1235
- _blocks: this._blocks.map((t) => t.state)
1236
- };
1237
- }
1238
- set state(t) {
1239
- const {
1240
- _blocks: e,
1241
- ...s
1242
- } = t;
1243
- this._blocks.forEach((i, u) => i.state = e[u]), super.state = s;
1244
- }
1245
- get isComplete() {
1246
- return this.exposeBlock ? this.exposeBlock.isComplete : this._blocks.every((t) => t.isComplete);
1247
- }
1248
- get isFilled() {
1249
- return this._blocks.every((t) => t.isFilled);
1250
- }
1251
- get isFixed() {
1252
- return this._blocks.every((t) => t.isFixed);
1253
- }
1254
- get isOptional() {
1255
- return this._blocks.every((t) => t.isOptional);
1256
- }
1257
- get unmaskedValue() {
1258
- return this.exposeBlock ? this.exposeBlock.unmaskedValue : this._blocks.reduce((t, e) => t += e.unmaskedValue, "");
1259
- }
1260
- set unmaskedValue(t) {
1261
- if (this.exposeBlock) {
1262
- const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1263
- this.exposeBlock.unmaskedValue = t, this.appendTail(e), this.doCommit();
1264
- } else
1265
- super.unmaskedValue = t;
1266
- }
1267
- get value() {
1268
- return this.exposeBlock ? this.exposeBlock.value : (
1269
- // TODO return _value when not in change?
1270
- this._blocks.reduce((t, e) => t += e.value, "")
1271
- );
1272
- }
1273
- set value(t) {
1274
- if (this.exposeBlock) {
1275
- const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1276
- this.exposeBlock.value = t, this.appendTail(e), this.doCommit();
1277
- } else
1278
- super.value = t;
1279
- }
1280
- get typedValue() {
1281
- return this.exposeBlock ? this.exposeBlock.typedValue : super.typedValue;
1282
- }
1283
- set typedValue(t) {
1284
- if (this.exposeBlock) {
1285
- const e = this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock)) + this.exposeBlock.displayValue.length);
1286
- this.exposeBlock.typedValue = t, this.appendTail(e), this.doCommit();
1287
- } else
1288
- super.typedValue = t;
1289
- }
1290
- get displayValue() {
1291
- return this._blocks.reduce((t, e) => t += e.displayValue, "");
1292
- }
1293
- updateOptions(t) {
1294
- super.updateOptions(t);
1295
- }
1296
- _update(t) {
1297
- t.definitions = Object.assign({}, this.definitions, t.definitions), super._update(t), this._rebuildMask();
1298
- }
1299
- _rebuildMask() {
1300
- const t = this.definitions;
1301
- this._blocks = [], this.exposeBlock = void 0, this._stops = [], this._maskedBlocks = {};
1302
- const e = this.mask;
1303
- if (!e || !t)
1304
- return;
1305
- let s = !1, i = !1;
1306
- for (let u = 0; u < e.length; ++u) {
1307
- if (this.blocks) {
1308
- const d = e.slice(u), v = Object.keys(this.blocks).filter((S) => d.indexOf(S) === 0);
1309
- v.sort((S, L) => L.length - S.length);
1310
- const _ = v[0];
1311
- if (_) {
1312
- const {
1313
- expose: S,
1314
- ...L
1315
- } = x(this.blocks[_]), N = A({
1316
- lazy: this.lazy,
1317
- eager: this.eager,
1318
- placeholderChar: this.placeholderChar,
1319
- displayChar: this.displayChar,
1320
- overwrite: this.overwrite,
1321
- ...L,
1322
- parent: this
1323
- });
1324
- N && (this._blocks.push(N), S && (this.exposeBlock = N), this._maskedBlocks[_] || (this._maskedBlocks[_] = []), this._maskedBlocks[_].push(this._blocks.length - 1)), u += _.length - 1;
1325
- continue;
1326
- }
1327
- }
1328
- let a = e[u], r = a in t;
1329
- if (a === k.STOP_CHAR) {
1330
- this._stops.push(this._blocks.length);
1331
- continue;
1332
- }
1333
- if (a === "{" || a === "}") {
1334
- s = !s;
1335
- continue;
1336
- }
1337
- if (a === "[" || a === "]") {
1338
- i = !i;
1339
- continue;
1340
- }
1341
- if (a === k.ESCAPE_CHAR) {
1342
- if (++u, a = e[u], !a)
1343
- break;
1344
- r = !1;
1345
- }
1346
- const l = r ? new M({
1347
- isOptional: i,
1348
- lazy: this.lazy,
1349
- eager: this.eager,
1350
- placeholderChar: this.placeholderChar,
1351
- displayChar: this.displayChar,
1352
- ...x(t[a]),
1353
- parent: this
1354
- }) : new R({
1355
- char: a,
1356
- eager: this.eager,
1357
- isUnmasking: s
1358
- });
1359
- this._blocks.push(l);
1360
- }
1361
- }
1362
- reset() {
1363
- super.reset(), this._blocks.forEach((t) => t.reset());
1364
- }
1365
- doCommit() {
1366
- this._blocks.forEach((t) => t.doCommit()), super.doCommit();
1367
- }
1368
- appendTail(t) {
1369
- return super.appendTail(t).aggregate(this._appendPlaceholder());
1370
- }
1371
- _appendEager() {
1372
- var t;
1373
- const e = new c();
1374
- let s = (t = this._mapPosToBlock(this.displayValue.length)) == null ? void 0 : t.index;
1375
- if (s == null)
1376
- return e;
1377
- this._blocks[s].isFilled && ++s;
1378
- for (let i = s; i < this._blocks.length; ++i) {
1379
- const u = this._blocks[i]._appendEager();
1380
- if (!u.inserted)
1381
- break;
1382
- e.aggregate(u);
1383
- }
1384
- return e;
1385
- }
1386
- _appendCharRaw(t, e) {
1387
- e === void 0 && (e = {});
1388
- const s = this._mapPosToBlock(this.displayValue.length), i = new c();
1389
- if (!s)
1390
- return i;
1391
- for (let a = s.index; ; ++a) {
1392
- var u;
1393
- const r = this._blocks[a];
1394
- if (!r)
1395
- break;
1396
- const l = r._appendChar(t, {
1397
- ...e,
1398
- _beforeTailState: (u = e._beforeTailState) == null || (u = u._blocks) == null ? void 0 : u[a]
1399
- }), d = l.skip;
1400
- if (i.aggregate(l), d || l.rawInserted)
1401
- break;
1402
- }
1403
- return i;
1404
- }
1405
- extractTail(t, e) {
1406
- t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1407
- const s = new C();
1408
- return t === e || this._forEachBlocksInRange(t, e, (i, u, a, r) => {
1409
- const l = i.extractTail(a, r);
1410
- l.stop = this._findStopBefore(u), l.from = this._blockStartPos(u), l instanceof C && (l.blockIndex = u), s.extend(l);
1411
- }), s;
1412
- }
1413
- extractInput(t, e, s) {
1414
- if (t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), s === void 0 && (s = {}), t === e)
1415
- return "";
1416
- let i = "";
1417
- return this._forEachBlocksInRange(t, e, (u, a, r, l) => {
1418
- i += u.extractInput(r, l, s);
1419
- }), i;
1420
- }
1421
- _findStopBefore(t) {
1422
- let e;
1423
- for (let s = 0; s < this._stops.length; ++s) {
1424
- const i = this._stops[s];
1425
- if (i <= t)
1426
- e = i;
1427
- else
1428
- break;
1429
- }
1430
- return e;
1431
- }
1432
- /** Appends placeholder depending on laziness */
1433
- _appendPlaceholder(t) {
1434
- const e = new c();
1435
- if (this.lazy && t == null)
1436
- return e;
1437
- const s = this._mapPosToBlock(this.displayValue.length);
1438
- if (!s)
1439
- return e;
1440
- const i = s.index, u = t ?? this._blocks.length;
1441
- return this._blocks.slice(i, u).forEach((a) => {
1442
- if (!a.lazy || t != null) {
1443
- var r;
1444
- const l = a._appendPlaceholder((r = a._blocks) == null ? void 0 : r.length);
1445
- this._value += l.inserted, e.aggregate(l);
1446
- }
1447
- }), e;
1448
- }
1449
- /** Finds block in pos */
1450
- _mapPosToBlock(t) {
1451
- let e = "";
1452
- for (let s = 0; s < this._blocks.length; ++s) {
1453
- const i = this._blocks[s], u = e.length;
1454
- if (e += i.displayValue, t <= e.length)
1455
- return {
1456
- index: s,
1457
- offset: t - u
1458
- };
1459
- }
1460
- }
1461
- _blockStartPos(t) {
1462
- return this._blocks.slice(0, t).reduce((e, s) => e += s.displayValue.length, 0);
1463
- }
1464
- _forEachBlocksInRange(t, e, s) {
1465
- e === void 0 && (e = this.displayValue.length);
1466
- const i = this._mapPosToBlock(t);
1467
- if (i) {
1468
- const u = this._mapPosToBlock(e), a = u && i.index === u.index, r = i.offset, l = u && a ? u.offset : this._blocks[i.index].displayValue.length;
1469
- if (s(this._blocks[i.index], i.index, r, l), u && !a) {
1470
- for (let d = i.index + 1; d < u.index; ++d)
1471
- s(this._blocks[d], d, 0, this._blocks[d].displayValue.length);
1472
- s(this._blocks[u.index], u.index, 0, u.offset);
1473
- }
1474
- }
1475
- }
1476
- remove(t, e) {
1477
- t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1478
- const s = super.remove(t, e);
1479
- return this._forEachBlocksInRange(t, e, (i, u, a, r) => {
1480
- s.aggregate(i.remove(a, r));
1481
- }), s;
1482
- }
1483
- nearestInputPos(t, e) {
1484
- if (e === void 0 && (e = h.NONE), !this._blocks.length)
1485
- return 0;
1486
- const s = new X(this, t);
1487
- if (e === h.NONE)
1488
- return s.pushRightBeforeInput() || (s.popState(), s.pushLeftBeforeInput()) ? s.pos : this.displayValue.length;
1489
- if (e === h.LEFT || e === h.FORCE_LEFT) {
1490
- if (e === h.LEFT) {
1491
- if (s.pushRightBeforeFilled(), s.ok && s.pos === t)
1492
- return t;
1493
- s.popState();
1494
- }
1495
- if (s.pushLeftBeforeInput(), s.pushLeftBeforeRequired(), s.pushLeftBeforeFilled(), e === h.LEFT) {
1496
- if (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.ok && s.pos <= t || (s.popState(), s.ok && s.pos <= t))
1497
- return s.pos;
1498
- s.popState();
1499
- }
1500
- return s.ok ? s.pos : e === h.FORCE_LEFT ? 0 : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : 0);
1501
- }
1502
- return e === h.RIGHT || e === h.FORCE_RIGHT ? (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.pushRightBeforeFilled() ? s.pos : e === h.FORCE_RIGHT ? this.displayValue.length : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : this.nearestInputPos(t, h.LEFT))) : t;
1503
- }
1504
- totalInputPositions(t, e) {
1505
- t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length);
1506
- let s = 0;
1507
- return this._forEachBlocksInRange(t, e, (i, u, a, r) => {
1508
- s += i.totalInputPositions(a, r);
1509
- }), s;
1510
- }
1511
- /** Get block by name */
1512
- maskedBlock(t) {
1513
- return this.maskedBlocks(t)[0];
1514
- }
1515
- /** Get all blocks by name */
1516
- maskedBlocks(t) {
1517
- const e = this._maskedBlocks[t];
1518
- return e ? e.map((s) => this._blocks[s]) : [];
1519
- }
1520
- }
1521
- k.DEFAULTS = {
1522
- lazy: !0,
1523
- placeholderChar: "_"
1524
- }, k.STOP_CHAR = "`", k.ESCAPE_CHAR = "\\", k.InputDefinition = M, k.FixedDefinition = R, o.MaskedPattern = k;
1525
- class V extends k {
1526
- /**
1527
- Optionally sets max length of pattern.
1528
- Used when pattern length is longer then `to` param length. Pads zeros at start in this case.
1529
- */
1530
- /** Min bound */
1531
- /** Max bound */
1532
- constructor(t) {
1533
- super(t);
1534
- }
1535
- /** */
1536
- get _matchFrom() {
1537
- return this.maxLength - String(this.from).length;
1538
- }
1539
- get isComplete() {
1540
- return super.isComplete && !!this.value;
1541
- }
1542
- updateOptions(t) {
1543
- super.updateOptions(t);
1544
- }
1545
- _update(t) {
1546
- const {
1547
- to: e = this.to || 0,
1548
- from: s = this.from || 0,
1549
- maxLength: i = this.maxLength || 0,
1550
- autofix: u = this.autofix,
1551
- ...a
1552
- } = t;
1553
- this.to = e, this.from = s, this.maxLength = Math.max(String(e).length, i), this.autofix = u;
1554
- const r = String(this.from).padStart(this.maxLength, "0"), l = String(this.to).padStart(this.maxLength, "0");
1555
- let d = 0;
1556
- for (; d < l.length && l[d] === r[d]; )
1557
- ++d;
1558
- a.mask = l.slice(0, d).replace(/0/g, "\\0") + "0".repeat(this.maxLength - d), super._update(a);
1559
- }
1560
- boundaries(t) {
1561
- let e = "", s = "";
1562
- const [, i, u] = t.match(/^(\D*)(\d*)(\D*)/) || [];
1563
- return u && (e = "0".repeat(i.length) + u, s = "9".repeat(i.length) + u), e = e.padEnd(this.maxLength, "0"), s = s.padEnd(this.maxLength, "9"), [e, s];
1564
- }
1565
- doPrepareChar(t, e) {
1566
- e === void 0 && (e = {});
1567
- let s;
1568
- if ([t, s] = super.doPrepareChar(t.replace(/\D/g, ""), e), !this.autofix || !t)
1569
- return [t, s];
1570
- const i = String(this.from).padStart(this.maxLength, "0"), u = String(this.to).padStart(this.maxLength, "0"), a = this.value + t;
1571
- if (a.length > this.maxLength)
1572
- return ["", s];
1573
- const [r, l] = this.boundaries(a);
1574
- return Number(l) < this.from ? [i[a.length - 1], s] : Number(r) > this.to ? this.autofix === "pad" && a.length < this.maxLength ? ["", s.aggregate(this.append(i[a.length - 1] + t, e))] : [u[a.length - 1], s] : [t, s];
1575
- }
1576
- doValidate(t) {
1577
- const e = this.value;
1578
- if (e.search(/[^0]/) === -1 && e.length <= this._matchFrom)
1579
- return !0;
1580
- const [i, u] = this.boundaries(e);
1581
- return this.from <= Number(u) && Number(i) <= this.to && super.doValidate(t);
1582
- }
1583
- }
1584
- o.MaskedRange = V;
1585
- class B extends k {
1586
- /** Pattern mask for date according to {@link MaskedDate#format} */
1587
- /** Start date */
1588
- /** End date */
1589
- /** */
1590
- /** Format typed value to string */
1591
- /** Parse string to get typed value */
1592
- constructor(t) {
1593
- const {
1594
- mask: e,
1595
- pattern: s,
1596
- ...i
1597
- } = {
1598
- ...B.DEFAULTS,
1599
- ...t
1600
- };
1601
- super({
1602
- ...i,
1603
- mask: m(e) ? e : s
1604
- });
1605
- }
1606
- /** Parsed Date */
1607
- get date() {
1608
- return this.typedValue;
1609
- }
1610
- set date(t) {
1611
- this.typedValue = t;
1612
- }
1613
- get typedValue() {
1614
- return this.isComplete ? super.typedValue : null;
1615
- }
1616
- set typedValue(t) {
1617
- super.typedValue = t;
1618
- }
1619
- updateOptions(t) {
1620
- super.updateOptions(t);
1621
- }
1622
- _update(t) {
1623
- const {
1624
- mask: e,
1625
- pattern: s,
1626
- blocks: i,
1627
- ...u
1628
- } = {
1629
- ...B.DEFAULTS,
1630
- ...t
1631
- }, a = Object.assign({}, B.GET_DEFAULT_BLOCKS());
1632
- t.min && (a.Y.from = t.min.getFullYear()), t.max && (a.Y.to = t.max.getFullYear()), t.min && t.max && a.Y.from === a.Y.to && (a.m.from = t.min.getMonth() + 1, a.m.to = t.max.getMonth() + 1, a.m.from === a.m.to && (a.d.from = t.min.getDate(), a.d.to = t.max.getDate())), Object.assign(a, this.blocks, i), Object.keys(a).forEach((r) => {
1633
- const l = a[r];
1634
- !("autofix" in l) && "autofix" in t && (l.autofix = t.autofix);
1635
- }), super._update({
1636
- ...u,
1637
- mask: m(e) ? e : s,
1638
- blocks: a
1639
- });
1640
- }
1641
- doValidate(t) {
1642
- const e = this.date;
1643
- return super.doValidate(t) && (!this.isComplete || this.isDateExist(this.value) && e != null && (this.min == null || this.min <= e) && (this.max == null || e <= this.max));
1644
- }
1645
- /** Checks if date is exists */
1646
- isDateExist(t) {
1647
- return this.format(this.parse(t, this), this).indexOf(t) >= 0;
1648
- }
1649
- maskEquals(t) {
1650
- return t === Date || super.maskEquals(t);
1651
- }
1652
- }
1653
- B.GET_DEFAULT_BLOCKS = () => ({
1654
- d: {
1655
- mask: V,
1656
- from: 1,
1657
- to: 31,
1658
- maxLength: 2
1659
- },
1660
- m: {
1661
- mask: V,
1662
- from: 1,
1663
- to: 12,
1664
- maxLength: 2
1665
- },
1666
- Y: {
1667
- mask: V,
1668
- from: 1900,
1669
- to: 9999
1670
- }
1671
- }), B.DEFAULTS = {
1672
- mask: Date,
1673
- pattern: "d{.}`m{.}`Y",
1674
- format: (n, t) => {
1675
- if (!n)
1676
- return "";
1677
- const e = String(n.getDate()).padStart(2, "0"), s = String(n.getMonth() + 1).padStart(2, "0"), i = n.getFullYear();
1678
- return [e, s, i].join(".");
1679
- },
1680
- parse: (n, t) => {
1681
- const [e, s, i] = n.split(".").map(Number);
1682
- return new Date(i, s - 1, e);
1683
- }
1684
- }, o.MaskedDate = B;
1685
- class D extends f {
1686
- /** Currently chosen mask */
1687
- /** Currently chosen mask */
1688
- /** Compliled {@link Masked} options */
1689
- /** Chooses {@link Masked} depending on input value */
1690
- constructor(t) {
1691
- super({
1692
- ...D.DEFAULTS,
1693
- ...t
1694
- }), this.currentMask = void 0;
1695
- }
1696
- get value() {
1697
- return this.exposeMask ? this.exposeMask.value : this.currentMask ? this.currentMask.value : "";
1698
- }
1699
- set value(t) {
1700
- this.exposeMask ? (this.exposeMask.value = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.value = t;
1701
- }
1702
- get unmaskedValue() {
1703
- return this.exposeMask ? this.exposeMask.unmaskedValue : this.currentMask ? this.currentMask.unmaskedValue : "";
1704
- }
1705
- set unmaskedValue(t) {
1706
- this.exposeMask ? (this.exposeMask.unmaskedValue = t, this.currentMask = this.exposeMask, this._applyDispatch()) : super.unmaskedValue = t;
1707
- }
1708
- get typedValue() {
1709
- return this.exposeMask ? this.exposeMask.typedValue : this.currentMask ? this.currentMask.typedValue : "";
1710
- }
1711
- set typedValue(t) {
1712
- if (this.exposeMask) {
1713
- this.exposeMask.typedValue = t, this.currentMask = this.exposeMask, this._applyDispatch();
1714
- return;
1715
- }
1716
- let e = String(t);
1717
- this.currentMask && (this.currentMask.typedValue = t, e = this.currentMask.unmaskedValue), this.unmaskedValue = e;
1718
- }
1719
- get displayValue() {
1720
- return this.currentMask ? this.currentMask.displayValue : "";
1721
- }
1722
- get isComplete() {
1723
- var t;
1724
- return !!((t = this.currentMask) != null && t.isComplete);
1725
- }
1726
- get isFilled() {
1727
- var t;
1728
- return !!((t = this.currentMask) != null && t.isFilled);
1729
- }
1730
- get state() {
1731
- var t;
1732
- return {
1733
- ...super.state,
1734
- _rawInputValue: this.rawInputValue,
1735
- compiledMasks: this.compiledMasks.map((e) => e.state),
1736
- currentMaskRef: this.currentMask,
1737
- currentMask: (t = this.currentMask) == null ? void 0 : t.state
1738
- };
1739
- }
1740
- set state(t) {
1741
- const {
1742
- compiledMasks: e,
1743
- currentMaskRef: s,
1744
- currentMask: i,
1745
- ...u
1746
- } = t;
1747
- e && this.compiledMasks.forEach((a, r) => a.state = e[r]), s != null && (this.currentMask = s, this.currentMask.state = i), super.state = u;
1748
- }
1749
- get overwrite() {
1750
- return this.currentMask ? this.currentMask.overwrite : this._overwrite;
1751
- }
1752
- set overwrite(t) {
1753
- this._overwrite = t;
1754
- }
1755
- get eager() {
1756
- return this.currentMask ? this.currentMask.eager : this._eager;
1757
- }
1758
- set eager(t) {
1759
- this._eager = t;
1760
- }
1761
- get skipInvalid() {
1762
- return this.currentMask ? this.currentMask.skipInvalid : this._skipInvalid;
1763
- }
1764
- set skipInvalid(t) {
1765
- this._skipInvalid = t;
1766
- }
1767
- updateOptions(t) {
1768
- super.updateOptions(t);
1769
- }
1770
- _update(t) {
1771
- super._update(t), "mask" in t && (this.exposeMask = void 0, this.compiledMasks = Array.isArray(t.mask) ? t.mask.map((e) => {
1772
- const {
1773
- expose: s,
1774
- ...i
1775
- } = x(e), u = A({
1776
- overwrite: this._overwrite,
1777
- eager: this._eager,
1778
- skipInvalid: this._skipInvalid,
1779
- ...i
1780
- });
1781
- return s && (this.exposeMask = u), u;
1782
- }) : []);
1783
- }
1784
- _appendCharRaw(t, e) {
1785
- e === void 0 && (e = {});
1786
- const s = this._applyDispatch(t, e);
1787
- return this.currentMask && s.aggregate(this.currentMask._appendChar(t, this.currentMaskFlags(e))), s;
1788
- }
1789
- _applyDispatch(t, e, s) {
1790
- t === void 0 && (t = ""), e === void 0 && (e = {}), s === void 0 && (s = "");
1791
- const i = e.tail && e._beforeTailState != null ? e._beforeTailState._value : this.value, u = this.rawInputValue, a = e.tail && e._beforeTailState != null ? e._beforeTailState._rawInputValue : u, r = u.slice(a.length), l = this.currentMask, d = new c(), v = l == null ? void 0 : l.state;
1792
- if (this.currentMask = this.doDispatch(t, {
1793
- ...e
1794
- }, s), this.currentMask)
1795
- if (this.currentMask !== l) {
1796
- if (this.currentMask.reset(), a) {
1797
- const _ = this.currentMask.append(a, {
1798
- raw: !0
1799
- });
1800
- d.tailShift = _.inserted.length - i.length;
1801
- }
1802
- r && (d.tailShift += this.currentMask.append(r, {
1803
- raw: !0,
1804
- tail: !0
1805
- }).tailShift);
1806
- } else
1807
- v && (this.currentMask.state = v);
1808
- return d;
1809
- }
1810
- _appendPlaceholder() {
1811
- const t = this._applyDispatch();
1812
- return this.currentMask && t.aggregate(this.currentMask._appendPlaceholder()), t;
1813
- }
1814
- _appendEager() {
1815
- const t = this._applyDispatch();
1816
- return this.currentMask && t.aggregate(this.currentMask._appendEager()), t;
1817
- }
1818
- appendTail(t) {
1819
- const e = new c();
1820
- return t && e.aggregate(this._applyDispatch("", {}, t)), e.aggregate(this.currentMask ? this.currentMask.appendTail(t) : super.appendTail(t));
1821
- }
1822
- currentMaskFlags(t) {
1823
- var e, s;
1824
- return {
1825
- ...t,
1826
- _beforeTailState: ((e = t._beforeTailState) == null ? void 0 : e.currentMaskRef) === this.currentMask && ((s = t._beforeTailState) == null ? void 0 : s.currentMask) || t._beforeTailState
1827
- };
1828
- }
1829
- doDispatch(t, e, s) {
1830
- return e === void 0 && (e = {}), s === void 0 && (s = ""), this.dispatch(t, this, e, s);
1831
- }
1832
- doValidate(t) {
1833
- return super.doValidate(t) && (!this.currentMask || this.currentMask.doValidate(this.currentMaskFlags(t)));
1834
- }
1835
- doPrepare(t, e) {
1836
- e === void 0 && (e = {});
1837
- let [s, i] = super.doPrepare(t, e);
1838
- if (this.currentMask) {
1839
- let u;
1840
- [s, u] = super.doPrepare(s, this.currentMaskFlags(e)), i = i.aggregate(u);
1841
- }
1842
- return [s, i];
1843
- }
1844
- doPrepareChar(t, e) {
1845
- e === void 0 && (e = {});
1846
- let [s, i] = super.doPrepareChar(t, e);
1847
- if (this.currentMask) {
1848
- let u;
1849
- [s, u] = super.doPrepareChar(s, this.currentMaskFlags(e)), i = i.aggregate(u);
1850
- }
1851
- return [s, i];
1852
- }
1853
- reset() {
1854
- var t;
1855
- (t = this.currentMask) == null || t.reset(), this.compiledMasks.forEach((e) => e.reset());
1856
- }
1857
- remove(t, e) {
1858
- const s = new c();
1859
- return this.currentMask && s.aggregate(this.currentMask.remove(t, e)).aggregate(this._applyDispatch()), s;
1860
- }
1861
- extractInput(t, e, s) {
1862
- return this.currentMask ? this.currentMask.extractInput(t, e, s) : "";
1863
- }
1864
- extractTail(t, e) {
1865
- return this.currentMask ? this.currentMask.extractTail(t, e) : super.extractTail(t, e);
1866
- }
1867
- doCommit() {
1868
- this.currentMask && this.currentMask.doCommit(), super.doCommit();
1869
- }
1870
- nearestInputPos(t, e) {
1871
- return this.currentMask ? this.currentMask.nearestInputPos(t, e) : super.nearestInputPos(t, e);
1872
- }
1873
- maskEquals(t) {
1874
- return Array.isArray(t) ? this.compiledMasks.every((e, s) => {
1875
- if (!t[s])
1876
- return;
1877
- const {
1878
- mask: i,
1879
- ...u
1880
- } = t[s];
1881
- return b(e, u) && e.maskEquals(i);
1882
- }) : super.maskEquals(t);
1883
- }
1884
- typedValueEquals(t) {
1885
- var e;
1886
- return !!((e = this.currentMask) != null && e.typedValueEquals(t));
1887
- }
1888
- }
1889
- D.DEFAULTS = void 0, D.DEFAULTS = {
1890
- dispatch: (n, t, e, s) => {
1891
- if (!t.compiledMasks.length)
1892
- return;
1893
- const i = t.rawInputValue, u = t.compiledMasks.map((a, r) => {
1894
- const l = t.currentMask === a, d = l ? a.displayValue.length : a.nearestInputPos(a.displayValue.length, h.FORCE_LEFT);
1895
- return a.rawInputValue !== i ? (a.reset(), a.append(i, {
1896
- raw: !0
1897
- })) : l || a.remove(d), a.append(n, t.currentMaskFlags(e)), a.appendTail(s), {
1898
- index: r,
1899
- weight: a.rawInputValue.length,
1900
- totalInputPositions: a.totalInputPositions(0, Math.max(d, a.nearestInputPos(a.displayValue.length, h.FORCE_LEFT)))
1901
- };
1902
- });
1903
- return u.sort((a, r) => r.weight - a.weight || r.totalInputPositions - a.totalInputPositions), t.compiledMasks[u[0].index];
1904
- }
1905
- }, o.MaskedDynamic = D;
1906
- class Y extends k {
1907
- constructor(t) {
1908
- super(t);
1909
- }
1910
- updateOptions(t) {
1911
- super.updateOptions(t);
1912
- }
1913
- _update(t) {
1914
- const {
1915
- enum: e,
1916
- ...s
1917
- } = t;
1918
- if (e) {
1919
- const i = e.map((r) => r.length), u = Math.min(...i), a = Math.max(...i) - u;
1920
- s.mask = "*".repeat(u), a && (s.mask += "[" + "*".repeat(a) + "]"), this.enum = e;
1921
- }
1922
- super._update(s);
1923
- }
1924
- doValidate(t) {
1925
- return this.enum.some((e) => e.indexOf(this.unmaskedValue) === 0) && super.doValidate(t);
1926
- }
1927
- }
1928
- o.MaskedEnum = Y;
1929
- class $ extends f {
1930
- /** */
1931
- /** Enable characters overwriting */
1932
- /** */
1933
- /** */
1934
- updateOptions(t) {
1935
- super.updateOptions(t);
1936
- }
1937
- _update(t) {
1938
- super._update({
1939
- ...t,
1940
- validate: t.mask
1941
- });
1942
- }
1943
- }
1944
- o.MaskedFunction = $;
1945
- class g extends f {
1946
- /** Single char */
1947
- /** Single char */
1948
- /** Array of single chars */
1949
- /** */
1950
- /** */
1951
- /** Digits after point */
1952
- /** Flag to remove leading and trailing zeros in the end of editing */
1953
- /** Flag to pad trailing zeros after point in the end of editing */
1954
- /** Enable characters overwriting */
1955
- /** */
1956
- /** */
1957
- /** Format typed value to string */
1958
- /** Parse string to get typed value */
1959
- constructor(t) {
1960
- super({
1961
- ...g.DEFAULTS,
1962
- ...t
1963
- });
1964
- }
1965
- get unmaskedValue() {
1966
- return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix, g.UNMASKED_RADIX);
1967
- }
1968
- set unmaskedValue(t) {
1969
- super.unmaskedValue = t;
1970
- }
1971
- get typedValue() {
1972
- return this.parse(this.unmaskedValue, this);
1973
- }
1974
- set typedValue(t) {
1975
- this.rawInputValue = this.format(t, this).replace(g.UNMASKED_RADIX, this.radix);
1976
- }
1977
- /** Parsed Number */
1978
- get number() {
1979
- return this.typedValue;
1980
- }
1981
- set number(t) {
1982
- this.typedValue = t;
1983
- }
1984
- /**
1985
- Is negative allowed
1986
- */
1987
- get allowNegative() {
1988
- return this.min != null && this.min < 0 || this.max != null && this.max < 0;
1989
- }
1990
- /**
1991
- Is positive allowed
1992
- */
1993
- get allowPositive() {
1994
- return this.min != null && this.min > 0 || this.max != null && this.max > 0;
1995
- }
1996
- updateOptions(t) {
1997
- super.updateOptions(t);
1998
- }
1999
- _update(t) {
2000
- super._update(t), this._updateRegExps();
2001
- }
2002
- _updateRegExps() {
2003
- const t = "^" + (this.allowNegative ? "[+|\\-]?" : ""), e = "\\d*", s = (this.scale ? "(" + y(this.radix) + "\\d{0," + this.scale + "})?" : "") + "$";
2004
- this._numberRegExp = new RegExp(t + e + s), this._mapToRadixRegExp = new RegExp("[" + this.mapToRadix.map(y).join("") + "]", "g"), this._thousandsSeparatorRegExp = new RegExp(y(this.thousandsSeparator), "g");
2005
- }
2006
- _removeThousandsSeparators(t) {
2007
- return t.replace(this._thousandsSeparatorRegExp, "");
2008
- }
2009
- _insertThousandsSeparators(t) {
2010
- const e = t.split(this.radix);
2011
- return e[0] = e[0].replace(/\B(?=(\d{3})+(?!\d))/g, this.thousandsSeparator), e.join(this.radix);
2012
- }
2013
- doPrepareChar(t, e) {
2014
- e === void 0 && (e = {});
2015
- const [s, i] = super.doPrepareChar(this._removeThousandsSeparators(this.scale && this.mapToRadix.length && /*
2016
- radix should be mapped when
2017
- 1) input is done from keyboard = flags.input && flags.raw
2018
- 2) unmasked value is set = !flags.input && !flags.raw
2019
- and should not be mapped when
2020
- 1) value is set = flags.input && !flags.raw
2021
- 2) raw value is set = !flags.input && flags.raw
2022
- */
2023
- (e.input && e.raw || !e.input && !e.raw) ? t.replace(this._mapToRadixRegExp, this.radix) : t), e);
2024
- return t && !s && (i.skip = !0), s && !this.allowPositive && !this.value && s !== "-" && i.aggregate(this._appendChar("-")), [s, i];
2025
- }
2026
- _separatorsCount(t, e) {
2027
- e === void 0 && (e = !1);
2028
- let s = 0;
2029
- for (let i = 0; i < t; ++i)
2030
- this._value.indexOf(this.thousandsSeparator, i) === i && (++s, e && (t += this.thousandsSeparator.length));
2031
- return s;
2032
- }
2033
- _separatorsCountFromSlice(t) {
2034
- return t === void 0 && (t = this._value), this._separatorsCount(this._removeThousandsSeparators(t).length, !0);
2035
- }
2036
- extractInput(t, e, s) {
2037
- return t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e), this._removeThousandsSeparators(super.extractInput(t, e, s));
2038
- }
2039
- _appendCharRaw(t, e) {
2040
- if (e === void 0 && (e = {}), !this.thousandsSeparator)
2041
- return super._appendCharRaw(t, e);
2042
- const s = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, i = this._separatorsCountFromSlice(s);
2043
- this._value = this._removeThousandsSeparators(this.value);
2044
- const u = super._appendCharRaw(t, e);
2045
- this._value = this._insertThousandsSeparators(this._value);
2046
- const a = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, r = this._separatorsCountFromSlice(a);
2047
- return u.tailShift += (r - i) * this.thousandsSeparator.length, u.skip = !u.rawInserted && t === this.thousandsSeparator, u;
2048
- }
2049
- _findSeparatorAround(t) {
2050
- if (this.thousandsSeparator) {
2051
- const e = t - this.thousandsSeparator.length + 1, s = this.value.indexOf(this.thousandsSeparator, e);
2052
- if (s <= t)
2053
- return s;
2054
- }
2055
- return -1;
2056
- }
2057
- _adjustRangeWithSeparators(t, e) {
2058
- const s = this._findSeparatorAround(t);
2059
- s >= 0 && (t = s);
2060
- const i = this._findSeparatorAround(e);
2061
- return i >= 0 && (e = i + this.thousandsSeparator.length), [t, e];
2062
- }
2063
- remove(t, e) {
2064
- t === void 0 && (t = 0), e === void 0 && (e = this.displayValue.length), [t, e] = this._adjustRangeWithSeparators(t, e);
2065
- const s = this.value.slice(0, t), i = this.value.slice(e), u = this._separatorsCount(s.length);
2066
- this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(s + i));
2067
- const a = this._separatorsCountFromSlice(s);
2068
- return new c({
2069
- tailShift: (a - u) * this.thousandsSeparator.length
2070
- });
2071
- }
2072
- nearestInputPos(t, e) {
2073
- if (!this.thousandsSeparator)
2074
- return t;
2075
- switch (e) {
2076
- case h.NONE:
2077
- case h.LEFT:
2078
- case h.FORCE_LEFT: {
2079
- const s = this._findSeparatorAround(t - 1);
2080
- if (s >= 0) {
2081
- const i = s + this.thousandsSeparator.length;
2082
- if (t < i || this.value.length <= i || e === h.FORCE_LEFT)
2083
- return s;
2084
- }
2085
- break;
2086
- }
2087
- case h.RIGHT:
2088
- case h.FORCE_RIGHT: {
2089
- const s = this._findSeparatorAround(t);
2090
- if (s >= 0)
2091
- return s + this.thousandsSeparator.length;
2092
- }
2093
- }
2094
- return t;
2095
- }
2096
- doValidate(t) {
2097
- let e = !!this._removeThousandsSeparators(this.value).match(this._numberRegExp);
2098
- if (e) {
2099
- const s = this.number;
2100
- e = e && !isNaN(s) && // check min bound for negative values
2101
- (this.min == null || this.min >= 0 || this.min <= this.number) && // check max bound for positive values
2102
- (this.max == null || this.max <= 0 || this.number <= this.max);
2103
- }
2104
- return e && super.doValidate(t);
2105
- }
2106
- doCommit() {
2107
- if (this.value) {
2108
- const t = this.number;
2109
- let e = t;
2110
- this.min != null && (e = Math.max(e, this.min)), this.max != null && (e = Math.min(e, this.max)), e !== t && (this.unmaskedValue = this.format(e, this));
2111
- let s = this.value;
2112
- this.normalizeZeros && (s = this._normalizeZeros(s)), this.padFractionalZeros && this.scale > 0 && (s = this._padFractionalZeros(s)), this._value = s;
2113
- }
2114
- super.doCommit();
2115
- }
2116
- _normalizeZeros(t) {
2117
- const e = this._removeThousandsSeparators(t).split(this.radix);
2118
- return e[0] = e[0].replace(/^(\D*)(0*)(\d*)/, (s, i, u, a) => i + a), t.length && !/\d$/.test(e[0]) && (e[0] = e[0] + "0"), e.length > 1 && (e[1] = e[1].replace(/0*$/, ""), e[1].length || (e.length = 1)), this._insertThousandsSeparators(e.join(this.radix));
2119
- }
2120
- _padFractionalZeros(t) {
2121
- if (!t)
2122
- return t;
2123
- const e = t.split(this.radix);
2124
- return e.length < 2 && e.push(""), e[1] = e[1].padEnd(this.scale, "0"), e.join(this.radix);
2125
- }
2126
- doSkipInvalid(t, e, s) {
2127
- e === void 0 && (e = {});
2128
- const i = this.scale === 0 && t !== this.thousandsSeparator && (t === this.radix || t === g.UNMASKED_RADIX || this.mapToRadix.includes(t));
2129
- return super.doSkipInvalid(t, e, s) && !i;
2130
- }
2131
- typedValueEquals(t) {
2132
- return (super.typedValueEquals(t) || g.EMPTY_VALUES.includes(t) && g.EMPTY_VALUES.includes(this.typedValue)) && !(t === 0 && this.value === "");
2133
- }
2134
- }
2135
- g.UNMASKED_RADIX = ".", g.EMPTY_VALUES = [...f.EMPTY_VALUES, 0], g.DEFAULTS = {
2136
- mask: Number,
2137
- radix: ",",
2138
- thousandsSeparator: "",
2139
- mapToRadix: [g.UNMASKED_RADIX],
2140
- min: Number.MIN_SAFE_INTEGER,
2141
- max: Number.MAX_SAFE_INTEGER,
2142
- scale: 2,
2143
- normalizeZeros: !0,
2144
- padFractionalZeros: !1,
2145
- parse: Number,
2146
- format: (n) => n.toLocaleString("en-US", {
2147
- useGrouping: !1,
2148
- maximumFractionDigits: 20
2149
- })
2150
- }, o.MaskedNumber = g;
2151
- const T = {
2152
- MASKED: "value",
2153
- UNMASKED: "unmaskedValue",
2154
- TYPED: "typedValue"
2155
- };
2156
- function O(n, t, e) {
2157
- t === void 0 && (t = T.MASKED), e === void 0 && (e = T.MASKED);
2158
- const s = A(n);
2159
- return (i) => s.runIsolated((u) => (u[t] = i, u[e]));
2160
- }
2161
- function K(n, t, e, s) {
2162
- return O(t, e, s)(n);
2163
- }
2164
- o.PIPE_TYPE = T, o.createPipe = O, o.pipe = K;
2165
- try {
2166
- globalThis.IMask = o;
2167
- } catch {
2168
- }
2169
- p.ChangeDetails = c, p.ChunksTailDetails = C, p.DIRECTION = h, p.HTMLContenteditableMaskElement = w, p.HTMLInputMaskElement = z, p.HTMLMaskElement = F, p.InputMask = G, p.MaskElement = I, p.Masked = f, p.MaskedDate = B, p.MaskedDynamic = D, p.MaskedEnum = Y, p.MaskedFunction = $, p.MaskedNumber = g, p.MaskedPattern = k, p.MaskedRange = V, p.MaskedRegExp = q, p.PIPE_TYPE = T, p.PatternFixedDefinition = R, p.PatternInputDefinition = M, p.createMask = A, p.createPipe = O, p.default = o, p.forceDirection = j, p.normalizeOpts = x, p.pipe = K, Object.defineProperty(p, "__esModule", { value: !0 });
2170
36
  });
2171
- const W = IMask;
2172
37
  export {
2173
- W as default
38
+ B as default
2174
39
  };
2175
40
  //# sourceMappingURL=design-system106.mjs.map