bromcom-ui 2.11.1 → 2.12.0-test.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/dist/bromcom-ui/bromcom-ui.css +1 -1
  2. package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
  3. package/dist/bromcom-ui/{p-c49b6287.entry.js → p-01416407.entry.js} +1 -1
  4. package/dist/bromcom-ui/p-0218b337.js +5 -0
  5. package/dist/bromcom-ui/p-055e4575.entry.js +5 -0
  6. package/dist/bromcom-ui/p-0a1c01fa.entry.js +5 -0
  7. package/dist/bromcom-ui/p-0d207b61.entry.js +5 -0
  8. package/dist/bromcom-ui/{p-a42fbe84.entry.js → p-183bc78f.entry.js} +1 -1
  9. package/dist/bromcom-ui/p-195c5945.entry.js +5 -0
  10. package/dist/bromcom-ui/p-1e793658.entry.js +5 -0
  11. package/dist/bromcom-ui/{p-e8eaa3bb.entry.js → p-28f78dd4.entry.js} +1 -1
  12. package/dist/bromcom-ui/p-2ab4e748.entry.js +5 -0
  13. package/dist/bromcom-ui/p-2fbae1fa.entry.js +5 -0
  14. package/dist/bromcom-ui/p-2fdde750.entry.js +5 -0
  15. package/dist/bromcom-ui/{p-a6aa173f.entry.js → p-3078fcd2.entry.js} +1 -1
  16. package/dist/bromcom-ui/p-30a06f92.js +5 -0
  17. package/dist/bromcom-ui/p-310cab1a.js +14 -0
  18. package/dist/bromcom-ui/p-3182df7e.js +10 -0
  19. package/dist/bromcom-ui/{p-1b558b0f.entry.js → p-3960cae8.entry.js} +1 -1
  20. package/dist/bromcom-ui/p-39eb3017.entry.js +5 -0
  21. package/dist/bromcom-ui/{p-59f7fa84.entry.js → p-3a06c6b1.entry.js} +1 -1
  22. package/dist/bromcom-ui/p-3dba7987.js +5 -0
  23. package/dist/bromcom-ui/{p-3f3579b5.entry.js → p-3e63aea1.entry.js} +1 -1
  24. package/dist/bromcom-ui/p-3f8853a8.entry.js +5 -0
  25. package/dist/bromcom-ui/p-4680865d.js +5 -0
  26. package/dist/bromcom-ui/p-4689c10d.entry.js +5 -0
  27. package/dist/bromcom-ui/{p-d01426b6.entry.js → p-4e33341b.entry.js} +1 -1
  28. package/dist/bromcom-ui/p-516eb821.entry.js +5 -0
  29. package/dist/bromcom-ui/{p-24906295.entry.js → p-54c2dc4e.entry.js} +1 -1
  30. package/dist/bromcom-ui/{p-a1e299af.entry.js → p-56fca120.entry.js} +1 -1
  31. package/dist/bromcom-ui/{p-b764ab86.entry.js → p-57d2c129.entry.js} +1 -1
  32. package/dist/bromcom-ui/{p-270e1b24.entry.js → p-59294a5a.entry.js} +1 -1
  33. package/dist/bromcom-ui/p-5a6caa99.entry.js +5 -0
  34. package/dist/bromcom-ui/{p-a34bc3d8.entry.js → p-5bea1cd3.entry.js} +1 -1
  35. package/dist/bromcom-ui/{p-7005fb55.entry.js → p-5e50d99c.entry.js} +1 -1
  36. package/dist/bromcom-ui/p-5f04686a.entry.js +5 -0
  37. package/dist/bromcom-ui/p-619d632d.entry.js +5 -0
  38. package/dist/bromcom-ui/p-626a65e9.js +5 -0
  39. package/dist/bromcom-ui/{p-fcf4b343.entry.js → p-67a6f0b1.entry.js} +1 -1
  40. package/dist/bromcom-ui/{p-dc62a5f7.entry.js → p-68fb3f60.entry.js} +1 -1
  41. package/dist/bromcom-ui/{p-c7caf94d.js → p-6b55a1fe.js} +1 -1
  42. package/dist/bromcom-ui/{p-a0d6d680.js → p-6b5ed4d8.js} +1 -1
  43. package/dist/bromcom-ui/p-70761906.entry.js +5 -0
  44. package/dist/bromcom-ui/{p-0bde4e71.entry.js → p-72bbcca6.entry.js} +1 -1
  45. package/dist/bromcom-ui/{p-06392358.entry.js → p-74cedefe.entry.js} +1 -1
  46. package/dist/bromcom-ui/p-76edf59f.js +7 -0
  47. package/dist/bromcom-ui/{p-5c70a918.entry.js → p-7c43d2ac.entry.js} +1 -1
  48. package/dist/bromcom-ui/{p-f9b59bcc.entry.js → p-7edab876.entry.js} +1 -1
  49. package/dist/bromcom-ui/{p-d59d9687.entry.js → p-7f1612df.entry.js} +1 -1
  50. package/dist/bromcom-ui/{p-61753299.js → p-816fbffd.js} +1 -1
  51. package/dist/bromcom-ui/p-86bfeae7.entry.js +5 -0
  52. package/dist/bromcom-ui/{p-a6142e74.entry.js → p-8858f845.entry.js} +1 -1
  53. package/dist/bromcom-ui/{p-08af4159.entry.js → p-89cffdc1.entry.js} +1 -1
  54. package/dist/bromcom-ui/{p-32c55505.entry.js → p-8c3535b6.entry.js} +1 -1
  55. package/dist/bromcom-ui/p-8de5e85a.entry.js +5 -0
  56. package/dist/bromcom-ui/p-8e2fc0fb.entry.js +5 -0
  57. package/dist/bromcom-ui/{p-3115008f.entry.js → p-8eec338f.entry.js} +1 -1
  58. package/dist/bromcom-ui/{p-4393b33e.entry.js → p-903d62ff.entry.js} +1 -1
  59. package/dist/bromcom-ui/{p-ce3b34da.entry.js → p-90b3e6b7.entry.js} +1 -1
  60. package/dist/bromcom-ui/{p-9589f69c.entry.js → p-91873347.entry.js} +1 -1
  61. package/dist/bromcom-ui/{p-bde67994.entry.js → p-91c0ab1c.entry.js} +1 -1
  62. package/dist/bromcom-ui/{p-3861fc92.entry.js → p-94fd1636.entry.js} +1 -1
  63. package/dist/bromcom-ui/p-a5830216.entry.js +5 -0
  64. package/dist/bromcom-ui/{p-5196912d.js → p-a8fd6d69.js} +1 -1
  65. package/dist/bromcom-ui/{p-d9fcd150.js → p-aaed6cc7.js} +1 -1
  66. package/dist/bromcom-ui/{p-c7aff122.js → p-b175108e.js} +1 -1
  67. package/dist/bromcom-ui/{p-77b1dbdd.entry.js → p-b284e383.entry.js} +1 -1
  68. package/dist/bromcom-ui/{p-e9333e52.entry.js → p-b378aff5.entry.js} +1 -1
  69. package/dist/bromcom-ui/{p-9b59c689.entry.js → p-b3fe26a3.entry.js} +1 -1
  70. package/dist/bromcom-ui/p-b4548f75.entry.js +5 -0
  71. package/dist/bromcom-ui/{p-77ef609e.entry.js → p-ba3c6657.entry.js} +1 -1
  72. package/dist/bromcom-ui/p-bba4602d.entry.js +5 -0
  73. package/dist/bromcom-ui/p-bd640601.entry.js +5 -0
  74. package/dist/bromcom-ui/{p-09318a64.js → p-be7e5e83.js} +1 -1
  75. package/dist/bromcom-ui/p-be970dce.entry.js +5 -0
  76. package/dist/bromcom-ui/p-bed627ab.js +11 -0
  77. package/dist/bromcom-ui/p-bf2dcc43.entry.js +5 -0
  78. package/dist/bromcom-ui/p-c1c4d275.entry.js +5 -0
  79. package/dist/bromcom-ui/{p-f56f2a2d.entry.js → p-c2620166.entry.js} +1 -1
  80. package/dist/bromcom-ui/p-c4b075da.entry.js +5 -0
  81. package/dist/bromcom-ui/{p-743731ac.js → p-c4d3aee2.js} +1 -1
  82. package/dist/bromcom-ui/{p-2d3ff3b8.entry.js → p-c7a3c347.entry.js} +1 -1
  83. package/dist/bromcom-ui/{p-81887469.entry.js → p-c9aa4a0d.entry.js} +1 -1
  84. package/dist/bromcom-ui/{p-c1761829.entry.js → p-cfffca09.entry.js} +1 -1
  85. package/dist/bromcom-ui/{p-1e377d82.js → p-d0dc95ae.js} +1 -1
  86. package/dist/bromcom-ui/{p-8b6d3a37.js → p-d2f863d9.js} +1 -1
  87. package/dist/bromcom-ui/{p-8a6fb2d5.entry.js → p-d9157255.entry.js} +1 -1
  88. package/dist/bromcom-ui/p-d971ec3b.entry.js +5 -0
  89. package/dist/bromcom-ui/p-de5a0e24.entry.js +5 -0
  90. package/dist/bromcom-ui/{p-a486613b.entry.js → p-df185078.entry.js} +1 -1
  91. package/dist/bromcom-ui/p-e0aa747b.entry.js +5 -0
  92. package/dist/bromcom-ui/{p-20b5c273.entry.js → p-e2e529ef.entry.js} +1 -1
  93. package/dist/bromcom-ui/{p-6657830f.js → p-e45c1546.js} +1 -1
  94. package/dist/bromcom-ui/p-e61cd999.entry.js +5 -0
  95. package/dist/bromcom-ui/{p-81cbc318.entry.js → p-e671e409.entry.js} +1 -1
  96. package/dist/bromcom-ui/{p-8ed054fe.js → p-e6755449.js} +1 -1
  97. package/dist/bromcom-ui/p-ebcb30ef.entry.js +5 -0
  98. package/dist/bromcom-ui/{p-375906b2.entry.js → p-ed1fb15d.entry.js} +1 -1
  99. package/dist/bromcom-ui/p-f06f42dc.entry.js +5 -0
  100. package/dist/bromcom-ui/{p-207c20c6.entry.js → p-f144de37.entry.js} +1 -1
  101. package/dist/bromcom-ui/{p-fc787048.entry.js → p-f1550bf5.entry.js} +1 -1
  102. package/dist/bromcom-ui/{p-887c26f8.entry.js → p-f9a7a32e.entry.js} +1 -1
  103. package/dist/bromcom-ui/{p-beaec5b8.js → p-fcc6f71e.js} +1 -1
  104. package/dist/bromcom-ui/p-fd8a6bb8.entry.js +5 -0
  105. package/dist/bromcom-ui/p-fe39eea8.js +5 -0
  106. package/dist/cjs/Overflow-7a86d378.js +2233 -0
  107. package/dist/cjs/bcm-accordion.cjs.entry.js +3 -3
  108. package/dist/cjs/bcm-alert.cjs.entry.js +3 -3
  109. package/dist/cjs/bcm-attendance-actions-comment.cjs.entry.js +7 -6
  110. package/dist/cjs/bcm-attendance-actions-dropdown.cjs.entry.js +7 -6
  111. package/dist/cjs/bcm-attendance-actions.cjs.entry.js +7 -6
  112. package/dist/cjs/bcm-attendance.cjs.entry.js +3 -3
  113. package/dist/cjs/bcm-avatar_2.cjs.entry.js +7 -6
  114. package/dist/cjs/bcm-breadcrumb.cjs.entry.js +3 -3
  115. package/dist/cjs/bcm-button-group.cjs.entry.js +3 -3
  116. package/dist/cjs/bcm-button_11.cjs.entry.js +3340 -0
  117. package/dist/cjs/bcm-caption.cjs.entry.js +7 -6
  118. package/dist/cjs/bcm-card.cjs.entry.js +4 -4
  119. package/dist/cjs/bcm-checkbox-group.cjs.entry.js +3 -3
  120. package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +3 -3
  121. package/dist/cjs/bcm-checkbox_2.cjs.entry.js +4 -4
  122. package/dist/cjs/bcm-chip-group.cjs.entry.js +7 -6
  123. package/dist/cjs/bcm-chip.cjs.entry.js +4 -4
  124. package/dist/cjs/bcm-collapse.cjs.entry.js +3 -3
  125. package/dist/cjs/bcm-color-input.cjs.entry.js +7 -6
  126. package/dist/cjs/bcm-date-picker.cjs.entry.js +182 -0
  127. package/dist/cjs/bcm-date.cjs.entry.js +182 -0
  128. package/dist/cjs/bcm-datetime-picker.cjs.entry.js +1450 -0
  129. package/dist/cjs/bcm-default.cjs.entry.js +3 -3
  130. package/dist/cjs/bcm-drawer.cjs.entry.js +7 -6
  131. package/dist/cjs/bcm-dropdown.cjs.entry.js +4 -4
  132. package/dist/cjs/bcm-expansion-panel.cjs.entry.js +4 -4
  133. package/dist/cjs/bcm-form-2.cjs.entry.js +213 -0
  134. package/dist/cjs/bcm-input-custom.cjs.entry.js +3 -3
  135. package/dist/cjs/bcm-input-dropdown.cjs.entry.js +7 -6
  136. package/dist/cjs/bcm-item.cjs.entry.js +4 -4
  137. package/dist/cjs/bcm-items.cjs.entry.js +3 -3
  138. package/dist/cjs/bcm-list_3.cjs.entry.js +22 -20
  139. package/dist/cjs/bcm-menu.cjs.entry.js +8 -7
  140. package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +7 -6
  141. package/dist/cjs/bcm-modal-2-header.cjs.entry.js +7 -6
  142. package/dist/cjs/bcm-modal-2.cjs.entry.js +7 -6
  143. package/dist/cjs/bcm-modal.cjs.entry.js +3 -3
  144. package/dist/cjs/bcm-old-input.cjs.entry.js +397 -0
  145. package/dist/cjs/bcm-overlay_2.cjs.entry.js +1 -1
  146. package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +4 -4
  147. package/dist/cjs/bcm-popconfirm.cjs.entry.js +3 -3
  148. package/dist/cjs/bcm-popover.cjs.entry.js +7 -6
  149. package/dist/cjs/bcm-progress.cjs.entry.js +4 -4
  150. package/dist/cjs/bcm-radio-group.cjs.entry.js +7 -6
  151. package/dist/cjs/bcm-radio.cjs.entry.js +8 -7
  152. package/dist/cjs/bcm-range.cjs.entry.js +3 -3
  153. package/dist/cjs/bcm-rc-picker.cjs.entry.js +9986 -0
  154. package/dist/cjs/bcm-shortcut.cjs.entry.js +7 -6
  155. package/dist/cjs/bcm-skeleton.cjs.entry.js +7 -6
  156. package/dist/cjs/bcm-step.cjs.entry.js +4 -4
  157. package/dist/cjs/bcm-stepper.cjs.entry.js +8 -7
  158. package/dist/cjs/bcm-switch.cjs.entry.js +3 -3
  159. package/dist/cjs/bcm-tab-group.cjs.entry.js +7 -6
  160. package/dist/cjs/bcm-tab-item-header.cjs.entry.js +7 -6
  161. package/dist/cjs/bcm-tab-item.cjs.entry.js +7 -6
  162. package/dist/cjs/bcm-table.cjs.entry.js +7 -6
  163. package/dist/cjs/bcm-tag.cjs.entry.js +4 -4
  164. package/dist/cjs/bcm-text.cjs.entry.js +2 -2
  165. package/dist/cjs/bcm-textarea.cjs.entry.js +4 -4
  166. package/dist/cjs/bcm-time-picker.cjs.entry.js +150 -0
  167. package/dist/cjs/bcm-toast.cjs.entry.js +3 -3
  168. package/dist/cjs/bromcom-ui.cjs.js +3 -3
  169. package/dist/cjs/{color-helper-c3a819ea.js → color-helper-dc98a2ca.js} +1 -1
  170. package/dist/cjs/{colors-078851ec.js → colors-250d0982.js} +13 -7
  171. package/dist/cjs/datetime-helper-eaf4fadb.js +11 -0
  172. package/dist/cjs/{generate-82c63a56.js → generate-c09a3ff3.js} +2 -2
  173. package/dist/cjs/{global-1e13ce25.js → global-6b15ed51.js} +1 -1
  174. package/dist/cjs/{Overflow-a821abd0.js → index-e05a7c6f.js} +87 -2311
  175. package/dist/cjs/{input-template-e0087a2b.js → input-template-8ca49c2e.js} +1 -1
  176. package/dist/cjs/{json-parse-decarator-e0946e2e.js → json-parse-decarator-d32b1b4a.js} +1 -1
  177. package/dist/cjs/loader.cjs.js +3 -3
  178. package/dist/cjs/moment-d06b012f.js +4601 -0
  179. package/dist/cjs/{number-helper-10017fcd.js → number-helper-243f0583.js} +1 -1
  180. package/dist/cjs/old-bcm-popover-box.cjs.entry.js +4 -4
  181. package/dist/cjs/old-bcm-popover.cjs.entry.js +3 -3
  182. package/dist/cjs/{package-13f78ab4.js → package-6483ada2.js} +1 -1
  183. package/dist/cjs/{stepper-states-77438c3a.js → stepper-states-4e435c7d.js} +1 -1
  184. package/dist/cjs/{tooltip-helper-a2793290.js → tooltip-helper-31cc88d8.js} +5 -4
  185. package/dist/cjs/{validators-f4c3063b.js → validators-e7423b70.js} +1 -6
  186. package/dist/collection/collection-manifest.json +2 -0
  187. package/dist/collection/components/molecules/input/input.style.js +117 -0
  188. package/dist/collection/components/molecules/input/input2.js +918 -0
  189. package/dist/collection/components/molecules/number-input/number-input.js +776 -95
  190. package/dist/collection/components/molecules/number-input/react-input.js +96 -0
  191. package/dist/collection/components/molecules/radio/radio.js +1 -1
  192. package/dist/collection/components/organism/form/form.js +2 -2
  193. package/dist/collection/components/organism/form-2/bcm-form-components.js +2 -1
  194. package/dist/collection/components/organism/list/list.css +0 -1
  195. package/dist/components/bcm-form-2.js +2 -1
  196. package/dist/components/bcm-input-2.d.ts +11 -0
  197. package/dist/components/bcm-input-2.js +225 -0
  198. package/dist/components/bcm-number-input.js +295 -79
  199. package/dist/components/bcm-react-number.d.ts +11 -0
  200. package/dist/components/bcm-react-number.js +10 -0
  201. package/dist/components/colors2.js +13 -7
  202. package/dist/components/form.js +2 -2
  203. package/dist/components/generate.js +1 -1
  204. package/dist/components/index.d.ts +2 -0
  205. package/dist/components/index.js +2 -0
  206. package/dist/components/input.style.js +120 -0
  207. package/dist/components/list.js +1 -1
  208. package/dist/components/radio.js +1 -1
  209. package/dist/components/react-input.js +1242 -0
  210. package/dist/esm/Overflow-32a0ec34.js +2217 -0
  211. package/dist/esm/{_commonjsHelpers-82aa9212.js → _commonjsHelpers-be0d4ec8.js} +1 -1
  212. package/dist/esm/bcm-accordion.entry.js +4 -4
  213. package/dist/esm/bcm-alert.entry.js +6 -6
  214. package/dist/esm/bcm-attendance-actions-comment.entry.js +9 -8
  215. package/dist/esm/bcm-attendance-actions-dropdown.entry.js +10 -9
  216. package/dist/esm/bcm-attendance-actions.entry.js +10 -9
  217. package/dist/esm/bcm-attendance.entry.js +4 -4
  218. package/dist/esm/bcm-autocomplete.entry.js +2 -2
  219. package/dist/esm/bcm-avatar_2.entry.js +9 -8
  220. package/dist/esm/bcm-breadcrumb.entry.js +5 -5
  221. package/dist/esm/bcm-button-group.entry.js +6 -6
  222. package/dist/esm/bcm-button_11.entry.js +3326 -0
  223. package/dist/esm/bcm-caption.entry.js +11 -10
  224. package/dist/esm/bcm-card.entry.js +8 -8
  225. package/dist/esm/bcm-checkbox-group.entry.js +6 -6
  226. package/dist/esm/bcm-checkbox-lite_9.entry.js +5 -5
  227. package/dist/esm/bcm-checkbox_2.entry.js +9 -9
  228. package/dist/esm/bcm-chip-group.entry.js +12 -11
  229. package/dist/esm/bcm-chip.entry.js +6 -6
  230. package/dist/esm/bcm-collapse.entry.js +6 -6
  231. package/dist/esm/bcm-color-input.entry.js +9 -8
  232. package/dist/esm/bcm-colorpicker.entry.js +2 -2
  233. package/dist/esm/bcm-date-picker.entry.js +178 -0
  234. package/dist/esm/bcm-date.entry.js +178 -0
  235. package/dist/esm/bcm-datetime-picker.entry.js +1446 -0
  236. package/dist/esm/bcm-default.entry.js +4 -4
  237. package/dist/esm/bcm-drawer.entry.js +10 -9
  238. package/dist/esm/bcm-dropdown.entry.js +6 -6
  239. package/dist/esm/bcm-error-layout.entry.js +2 -2
  240. package/dist/esm/bcm-expansion-panel.entry.js +7 -7
  241. package/dist/esm/bcm-form-2.entry.js +209 -0
  242. package/dist/esm/bcm-input-custom.entry.js +5 -5
  243. package/dist/esm/bcm-input-dropdown.entry.js +11 -10
  244. package/dist/esm/bcm-item.entry.js +6 -6
  245. package/dist/esm/bcm-items.entry.js +5 -5
  246. package/dist/esm/bcm-link.entry.js +2 -2
  247. package/dist/esm/bcm-list_3.entry.js +17 -15
  248. package/dist/esm/bcm-menu.entry.js +11 -10
  249. package/dist/esm/bcm-message.entry.js +2 -2
  250. package/dist/esm/bcm-modal-2-footer.entry.js +10 -9
  251. package/dist/esm/bcm-modal-2-header.entry.js +9 -8
  252. package/dist/esm/bcm-modal-2.entry.js +10 -9
  253. package/dist/esm/bcm-modal.entry.js +7 -7
  254. package/dist/esm/bcm-notification.entry.js +2 -2
  255. package/dist/esm/bcm-old-input.entry.js +393 -0
  256. package/dist/esm/bcm-old-tag_2.entry.js +2 -2
  257. package/dist/esm/bcm-overlay_2.entry.js +3 -3
  258. package/dist/esm/bcm-popconfirm-box.entry.js +8 -8
  259. package/dist/esm/bcm-popconfirm.entry.js +5 -5
  260. package/dist/esm/bcm-popover.entry.js +9 -8
  261. package/dist/esm/bcm-progress.entry.js +6 -6
  262. package/dist/esm/bcm-radio-group.entry.js +11 -10
  263. package/dist/esm/bcm-radio.entry.js +11 -10
  264. package/dist/esm/bcm-range.entry.js +5 -5
  265. package/dist/esm/{bcm-button_15.entry.js → bcm-rc-picker.entry.js} +9 -8632
  266. package/dist/esm/bcm-result.entry.js +2 -2
  267. package/dist/esm/bcm-select-group.entry.js +2 -2
  268. package/dist/esm/bcm-select-option.entry.js +2 -2
  269. package/dist/esm/bcm-select.entry.js +3 -3
  270. package/dist/esm/bcm-shortcut.entry.js +10 -9
  271. package/dist/esm/bcm-skeleton.entry.js +9 -8
  272. package/dist/esm/bcm-step.entry.js +6 -6
  273. package/dist/esm/bcm-stepper.entry.js +11 -10
  274. package/dist/esm/bcm-switch.entry.js +6 -6
  275. package/dist/esm/bcm-tab-group.entry.js +9 -8
  276. package/dist/esm/bcm-tab-item-header.entry.js +10 -9
  277. package/dist/esm/bcm-tab-item.entry.js +9 -8
  278. package/dist/esm/bcm-tab-pane.entry.js +2 -2
  279. package/dist/esm/bcm-tab.entry.js +2 -2
  280. package/dist/esm/bcm-table.entry.js +10 -9
  281. package/dist/esm/bcm-tabs-content.entry.js +2 -2
  282. package/dist/esm/bcm-tabs.entry.js +2 -2
  283. package/dist/esm/bcm-tag.entry.js +6 -6
  284. package/dist/esm/bcm-text.entry.js +6 -6
  285. package/dist/esm/bcm-textarea.entry.js +7 -7
  286. package/dist/esm/bcm-time-picker.entry.js +146 -0
  287. package/dist/esm/bcm-timeline-item.entry.js +2 -2
  288. package/dist/esm/bcm-timeline.entry.js +2 -2
  289. package/dist/esm/bcm-toast.entry.js +6 -6
  290. package/dist/esm/bromcom-ui.js +3 -3
  291. package/dist/esm/{caption-template-fd7738eb.js → caption-template-5c43c733.js} +1 -1
  292. package/dist/esm/{color-helper-3b528349.js → color-helper-c0bb1d8a.js} +1 -1
  293. package/dist/esm/{colors-c530a5b8.js → colors-df32bb43.js} +14 -8
  294. package/dist/esm/datetime-helper-df25808a.js +9 -0
  295. package/dist/esm/{generate-b33f722f.js → generate-bcc4b036.js} +2 -2
  296. package/dist/esm/{global-d524a06a.js → global-158eb485.js} +1 -1
  297. package/dist/esm/{Overflow-2cffcda0.js → index-a6d9d0af.js} +89 -2298
  298. package/dist/esm/{index-f549811f.js → index-b84bc8c9.js} +1 -1
  299. package/dist/esm/{input-template-453bfff8.js → input-template-673e33b3.js} +2 -2
  300. package/dist/esm/{json-parse-decarator-1aa4119c.js → json-parse-decarator-c5dee289.js} +1 -1
  301. package/dist/esm/{label-template-374fbdcd.js → label-template-c15569c4.js} +1 -1
  302. package/dist/esm/loader.js +3 -3
  303. package/dist/esm/{lodash-4197be99.js → lodash-0a4396a7.js} +1 -1
  304. package/dist/esm/moment-15cd9198.js +4598 -0
  305. package/dist/esm/{number-helper-712eedd0.js → number-helper-f6f2817c.js} +1 -1
  306. package/dist/esm/old-bcm-popover-box.entry.js +8 -8
  307. package/dist/esm/old-bcm-popover.entry.js +5 -5
  308. package/dist/esm/{package-c604bd07.js → package-255a905d.js} +1 -1
  309. package/dist/esm/{popover-placement-d12fec40.js → popover-placement-2f5939ea.js} +1 -1
  310. package/dist/esm/{slot-template-2a19b2db.js → slot-template-7c36d3be.js} +1 -1
  311. package/dist/esm/{stepper-states-00eb7d7d.js → stepper-states-aef71cbc.js} +1 -1
  312. package/dist/esm/{string-helper-3592bdc2.js → string-helper-85990695.js} +1 -1
  313. package/dist/esm/{tooltip-helper-088013ec.js → tooltip-helper-b27db4cd.js} +6 -5
  314. package/dist/esm/{validators-ebf92486.js → validators-2052b679.js} +2 -6
  315. package/dist/types/components/molecules/input/input.style.d.ts +576 -0
  316. package/dist/types/components/molecules/input/input2.d.ts +64 -0
  317. package/dist/types/components/molecules/number-input/number-input.d.ts +66 -17
  318. package/dist/types/components/molecules/number-input/react-input.d.ts +16 -0
  319. package/dist/types/components.d.ts +203 -19
  320. package/package.json +3 -2
  321. package/dist/bromcom-ui/p-04068410.entry.js +0 -5
  322. package/dist/bromcom-ui/p-0d87846a.entry.js +0 -5
  323. package/dist/bromcom-ui/p-0ed34855.entry.js +0 -5
  324. package/dist/bromcom-ui/p-0f58e83a.js +0 -5
  325. package/dist/bromcom-ui/p-19283acb.entry.js +0 -5
  326. package/dist/bromcom-ui/p-2b4970f5.entry.js +0 -5
  327. package/dist/bromcom-ui/p-2e7107b8.entry.js +0 -5
  328. package/dist/bromcom-ui/p-346395fa.entry.js +0 -5
  329. package/dist/bromcom-ui/p-376a20ed.js +0 -5
  330. package/dist/bromcom-ui/p-3a43bf45.js +0 -5
  331. package/dist/bromcom-ui/p-41e75c88.entry.js +0 -5
  332. package/dist/bromcom-ui/p-4e44bab2.entry.js +0 -5
  333. package/dist/bromcom-ui/p-51b2e857.entry.js +0 -5
  334. package/dist/bromcom-ui/p-52a75efb.entry.js +0 -5
  335. package/dist/bromcom-ui/p-5fbb4950.entry.js +0 -5
  336. package/dist/bromcom-ui/p-630a4d45.entry.js +0 -5
  337. package/dist/bromcom-ui/p-65ac7386.entry.js +0 -5
  338. package/dist/bromcom-ui/p-7c512c4d.entry.js +0 -5
  339. package/dist/bromcom-ui/p-82d01088.entry.js +0 -5
  340. package/dist/bromcom-ui/p-82f0b161.js +0 -5
  341. package/dist/bromcom-ui/p-84b97f53.entry.js +0 -5
  342. package/dist/bromcom-ui/p-857628f6.js +0 -5
  343. package/dist/bromcom-ui/p-926f8ac4.entry.js +0 -5
  344. package/dist/bromcom-ui/p-950a341e.entry.js +0 -7
  345. package/dist/bromcom-ui/p-9810187e.entry.js +0 -5
  346. package/dist/bromcom-ui/p-9b5c86e1.entry.js +0 -5
  347. package/dist/bromcom-ui/p-a5208f05.entry.js +0 -5
  348. package/dist/bromcom-ui/p-aea1b034.entry.js +0 -5
  349. package/dist/bromcom-ui/p-b381e7f1.js +0 -19
  350. package/dist/bromcom-ui/p-b4da198b.entry.js +0 -5
  351. package/dist/bromcom-ui/p-cf011393.entry.js +0 -5
  352. package/dist/bromcom-ui/p-d098f115.entry.js +0 -5
  353. package/dist/bromcom-ui/p-e0ab7b38.js +0 -11
  354. package/dist/bromcom-ui/p-e3c69b3b.entry.js +0 -5
  355. package/dist/bromcom-ui/p-fe776e62.entry.js +0 -5
  356. package/dist/cjs/bcm-button_15.cjs.entry.js +0 -18623
  357. package/dist/cjs/bcm-number-input.cjs.entry.js +0 -108
  358. package/dist/collection/components/molecules/number-input/number-input.css +0 -137
  359. package/dist/collection/components/molecules/number-input/number-input.style.js +0 -45
  360. package/dist/esm/bcm-number-input.entry.js +0 -104
  361. package/dist/types/components/molecules/number-input/number-input.style.d.ts +0 -200
@@ -0,0 +1,1446 @@
1
+ /*!
2
+ * Built with Stencil
3
+ * Copyright (c) Bromcom.
4
+ */
5
+ import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-0615c2b8.js';
6
+ import { D as DragDirections, E as ElementDragger } from './element-dragger-89bb52fd.js';
7
+ import { c as classnames } from './index-b84bc8c9.js';
8
+ import { D as DateTimeHelper } from './datetime-helper-df25808a.js';
9
+ import { d as delay } from './utils-57652744.js';
10
+ import { G as Generate } from './generate-bcc4b036.js';
11
+ import { B as Bcm } from './bcm-a50d55ba.js';
12
+ import { g as getPlacement, s as setPosition } from './popover-placement-2f5939ea.js';
13
+ import { L as LabelTemplate } from './label-template-c15569c4.js';
14
+ import { I as IsLoad } from './is-load-decorator-8277e3b8.js';
15
+ import './_commonjsHelpers-be0d4ec8.js';
16
+ import './package-255a905d.js';
17
+ import './colors-df32bb43.js';
18
+ import './string-helper-85990695.js';
19
+
20
+ var Months;
21
+ (function (Months) {
22
+ Months["january"] = "january";
23
+ Months["february"] = "february";
24
+ Months["march"] = "march";
25
+ Months["april"] = "april";
26
+ Months["may"] = "may";
27
+ Months["june"] = "june";
28
+ Months["july"] = "july";
29
+ Months["august"] = "august";
30
+ Months["september"] = "september";
31
+ Months["october"] = "october";
32
+ Months["november"] = "november";
33
+ Months["december"] = "december";
34
+ })(Months || (Months = {}));
35
+ var Days;
36
+ (function (Days) {
37
+ Days["sunday"] = "sunday";
38
+ Days["monday"] = "monday";
39
+ Days["tuesday"] = "tuesday";
40
+ Days["wednesday"] = "wednesday";
41
+ Days["thursday"] = "thursday";
42
+ Days["friday"] = "friday";
43
+ Days["saturday"] = "saturday";
44
+ })(Days || (Days = {}));
45
+ /**
46
+ * 'type' prop predefined values
47
+ */
48
+ var Types;
49
+ (function (Types) {
50
+ Types["datetime"] = "datetime";
51
+ Types["range"] = "range";
52
+ Types["date"] = "date";
53
+ Types["time"] = "time";
54
+ })(Types || (Types = {}));
55
+
56
+ const datetimePickerCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}.bcm-input[no-margin]{margin:0}.bcm-textarea[no-margin]{margin:0}.bcm-switch[no-margin]{margin:0}.bcm-checkbox[no-margin]{margin:0}.bcm-radio-group[no-margin]{margin:0}.bcm-checkbox-group[no-margin]{margin:0}.bcm-range[no-margin]{margin:0}.bcm-form[no-margin]{margin:0}.bcm-form-group[no-margin]{margin:0}.bcm-list[no-margin]{margin:0}.bcm-colorpicker[no-margin]{margin:0}.bcm-date-picker[no-margin]{margin:0}.bcm-time-picker[no-margin]{margin:0}.bcm-datetime-picker[no-margin]{margin:0}.bcm-select[no-margin]{margin:0}.bcm-listbox[no-margin]{margin:0}*{box-sizing:border-box}:host{display:inline-flex;flex-direction:column;position:relative;width:100%;max-width:256px;margin:0;margin-bottom:8px}:host(.full-width){max-width:100%}:host(.no-margin){margin:0}:host(.hidden){display:none}:host(.linked-component){display:none}.toggle{cursor:pointer}.toggle.disabled{cursor:not-allowed}.modules{display:flex}.picker-label{user-select:none;line-height:1}.datetime-picker{position:absolute;top:-1000px;display:inline-flex;flex-direction:column;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.25);opacity:0;visibility:hidden;transition:transform 0.2s ease, opacity 0.3s ease;transform:scale(0.8) translateY(-100px);background-color:#ffffff;min-height:356px;max-height:356px;box-sizing:border-box;z-index:-1000}.datetime-picker.alignment-left{left:0}.datetime-picker.alignment-right{right:0}.datetime-picker.open{top:calc(100% - 28px);z-index:10000;opacity:1;visibility:visible;transform:scale(1) translateY(0)}.datetime-picker.open.no-caption{top:100%}.actions{display:flex;align-items:center;justify-content:space-between;padding:8px;margin-top:auto;border-top:1px solid var(--bcm-color-grey-6)}.actions .current-date{font-size:14px;line-height:22px;color:var(--bcm-color-prime-blue-6);text-transform:capitalize}.date-container+.time-container{border-left:1px solid #cecece}.time-container{width:185px}.time-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.time-container .bcm-datetime-picker__header .now{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.time-container .bcm-datetime-picker__content{position:relative;display:flex}.time-container .hours,.time-container .minutes,.time-container .time-period{position:relative;flex:1 1 100%;max-width:100%;height:280px;overflow:hidden}.time-container .hours .items>span,.time-container .minutes .items>span,.time-container .time-period .items>span{font-size:14px;color:var(--bcm-color-grey-8)}.time-container .hours .items>span.selected,.time-container .minutes .items>span.selected,.time-container .time-period .items>span.selected{color:var(--bcm-color-prime-blue-6)}.date-container{width:364px;}.date-container .bcm-datetime-picker__header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;max-height:60px;border-bottom:1px solid var(--bcm-color-grey-4)}.date-container .bcm-datetime-picker__header .month-year-wrapper{display:flex;align-items:center;justify-content:center;margin:0 4px;min-width:125px}.date-container .bcm-datetime-picker__header .month-year{font-size:16px;line-height:24px}.date-container .bcm-datetime-picker__header .month-year{display:flex;align-items:center}.date-container .bcm-datetime-picker__header .month-year button{display:flex;align-items:center;box-shadow:none;background:transparent;outline:none;appearance:none;border:none;color:var(--bcm-color-prime-blue-6);cursor:pointer}.date-container .bcm-datetime-picker__header .month{text-transform:capitalize}.date-container .bcm-datetime-picker__header .year{padding-left:4px}.date-container .bcm-datetime-picker__header .today{font-size:14px;line-height:22px;cursor:pointer;color:var(--bcm-color-prime-blue-6);user-select:none}.date-container .bcm-datetime-picker__content{display:flex}.date-container .years{position:relative;flex:0 0 70px;max-width:70px;height:280px;overflow:hidden;background-color:var(--bcm-color-grey-2)}.date-container .days{width:100%}.date-container .day-numbers,.date-container .day-labels{display:grid;grid-template-columns:repeat(7, 1fr)}.date-container .day-numbers{padding:24px 24px}.date-container .day-numbers>span,.date-container .day-labels span{text-align:center}.date-container .day-numbers>span{position:relative;padding-bottom:100%;cursor:pointer}.date-container .day-numbers>span.not-this-month{color:var(--bcm-color-grey-4)}.date-container .day-numbers>span.is-weekend{color:var(--bcm-color-prime-blue-3)}.date-container .day-numbers>span.is-disabled-date:not(.today){color:var(--bcm-color-grey-4);cursor:not-allowed}.date-container .day-numbers>span.is-disabled-date:not(.today):before{opacity:0 !important}.date-container .day-numbers>span.today{color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.today:before{opacity:1;background-color:var(--bcm-color-prime-blue-2);border:1px solid var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.selected-start{background:linear-gradient(90deg, white 50%, #8abde2 50%) !important}.date-container .day-numbers>span.selected-end{background:linear-gradient(90deg, #8abde2 50%, white 50%) !important}.date-container .day-numbers>span.range{background:#8abde2}.date-container .day-numbers>span.range:not(.today){color:#ffffff}.date-container .day-numbers>span.range:not(.today):before{background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers>span.range.is-weekend:not(.today){color:var(--bcm-color-prime-blue-2)}.date-container .day-numbers>span.selected,.date-container .day-numbers>span.selected-end{color:#ffffff}.date-container .day-numbers>span.selected:before,.date-container .day-numbers>span.selected-end:before{opacity:1;background-color:var(--bcm-color-prime-blue-6)}.date-container .day-numbers.start-1>span:first-child{grid-column:1}.date-container .day-numbers.start-2>span:first-child{grid-column:2}.date-container .day-numbers.start-3>span:first-child{grid-column:3}.date-container .day-numbers.start-4>span:first-child{grid-column:4}.date-container .day-numbers.start-5>span:first-child{grid-column:5}.date-container .day-numbers.start-6>span:first-child{grid-column:6}.date-container .day-numbers.start-7>span:first-child{grid-column:7}.date-container .day-numbers>span:before{content:\"\";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:50%;background-color:var(--bcm-color-grey-4);opacity:0;box-sizing:border-box}.date-container .day-numbers>span:hover.not-this-month:not(.is-weekend){color:var(--bcm-color-grey-6)}.date-container .day-numbers>span:hover:before{opacity:1}.date-container .day-numbers .number{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}.date-container .day-labels{padding:24px 40px 0 40px}.date-container .day-labels span{font-size:12px;color:var(--bcm-color-grey-6)}.date-container .day-labels span:nth-child(7n+6),.date-container .day-labels span:nth-child(7n+7){color:var(--bcm-color-prime-blue-3)}.years .items,.hours .items,.minutes .items,.time-period .items{position:relative;display:flex;flex-direction:column;z-index:0;transform:translateY(0);scroll-behavior:smooth}.years .items>span,.hours .items>span,.minutes .items>span,.time-period .items>span{text-align:center;font-size:12px;min-height:26px;max-height:26px;line-height:26px;color:var(--bcm-color-grey-8);user-select:none}.years:before,.years:after,.hours:before,.hours:after,.minutes:before,.minutes:after,.time-period:before,.time-period:after{content:\"\";position:absolute;left:0;width:100%;height:40px}.years:before,.hours:before,.minutes:before,.time-period:before{top:-40px;box-shadow:0 10px 100px 70px #ffffff;z-index:1}.years:after,.hours:after,.minutes:after,.time-period:after{bottom:-40px;box-shadow:0 -10px 100px 70px #ffffff;z-index:2}.select-strip{position:absolute;width:100%;top:50%;left:0;transform:translateY(-50%);min-height:26px;max-height:26px;border:1px solid var(--bcm-color-grey-5);border-left:0;border-right:0;pointer-events:none;box-sizing:border-box}.bcm-label{font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin-bottom:4px;font-weight:500;color:#475569}.bcm-label.tw-text-1{font-size:10px;line-height:18px}.bcm-label.tw-text-2{font-size:12px;line-height:20px}.bcm-label.tw-text-3{font-size:14px;line-height:22px}.bcm-caption-area{color:#dc2626;font-weight:400;justify-content:space-between;align-items:flex-start;flex-direction:row;min-height:20px;display:flex;margin-top:4px;font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.bcm-caption-area.tw-text-1{font-size:10px;line-height:18px}.bcm-caption-area.tw-text-2{font-size:12px;line-height:20px}.bcm-caption-area.tw-text-3{font-size:14px;line-height:22px}.picker-input-container{display:flex;flex-direction:column;align-items:flex-start;justify-content:stretch}";
57
+
58
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
59
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
60
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
61
+ r = Reflect.decorate(decorators, target, key, desc);
62
+ else
63
+ for (var i = decorators.length - 1; i >= 0; i--)
64
+ if (d = decorators[i])
65
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
66
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
67
+ };
68
+ const stringify = JSON.stringify;
69
+ const BcmDatetimePicker = class {
70
+ constructor(hostRef) {
71
+ registerInstance(this, hostRef);
72
+ this.load = createEvent(this, "bcm-load", 7);
73
+ this.change = createEvent(this, "bcm-change", 7);
74
+ this.bcmOpen = createEvent(this, "bcm-open", 7);
75
+ this.inputId = null;
76
+ this.emptyState = false;
77
+ this.initialized = false;
78
+ this.disabledDatesList = { min: null, max: null, dates: [] };
79
+ this.dayNumbers = [];
80
+ this.valueText = null;
81
+ this.dataIsValid = false;
82
+ this._id = Generate.UID();
83
+ this.date = new Date();
84
+ this.endDate = null;
85
+ this.type = Types.datetime;
86
+ this.disabled = false;
87
+ this.disabledDates = '';
88
+ this.value = null;
89
+ this._open = false;
90
+ this.hidden = false;
91
+ this.name = undefined;
92
+ this.fullWidth = false;
93
+ this.required = false;
94
+ this.label = undefined;
95
+ this.placeholder = undefined;
96
+ this.minYear = 1900;
97
+ this.maxYear = 2200;
98
+ this.noCaption = false;
99
+ this.noMargin = false;
100
+ this.captionError = undefined;
101
+ this.caption = '';
102
+ this.captionType = 'default';
103
+ this.alignment = undefined;
104
+ this.placement = Bcm.Placement['bottom-start'];
105
+ this.linkedComponent = undefined;
106
+ this.clearable = false;
107
+ this.years = [];
108
+ this.hours = [];
109
+ this.minutes = [];
110
+ this.hasDateModule = false;
111
+ this.hasTimeModule = false;
112
+ this.renderDate = undefined;
113
+ this.selectedDate = undefined;
114
+ this.selectedEndDate = undefined;
115
+ this.error = false;
116
+ this.errorText = '';
117
+ this.tick = {};
118
+ }
119
+ markForCheck() {
120
+ this.tick = Generate.UID();
121
+ }
122
+ openChanged() {
123
+ this.bcmOpen.emit(this._open);
124
+ }
125
+ /**
126
+ * @ComponentMethod
127
+ */
128
+ componentWillLoad() {
129
+ this.inputId = 'picker-input-' + this._id;
130
+ this.hasDateModule = this.type === Types.datetime
131
+ || this.type === Types.date
132
+ || this.type === Types.range;
133
+ this.hasTimeModule = this.type === Types.datetime
134
+ || this.type === Types.time;
135
+ this.prepareDisabledDates();
136
+ this.setData();
137
+ // Generate year, hour, minute sequences
138
+ // #
139
+ if (!this.initialized) {
140
+ for (let i = this.minYear; i <= this.maxYear; i++)
141
+ this.years.push(i);
142
+ for (let i = 0; i <= 23; i++)
143
+ this.hours.push(i);
144
+ for (let i = 0; i <= 59; i++)
145
+ this.minutes.push(i);
146
+ this.load.emit();
147
+ }
148
+ this.initialized = true;
149
+ }
150
+ /**
151
+ * @ComponentMethod
152
+ */
153
+ componentDidRender() {
154
+ // Create years selection
155
+ // #
156
+ if (this.hasDateModule && !this.yearsDragger) {
157
+ this.createDragSelection('years', this.yearsElement, this.yearsWrapperElement, this.yearsStripElement, DragDirections.y);
158
+ this.createWheelChange('years', this.yearsWrapperElement, this.yearsStripElement);
159
+ this.setDragSelection('years', this.currentDate.year);
160
+ }
161
+ // Create hours selection
162
+ // #
163
+ if (this.hasTimeModule && !this.hoursDragger) {
164
+ this.createDragSelection('hours', this.hoursElement, this.hoursWrapperElement, this.timeStripElement, DragDirections.y);
165
+ this.createWheelChange('hours', this.hoursWrapperElement, this.timeStripElement);
166
+ this.setDragSelection('hours', this.currentDate.hour);
167
+ }
168
+ // Create minutes selection
169
+ // #
170
+ if (this.hasTimeModule && !this.minutesDragger) {
171
+ this.createDragSelection('minutes', this.minutesElement, this.minutesWrapperElement, this.timeStripElement, DragDirections.y);
172
+ this.createWheelChange('minutes', this.minutesWrapperElement, this.timeStripElement);
173
+ this.setDragSelection('minutes', this.currentDate.minute);
174
+ }
175
+ }
176
+ /**
177
+ * @desc
178
+ * @param newValue
179
+ */
180
+ renderDateChange() {
181
+ if (!this.initialized)
182
+ return;
183
+ this.setData();
184
+ this.hasDateModule && this.setDragSelection('years', this.currentDate.year);
185
+ }
186
+ /**
187
+ * @desc
188
+ * @param newValue
189
+ */
190
+ openChange(newValue) {
191
+ if (newValue) {
192
+ this.calculateLocation();
193
+ // Create years selection
194
+ // #
195
+ if (this.hasDateModule) {
196
+ this.createDragSelection('years', this.yearsElement, this.yearsWrapperElement, this.yearsStripElement, DragDirections.y);
197
+ this.createWheelChange('years', this.yearsWrapperElement, this.yearsStripElement);
198
+ this.setDragSelection('years', this.currentDate.year);
199
+ }
200
+ // Create hours selection
201
+ // #
202
+ if (this.hasTimeModule) {
203
+ this.createDragSelection('hours', this.hoursElement, this.hoursWrapperElement, this.timeStripElement, DragDirections.y);
204
+ this.createWheelChange('hours', this.hoursWrapperElement, this.timeStripElement);
205
+ this.setDragSelection('hours', this.currentDate.hour, true);
206
+ }
207
+ // Create minutes selection
208
+ // #
209
+ if (this.hasTimeModule) {
210
+ this.createDragSelection('minutes', this.minutesElement, this.minutesWrapperElement, this.timeStripElement, DragDirections.y);
211
+ this.createWheelChange('minutes', this.minutesWrapperElement, this.timeStripElement);
212
+ this.setDragSelection('minutes', this.currentDate.minute, true);
213
+ }
214
+ this.markForCheck();
215
+ forceUpdate(this.el);
216
+ }
217
+ }
218
+ /**
219
+ * @desc
220
+ * @param newValue
221
+ */
222
+ valueChange(newValue, oldValue) {
223
+ const errorObject1 = { isValid: false, value: this.valueText };
224
+ const errorObject2 = { isValid: false, value: this.inputElement.value };
225
+ if (!newValue) {
226
+ this.change.emit();
227
+ return;
228
+ }
229
+ if (this.type !== Types.range && this.error) {
230
+ this.change.emit(errorObject2);
231
+ return;
232
+ }
233
+ try {
234
+ if ((oldValue && stringify(newValue.dateObject) !== stringify(oldValue.dateObject)) || (!oldValue && newValue)) {
235
+ if (this.type === Types.date || this.type === Types.datetime) {
236
+ this.change.emit(newValue);
237
+ }
238
+ if (this.type === Types.time) {
239
+ this.change.emit(newValue);
240
+ // this.change.emit({
241
+ // time: newValue.time,
242
+ // timeObject: newValue.dateObject
243
+ // })
244
+ }
245
+ if (this.type === Types.range) {
246
+ const dateObject = newValue.dateObject;
247
+ if (dateObject.start.date && dateObject.end.date) {
248
+ if (newValue.isValid) {
249
+ this.change.emit({
250
+ isValid: newValue.isValid,
251
+ value: newValue.value,
252
+ start: dateObject.start,
253
+ end: dateObject.end
254
+ });
255
+ }
256
+ }
257
+ else {
258
+ this.change.emit(errorObject1);
259
+ }
260
+ }
261
+ }
262
+ }
263
+ catch (exception) { }
264
+ }
265
+ /**
266
+ * @desc
267
+ * @param newValue -
268
+ */
269
+ disabledDatesChange(newValue) {
270
+ if (newValue) {
271
+ this.prepareDisabledDates();
272
+ }
273
+ }
274
+ /**
275
+ * @desc
276
+ * @param date
277
+ */
278
+ stringToDate(date) {
279
+ const isDate = !!date.getMonth;
280
+ if (!isDate) {
281
+ return new Date(Date.parse(this.switchDDMM(date)));
282
+ }
283
+ return date;
284
+ }
285
+ /**
286
+ * @desc
287
+ * @param date
288
+ */
289
+ dateToString(date) {
290
+ if (!(date instanceof Date))
291
+ return false;
292
+ }
293
+ /**
294
+ *
295
+ * @param str
296
+ */
297
+ switchDDMM(str) {
298
+ if (!str)
299
+ return;
300
+ const parts = str.split('/');
301
+ if (str.indexOf('/') === -1 || parts.length !== 3)
302
+ return str;
303
+ return `${parts[1]}/${parts[0]}/${parts[2]}`;
304
+ }
305
+ /**
306
+ * @desc
307
+ */
308
+ setData() {
309
+ this.date = this.stringToDate(this.date);
310
+ if (!this.initialized && !this.renderDate) {
311
+ this.renderDate = this.date && this.date || new Date();
312
+ }
313
+ if (!this.initialized && this.endDate) {
314
+ this.selectedEndDate = this.stringToDate(this.endDate);
315
+ //this.currentEndDate = this.createDateObject(this.selectedEndDate)
316
+ }
317
+ const date = this.renderDate;
318
+ this.currentDate = this.createDateObject(date);
319
+ // Calculate days in current
320
+ // month
321
+ this.dayNumbers = this.getMonthDayNumbers(date).map(day => {
322
+ return {
323
+ day,
324
+ thisMonth: true,
325
+ isWeekend: this.getDayIsWeekend(date, day),
326
+ today: this.getIsCurrentDate(date, day),
327
+ date: this.getTargetDayDate(date, day)
328
+ };
329
+ });
330
+ // Add prev month days to
331
+ // empty columns
332
+ if (this.currentDate.year > this.minYear) {
333
+ let targetMonth = new Date(new Date(date).setMonth(this.currentDate.month - 1, 1));
334
+ let targetMonthDayNumbers = this.getMonthDayNumbers(targetMonth).reverse();
335
+ let max = this.currentDate.monthFirstDay;
336
+ for (let i = 1; i < (max === 0 ? 7 : max); i++) {
337
+ const day = targetMonthDayNumbers[i - 1];
338
+ this.dayNumbers.unshift({
339
+ day,
340
+ prevMonth: true,
341
+ isWeekend: this.getDayIsWeekend(targetMonth, day),
342
+ date: this.getTargetDayDate(targetMonth, day)
343
+ });
344
+ }
345
+ }
346
+ // Add next month days to
347
+ // rest of columns
348
+ if (this.currentDate.year < this.maxYear) {
349
+ let targetMonth = new Date(new Date(date).setMonth(this.currentDate.month + 1));
350
+ let targetMonthDayNumbers = this.getMonthDayNumbers(targetMonth);
351
+ let max = 42 - this.dayNumbers.length;
352
+ for (let i = 0; i < max; i++) {
353
+ const day = targetMonthDayNumbers[i];
354
+ this.dayNumbers.push({
355
+ day,
356
+ nextMonth: true,
357
+ isWeekend: this.getDayIsWeekend(targetMonth, day),
358
+ date: this.getTargetDayDate(targetMonth, day)
359
+ });
360
+ }
361
+ }
362
+ if (!this.emptyState) {
363
+ this.valueText = this.getValueText();
364
+ }
365
+ forceUpdate(this.el);
366
+ }
367
+ /**
368
+ * @desc
369
+ */
370
+ prepareDisabledDates() {
371
+ if (!this.disabledDates)
372
+ return;
373
+ let disabledDatesData = null;
374
+ if (typeof this.disabledDates === 'string') {
375
+ try {
376
+ disabledDatesData = JSON.parse(this.disabledDates);
377
+ }
378
+ catch (e) {
379
+ return;
380
+ }
381
+ }
382
+ else
383
+ disabledDatesData = this.disabledDates;
384
+ // Convert dates to list
385
+ // #
386
+ if (disabledDatesData.dates && disabledDatesData.dates.length && !!disabledDatesData.dates.length) {
387
+ const disabledDates = disabledDatesData.dates.map(date => {
388
+ const tempDate = new Date(date);
389
+ if (tempDate.toString().toLowerCase() === 'invalid date')
390
+ return null;
391
+ else
392
+ return tempDate;
393
+ }).filter(date => date);
394
+ this.disabledDatesList.dates = disabledDates;
395
+ }
396
+ // Get min & max range
397
+ // #
398
+ if (disabledDatesData.min &&
399
+ disabledDatesData.max && (disabledDatesData.min.getTime() > disabledDatesData.max.getTime() ||
400
+ disabledDatesData.max.getTime() < disabledDatesData.min.getTime())) {
401
+ return;
402
+ }
403
+ if (disabledDatesData.min && disabledDatesData.min instanceof Date) {
404
+ this.disabledDatesList.min = new Date(disabledDatesData.min.toDateString());
405
+ }
406
+ else {
407
+ delete this.disabledDatesList.min;
408
+ }
409
+ if (disabledDatesData.max && disabledDatesData.max instanceof Date) {
410
+ this.disabledDatesList.max = new Date(disabledDatesData.max.toDateString());
411
+ }
412
+ else {
413
+ delete this.disabledDatesList.max;
414
+ }
415
+ const value = this.inputElement && this.inputElement.value;
416
+ value && this.setDataFromText(value);
417
+ }
418
+ /**
419
+ *
420
+ * @param target
421
+ * @param wheelTriggerElement
422
+ * @param strip
423
+ */
424
+ createWheelChange(target, wheelTriggerElement, strip) {
425
+ /**
426
+ * [ Mouse Event: wheel ]
427
+ */
428
+ wheelTriggerElement.addEventListener('wheel', (event) => {
429
+ const moveDown = event.deltaY > 0;
430
+ const dragger = this[target + 'Dragger'];
431
+ const draggerOffsetY = dragger.getOffset().top;
432
+ const childIdx = this.getTargetChildByDragPosition({ y: draggerOffsetY }, strip);
433
+ let nextChild = moveDown ? childIdx + 1 : childIdx - 1;
434
+ // Array bounds check
435
+ // #
436
+ nextChild < 0
437
+ ? (nextChild = 0) : typeof this[target][nextChild] === 'undefined'
438
+ ? (nextChild = this[target].length - 1) : nextChild;
439
+ if (this.type == "time" && !this.selectedDate) {
440
+ this.setTime();
441
+ }
442
+ this.setDragSelection(target, this[target][nextChild], true, true);
443
+ });
444
+ }
445
+ /**
446
+ * @desc
447
+ */
448
+ createDragSelection(target, element, dragTriggerElement, strip, direction) {
449
+ const dragger = target + 'Dragger';
450
+ this[dragger] = new ElementDragger({
451
+ target: element,
452
+ trigger: dragTriggerElement,
453
+ direction: direction,
454
+ useTransform: true,
455
+ limit: {
456
+ y: {
457
+ max: strip.offsetTop - (strip.offsetHeight / 2),
458
+ min: (element.offsetHeight - (strip.offsetTop + strip.offsetHeight / 2)) * -1
459
+ }
460
+ }
461
+ });
462
+ /**
463
+ * [ ElementDragger Event: end ]
464
+ */
465
+ this[dragger].on('end', (pos) => {
466
+ const childIdx = this.getTargetChildByDragPosition(pos, strip);
467
+ // Select target child when dragging
468
+ // end
469
+ this.selectTargetChildByDragIdx(childIdx, strip, this[dragger]);
470
+ // Set target value
471
+ // #
472
+ this.setDragSelection(target, this[target][childIdx], false);
473
+ });
474
+ }
475
+ /**
476
+ * @desc Calculates which child in center of strip
477
+ * for drag areas
478
+ */
479
+ getTargetChildByDragPosition({ y }, strip) {
480
+ const stripHeight = strip.offsetHeight;
481
+ const stripCenter = stripHeight / 2;
482
+ const stripTriggerY = strip.offsetTop - (stripCenter);
483
+ const childY = -(y - stripTriggerY - (stripCenter));
484
+ return Math.floor(childY / stripHeight);
485
+ }
486
+ /**
487
+ * @esc
488
+ * @param target
489
+ * @param childIdx
490
+ */
491
+ selectTargetChildByDragIdx(childIdx, strip, dragger, anim = true) {
492
+ const y = ((strip.offsetHeight / 2) + strip.offsetTop) - ((childIdx + 1) * (strip.offsetHeight));
493
+ dragger.setPosition({ y, anim });
494
+ }
495
+ /**
496
+ * @desc
497
+ * @param year
498
+ */
499
+ setDragSelection(target, value, scroll = true, anim = false) {
500
+ // if (!value) return
501
+ const childIdx = this[target].findIndex((itemValue) => itemValue === value);
502
+ scroll && this.selectTargetChildByDragIdx(childIdx, this[target === 'years' ? target + 'StripElement' : 'timeStripElement'], this[target + 'Dragger'], anim);
503
+ switch (target) {
504
+ case 'years':
505
+ this.date.setFullYear(value);
506
+ break;
507
+ case 'hours':
508
+ this.date.setHours(value);
509
+ break;
510
+ case 'minutes':
511
+ this.date.setMinutes(value);
512
+ break;
513
+ }
514
+ this.renderDate = this.date;
515
+ this.setData();
516
+ if (this.selectedDate) {
517
+ this.setValue();
518
+ }
519
+ }
520
+ /**
521
+ * @desc
522
+ * @returns
523
+ */
524
+ getHours12() {
525
+ const hours = (this.date.getHours() + 24) % 12 || 12;
526
+ return hours > 12 ? hours - 12 : hours;
527
+ }
528
+ /**
529
+ * @desc
530
+ * @param date
531
+ * @param excludeTime -
532
+ */
533
+ createDateObject(date, { excludeTime = false, exactMonthNumber = false } = {}) {
534
+ const dateYear = date.getFullYear();
535
+ const year = dateYear >= this.maxYear
536
+ ? this.maxYear : dateYear <= this.minYear
537
+ ? this.minYear : dateYear;
538
+ return Object.assign(Object.assign({ year, day: date.getDate(), month: date.getMonth() + (exactMonthNumber ? 1 : 0), dayOfWeek: date.getDay(), monthFirstDay: new Date(new Date(date).setDate(1)).getDay() }, !excludeTime && { hour: date.getHours() }), !excludeTime && { minute: date.getMinutes() });
539
+ }
540
+ /**
541
+ * @desc
542
+ * @param max
543
+ */
544
+ generateDaysArrayFromMax(max) {
545
+ return Array.from(Array(max + 1).keys()).slice(1);
546
+ }
547
+ /**
548
+ * @desc
549
+ * @param date
550
+ */
551
+ getMonthDayNumbers(date) {
552
+ const totalDays = this.getDaysInMonth(date.getMonth(), date.getFullYear());
553
+ return this.generateDaysArrayFromMax(totalDays);
554
+ }
555
+ /**
556
+ * @desc
557
+ * @param date
558
+ * @param day
559
+ */
560
+ getTargetDayDate(date, day) {
561
+ return new Date(new Date(date).setDate(day));
562
+ }
563
+ /**
564
+ * @desc
565
+ * @param date
566
+ * @param day
567
+ */
568
+ getDayIsWeekend(date, day) {
569
+ const dayOfWeek = new Date(new Date(date).setDate(day)).getDay();
570
+ return (dayOfWeek === 6) || (dayOfWeek === 0);
571
+ }
572
+ /**
573
+ * @desc
574
+ * @param date
575
+ */
576
+ getClock(date) {
577
+ date = date || new Date();
578
+ const hours = date.getHours();
579
+ const minutes = date.getMinutes();
580
+ const seconds = date.getSeconds();
581
+ const milis = date.getMilliseconds();
582
+ return { hours, minutes, seconds, milis };
583
+ }
584
+ /**
585
+ * @desc
586
+ */
587
+ setValue(reset) {
588
+ var _a, _b, _c;
589
+ const date = new Date(this.date.setHours(Number(this.currentDate.hour), Number(this.currentDate.minute)));
590
+ if (reset) {
591
+ this.value = null;
592
+ return;
593
+ }
594
+ this.dataIsValid = true;
595
+ if (this.type === Types.datetime) {
596
+ const dateObject = Object.assign({}, this.currentDate);
597
+ dateObject.month += 1;
598
+ if (((_a = this.value) === null || _a === void 0 ? void 0 : _a.value) != this.valueText) {
599
+ this.value = {
600
+ isValid: this.dataIsValid,
601
+ date: date,
602
+ timestamp: date.getTime(),
603
+ dateObject,
604
+ value: this.valueText
605
+ };
606
+ }
607
+ }
608
+ if (this.type === Types.date) {
609
+ const dateObject = Object.assign({}, this.currentDate);
610
+ delete dateObject.hour;
611
+ delete dateObject.minute;
612
+ dateObject.month += 1;
613
+ if (((_b = this.value) === null || _b === void 0 ? void 0 : _b.value) != this.valueText) {
614
+ this.value = {
615
+ isValid: this.dataIsValid,
616
+ date,
617
+ timestamp: date.getTime(),
618
+ dateObject,
619
+ value: this.valueText
620
+ };
621
+ }
622
+ }
623
+ if (this.type === Types.time) {
624
+ const getTimeText = this.getTimeText();
625
+ const dateObject = Object.assign({}, this.currentDate);
626
+ dateObject.month += 1;
627
+ this.value = {
628
+ isValid: this.dataIsValid,
629
+ date: date,
630
+ timestamp: date.getTime(),
631
+ time: getTimeText,
632
+ dateObject,
633
+ timeObject: {
634
+ hours: this.currentDate.hour,
635
+ minutes: this.currentDate.minute
636
+ },
637
+ value: getTimeText
638
+ };
639
+ this.inputElement.value = getTimeText;
640
+ }
641
+ if (this.type === Types.range) {
642
+ if (((_c = this.value) === null || _c === void 0 ? void 0 : _c.value) != this.valueText) {
643
+ this.value = {
644
+ isValid: this.dataIsValid,
645
+ dateObject: {
646
+ start: Object.assign({}, this.selectedDate && {
647
+ date: this.selectedDate,
648
+ timestamp: this.selectedDate.getTime(),
649
+ detail: this.createDateObject(this.selectedDate, {
650
+ excludeTime: true,
651
+ exactMonthNumber: true
652
+ })
653
+ }),
654
+ end: Object.assign({}, this.selectedEndDate && {
655
+ date: this.selectedEndDate,
656
+ timestamp: this.selectedEndDate.getTime(),
657
+ detail: this.createDateObject(this.selectedEndDate, {
658
+ excludeTime: true,
659
+ exactMonthNumber: true
660
+ })
661
+ })
662
+ },
663
+ value: this.valueText
664
+ };
665
+ }
666
+ }
667
+ }
668
+ /**
669
+ * @desc
670
+ * @param month
671
+ */
672
+ setMonth(month) {
673
+ this.renderDate.setDate(1);
674
+ this.renderDate = new Date(this.renderDate.setMonth(month));
675
+ this.setDragSelection('years', this.currentDate.year);
676
+ }
677
+ /**
678
+ * @desc
679
+ * @param popupClosing -
680
+ */
681
+ checkRangeValidation({ popupClosing = false } = {}) {
682
+ if (this.type !== Types.range)
683
+ return true;
684
+ const errorText = 'date range invalid';
685
+ if (popupClosing && (!this.selectedDate || this.selectedDate && !this.selectedEndDate)) {
686
+ this.setError(true, errorText);
687
+ return false;
688
+ }
689
+ if (!popupClosing) {
690
+ this.setError(false);
691
+ return true;
692
+ }
693
+ return true;
694
+ }
695
+ /**
696
+ * @desc
697
+ * @param value
698
+ * @param max
699
+ * @returns
700
+ */
701
+ pad(value, max) {
702
+ return value < max ? '0' : '';
703
+ }
704
+ /**
705
+ * @desc
706
+ * @returns
707
+ */
708
+ isInputClearable() {
709
+ if (this.inputElement && this.inputElement.value) {
710
+ return true;
711
+ }
712
+ return false;
713
+ }
714
+ /**
715
+ * @desc
716
+ * @param date
717
+ */
718
+ isDisabledDate(date) {
719
+ if (!!this.disabledDatesList.dates.map(d => this.isSameDate(d, date)).filter(d => d).length)
720
+ return true;
721
+ if (this.disabledDatesList.min) {
722
+ const minDate = new Date(this.disabledDatesList.min);
723
+ if (minDate && minDate.getTime() > date.getTime())
724
+ return true;
725
+ }
726
+ if (this.disabledDatesList.max) {
727
+ const maxDate = new Date(this.disabledDatesList.max);
728
+ if (maxDate && new Date(maxDate.setDate(maxDate.getDate() + 1)).getTime() < date.getTime())
729
+ return true;
730
+ }
731
+ }
732
+ /**
733
+ * @desc
734
+ * @param date
735
+ */
736
+ setDate(date, isUserSelect, notClosePicker = false) {
737
+ const isRange = this.type === Types.range;
738
+ const isEndSelect = !!this.selectedEndDate;
739
+ // Check disabled date
740
+ // #
741
+ if ((this.type === Types.date || this.type === Types.datetime) && this.isDisabledDate(date)) {
742
+ return;
743
+ }
744
+ this.emptyState = false;
745
+ if (!isRange || (isRange && !isEndSelect)) {
746
+ this.date = new Date(date.setHours(this.currentDate.hour, this.currentDate.minute));
747
+ }
748
+ isRange && this.checkRangeValidation();
749
+ if (isRange && this.selectedDate && this.selectedEndDate) {
750
+ this.selectedDate = null;
751
+ this.selectedEndDate = null;
752
+ }
753
+ if (isUserSelect) {
754
+ const newDate = new Date(date);
755
+ !isRange
756
+ ? this.selectedDate = newDate
757
+ : !this.selectedDate
758
+ ? this.selectedDate = newDate
759
+ : this.selectedDate.getTime() > newDate.getTime()
760
+ ? (this.selectedEndDate = this.selectedDate) && (this.selectedDate = newDate)
761
+ : this.selectedEndDate = newDate;
762
+ !isRange && (this._open = notClosePicker);
763
+ this.renderDate = this.date;
764
+ this.valueText = this.getValueText();
765
+ this.setValue();
766
+ const splitText = this.valueText.split('/');
767
+ const newValue = this.valueText ? this.changeFormat(new Date(splitText[1] + "/" + splitText[0] + "/" + splitText[2])) : '';
768
+ this.inputElement.value = newValue;
769
+ }
770
+ }
771
+ setDataFromText(text, updateData = false, openPicker = true) {
772
+ let update = false;
773
+ let errorState = '';
774
+ const parsed = this.parse(text);
775
+ if ((this.type === Types.date || this.type === Types.datetime) && this.isDisabledDate(parsed.date)) {
776
+ parsed.dateIsValid = false;
777
+ errorState = 'disabled-date';
778
+ }
779
+ // Check mode datetime
780
+ // #
781
+ if (this.type === Types.datetime && parsed.dateIsValid && parsed.timeIsValid) {
782
+ updateData && this.setDate(parsed.date, true, openPicker);
783
+ updateData && this.setTime(parsed.timeSections[0], parsed.timeSections[1]);
784
+ update = true;
785
+ }
786
+ // Check mode date
787
+ // #
788
+ if (this.type === Types.date && parsed.dateIsValid) {
789
+ updateData && this.setDate(parsed.date, true, openPicker);
790
+ update = true;
791
+ }
792
+ // Check mode time
793
+ // #
794
+ if (this.type === Types.time && parsed.timeIsValid) {
795
+ updateData && this.setTime(parsed.timeSections[0], parsed.timeSections[1]);
796
+ update = true;
797
+ }
798
+ // Check mode range
799
+ // #
800
+ if (this.type === Types.range) {
801
+ if (parsed.dateIsValid && !this.selectedDate) {
802
+ updateData && this.setDate(parsed.date, true, openPicker);
803
+ update = true;
804
+ }
805
+ if (parsed.date2IsValid && !this.selectedEndDate) {
806
+ updateData && this.setDate(parsed.date2, true, openPicker);
807
+ update = true;
808
+ }
809
+ if (this.selectedDate && this.selectedEndDate && parsed.rangeIsValid) {
810
+ if (this.isSameDate(parsed.date2, this.selectedEndDate) && !this.isSameDate(parsed.date, this.selectedDate)) {
811
+ this.selectedDate = null;
812
+ updateData && this.setDate(parsed.date, true, openPicker);
813
+ update = true;
814
+ }
815
+ if (this.isSameDate(parsed.date, this.selectedDate) && !this.isSameDate(parsed.date2, this.selectedEndDate)) {
816
+ this.selectedEndDate = null;
817
+ updateData && this.setDate(parsed.date2, true, openPicker);
818
+ update = true;
819
+ }
820
+ }
821
+ if (this.selectedDate && this.selectedEndDate && !parsed.rangeIsValid && updateData) {
822
+ this.selectedDate = null;
823
+ this.selectedEndDate = null;
824
+ }
825
+ }
826
+ // Fix: render warning
827
+ if (update) {
828
+ if (updateData) {
829
+ this.renderDate = this.date;
830
+ }
831
+ this.setError(false);
832
+ }
833
+ else {
834
+ if (this.type === Types.range && this.selectedDate && this.selectedEndDate && parsed.rangeIsValid) {
835
+ this.setError(false);
836
+ }
837
+ else {
838
+ if (errorState) {
839
+ this.setError(true, (errorState === 'disabled-date' && 'selected date is not allowed'));
840
+ }
841
+ else {
842
+ if (text) {
843
+ this.setError(true, (this.type === Types.datetime && 'invalid date or time') ||
844
+ (this.type === Types.range && 'invalid date range') ||
845
+ (this.type === Types.date && 'The selected date is not allowed.') ||
846
+ (this.type === Types.time && 'invalid time'));
847
+ }
848
+ this.setValue(true);
849
+ }
850
+ }
851
+ const splitText = text.split('/');
852
+ const newValue = text && !this.error ? this.changeFormat(new Date(splitText[1] + "/" + splitText[0] + "/" + splitText[2])) : '';
853
+ this.inputElement.value = newValue;
854
+ }
855
+ }
856
+ /**
857
+ * @desc
858
+ */
859
+ setDateToday() {
860
+ const date = new Date();
861
+ if (this.type === Types.range) {
862
+ this.selectedDate = null;
863
+ this.selectedEndDate = null;
864
+ }
865
+ this.setDate(date, true, false);
866
+ }
867
+ HourContentDblClick(e) {
868
+ const getPath = Generate.findEventPathWithNodeName(e, 'SPAN');
869
+ if (getPath && getPath.classList.contains('selected')) {
870
+ this.setValue();
871
+ this._open = false;
872
+ }
873
+ }
874
+ /**
875
+ * @desc
876
+ */
877
+ setTime(hours, minutes) {
878
+ this.renderDate = new Date(this.date.setHours(Number(hours || this.getClock().hours), Number(minutes || this.getClock().minutes)));
879
+ if (this.type === Types.time) {
880
+ this.selectedDate = this.date;
881
+ }
882
+ const hour = this.currentDate.hour || new Date().getHours();
883
+ const minute = this.currentDate.minute == 0 ? 0 : this.currentDate.minute || new Date().getMinutes();
884
+ this.setDragSelection('hours', hour, true, true);
885
+ this.setDragSelection('minutes', minute, true, true);
886
+ }
887
+ /**
888
+ * @desc
889
+ * @param state
890
+ * @param error
891
+ */
892
+ setError(state = false, error = '') {
893
+ this.error = state;
894
+ this.errorText = !state ? '' : error;
895
+ }
896
+ /**
897
+ * @desc
898
+ */
899
+ getError() {
900
+ const { error, errorText } = this;
901
+ return { valid: !error, error, errorText };
902
+ }
903
+ /**
904
+ * @desc
905
+ * @param month
906
+ * @param year
907
+ */
908
+ getDaysInMonth(month, year) {
909
+ return new Date(year, month + 1, 0).getDate();
910
+ }
911
+ /**
912
+ * @desc
913
+ * @param date
914
+ * @param day
915
+ * @returns
916
+ */
917
+ getIsCurrentDate(date, day) {
918
+ const today = new Date();
919
+ return today.getDate() === day
920
+ && today.getMonth() === date.getMonth()
921
+ && today.getFullYear() === date.getFullYear();
922
+ }
923
+ /**
924
+ * @desc
925
+ * @param date1
926
+ * @param date2
927
+ */
928
+ isSameDate(date1, date2) {
929
+ return (date1.getFullYear() === date2.getFullYear() &&
930
+ date1.getMonth() === date2.getMonth() &&
931
+ date1.getDate() === date2.getDate());
932
+ }
933
+ /**
934
+ * @desc
935
+ * @param date
936
+ * @returns
937
+ */
938
+ getSelected(date, endDate = false) {
939
+ const selectPart = endDate ? 'EndDate' : 'Date';
940
+ const targetDate = new Date(this['selected' + selectPart]);
941
+ const year = targetDate.getFullYear();
942
+ const month = targetDate.getMonth();
943
+ const day = targetDate.getDate();
944
+ const isSelected = date.getDate() === day
945
+ && date.getMonth() === month
946
+ && date.getFullYear() === year;
947
+ return isSelected;
948
+ }
949
+ /**
950
+ * @desc
951
+ * @param date
952
+ */
953
+ getDateIsInRange(date) {
954
+ if (this.type !== Types.range || (!this.selectedDate || !this.selectedEndDate))
955
+ return;
956
+ const current = date.getTime();
957
+ const start = this.selectedDate.getTime();
958
+ const end = this.selectedEndDate.getTime();
959
+ return current > start && current < end;
960
+ }
961
+ /**
962
+ * @desc
963
+ */
964
+ getMonthText() {
965
+ return Object.values(Months)[this.renderDate.getMonth()];
966
+ }
967
+ /**
968
+ * @desc
969
+ */
970
+ getCurrentDateText() {
971
+ const dayText = Object.values(Days)[this.currentDate.dayOfWeek];
972
+ const monthText = Object.values(Months)[this.currentDate.month];
973
+ const text = `${dayText}, ${this.currentDate.day}th ${monthText} ${this.currentDate.year}`;
974
+ return text;
975
+ }
976
+ /**
977
+ * @desc
978
+ * @returns
979
+ */
980
+ getTimeText() {
981
+ const { hour, minute } = this.currentDate;
982
+ return `${hour < 10 ? '0' + hour : hour}:${minute < 10 ? '0' + minute : minute}`;
983
+ }
984
+ /**
985
+ *
986
+ */
987
+ getValueText() {
988
+ if (!this.selectedDate)
989
+ return '';
990
+ const selectedDate = this.selectedDate;
991
+ const year = selectedDate.getFullYear();
992
+ const day = selectedDate.getDate();
993
+ const baseMonth = selectedDate.getMonth();
994
+ const month = baseMonth + 1;
995
+ let text = '';
996
+ if (this.type === Types.date || this.type === Types.datetime) {
997
+ text = `${day < 10 ? '0' + day : day}/${month < 10 ? '0' + month : month}/${year}`;
998
+ }
999
+ if (this.type === Types.time) {
1000
+ text = this.getTimeText();
1001
+ }
1002
+ if (this.type === Types.datetime) {
1003
+ text = `${text} ${this.getTimeText()}`;
1004
+ }
1005
+ if (this.type === Types.range) {
1006
+ text = `${day < 10 ? '0' + day : day}/${month < 10 ? '0' + month : month}/${year}`;
1007
+ }
1008
+ if (this.type === Types.range && this.selectedEndDate) {
1009
+ const endDate = this.selectedEndDate;
1010
+ const endYear = endDate.getFullYear();
1011
+ const endDay = endDate.getDate();
1012
+ const endBaseMonth = endDate.getMonth();
1013
+ const endMonth = endBaseMonth + 1;
1014
+ text += `-${endDay < 10 ? '0' + endDay : endDay}/${endMonth < 10 ? '0' + endMonth : endMonth}/${endYear}`;
1015
+ }
1016
+ this.setDataFromText(text);
1017
+ return text;
1018
+ }
1019
+ parseDate(input) {
1020
+ var parts = input.split('/');
1021
+ var day = parseInt(parts[0], 10);
1022
+ var month = parseInt(parts[1], 10) - 1;
1023
+ var year = parseInt(parts[2], 10);
1024
+ if (isNaN(day) || isNaN(month) || isNaN(year)) {
1025
+ return 'invalid date';
1026
+ }
1027
+ var date = new Date(year, month, day);
1028
+ if (date.getDate() !== day || date.getMonth() !== month || date.getFullYear() !== year) {
1029
+ return 'invalid date';
1030
+ }
1031
+ return date;
1032
+ }
1033
+ /**
1034
+ * @desc
1035
+ * @param dateStr
1036
+ */
1037
+ parse(dateStr) {
1038
+ const sections = dateStr.split(this.type === Types.range ? '-' : ' ');
1039
+ // const sections: Array<string> = dateStr.split("-")
1040
+ const sectionDate = this.switchDDMM(sections[0]);
1041
+ const sectionDate2 = this.switchDDMM(sections[1]);
1042
+ const sectionTime = this.type === Types.datetime ? sections[1] : sections[0];
1043
+ const date = new Date(sectionDate);
1044
+ const date2 = new Date(sectionDate2);
1045
+ const dateCheck = date.toString().toLowerCase() !== 'invalid date' && this.parseDate(dateStr) !== 'invalid date';
1046
+ const dateCheck2 = date2.toString().toLowerCase() !== 'invalid date';
1047
+ const regDate = /^((0?[1-9]|1[0-2])(-|\/)(0?[1-9]|[12]\d|3[01])(-|\/)[12]\d{3})$/;
1048
+ const regDateCheck = regDate.test(sectionDate);
1049
+ const regDateCheck2 = regDate.test(sectionDate2);
1050
+ const regTime = /\b([01][0-9]|2[0-3]):([0-5][0-9])\b/;
1051
+ const regTimeCheck = regTime.test(sectionTime);
1052
+ const dateIsValid = dateCheck && regDateCheck;
1053
+ const date2IsValid = dateCheck2 && regDateCheck2;
1054
+ const timeSections = regTimeCheck ? sectionTime.split(':') : '';
1055
+ return {
1056
+ date,
1057
+ date2,
1058
+ timeSections,
1059
+ dateIsValid,
1060
+ date2IsValid,
1061
+ rangeIsValid: dateIsValid && date2IsValid,
1062
+ timeIsValid: regTimeCheck
1063
+ };
1064
+ }
1065
+ /**
1066
+ * @desc
1067
+ */
1068
+ getPrevMonth() {
1069
+ this.setMonth(this.renderDate.getMonth() - 1);
1070
+ }
1071
+ /**
1072
+ * @desc
1073
+ */
1074
+ getNextMonth() {
1075
+ this.setMonth(this.renderDate.getMonth() + 1);
1076
+ }
1077
+ /**
1078
+ * @desc
1079
+ * @param idx
1080
+ */
1081
+ yearClick(idx) {
1082
+ if (this.yearsDragger.busy)
1083
+ return;
1084
+ this.setDragSelection('years', this.years[idx], true, true);
1085
+ }
1086
+ /**
1087
+ * @desc
1088
+ * @param idx
1089
+ */
1090
+ hourClick(idx) {
1091
+ if (this.hoursDragger.busy)
1092
+ return;
1093
+ if (!this.selectedDate) {
1094
+ this.setTime();
1095
+ }
1096
+ this.setDragSelection('hours', this.hours[idx], true, true);
1097
+ }
1098
+ /**
1099
+ * @desc
1100
+ * @param idx
1101
+ */
1102
+ minuteClick(idx) {
1103
+ if (this.minutesDragger.busy)
1104
+ return;
1105
+ if (!this.selectedDate) {
1106
+ this.setTime();
1107
+ }
1108
+ this.setDragSelection('minutes', this.minutes[idx], true, true);
1109
+ }
1110
+ /**
1111
+ * @desc
1112
+ */
1113
+ openPicker() {
1114
+ if (this.disabled)
1115
+ return;
1116
+ !this._open && (this._open = true);
1117
+ }
1118
+ /**
1119
+ * @desc
1120
+ * @param date
1121
+ */
1122
+ handleDayNumber(date) {
1123
+ if (this.type === Types.range
1124
+ && this.selectedDate
1125
+ && !this.selectedEndDate
1126
+ && this.isSameDate(this.selectedDate, date))
1127
+ return;
1128
+ this.setDate(date, true);
1129
+ }
1130
+ /**
1131
+ * @desc
1132
+ * @param value
1133
+ */
1134
+ handleInputInput(value) {
1135
+ this.setDataFromText(value, true);
1136
+ }
1137
+ /**
1138
+ * @desc
1139
+ * @param event -
1140
+ */
1141
+ handleInputChange(event) {
1142
+ this.setDataFromText(this.inputElement.value, true, false);
1143
+ event.stopPropagation();
1144
+ }
1145
+ /**
1146
+ * @desc
1147
+ */
1148
+ async handleInputClear() {
1149
+ this.selectedDate = null;
1150
+ this.selectedEndDate = null;
1151
+ this.emptyState = true;
1152
+ this.renderDate = new Date();
1153
+ this._open = false;
1154
+ this.setValue(true);
1155
+ this.setError();
1156
+ this.getValueText();
1157
+ await this.inputElement.setClear();
1158
+ await delay(10);
1159
+ return Promise.resolve();
1160
+ }
1161
+ /**
1162
+ * @desc
1163
+ * @param event
1164
+ */
1165
+ handleWheel(event) {
1166
+ event.preventDefault();
1167
+ }
1168
+ /**
1169
+ * @desc
1170
+ * @param event
1171
+ */
1172
+ handleWindowClick(event) {
1173
+ if (this._open) {
1174
+ const list = document.getElementById(`picker-vp-${this._id}`);
1175
+ const isClickInside = Generate.findEventPath(event, this.el);
1176
+ const isClickList = list ? (Generate.findEventPath(event, list)) : false;
1177
+ if (!isClickInside && !isClickList) {
1178
+ this._open = false;
1179
+ }
1180
+ }
1181
+ }
1182
+ openToggle() {
1183
+ if (this.disabled)
1184
+ return;
1185
+ this._open = !this._open;
1186
+ }
1187
+ /**
1188
+ * @desc
1189
+ */
1190
+ async open() {
1191
+ await delay(50);
1192
+ this.openToggle();
1193
+ }
1194
+ /**
1195
+ * @desc
1196
+ */
1197
+ async close() {
1198
+ this._open = false;
1199
+ }
1200
+ /**
1201
+ * @desc
1202
+ */
1203
+ async getValue() {
1204
+ return this.value;
1205
+ }
1206
+ /**
1207
+ * @param
1208
+ * @param disabled
1209
+ */
1210
+ async setDisabled(disabled) {
1211
+ this.disabled = disabled;
1212
+ }
1213
+ changeFormat(date, reverseDay = false) {
1214
+ if (!date)
1215
+ return;
1216
+ const pad = (n) => n < 10 ? `0${n}` : n;
1217
+ const day = pad(new Date(date).getDate());
1218
+ const month = pad(new Date(date).getMonth() + 1);
1219
+ const year = new Date(date).getFullYear();
1220
+ const hours = pad(new Date(date).getHours());
1221
+ const minutes = pad(new Date(date).getMinutes());
1222
+ if (this.type == "range" || this.type == "date") {
1223
+ return reverseDay ? `${month}/${day}/${year}` : `${day}/${month}/${year}`;
1224
+ }
1225
+ return reverseDay ? `${month}/${day}/${year} ${hours}:${minutes}` : `${day}/${month}/${year} ${hours}:${minutes}`;
1226
+ }
1227
+ isTime(value) {
1228
+ return /^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/.test(value);
1229
+ }
1230
+ getHHMM(date) {
1231
+ if (!date)
1232
+ return;
1233
+ const pad = (n) => n < 10 ? `0${n}` : n;
1234
+ const hours = pad(new Date(date).getHours());
1235
+ const minutes = pad(new Date(date).getMinutes());
1236
+ return `${hours}:${minutes}`;
1237
+ }
1238
+ /**
1239
+ * @desc
1240
+ * @param dateOrTime
1241
+ */
1242
+ async set(dateOrTime) {
1243
+ if (dateOrTime) {
1244
+ if (typeof dateOrTime === "number") {
1245
+ dateOrTime = new Date(dateOrTime);
1246
+ }
1247
+ if (this.type == "time") {
1248
+ let time = dateOrTime;
1249
+ if (!this.isTime(dateOrTime)) {
1250
+ time = this.getHHMM(dateOrTime);
1251
+ }
1252
+ this.setDataFromText(time, true, false);
1253
+ }
1254
+ else {
1255
+ const split = dateOrTime.toString().split('-');
1256
+ const parseDate0 = Date.parse(split[0]);
1257
+ if (split[0] && !isNaN(parseDate0)) {
1258
+ var date = this.changeFormat(DateTimeHelper.convertTimeStampToDate(new Date(split[0]).getTime()));
1259
+ if (split[1] && !isNaN(Date.parse(split[1]))) {
1260
+ var date2 = this.changeFormat(DateTimeHelper.convertTimeStampToDate(new Date(split[1]).getTime()));
1261
+ date = date + "-" + date2;
1262
+ }
1263
+ this.setDataFromText(date, true, false);
1264
+ }
1265
+ else {
1266
+ this.setDataFromText('', true, false);
1267
+ }
1268
+ }
1269
+ }
1270
+ else {
1271
+ this.setClear();
1272
+ }
1273
+ }
1274
+ async get() {
1275
+ var _a;
1276
+ return ((_a = this.value) === null || _a === void 0 ? void 0 : _a.timestamp) || null;
1277
+ }
1278
+ async setClear() {
1279
+ await this.handleInputClear();
1280
+ return Promise.resolve();
1281
+ }
1282
+ /**
1283
+ * @desc
1284
+ */
1285
+ async getInput() {
1286
+ return this.inputElement;
1287
+ }
1288
+ /**
1289
+ * @desc
1290
+ * @returns
1291
+ */
1292
+ async isValid() {
1293
+ return this.getError();
1294
+ }
1295
+ async resetCaption() {
1296
+ await delay(10);
1297
+ await this.inputElement.resetCaption();
1298
+ this.captionType = 'default';
1299
+ this.captionError = null;
1300
+ await delay(10);
1301
+ return Promise.resolve();
1302
+ }
1303
+ addZeroBefore(n) {
1304
+ return (n < 10 ? '0' : '') + n;
1305
+ }
1306
+ formatDate(date, format) {
1307
+ const map = {
1308
+ mm: this.addZeroBefore(date.getMonth() + 1),
1309
+ dd: this.addZeroBefore(date.getDate()),
1310
+ yyyy: this.addZeroBefore(date.getFullYear()),
1311
+ hh: this.addZeroBefore(date.getHours()),
1312
+ mi: this.addZeroBefore(date.getMinutes()),
1313
+ };
1314
+ return format.replace(/mm|dd|yyyy|hh|mi/gi, matched => map[matched]);
1315
+ }
1316
+ handleResize() {
1317
+ this.calculateLocation();
1318
+ }
1319
+ handleWheels(event) {
1320
+ if (this._open) {
1321
+ const list = document.querySelector(`#picker-vp-${this._id}`);
1322
+ const isClickInside = list && Generate.findEventPath(event, list);
1323
+ if (isClickInside) {
1324
+ this.calculateLocation();
1325
+ }
1326
+ else {
1327
+ this._open = false;
1328
+ }
1329
+ }
1330
+ }
1331
+ componentDidLoad() {
1332
+ const picker = this.el.shadowRoot.querySelector(`#picker-vp-${this._id}`);
1333
+ //move to body
1334
+ if (picker) {
1335
+ document.body.appendChild(picker);
1336
+ this.calculateLocation();
1337
+ }
1338
+ }
1339
+ disconnectedCallback() {
1340
+ this.el.innerHTML = '';
1341
+ const pickerBox = document.getElementById(`picker-vp-${this._id}`);
1342
+ if (pickerBox) {
1343
+ pickerBox.remove();
1344
+ }
1345
+ }
1346
+ async calculateLocation() {
1347
+ const pickerBox = document.getElementById(`picker-vp-${this._id}`);
1348
+ const placementArray = this.placement.split('-');
1349
+ if (this.alignment) {
1350
+ this.placement = placementArray[0] + (this.alignment == "right" ? "-end" : "-start");
1351
+ }
1352
+ var placement = this.placement;
1353
+ const targetElementId = this.linkedComponent ? this.linkedComponent : this._id;
1354
+ const target = document.getElementById(targetElementId);
1355
+ if (target) {
1356
+ const targetElement = this.linkedComponent ? target : target.shadowRoot.querySelector(`#picker-input-${this._id}`) || target.shadowRoot.querySelector("bcm-datetime-picker").shadowRoot.querySelector(`#picker-input-${this._id}`);
1357
+ if (pickerBox && targetElement) {
1358
+ getPlacement(pickerBox, targetElement, placement, (place) => (placement = place));
1359
+ await delay(10);
1360
+ let pos = setPosition(placement, targetElement);
1361
+ let captionAreaHeight = this.noCaption ? 0 : 20;
1362
+ let labelAreaHeight = 0;
1363
+ // if (this.fullWidth) {
1364
+ // pickerBox.style.width = targetElement.offsetWidth + 'px';
1365
+ // }
1366
+ getPlacement(pickerBox, targetElement, placement, (place) => (placement = place));
1367
+ await delay(10);
1368
+ pos = setPosition(placement, targetElement);
1369
+ if (this.linkedComponent) {
1370
+ pickerBox.style.top = (placement.split('-')[0] == 'top' ? pos[0] - pickerBox.offsetHeight : pos[0]) + 'px';
1371
+ }
1372
+ else {
1373
+ pickerBox.style.top = (placement.split('-')[0] == 'top' ? pos[0] - pickerBox.offsetHeight + labelAreaHeight : pos[0] - captionAreaHeight) + 'px';
1374
+ }
1375
+ switch (placement.split('-')[1]) {
1376
+ case "start":
1377
+ pickerBox.style.left = pos[1] + 'px';
1378
+ break;
1379
+ case "center":
1380
+ pickerBox.style.left = pos[1] - pickerBox.offsetWidth / 2 + 'px';
1381
+ break;
1382
+ case "end":
1383
+ pickerBox.style.left = pos[1] - pickerBox.offsetWidth + 'px';
1384
+ break;
1385
+ }
1386
+ pickerBox.classList.toggle('bcm-list--top', placement.split('-')[0] == 'top');
1387
+ }
1388
+ }
1389
+ }
1390
+ handleKeyDown(ev) {
1391
+ const keycode = ev.keyCode || ev.which;
1392
+ if (keycode === Bcm.KeyCode.escape) {
1393
+ if (this._open) {
1394
+ this._open = false;
1395
+ ev.preventDefault();
1396
+ ev.stopPropagation();
1397
+ ev.stopImmediatePropagation();
1398
+ this.markForCheck();
1399
+ }
1400
+ }
1401
+ }
1402
+ render() {
1403
+ const dayNumbersClasses = classnames('day-numbers');
1404
+ const datetimePickerClasses = classnames('datetime-picker', 'datetime-picker-wrapper', {
1405
+ 'open': this._open,
1406
+ 'no-caption': this.noCaption,
1407
+ });
1408
+ const hostClasses = classnames(this.hidden ? 'hidden' : null, {
1409
+ 'full-width': this.fullWidth,
1410
+ 'linked-component': this.linkedComponent,
1411
+ 'no-margin': this.noMargin,
1412
+ });
1413
+ const toggleClasses = classnames('toggle', {
1414
+ disabled: this.disabled
1415
+ });
1416
+ const clockIcon = `<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm61.8-104.4l-84.9-61.7c-3.1-2.3-4.9-5.9-4.9-9.7V116c0-6.6 5.4-12 12-12h32c6.6 0 12 5.4 12 12v141.7l66.8 48.6c5.4 3.9 6.5 11.4 2.6 16.8L334.6 349c-3.9 5.3-11.4 6.5-16.8 2.6z"/></svg>`;
1417
+ const calendarIcon = `<svg style="fill: #595959; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"/></svg>`;
1418
+ const errorIcon = `<svg style="fill: #ef4444; width: 14px; height: 14px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm42-104c0 23.2-18.8 42-42 42s-42-18.8-42-42 18.8-42 42-42 42 18.8 42 42zm-81.4-211.4l6.8 136c.3 6.4 5.6 11.4 12 11.4h41.2c6.4 0 11.7-5.1 12-11.4l6.8-136c.3-6.9-5.1-12.6-12-12.6h-54.8c-6.9 0-12.4 5.7-12 12.6z"/></svg>`;
1419
+ const inputIcon = this.type == "time" ? clockIcon : calendarIcon;
1420
+ return (h(Host, { class: hostClasses, "bcm-internal-id": this.inputId }, this.label && (h("div", { class: "picker-label", onClick: () => this.openToggle() }, h(LabelTemplate, { size: "medium", type: this.captionType, value: this.label, required: this.required, htmlFor: this._id }))), h("bcm-old-input", { ref: el => (this.inputElement = el), placeholder: this.placeholder || 'Select ' + (this.type === Types.datetime ? 'date and time' : '') + (this.type === Types.date ? 'date' : '') + (this.type === Types.time ? 'time' : '') + (this.type === Types.range ? 'date range' : ''), value: this.valueText, required: this.required, fullWidth: this.fullWidth, disabled: this.disabled, name: this.name, id: this.inputId, clearable: this.clearable, onClick: () => this.openPicker(), "no-margin": true, disableWatchValue: true, "on-bcm-clear": () => this.handleInputClear(), "on-bcm-change": (e) => this.handleInputChange(e),
1421
+ // on-bcm-input={(e: CustomEvent) => this.handleInputInput(e.detail)}
1422
+ noCaption: this.noCaption, captionError: this.captionError, caption: this.caption, captionType: this.captionType }, this.error && (h("span", { slot: "suffix" }, h("span", { id: "error-icon", class: toggleClasses, innerHTML: errorIcon, title: this.errorText }))), h("span", { slot: "suffix", onClick: () => this.openPicker() }, h("span", { id: "calender-icon", class: toggleClasses, innerHTML: inputIcon }))), h("div", { id: "picker-vp-" + this._id, class: datetimePickerClasses, onWheel: (e) => this.handleWheel(e) }, h("div", { class: "modules" }, this.hasDateModule && (h("div", { class: "date-container" }, h("div", { class: "bcm-datetime-picker__header" }, h("span", null), h("div", { class: "month-year" }, h("button", { onClick: () => this.getPrevMonth() }, h("bcm-icon", { icon: "far fa-chevron-left" })), h("div", { class: "month-year-wrapper" }, h("span", { class: "month" }, this.getMonthText()), ",", h("span", { class: "year" }, this.date.getFullYear())), h("button", { onClick: () => this.getNextMonth() }, h("bcm-icon", { icon: "far fa-chevron-right" }))), h("span", { class: "today", onClick: () => this.setDateToday() }, "Today")), h("div", { class: "bcm-datetime-picker__content" }, h("div", { class: "years", ref: el => (this.yearsWrapperElement = el) }, h("div", { class: "items", ref: el => (this.yearsElement = el) }, this.years.map((year, idx) => h("span", { onClick: () => this.yearClick(idx) }, year))), h("div", { class: "select-strip", ref: el => (this.yearsStripElement = el) })), h("div", { class: "days" }, h("div", { class: "day-labels" }, h("span", null, "Mo"), h("span", null, "Tu"), h("span", null, "We"), h("span", null, "Th"), h("span", null, "Fr"), h("span", null, "Sa"), h("span", null, "Su")), h("div", { class: dayNumbersClasses }, this.dayNumbers.map(day => (h("span", { class: {
1423
+ 'is-disabled-date': (this.type === Types.date || this.type === Types.datetime) && this.isDisabledDate(day.date),
1424
+ 'not-this-month': !day.thisMonth,
1425
+ 'is-weekend': day.isWeekend,
1426
+ 'today': day.today,
1427
+ 'selected': this.getSelected(day.date),
1428
+ 'selected-start': this.getSelected(day.date) && this.selectedEndDate && this.type === Types.range,
1429
+ 'selected-end': this.getSelected(day.date, true) && this.type === Types.range,
1430
+ 'range': this.getDateIsInRange(day.date) && this.type === Types.range
1431
+ }, onClick: () => this.handleDayNumber(day.date) }, h("span", { class: "number" }, day.day))))))))), this.hasTimeModule && (h("div", { class: "time-container" }, h("div", { class: "bcm-datetime-picker__header" }, h("div", { class: "month-year" }, h("span", { class: "month" }, this.getTimeText())), h("span", { class: "now", onClick: () => { this.setTime(), this.type == "time" && (this._open = false); } }, "Now")), h("div", { class: "bcm-datetime-picker__content", onDblClick: (e) => { this.HourContentDblClick(e); } }, h("div", { class: "hours", ref: el => (this.hoursWrapperElement = el) }, h("div", { class: "items", ref: el => (this.hoursElement = el) }, this.hours.map((hour, idx) => h("span", { class: this.currentDate.hour === hour ? 'selected' : '', onClick: () => this.hourClick(idx) }, (hour < 10 && '0') + hour)))), h("div", { class: "minutes", ref: el => (this.minutesWrapperElement = el) }, h("div", { class: "items", ref: el => (this.minutesElement = el) }, this.minutes.map((minute, idx) => h("span", { class: this.currentDate.minute === minute ? 'selected' : '', onClick: () => this.minuteClick(idx) }, (minute < 10 && '0') + minute)))), h("div", { class: "select-strip", ref: el => (this.timeStripElement = el) }))))))));
1432
+ }
1433
+ get el() { return getElement(this); }
1434
+ static get watchers() { return {
1435
+ "_open": ["openChanged", "openChange"],
1436
+ "renderDate": ["renderDateChange"],
1437
+ "value": ["valueChange"],
1438
+ "disabledDates": ["disabledDatesChange"]
1439
+ }; }
1440
+ };
1441
+ __decorate([
1442
+ IsLoad()
1443
+ ], BcmDatetimePicker.prototype, "el", void 0);
1444
+ BcmDatetimePicker.style = datetimePickerCss;
1445
+
1446
+ export { BcmDatetimePicker as bcm_datetime_picker };