@banzamel/mineralui 2.3.1 → 2.4.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 (236) hide show
  1. package/README.md +2 -2
  2. package/dist/{MAvatar-bUWENcq-.cjs → MAvatar-xI5aZ-bP.cjs} +2 -2
  3. package/dist/{MAvatar-bUWENcq-.cjs.map → MAvatar-xI5aZ-bP.cjs.map} +1 -1
  4. package/dist/{MButton-R08y1HCT.cjs → MButton-CMbmWmMI.cjs} +2 -2
  5. package/dist/{MButton-R08y1HCT.cjs.map → MButton-CMbmWmMI.cjs.map} +1 -1
  6. package/dist/{MButtonGroup-C-LiXWRC.cjs → MButtonGroup-agnKWUPy.cjs} +2 -2
  7. package/dist/{MButtonGroup-C-LiXWRC.cjs.map → MButtonGroup-agnKWUPy.cjs.map} +1 -1
  8. package/dist/{MCard-1OVOl4Ql.cjs → MCard-CADu7UUA.cjs} +2 -2
  9. package/dist/{MCard-1OVOl4Ql.cjs.map → MCard-CADu7UUA.cjs.map} +1 -1
  10. package/dist/{MCheckbox-CM5HJQWW.cjs → MCheckbox-stBujis6.cjs} +2 -2
  11. package/dist/{MCheckbox-CM5HJQWW.cjs.map → MCheckbox-stBujis6.cjs.map} +1 -1
  12. package/dist/{MConflictIllustration-B2AtfpYO.cjs → MConflictIllustration-CWWnskbi.cjs} +2 -2
  13. package/dist/{MConflictIllustration-B2AtfpYO.cjs.map → MConflictIllustration-CWWnskbi.cjs.map} +1 -1
  14. package/dist/{MDetailList-DTLU7HQZ.cjs → MDetailList-CQ2sJ7Jl.cjs} +2 -2
  15. package/dist/{MDetailList-DTLU7HQZ.cjs.map → MDetailList-CQ2sJ7Jl.cjs.map} +1 -1
  16. package/dist/MDropdownMenu-B7RR8d8x.js +172 -0
  17. package/dist/MDropdownMenu-B7RR8d8x.js.map +1 -0
  18. package/dist/MDropdownMenu-DAzieAOs.cjs +2 -0
  19. package/dist/MDropdownMenu-DAzieAOs.cjs.map +1 -0
  20. package/dist/{MGrid-B_0kFUws.cjs → MGrid-LHi7TY5J.cjs} +2 -2
  21. package/dist/{MGrid-B_0kFUws.cjs.map → MGrid-LHi7TY5J.cjs.map} +1 -1
  22. package/dist/{MHeading-BLnb3dNv.cjs → MHeading-7yt1C6oS.cjs} +2 -2
  23. package/dist/{MHeading-BLnb3dNv.cjs.map → MHeading-7yt1C6oS.cjs.map} +1 -1
  24. package/dist/{MI18nProvider-Cg-vxV6j.cjs → MI18nProvider-Cx4ZaFtv.cjs} +2 -2
  25. package/dist/{MI18nProvider-Cg-vxV6j.cjs.map → MI18nProvider-Cx4ZaFtv.cjs.map} +1 -1
  26. package/dist/{MInput-BpTlP8GE.cjs → MInput-BSeWCsPi.cjs} +2 -2
  27. package/dist/{MInput-BpTlP8GE.cjs.map → MInput-BSeWCsPi.cjs.map} +1 -1
  28. package/dist/{MInputCVC-B4V0QI5h.js → MInputCVC-CtHPCx_r.js} +2 -2
  29. package/dist/{MInputCVC-B4V0QI5h.js.map → MInputCVC-CtHPCx_r.js.map} +1 -1
  30. package/dist/{MInputCVC-BlY5OrVn.cjs → MInputCVC-rNs8w4gH.cjs} +2 -2
  31. package/dist/{MInputCVC-BlY5OrVn.cjs.map → MInputCVC-rNs8w4gH.cjs.map} +1 -1
  32. package/dist/{MInputSearch-9wcXlY8-.cjs → MInputSearch-BfPPgEGZ.cjs} +2 -2
  33. package/dist/{MInputSearch-9wcXlY8-.cjs.map → MInputSearch-BfPPgEGZ.cjs.map} +1 -1
  34. package/dist/{MKbd-n4fhKIxb.cjs → MKbd-C6XHWlmE.cjs} +2 -2
  35. package/dist/{MKbd-n4fhKIxb.cjs.map → MKbd-C6XHWlmE.cjs.map} +1 -1
  36. package/dist/{MLink-Biipj7xz.cjs → MLink-CbaDlP5I.cjs} +2 -2
  37. package/dist/{MLink-Biipj7xz.cjs.map → MLink-CbaDlP5I.cjs.map} +1 -1
  38. package/dist/{MLoader-XcpKlLrd.cjs → MLoader-DELAIhz5.cjs} +2 -2
  39. package/dist/{MLoader-XcpKlLrd.cjs.map → MLoader-DELAIhz5.cjs.map} +1 -1
  40. package/dist/{MPagination-C6QQdEj_.cjs → MPagination-C2lpvPqC.cjs} +2 -2
  41. package/dist/{MPagination-C6QQdEj_.cjs.map → MPagination-C2lpvPqC.cjs.map} +1 -1
  42. package/dist/MPopover-DI_7niwe.cjs +2 -0
  43. package/dist/MPopover-DI_7niwe.cjs.map +1 -0
  44. package/dist/{MPopover-C5aaGhma.js → MPopover-Dd-GIBU6.js} +10 -5
  45. package/dist/MPopover-Dd-GIBU6.js.map +1 -0
  46. package/dist/{MPortal-BciZHNDC.cjs → MPortal-C9Ucq8Um.cjs} +2 -2
  47. package/dist/{MPortal-BciZHNDC.cjs.map → MPortal-C9Ucq8Um.cjs.map} +1 -1
  48. package/dist/{MSimpleGrid-BwNfaxQP.cjs → MSimpleGrid-K-8Qg9em.cjs} +2 -2
  49. package/dist/{MSimpleGrid-BwNfaxQP.cjs.map → MSimpleGrid-K-8Qg9em.cjs.map} +1 -1
  50. package/dist/{MSkeleton-CLSU5pL6.cjs → MSkeleton-DgU8aktI.cjs} +2 -2
  51. package/dist/{MSkeleton-CLSU5pL6.cjs.map → MSkeleton-DgU8aktI.cjs.map} +1 -1
  52. package/dist/{MSlider-DZnMB49q.cjs → MSlider-0ApojrDC.cjs} +2 -2
  53. package/dist/{MSlider-DZnMB49q.cjs.map → MSlider-0ApojrDC.cjs.map} +1 -1
  54. package/dist/{MStack-BP_BUeCc.cjs → MStack-BOOciEts.cjs} +2 -2
  55. package/dist/{MStack-BP_BUeCc.cjs.map → MStack-BOOciEts.cjs.map} +1 -1
  56. package/dist/{MSubText-VHsgFsv2.cjs → MSubText-WixraICV.cjs} +2 -2
  57. package/dist/{MSubText-VHsgFsv2.cjs.map → MSubText-WixraICV.cjs.map} +1 -1
  58. package/dist/{MSurface-CYeVFOw_.cjs → MSurface-CF8BFFn4.cjs} +2 -2
  59. package/dist/{MSurface-CYeVFOw_.cjs.map → MSurface-CF8BFFn4.cjs.map} +1 -1
  60. package/dist/{MTag-BzTp1crT.cjs → MTag-CgXh2PQC.cjs} +2 -2
  61. package/dist/{MTag-BzTp1crT.cjs.map → MTag-CgXh2PQC.cjs.map} +1 -1
  62. package/dist/{MText-j6Zbbj5Y.cjs → MText-CDDEGjBx.cjs} +2 -2
  63. package/dist/{MText-j6Zbbj5Y.cjs.map → MText-CDDEGjBx.cjs.map} +1 -1
  64. package/dist/{MTooltip-BEfO9jTe.cjs → MTooltip-BWqyv6QU.cjs} +2 -2
  65. package/dist/{MTooltip-BEfO9jTe.cjs.map → MTooltip-BWqyv6QU.cjs.map} +1 -1
  66. package/dist/{MTreeView-DuQkm0ZV.cjs → MTreeView-BcVw0Bgz.cjs} +2 -2
  67. package/dist/{MTreeView-DuQkm0ZV.cjs.map → MTreeView-BcVw0Bgz.cjs.map} +1 -1
  68. package/dist/{arduino-UeOrXakL.js → arduino-BHobW-W2.js} +1 -1
  69. package/dist/{arduino-UeOrXakL.js.map → arduino-BHobW-W2.js.map} +1 -1
  70. package/dist/{arduino-DdDHMIWB.cjs → arduino-Bedph8hQ.cjs} +1 -1
  71. package/dist/{arduino-DdDHMIWB.cjs.map → arduino-Bedph8hQ.cjs.map} +1 -1
  72. package/dist/{bash-B17_F5Sw.cjs → bash-CK4DSkpy.cjs} +1 -1
  73. package/dist/{bash-B17_F5Sw.cjs.map → bash-CK4DSkpy.cjs.map} +1 -1
  74. package/dist/{bash-CrHemXky.js → bash-oKnFbgn1.js} +1 -1
  75. package/dist/{bash-CrHemXky.js.map → bash-oKnFbgn1.js.map} +1 -1
  76. package/dist/{c-ODLxeMV_.cjs → c-9Uw9QchT.cjs} +1 -1
  77. package/dist/{c-ODLxeMV_.cjs.map → c-9Uw9QchT.cjs.map} +1 -1
  78. package/dist/{c-D9302r2r.js → c-Bjn-r6WZ.js} +1 -1
  79. package/dist/{c-D9302r2r.js.map → c-Bjn-r6WZ.js.map} +1 -1
  80. package/dist/calendar-BFfeWRa0.cjs +2 -0
  81. package/dist/calendar-BFfeWRa0.cjs.map +1 -0
  82. package/dist/calendar-DhRP5_mS.js +192 -0
  83. package/dist/calendar-DhRP5_mS.js.map +1 -0
  84. package/dist/calendar.cjs +3 -0
  85. package/dist/calendar.d.ts +1 -0
  86. package/dist/calendar.js +4 -0
  87. package/dist/{cards-CQSYgH9U.cjs → cards-Bwos44EP.cjs} +2 -2
  88. package/dist/{cards-CQSYgH9U.cjs.map → cards-Bwos44EP.cjs.map} +1 -1
  89. package/dist/{cards-Cpr9B8Mu.js → cards-Dus8TmSD.js} +4 -4
  90. package/dist/{cards-Cpr9B8Mu.js.map → cards-Dus8TmSD.js.map} +1 -1
  91. package/dist/cards.cjs +1 -1
  92. package/dist/cards.js +1 -1
  93. package/dist/components/calendar/MMiniCalendar/MMiniCalendar.d.ts +6 -0
  94. package/dist/components/calendar/MMiniCalendar/MMiniCalendar.types.d.ts +35 -0
  95. package/dist/components/calendar/MMiniCalendar/index.d.ts +2 -0
  96. package/dist/components/calendar/index.d.ts +2 -0
  97. package/dist/components/dropdowns/MSelect/MSelect.d.ts +1 -1
  98. package/dist/components/dropdowns/MSelect/MSelect.types.d.ts +2 -0
  99. package/dist/components/overlays/MDropdownMenu/MDropdownMenu.d.ts +1 -1
  100. package/dist/components/overlays/MDropdownMenu/MDropdownMenu.types.d.ts +7 -0
  101. package/dist/components/overlays/MDropdownMenu/index.d.ts +1 -1
  102. package/dist/components/overlays/index.d.ts +1 -1
  103. package/dist/{controls-CT_0lIPr.cjs → controls-CeHdKaQv.cjs} +2 -2
  104. package/dist/{controls-CT_0lIPr.cjs.map → controls-CeHdKaQv.cjs.map} +1 -1
  105. package/dist/controls.cjs +1 -1
  106. package/dist/{core-DBpQf3uY.cjs → core-CLRD6sG4.cjs} +1 -1
  107. package/dist/{core-DBpQf3uY.cjs.map → core-CLRD6sG4.cjs.map} +1 -1
  108. package/dist/{core-yRqh2XLu.js → core-CMHNXulE.js} +1 -1
  109. package/dist/{core-yRqh2XLu.js.map → core-CMHNXulE.js.map} +1 -1
  110. package/dist/{cpp-DuTgLZC1.cjs → cpp-BWqMcMeX.cjs} +1 -1
  111. package/dist/{cpp-DuTgLZC1.cjs.map → cpp-BWqMcMeX.cjs.map} +1 -1
  112. package/dist/{cpp-CLYSpJBB.js → cpp-b3FmFTKl.js} +1 -1
  113. package/dist/{cpp-CLYSpJBB.js.map → cpp-b3FmFTKl.js.map} +1 -1
  114. package/dist/{css-BgGh0eG1.js → css-8EzLAJKV.js} +1 -1
  115. package/dist/{css-BgGh0eG1.js.map → css-8EzLAJKV.js.map} +1 -1
  116. package/dist/{css-D0f-qByc.cjs → css-B4MkxW0b.cjs} +1 -1
  117. package/dist/{css-D0f-qByc.cjs.map → css-B4MkxW0b.cjs.map} +1 -1
  118. package/dist/{data-C-6DP7iY.js → data-Dh3C_VTi.js} +2 -2
  119. package/dist/{data-C-6DP7iY.js.map → data-Dh3C_VTi.js.map} +1 -1
  120. package/dist/{data-BZ92hzXx.cjs → data-Dl6U8Uct.cjs} +2 -2
  121. package/dist/{data-BZ92hzXx.cjs.map → data-Dl6U8Uct.cjs.map} +1 -1
  122. package/dist/data.cjs +1 -1
  123. package/dist/data.js +1 -1
  124. package/dist/{display-BF4jASt9.js → display-CYC1AImx.js} +12 -12
  125. package/dist/{display-BF4jASt9.js.map → display-CYC1AImx.js.map} +1 -1
  126. package/dist/{display-DMix8BmD.cjs → display-DU9E_18w.cjs} +2 -2
  127. package/dist/{display-DMix8BmD.cjs.map → display-DU9E_18w.cjs.map} +1 -1
  128. package/dist/display.cjs +1 -1
  129. package/dist/display.js +1 -1
  130. package/dist/dropdowns-ByDu8Wbt.js +1697 -0
  131. package/dist/dropdowns-ByDu8Wbt.js.map +1 -0
  132. package/dist/dropdowns-vaj6vhl6.cjs +2 -0
  133. package/dist/dropdowns-vaj6vhl6.cjs.map +1 -0
  134. package/dist/dropdowns.cjs +1 -1
  135. package/dist/dropdowns.js +1 -1
  136. package/dist/{feedback-BeJpXoKd.cjs → feedback-CUGuh4QZ.cjs} +2 -2
  137. package/dist/{feedback-BeJpXoKd.cjs.map → feedback-CUGuh4QZ.cjs.map} +1 -1
  138. package/dist/feedback.cjs +1 -1
  139. package/dist/{form-BWGLrCPi.cjs → form-DICGXS6_.cjs} +2 -2
  140. package/dist/{form-BWGLrCPi.cjs.map → form-DICGXS6_.cjs.map} +1 -1
  141. package/dist/{form-CgH1hioG.js → form-Dri4AzY9.js} +1 -1
  142. package/dist/{form-CgH1hioG.js.map → form-Dri4AzY9.js.map} +1 -1
  143. package/dist/form.cjs +1 -1
  144. package/dist/form.js +1 -1
  145. package/dist/frameworkTexts-C1yvIVm4.js +109 -0
  146. package/dist/frameworkTexts-C1yvIVm4.js.map +1 -0
  147. package/dist/frameworkTexts-D3wbwWCu.cjs +2 -0
  148. package/dist/frameworkTexts-D3wbwWCu.cjs.map +1 -0
  149. package/dist/i18n/frameworkTexts.d.ts +83 -0
  150. package/dist/i18n.cjs +1 -1
  151. package/dist/{icons-D675Im0B.cjs → icons-BxurYyW-.cjs} +2 -2
  152. package/dist/{icons-D675Im0B.cjs.map → icons-BxurYyW-.cjs.map} +1 -1
  153. package/dist/icons.cjs +1 -1
  154. package/dist/illustrations.cjs +1 -1
  155. package/dist/index.cjs +1 -1
  156. package/dist/index.d.ts +1 -0
  157. package/dist/index.js +12 -11
  158. package/dist/{inputs-x6vjAGCq.cjs → inputs-GCUfD923.cjs} +2 -2
  159. package/dist/{inputs-x6vjAGCq.cjs.map → inputs-GCUfD923.cjs.map} +1 -1
  160. package/dist/inputs.cjs +1 -1
  161. package/dist/inputs.js +1 -1
  162. package/dist/{javascript-CGjvHPZ1.cjs → javascript-BGrveJJw.cjs} +1 -1
  163. package/dist/{javascript-CGjvHPZ1.cjs.map → javascript-BGrveJJw.cjs.map} +1 -1
  164. package/dist/{javascript-CX3JhsYu.js → javascript-CH9YvIk2.js} +1 -1
  165. package/dist/{javascript-CX3JhsYu.js.map → javascript-CH9YvIk2.js.map} +1 -1
  166. package/dist/{json-BPIcVdlp.js → json-CPWARxtL.js} +1 -1
  167. package/dist/{json-BPIcVdlp.js.map → json-CPWARxtL.js.map} +1 -1
  168. package/dist/{json-B8svQsK0.cjs → json-D6oa0Lra.cjs} +1 -1
  169. package/dist/{json-B8svQsK0.cjs.map → json-D6oa0Lra.cjs.map} +1 -1
  170. package/dist/{layout-CdSpVJuK.js → layout-CS_dHOLM.js} +2 -2
  171. package/dist/{layout-CdSpVJuK.js.map → layout-CS_dHOLM.js.map} +1 -1
  172. package/dist/{layout-Ddo7HUPu.cjs → layout-Gr99WWTA.cjs} +2 -2
  173. package/dist/{layout-Ddo7HUPu.cjs.map → layout-Gr99WWTA.cjs.map} +1 -1
  174. package/dist/layout.cjs +1 -1
  175. package/dist/layout.js +1 -1
  176. package/dist/{licensing-DysMClel.cjs → licensing-DXCHcZd1.cjs} +2 -2
  177. package/dist/licensing-DXCHcZd1.cjs.map +1 -0
  178. package/dist/licensing-f5KYVz7D.js.map +1 -1
  179. package/dist/{locale-CbnstsMH.cjs → locale-BGLDTJSi.cjs} +2 -2
  180. package/dist/{locale-CbnstsMH.cjs.map → locale-BGLDTJSi.cjs.map} +1 -1
  181. package/dist/{media-DRz3JZfr.cjs → media-CE59IEdY.cjs} +2 -2
  182. package/dist/{media-DRz3JZfr.cjs.map → media-CE59IEdY.cjs.map} +1 -1
  183. package/dist/media.cjs +1 -1
  184. package/dist/{overlays-BUZEaZaJ.cjs → overlays--Pe-H5TW.cjs} +2 -2
  185. package/dist/{overlays-BUZEaZaJ.cjs.map → overlays--Pe-H5TW.cjs.map} +1 -1
  186. package/dist/{overlays-C1vO_A2I.js → overlays-DCXP_KsX.js} +2 -2
  187. package/dist/{overlays-C1vO_A2I.js.map → overlays-DCXP_KsX.js.map} +1 -1
  188. package/dist/overlays.cjs +1 -1
  189. package/dist/overlays.js +2 -2
  190. package/dist/{php-CKyelegh.cjs → php-DJ1nTQpr.cjs} +1 -1
  191. package/dist/{php-CKyelegh.cjs.map → php-DJ1nTQpr.cjs.map} +1 -1
  192. package/dist/{php-CBRzjinf.js → php-DeBdikHj.js} +1 -1
  193. package/dist/{php-CBRzjinf.js.map → php-DeBdikHj.js.map} +1 -1
  194. package/dist/primitives.cjs +1 -1
  195. package/dist/primitives.js +1 -1
  196. package/dist/style-runtime.cjs +1 -1
  197. package/dist/style-runtime.js +1 -1
  198. package/dist/styles.css +1 -1
  199. package/dist/{theme-BfNZicWk.cjs → theme-Bjs11y3s.cjs} +2 -2
  200. package/dist/{theme-BfNZicWk.cjs.map → theme-Bjs11y3s.cjs.map} +1 -1
  201. package/dist/theme.cjs +1 -1
  202. package/dist/{typescript-Xt3Sotw5.js → typescript-B5GRzMtL.js} +1 -1
  203. package/dist/{typescript-Xt3Sotw5.js.map → typescript-B5GRzMtL.js.map} +1 -1
  204. package/dist/{typescript-D6PDzwkM.cjs → typescript-qNh_eaB0.cjs} +1 -1
  205. package/dist/{typescript-D6PDzwkM.cjs.map → typescript-qNh_eaB0.cjs.map} +1 -1
  206. package/dist/{typography-Dk9kIORI.cjs → typography-D4PUdtMV.cjs} +2 -2
  207. package/dist/{typography-Dk9kIORI.cjs.map → typography-D4PUdtMV.cjs.map} +1 -1
  208. package/dist/typography.cjs +1 -1
  209. package/dist/{useGhostText-Dmkw3Am8.cjs → useGhostText-BTPneo4u.cjs} +2 -2
  210. package/dist/{useGhostText-Dmkw3Am8.cjs.map → useGhostText-BTPneo4u.cjs.map} +1 -1
  211. package/dist/{useInteractionEffect-DFTdcWHl.cjs → useInteractionEffect-q_9csNj7.cjs} +2 -2
  212. package/dist/{useInteractionEffect-DFTdcWHl.cjs.map → useInteractionEffect-q_9csNj7.cjs.map} +1 -1
  213. package/dist/{useKeyboardNav-HVG9JFD2.cjs → useKeyboardNav-D_OwIEZp.cjs} +2 -2
  214. package/dist/{useKeyboardNav-HVG9JFD2.cjs.map → useKeyboardNav-D_OwIEZp.cjs.map} +1 -1
  215. package/dist/utils/calendarDates.d.ts +51 -0
  216. package/dist/utils/licensing.d.ts +1 -1
  217. package/dist/utils/useControllableState.d.ts +5 -0
  218. package/dist/utils/useElementWidth.d.ts +10 -0
  219. package/dist/utils.cjs +1 -1
  220. package/dist/{xml-CrpWqcDk.js → xml-BTZ6XeQ9.js} +1 -1
  221. package/dist/{xml-CrpWqcDk.js.map → xml-BTZ6XeQ9.js.map} +1 -1
  222. package/dist/{xml-4YlaGgjP.cjs → xml-_Z3NZw2H.cjs} +1 -1
  223. package/dist/{xml-4YlaGgjP.cjs.map → xml-_Z3NZw2H.cjs.map} +1 -1
  224. package/package.json +16 -3
  225. package/dist/MDropdownMenu-BvN5grK5.cjs +0 -2
  226. package/dist/MDropdownMenu-BvN5grK5.cjs.map +0 -1
  227. package/dist/MDropdownMenu-CFoKJ7V6.js +0 -157
  228. package/dist/MDropdownMenu-CFoKJ7V6.js.map +0 -1
  229. package/dist/MPopover-C5aaGhma.js.map +0 -1
  230. package/dist/MPopover-CV-9MArH.cjs +0 -2
  231. package/dist/MPopover-CV-9MArH.cjs.map +0 -1
  232. package/dist/dropdowns-BwAVoncd.js +0 -1752
  233. package/dist/dropdowns-BwAVoncd.js.map +0 -1
  234. package/dist/dropdowns-D5IF0TK7.cjs +0 -2
  235. package/dist/dropdowns-D5IF0TK7.cjs.map +0 -1
  236. package/dist/licensing-DysMClel.cjs.map +0 -1
@@ -1,1752 +0,0 @@
1
- import { r as e } from "./MI18nProvider-VH14CI8u.js";
2
- import { Ji as t, Ki as n, Li as r, Ri as i, Xi as a, qi as o } from "./icons-CBMl-kOM.js";
3
- import { t as s } from "./cn-YER3QsV1.js";
4
- import { a as c, i as l } from "./validators-DVYOtFnw.js";
5
- import { i as u, u as d } from "./formatters-T0vvjMtB.js";
6
- import { _ as f, a as p, c as m, d as h, f as ee, g, h as te, i as _, l as v, o as y, p as b, r as ne, s as re, t as ie, u as ae } from "./dateUtils-CUY6CRCf.js";
7
- import { r as x } from "./useGhostText-DG0bzcao.js";
8
- import { t as S } from "./useKeyboardNav-iEXOdEMB.js";
9
- import { t as oe } from "./MPopover-C5aaGhma.js";
10
- import { r as se } from "./MButton-C1pnL4_j.js";
11
- import { t as ce } from "./MCheckbox-B7SpcD4H.js";
12
- import { t as le } from "./MTag-D9q6faIk.js";
13
- import { t as ue } from "./MInput-C8ObGzQk.js";
14
- import { t as de } from "./locale-CS1-IY_I.js";
15
- import { useCallback as C, useEffect as w, useMemo as T, useRef as fe, useState as E } from "react";
16
- import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
17
- //#region src/components/dropdowns/MSelect/MSelect.tsx
18
- function A({ options: e, value: t, defaultValue: r, onChange: i, multiple: o = !1, searchable: c = !1, placeholder: l = "Select...", disabled: u = !1, name: d, id: f, variant: p = "outlined", size: m = "md", color: h, fullWidth: ee = !1, label: g, helperText: te, errorText: _, error: v = !1, required: y = !1, loading: b = !1, clearable: ne = !1, maxHeight: re = 300, noOptionsText: ie = "No options", renderOption: ae, renderValue: x, className: ue, style: de }) {
19
- let [w, D] = E(!1), [A, j] = E(r ?? (o ? [] : "")), [M, N] = E(""), P = fe(null), F = t === void 0 ? A : t, I = v || !!_, L = T(() => Array.isArray(F) ? F : F ? [F] : [], [F]), R = T(() => e.filter((e) => L.includes(e.value)), [e, L]), pe = T(() => {
20
- if (!c || !M) return e;
21
- let t = M.toLowerCase();
22
- return e.filter((e) => e.label.toLowerCase().includes(t));
23
- }, [
24
- e,
25
- c,
26
- M
27
- ]), me = T(() => {
28
- let e = /* @__PURE__ */ new Map();
29
- for (let t of pe) {
30
- let n = t.group ?? "";
31
- e.has(n) || e.set(n, []), e.get(n).push(t);
32
- }
33
- return e;
34
- }, [pe]), z = pe, B = C((e) => {
35
- let n = z[e];
36
- if (!(!n || n.disabled)) if (o) {
37
- let e = Array.isArray(F) ? F : [], r = e.includes(n.value) ? e.filter((e) => e !== n.value) : [...e, n.value];
38
- t === void 0 && j(r), i?.(r);
39
- } else t === void 0 && j(n.value), i?.(n.value), D(!1), N("");
40
- }, [
41
- z,
42
- o,
43
- F,
44
- t,
45
- i
46
- ]), { activeIndex: he, setActiveIndex: ge, resetIndex: _e, onKeyDown: V } = S({
47
- itemCount: z.length,
48
- onSelect: B,
49
- onClose: () => {
50
- D(!1), N("");
51
- },
52
- isOpen: w
53
- }), ve = C(() => {
54
- u || (D((e) => !e), _e());
55
- }, [u, _e]), H = C((e) => {
56
- e.stopPropagation();
57
- let n = o ? [] : "";
58
- t === void 0 && j(n), i?.(n);
59
- }, [
60
- o,
61
- t,
62
- i
63
- ]), U = T(() => x && R.length > 0 ? x(o ? R : R[0]) : o && R.length > 0 ? /* @__PURE__ */ O("span", {
64
- className: "tags",
65
- children: R.map((e) => /* @__PURE__ */ O(le, {
66
- label: e.label,
67
- color: h,
68
- size: m,
69
- variant: "solid"
70
- }, e.value))
71
- }) : !o && R.length > 0 ? R[0].label : /* @__PURE__ */ O("span", {
72
- className: "placeholder",
73
- children: l
74
- }), [
75
- R,
76
- o,
77
- x,
78
- l,
79
- h,
80
- m
81
- ]);
82
- return /* @__PURE__ */ k("div", {
83
- className: s("select", h && `color-${h}`, ee && "full-width", ue),
84
- style: de,
85
- children: [
86
- g && /* @__PURE__ */ O("label", {
87
- htmlFor: f,
88
- className: s("field-label", w && "focused", I && "error", y && "required"),
89
- children: g
90
- }),
91
- /* @__PURE__ */ k("div", {
92
- ref: P,
93
- className: s("trigger", `field-${p}`, `field-${m}`, w && "focused", I && "error", u && "disabled"),
94
- onClick: ve,
95
- onKeyDown: V,
96
- tabIndex: u ? -1 : 0,
97
- role: "combobox",
98
- "aria-expanded": w,
99
- "aria-haspopup": "listbox",
100
- "aria-invalid": I || void 0,
101
- id: f,
102
- children: [
103
- /* @__PURE__ */ O("span", {
104
- className: "value",
105
- children: U
106
- }),
107
- b && /* @__PURE__ */ O(se, {
108
- size: "sm",
109
- color: h
110
- }),
111
- ne && L.length > 0 && !b && !u && /* @__PURE__ */ O("button", {
112
- type: "button",
113
- className: "clear-btn clear-btn-base",
114
- onClick: H,
115
- tabIndex: -1,
116
- "aria-label": "Clear selection",
117
- children: /* @__PURE__ */ O(a, {})
118
- }),
119
- /* @__PURE__ */ O("span", {
120
- className: s("arrow", w && "open"),
121
- "aria-hidden": "true",
122
- children: /* @__PURE__ */ O(n, {})
123
- })
124
- ]
125
- }),
126
- d && /* @__PURE__ */ O("input", {
127
- type: "hidden",
128
- name: d,
129
- value: Array.isArray(F) ? F.join(",") : F
130
- }),
131
- /* @__PURE__ */ O(oe, {
132
- className: "select-popover",
133
- open: w,
134
- anchorRef: P,
135
- onClose: () => {
136
- D(!1), N("");
137
- },
138
- matchWidth: !0,
139
- placement: "bottom-start",
140
- children: /* @__PURE__ */ k("div", {
141
- style: { maxHeight: re },
142
- className: "dropdown",
143
- children: [c && /* @__PURE__ */ O("div", {
144
- className: "search-box",
145
- children: /* @__PURE__ */ O("input", {
146
- type: "text",
147
- className: "search-input",
148
- placeholder: "Search...",
149
- value: M,
150
- onChange: (e) => {
151
- N(e.target.value), ge(0);
152
- },
153
- onKeyDown: V,
154
- autoFocus: !0
155
- })
156
- }), z.length === 0 ? /* @__PURE__ */ O("div", {
157
- className: "no-options",
158
- children: ie
159
- }) : /* @__PURE__ */ O("div", {
160
- className: "options-list",
161
- role: "listbox",
162
- children: [...me.entries()].map(([e, t]) => /* @__PURE__ */ k("div", { children: [e && /* @__PURE__ */ O("div", {
163
- className: "group-header",
164
- children: e
165
- }), t.map((e) => {
166
- let t = z.indexOf(e), n = t === he, r = L.includes(e.value);
167
- return /* @__PURE__ */ k("div", {
168
- className: s("option", n && "active", r && "selected", e.disabled && "disabled"),
169
- onClick: () => !e.disabled && B(t),
170
- onMouseEnter: () => ge(t),
171
- role: "option",
172
- "aria-selected": r,
173
- "aria-disabled": e.disabled,
174
- children: [o && /* @__PURE__ */ O(ce, {
175
- checked: r,
176
- size: "sm",
177
- color: h,
178
- clickEffect: "none",
179
- className: "select-check"
180
- }), ae ? ae(e, n, r) : e.label]
181
- }, e.value);
182
- })] }, e))
183
- })]
184
- })
185
- }),
186
- (_ || te) && /* @__PURE__ */ O("div", {
187
- className: "bottom-row",
188
- children: _ ? /* @__PURE__ */ O("span", {
189
- className: "field-error",
190
- role: "alert",
191
- children: _
192
- }) : /* @__PURE__ */ O("span", {
193
- className: "helper-text",
194
- children: te
195
- })
196
- })
197
- ]
198
- });
199
- }
200
- //#endregion
201
- //#region src/components/dropdowns/MAutocomplete/MAutocomplete.tsx
202
- function j(e) {
203
- return typeof e == "string" ? e : String(e);
204
- }
205
- function M(e) {
206
- return typeof e == "string" ? e : String(e);
207
- }
208
- function N(e, t, n) {
209
- if (!t) return e;
210
- let r = t.toLowerCase();
211
- return e.filter((e) => n(e).toLowerCase().includes(r));
212
- }
213
- function P({ options: e, value: t, onChange: n, getOptionLabel: r = j, getOptionValue: i = M, filterOptions: o, multiple: c = !1, debounceMs: l = 0, onInputChange: u, loading: d = !1, loadingText: f = "Loading...", noOptionsText: p = "No options", placeholder: m = "Type to search...", disabled: h = !1, name: ee, id: g, variant: te = "outlined", size: _ = "md", color: v, fullWidth: y = !1, label: b, helperText: ne, errorText: re, error: ie = !1, required: ae = !1, clearable: ce = !1, maxHeight: ue = 300, renderOption: de, renderTags: w, className: D, style: A }) {
214
- let [P, F] = E(!1), [I, L] = E(""), R = fe(null), pe = fe(null), me = ie || !!re, z = T(() => t == null ? [] : Array.isArray(t) ? t.filter((e) => e != null) : [t], [t]), B = T(() => o ? o(e, I) : N(e, I, r), [
215
- e,
216
- I,
217
- o,
218
- r
219
- ]), he = x((e) => u?.(e), l), ge = C((e) => {
220
- L(e.target.value), he(e.target.value), P || F(!0);
221
- }, [P, he]), _e = C((e) => {
222
- let t = B[e];
223
- if (t) if (c) {
224
- let e = [...z], r = i(t), a = e.findIndex((e) => i(e) === r);
225
- a >= 0 ? e.splice(a, 1) : e.push(t), n?.(e), L(""), pe.current?.focus();
226
- } else n?.(t), L(r(t)), F(!1);
227
- }, [
228
- B,
229
- c,
230
- z,
231
- i,
232
- r,
233
- n
234
- ]), V = C((e) => {
235
- let t = [...z];
236
- t.splice(e, 1), n?.(c ? t : t[0] ?? "");
237
- }, [
238
- z,
239
- n,
240
- c
241
- ]), { activeIndex: ve, setActiveIndex: H, resetIndex: U, onKeyDown: ye } = S({
242
- itemCount: B.length,
243
- onSelect: _e,
244
- onClose: () => F(!1),
245
- isOpen: P
246
- }), W = C((e) => {
247
- if (e.key === "Backspace" && c && !I && z.length > 0) {
248
- V(z.length - 1);
249
- return;
250
- }
251
- ye(e);
252
- }, [
253
- I,
254
- c,
255
- z,
256
- ye,
257
- V
258
- ]), G = C((e) => {
259
- e.stopPropagation(), L(""), n?.(c ? [] : ""), pe.current?.focus();
260
- }, [c, n]);
261
- return /* @__PURE__ */ k("div", {
262
- className: s("autocomplete", v && `color-${v}`, y && "full-width", D),
263
- style: A,
264
- children: [
265
- b && /* @__PURE__ */ O("label", {
266
- htmlFor: g,
267
- className: s("field-label", P && "focused", me && "error", ae && "required"),
268
- children: b
269
- }),
270
- /* @__PURE__ */ k("div", {
271
- ref: R,
272
- className: s("input-wrapper", `field-${te}`, `field-${_}`, P && "focused", me && "error", h && "disabled"),
273
- onClick: () => pe.current?.focus(),
274
- children: [
275
- c && z.length > 0 && (w ? w(z, V) : /* @__PURE__ */ O("span", {
276
- className: "tags",
277
- children: z.map((e, t) => /* @__PURE__ */ O(le, {
278
- label: r(e),
279
- color: v,
280
- size: _,
281
- variant: "solid",
282
- closable: !0,
283
- onClose: () => V(t)
284
- }, i(e)))
285
- })),
286
- /* @__PURE__ */ O("input", {
287
- ref: pe,
288
- type: "text",
289
- className: "input",
290
- value: I,
291
- onChange: ge,
292
- onFocus: () => {
293
- F(!0), U();
294
- },
295
- onKeyDown: W,
296
- placeholder: z.length > 0 ? "" : m,
297
- disabled: h,
298
- id: g,
299
- "aria-expanded": P,
300
- "aria-haspopup": "listbox",
301
- "aria-invalid": me || void 0,
302
- autoComplete: "off"
303
- }),
304
- d && /* @__PURE__ */ O(se, {
305
- size: "sm",
306
- color: v
307
- }),
308
- ce && (z.length > 0 || I) && !d && !h && /* @__PURE__ */ O("button", {
309
- type: "button",
310
- className: "clear-btn clear-btn-base",
311
- onClick: G,
312
- tabIndex: -1,
313
- children: /* @__PURE__ */ O(a, {})
314
- })
315
- ]
316
- }),
317
- ee && /* @__PURE__ */ O("input", {
318
- type: "hidden",
319
- name: ee,
320
- value: z.map(i).join(",")
321
- }),
322
- /* @__PURE__ */ O(oe, {
323
- className: s("autocomplete-popover", v && `color-${v}`),
324
- open: P && (B.length > 0 || d || !!I),
325
- anchorRef: R,
326
- onClose: () => F(!1),
327
- matchWidth: !0,
328
- placement: "bottom-start",
329
- children: /* @__PURE__ */ O("div", {
330
- style: { maxHeight: ue },
331
- className: "dropdown",
332
- children: d ? /* @__PURE__ */ O("div", {
333
- className: "loading-msg",
334
- children: f
335
- }) : B.length === 0 ? /* @__PURE__ */ O("div", {
336
- className: "no-options",
337
- children: p
338
- }) : /* @__PURE__ */ O("div", {
339
- className: "options-list",
340
- role: "listbox",
341
- children: B.map((e, t) => {
342
- let n = t === ve, a = z.some((t) => i(t) === i(e));
343
- return /* @__PURE__ */ O("div", {
344
- className: s("option", n && "active", a && "selected"),
345
- onClick: () => _e(t),
346
- onMouseEnter: () => H(t),
347
- role: "option",
348
- "aria-selected": a,
349
- children: de ? de(e, n) : r(e)
350
- }, i(e));
351
- })
352
- })
353
- })
354
- }),
355
- (re || ne) && /* @__PURE__ */ O("div", {
356
- className: "bottom-row",
357
- children: re ? /* @__PURE__ */ O("span", {
358
- className: "field-error",
359
- role: "alert",
360
- children: re
361
- }) : /* @__PURE__ */ O("span", {
362
- className: "helper-text",
363
- children: ne
364
- })
365
- })
366
- ]
367
- });
368
- }
369
- //#endregion
370
- //#region src/i18n/frameworkTexts.ts
371
- function F() {
372
- let t = e();
373
- return C((e, n) => t?.t(e, n) ?? n, [t]);
374
- }
375
- function I() {
376
- let e = F();
377
- return T(() => ({
378
- today: e("mineralui.datePicker.today", "Today"),
379
- clear: e("mineralui.datePicker.clear", "Clear"),
380
- previousMonth: e("mineralui.datePicker.previousMonth", "Previous month"),
381
- nextMonth: e("mineralui.datePicker.nextMonth", "Next month")
382
- }), [e]);
383
- }
384
- function L() {
385
- let e = F();
386
- return T(() => ({
387
- today: e("mineralui.dateRangePicker.today", "Today"),
388
- clear: e("mineralui.dateRangePicker.clear", "Clear"),
389
- previousMonth: e("mineralui.dateRangePicker.previousMonth", "Previous month"),
390
- nextMonth: e("mineralui.dateRangePicker.nextMonth", "Next month"),
391
- rangeSubtitle: e("mineralui.dateRangePicker.rangeSubtitle", "Select start and end dates in one panel."),
392
- defaultRangePlaceholder: e("mineralui.dateRangePicker.defaultRangePlaceholder", "Select date range..."),
393
- presets: {
394
- today: e("mineralui.dateRangePicker.presets.today", "Today"),
395
- days2: e("mineralui.dateRangePicker.presets.days2", "2 days"),
396
- days3: e("mineralui.dateRangePicker.presets.days3", "3 days"),
397
- days7: e("mineralui.dateRangePicker.presets.days7", "7 days"),
398
- days14: e("mineralui.dateRangePicker.presets.days14", "14 days"),
399
- days31: e("mineralui.dateRangePicker.presets.days31", "31 days"),
400
- thisMonth: e("mineralui.dateRangePicker.presets.thisMonth", "This month"),
401
- previousMonth: e("mineralui.dateRangePicker.presets.previousMonth", "Previous month"),
402
- months2: e("mineralui.dateRangePicker.presets.months2", "2 months"),
403
- months3: e("mineralui.dateRangePicker.presets.months3", "3 months"),
404
- months6: e("mineralui.dateRangePicker.presets.months6", "6 months"),
405
- year1: e("mineralui.dateRangePicker.presets.year1", "1 year")
406
- }
407
- }), [e]);
408
- }
409
- //#endregion
410
- //#region src/utils/colorRgbVar.ts
411
- var R = {
412
- primary: "var(--mineral-primary-rgb)",
413
- neutral: "var(--mineral-neutral-rgb)",
414
- success: "var(--mineral-success-rgb)",
415
- error: "var(--mineral-error-rgb)",
416
- warning: "var(--mineral-warning-rgb)",
417
- info: "var(--mineral-info-rgb)",
418
- light: "var(--mineral-light-rgb)",
419
- dark: "var(--mineral-dark-color-rgb)",
420
- news: "var(--mineral-news-rgb)"
421
- };
422
- function pe(e) {
423
- return R[e ?? "primary"] ?? R.primary;
424
- }
425
- //#endregion
426
- //#region src/components/dropdowns/MDatePicker/MDatePicker.tsx
427
- var me = "Date is unavailable", z = "Invalid time";
428
- function B(e) {
429
- if (!e) return null;
430
- if (e instanceof Date) return isNaN(e.getTime()) ? null : new Date(e.getTime());
431
- let t = new Date(e);
432
- return isNaN(t.getTime()) ? null : t;
433
- }
434
- function he(e) {
435
- let t = e.replace(/DD/g, "dd").replace(/YYYY/g, "yyyy"), n = t.match(/dd|MM|yyyy/g), r = t.match(/[^dMy]/)?.[0], i = r === "/" || r === "." || r === "-" ? r : ".";
436
- switch (n?.join("/")) {
437
- case "MM/dd/yyyy": return {
438
- inputFormat: "MM/DD/YYYY",
439
- separator: i
440
- };
441
- case "yyyy/MM/dd": return {
442
- inputFormat: "YYYY/MM/DD",
443
- separator: i
444
- };
445
- default: return {
446
- inputFormat: "DD/MM/YYYY",
447
- separator: i
448
- };
449
- }
450
- }
451
- function ge(e, t) {
452
- return e === "12h" ? t ? "hh:mm:ss AM" : "hh:mm AM" : t ? "HH:MM:SS" : "HH:MM";
453
- }
454
- function _e(e, t, n, r, i, a) {
455
- return e || (n ? `${t} ${a ?? ge(r, i)}` : t);
456
- }
457
- function V(e, t) {
458
- if (!e) return "";
459
- let n = y(f(e), t.format);
460
- return t.withTime ? `${n} ${v(e.getHours(), e.getMinutes(), e.getSeconds(), t.showSeconds, t.timeFormat)}` : n;
461
- }
462
- function ve(e, t) {
463
- return e ? e.length <= 2 ? e : e.length <= 4 ? `${e.slice(0, 2)}:${e.slice(2)}` : t ? `${e.slice(0, 2)}:${e.slice(2, 4)}:${e.slice(4, 6)}` : `${e.slice(0, 2)}:${e.slice(2, 4)}` : "";
464
- }
465
- function H(e) {
466
- let t = e.toUpperCase().replace(/[^APM]/g, "");
467
- return t ? t.startsWith("AM") ? "AM" : t.startsWith("PM") ? "PM" : t.startsWith("A") ? "A" : t.startsWith("P") ? "P" : "" : "";
468
- }
469
- function U(e, t) {
470
- let n = e.trim();
471
- if (!n) return {
472
- datePart: "",
473
- timePart: ""
474
- };
475
- if (!t) return {
476
- datePart: n,
477
- timePart: ""
478
- };
479
- let r = n.indexOf(" ");
480
- return r === -1 ? {
481
- datePart: n,
482
- timePart: ""
483
- } : {
484
- datePart: n.slice(0, r).trim(),
485
- timePart: n.slice(r + 1).trim()
486
- };
487
- }
488
- function ye(e, t) {
489
- let n = e.toUpperCase(), r = d(n), i = r.slice(0, 8), a = t.withTime ? r.slice(8, 8 + (t.showSeconds ? 6 : 4)) : "", o = u(i, t.inputFormat, t.separator);
490
- if (!t.withTime) return {
491
- formatted: o,
492
- datePart: o,
493
- timePart: ""
494
- };
495
- let s = ve(a, t.showSeconds), c = t.timeFormat === "12h" ? H(n) : "", l = `${s}${c ? `${s ? " " : ""}${c}` : ""}`.trim();
496
- if (!o) return {
497
- formatted: l,
498
- datePart: "",
499
- timePart: l
500
- };
501
- let f = i.length === 8, p = /\s/.test(n.slice(o.length));
502
- return {
503
- formatted: l || f && p ? `${o} ${l}` : o,
504
- datePart: o,
505
- timePart: l
506
- };
507
- }
508
- function W(e, t) {
509
- return e ? v(e.getHours(), e.getMinutes(), e.getSeconds(), t, "24h") : "";
510
- }
511
- function G(e, t) {
512
- let { datePart: n, timePart: r } = U(e, t.withTime);
513
- if (!n && !r) return { status: "empty" };
514
- let i = c(n, {
515
- format: t.inputFormat,
516
- minDate: t.minDate ?? void 0,
517
- maxDate: t.maxDate ?? void 0
518
- });
519
- if (!i.valid) return i.error === "Incomplete date" ? {
520
- status: "partial",
521
- datePart: n,
522
- timePart: r
523
- } : {
524
- status: "invalid",
525
- datePart: n,
526
- timePart: r,
527
- result: i
528
- };
529
- let a = l(n, t.inputFormat);
530
- return a ? t.isDisabled(a) ? {
531
- status: "invalid",
532
- datePart: n,
533
- timePart: r,
534
- result: {
535
- valid: !1,
536
- error: me
537
- }
538
- } : t.withTime ? r ? g(r, t.timeFormat) ? {
539
- status: "valid",
540
- datePart: n,
541
- timePart: r,
542
- value: ne(a, r, {
543
- format: t.timeFormat,
544
- showSeconds: t.showSeconds
545
- })
546
- } : {
547
- status: "invalid",
548
- datePart: n,
549
- timePart: r,
550
- result: {
551
- valid: !1,
552
- error: z
553
- }
554
- } : {
555
- status: "valid",
556
- datePart: n,
557
- timePart: "",
558
- value: ne(a, "", {
559
- format: t.timeFormat,
560
- showSeconds: t.showSeconds
561
- })
562
- } : {
563
- status: "valid",
564
- datePart: n,
565
- timePart: "",
566
- value: f(a)
567
- } : {
568
- status: "invalid",
569
- datePart: n,
570
- timePart: r,
571
- result: {
572
- valid: !1,
573
- error: "Invalid date"
574
- }
575
- };
576
- }
577
- function be(e) {
578
- let t = e.hours >= 12 ? "PM" : "AM";
579
- return {
580
- hours: e.hours % 12 || 12,
581
- minutes: e.minutes,
582
- seconds: e.seconds,
583
- meridiem: t
584
- };
585
- }
586
- function xe(e, t) {
587
- return t === "AM" ? e === 12 ? 0 : e : e === 12 ? 12 : e + 12;
588
- }
589
- function Se({ value: e, defaultValue: n, onChange: r, format: a = "dd.MM.yyyy", locale: c, min: l, max: u, disabledDates: m, placeholder: te, disabled: y = !1, readOnly: x = !1, name: S, id: se, variant: ce = "outlined", size: le = "md", color: A, label: j, helperText: M, errorText: N, error: P = !1, required: F = !1, clearable: L = !1, withTime: R = !1, validateOnBlur: me = !0, validateOnChange: ge = !1, onValidationChange: ve, timeFormat: H = "24h", showSeconds: U = !1, minuteStep: Se = 1, timePlaceholder: Ce, inline: we = !1, showTodayButton: Te = !0, firstDayOfWeek: Ee = 1, fullWidth: De = !1, className: Oe, style: ke }) {
590
- let q = de(c), J = I(), { inputFormat: Ae, separator: je } = T(() => he(a), [a]), [Me, Ne] = E(!1), [Pe, Fe] = E(() => B(n)), [Ie, Le] = E({ valid: !0 }), [Re, ze] = E(!1), Y = e === void 0 ? Pe : B(e), [Be, Ve] = E(() => V(Y, {
591
- format: a,
592
- withTime: R,
593
- timeFormat: H,
594
- showSeconds: U
595
- })), [He, Ue] = E(() => W(Y, U)), [We, Ge] = E(() => {
596
- let e = Y ? f(Y) : /* @__PURE__ */ new Date();
597
- return new Date(e.getFullYear(), e.getMonth(), 1);
598
- }), [Ke, qe] = E("days"), Je = fe(null), Ye = Y?.getTime() ?? null, Xe = B(l), Ze = B(u), Qe = P || Re && !Ie.valid, $e = N || (Re && !Ie.valid ? Ie.error : void 0), et = ae(q, Ee), tt = h(q);
599
- w(() => {
600
- if (Ve(V(Y, {
601
- format: a,
602
- withTime: R,
603
- timeFormat: H,
604
- showSeconds: U
605
- })), Ue(W(Y, U)), Y) {
606
- let e = f(Y);
607
- Ge(new Date(e.getFullYear(), e.getMonth(), 1));
608
- }
609
- }, [
610
- a,
611
- Ye,
612
- U,
613
- H,
614
- R
615
- ]);
616
- let X = C((e) => ee(e, Xe, Ze) ? Array.isArray(m) ? m.some((t) => b(t, e)) : typeof m == "function" ? m(e) : !1 : !0, [
617
- m,
618
- Ze,
619
- Xe
620
- ]), Z = C((e) => {
621
- Le(e), ve?.(e);
622
- }, [ve]), Q = C((t) => {
623
- e === void 0 && Fe(t), r?.(t);
624
- }, [r, e]), nt = T(() => G(Be, {
625
- inputFormat: Ae,
626
- minDate: Xe,
627
- maxDate: Ze,
628
- withTime: R,
629
- timeFormat: H,
630
- showSeconds: U,
631
- isDisabled: X
632
- }), [
633
- Ae,
634
- Be,
635
- X,
636
- Ze,
637
- Xe,
638
- U,
639
- H,
640
- R
641
- ]), rt = T(() => nt.status === "valid" ? f(nt.value) : Y ? f(Y) : null, [nt, Y]), $ = T(() => R ? g(nt.status !== "empty" && nt.timePart ? nt.timePart : He || W(Y, U), H) ?? {
642
- hours: 0,
643
- minutes: 0,
644
- seconds: 0
645
- } : null, [
646
- He,
647
- nt,
648
- Y,
649
- U,
650
- H,
651
- R
652
- ]), it = C((e) => {
653
- let t = ye(e.target.value, {
654
- inputFormat: Ae,
655
- separator: je,
656
- withTime: R,
657
- timeFormat: H,
658
- showSeconds: U
659
- });
660
- Ve(t.formatted), Ue(t.timePart);
661
- let n = G(t.formatted, {
662
- inputFormat: Ae,
663
- minDate: Xe,
664
- maxDate: Ze,
665
- withTime: R,
666
- timeFormat: H,
667
- showSeconds: U,
668
- isDisabled: X
669
- });
670
- if (n.status === "empty") {
671
- Z({ valid: !0 }), Q(null);
672
- return;
673
- }
674
- if (n.status === "invalid" && ge) Z(n.result);
675
- else if (n.status === "valid") {
676
- Z({ valid: !0 }), Ge(new Date(n.value.getFullYear(), n.value.getMonth(), 1));
677
- let t = U ? 6 : 4, r = R ? d(e.target.value).slice(8).length : 0;
678
- (!R || r >= t) && Q(n.value);
679
- }
680
- }, [
681
- Q,
682
- Z,
683
- Ae,
684
- X,
685
- Ze,
686
- Xe,
687
- je,
688
- U,
689
- H,
690
- ge,
691
- R
692
- ]), at = C(() => {
693
- ze(!0);
694
- let e = G(Be, {
695
- inputFormat: Ae,
696
- minDate: Xe,
697
- maxDate: Ze,
698
- withTime: R,
699
- timeFormat: H,
700
- showSeconds: U,
701
- isDisabled: X
702
- });
703
- if (e.status === "empty") {
704
- Z({ valid: !0 });
705
- return;
706
- }
707
- if (e.status === "partial") {
708
- me && Z({
709
- valid: !1,
710
- error: "Incomplete date"
711
- });
712
- return;
713
- }
714
- if (e.status === "invalid") {
715
- if (R && e.result.error === z && e.datePart) {
716
- let t = v(0, 0, 0, U, H), n = G(`${e.datePart} ${t}`, {
717
- inputFormat: Ae,
718
- minDate: Xe,
719
- maxDate: Ze,
720
- withTime: R,
721
- timeFormat: H,
722
- showSeconds: U,
723
- isDisabled: X
724
- });
725
- if (n.status === "valid") {
726
- Z({ valid: !0 }), Ve(V(n.value, {
727
- format: a,
728
- withTime: R,
729
- timeFormat: H,
730
- showSeconds: U
731
- })), Ue(W(n.value, U)), Q(n.value);
732
- return;
733
- }
734
- }
735
- me && Z(e.result);
736
- return;
737
- }
738
- Z({ valid: !0 }), Ve(V(e.value, {
739
- format: a,
740
- withTime: R,
741
- timeFormat: H,
742
- showSeconds: U
743
- })), Ue(W(e.value, U)), Q(e.value);
744
- }, [
745
- Q,
746
- Z,
747
- a,
748
- Ae,
749
- Be,
750
- X,
751
- Ze,
752
- Xe,
753
- U,
754
- H,
755
- me,
756
- R
757
- ]), ot = C((e) => {
758
- [
759
- "Backspace",
760
- "Delete",
761
- "Tab",
762
- "ArrowLeft",
763
- "ArrowRight",
764
- "Home",
765
- "End",
766
- "Enter"
767
- ].includes(e.key) || e.ctrlKey || e.metaKey || (R ? /^[0-9\s:./-APMapm]$/ : /^[0-9./-]$/).test(e.key) || e.preventDefault();
768
- }, [R]), st = C(() => {
769
- Ve(""), Ue(""), ze(!1), Z({ valid: !0 }), Q(null);
770
- }, [Q, Z]), ct = C((e) => {
771
- e.preventDefault(), e.stopPropagation(), !(y || x || we) && Ne((e) => !e);
772
- }, [
773
- y,
774
- we,
775
- x
776
- ]), lt = C((e) => {
777
- if (X(e)) return;
778
- let t = R ? He || v(0, 0, 0, U, H) : "", n = R ? ne(e, t, {
779
- format: H,
780
- showSeconds: U
781
- }) : f(e);
782
- ze(!0), Z({ valid: !0 }), Ue(t), Ve(V(n, {
783
- format: a,
784
- withTime: R,
785
- timeFormat: H,
786
- showSeconds: U
787
- })), Ge(new Date(e.getFullYear(), e.getMonth(), 1)), Q(n), !R && !we && Ne(!1);
788
- }, [
789
- Q,
790
- He,
791
- Z,
792
- a,
793
- we,
794
- X,
795
- U,
796
- H,
797
- R
798
- ]), ut = C(() => {
799
- let e = f(/* @__PURE__ */ new Date());
800
- X(e) || lt(e);
801
- }, [lt, X]), dt = T(() => {
802
- if (!R) return [];
803
- let e = [], t = H === "12h" ? 12 : 23, n = +(H === "12h");
804
- for (let r = n; r <= t; r += 1) e.push(r);
805
- return e;
806
- }, [H, R]), ft = T(() => {
807
- if (!R) return [];
808
- let e = [];
809
- for (let t = 0; t < 60; t += Se) e.push(t);
810
- return e;
811
- }, [Se, R]), pt = T(() => {
812
- if (!R || !U) return [];
813
- let e = [];
814
- for (let t = 0; t < 60; t += 1) e.push(t);
815
- return e;
816
- }, [U, R]), mt = C((e, t, n = 0) => {
817
- let r = v(e, t, n, U, H), i = rt;
818
- if (ze(!0), Ue(r), !i) {
819
- Ve(r);
820
- return;
821
- }
822
- let o = ne(i, r, {
823
- format: H,
824
- showSeconds: U
825
- });
826
- Z({ valid: !0 }), Ve(V(o, {
827
- format: a,
828
- withTime: R,
829
- timeFormat: H,
830
- showSeconds: U
831
- })), Q(o);
832
- }, [
833
- Q,
834
- rt,
835
- Z,
836
- a,
837
- U,
838
- H,
839
- R
840
- ]), ht = C((e) => {
841
- mt(xe($ ? be($).hours : 12, e), $?.minutes ?? 0, $?.seconds ?? 0);
842
- }, [$, mt]), gt = T(() => {
843
- let e = We.getFullYear(), t = We.getMonth(), n = _(e, t), r = p(e, t);
844
- Ee === 1 && (r = r === 0 ? 6 : r - 1);
845
- let i = [], a = t === 0 ? 11 : t - 1, o = t === 0 ? e - 1 : e, s = _(o, a);
846
- for (let e = r - 1; e >= 0; --e) i.push({
847
- date: new Date(o, a, s - e),
848
- currentMonth: !1
849
- });
850
- for (let r = 1; r <= n; r += 1) i.push({
851
- date: new Date(e, t, r),
852
- currentMonth: !0
853
- });
854
- let c = 42 - i.length, l = t === 11 ? 0 : t + 1, u = t === 11 ? e + 1 : e;
855
- for (let e = 1; e <= c; e += 1) i.push({
856
- date: new Date(u, l, e),
857
- currentMonth: !1
858
- });
859
- return i;
860
- }, [Ee, We]), _t = f(/* @__PURE__ */ new Date()), vt = Y ? f(Y) : rt, yt = () => /* @__PURE__ */ k("div", {
861
- className: "calendar",
862
- children: [
863
- /* @__PURE__ */ k("div", {
864
- className: "calendar-header",
865
- children: [
866
- /* @__PURE__ */ O("button", {
867
- type: "button",
868
- className: "nav-btn",
869
- onClick: () => Ge(ie(We, -1)),
870
- "aria-label": J.previousMonth,
871
- children: /* @__PURE__ */ O(t, {})
872
- }),
873
- /* @__PURE__ */ k("button", {
874
- type: "button",
875
- className: "header-title",
876
- onClick: () => qe((e) => e === "days" ? "months" : "days"),
877
- children: [
878
- tt[We.getMonth()],
879
- " ",
880
- We.getFullYear()
881
- ]
882
- }),
883
- /* @__PURE__ */ O("button", {
884
- type: "button",
885
- className: "nav-btn",
886
- onClick: () => Ge(ie(We, 1)),
887
- "aria-label": J.nextMonth,
888
- children: /* @__PURE__ */ O(o, {})
889
- })
890
- ]
891
- }),
892
- Ke === "days" ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("div", {
893
- className: "day-names",
894
- children: et.map((e) => /* @__PURE__ */ O("span", {
895
- className: "day-name",
896
- children: e
897
- }, e))
898
- }), /* @__PURE__ */ O("div", {
899
- className: "day-grid",
900
- children: gt.map(({ date: e, currentMonth: t }, n) => {
901
- let r = vt ? b(e, vt) : !1, i = b(e, _t), a = X(e);
902
- return /* @__PURE__ */ O("button", {
903
- type: "button",
904
- className: s("day", !t && "other-month", i && "today", r && "selected", a && "disabled"),
905
- onClick: () => lt(e),
906
- disabled: a,
907
- tabIndex: -1,
908
- children: e.getDate()
909
- }, `${e.toISOString()}-${n}`);
910
- })
911
- })] }) : /* @__PURE__ */ O("div", {
912
- className: "month-grid",
913
- children: tt.map((e, t) => /* @__PURE__ */ O("button", {
914
- type: "button",
915
- className: s("month-cell", We.getMonth() === t && "selected"),
916
- onClick: () => {
917
- Ge(new Date(We.getFullYear(), t, 1)), qe("days");
918
- },
919
- children: e.slice(0, 3)
920
- }, e))
921
- }),
922
- Te && /* @__PURE__ */ O("div", {
923
- className: "footer",
924
- children: /* @__PURE__ */ O("button", {
925
- type: "button",
926
- className: "today-btn",
927
- onClick: ut,
928
- children: J.today
929
- })
930
- })
931
- ]
932
- }), bt = () => {
933
- if (!R) return null;
934
- let e = $ ? be($) : null;
935
- return /* @__PURE__ */ k("div", {
936
- className: "date-picker-time-panel",
937
- children: [/* @__PURE__ */ O("div", {
938
- className: "date-picker-time-header",
939
- children: "Time"
940
- }), /* @__PURE__ */ k("div", {
941
- className: "date-picker-time-columns",
942
- children: [
943
- /* @__PURE__ */ O(K, {
944
- items: dt,
945
- selected: H === "12h" ? e?.hours : $?.hours,
946
- onSelect: (t) => mt(H === "12h" ? xe(t, e?.meridiem ?? "AM") : t, $?.minutes ?? 0, $?.seconds ?? 0),
947
- label: "Hr"
948
- }),
949
- /* @__PURE__ */ O(K, {
950
- items: ft,
951
- selected: $?.minutes,
952
- onSelect: (e) => mt($?.hours ?? 0, e, $?.seconds ?? 0),
953
- label: "Min"
954
- }),
955
- U && /* @__PURE__ */ O(K, {
956
- items: pt,
957
- selected: $?.seconds,
958
- onSelect: (e) => mt($?.hours ?? 0, $?.minutes ?? 0, e),
959
- label: "Sec"
960
- }),
961
- H === "12h" && /* @__PURE__ */ O(K, {
962
- items: ["AM", "PM"],
963
- selected: e?.meridiem,
964
- onSelect: ht,
965
- label: "AM/PM"
966
- })
967
- ]
968
- })]
969
- });
970
- }, xt = () => /* @__PURE__ */ k("div", {
971
- className: s("date-picker-popover-content", R && "with-time"),
972
- children: [yt(), bt()]
973
- }), St = R ? H === "12h" ? U ? 22 : 19 : U ? 19 : 16 : 10, Ct = _e(te, a, R, H, U, Ce);
974
- return we ? /* @__PURE__ */ k("div", {
975
- className: s("date-picker", A && `color-${A}`, De && "full-width", Oe),
976
- style: ke,
977
- children: [
978
- /* @__PURE__ */ O(ue, {
979
- value: Be,
980
- onChange: it,
981
- onBlur: at,
982
- onKeyDown: ot,
983
- onClear: st,
984
- type: "text",
985
- inputMode: R ? "text" : "numeric",
986
- autoComplete: "off",
987
- maxLength: St,
988
- placeholder: Ct,
989
- disabled: y,
990
- readOnly: x,
991
- id: se,
992
- variant: ce,
993
- size: le,
994
- color: A,
995
- label: j,
996
- helperText: M,
997
- error: Qe,
998
- errorText: $e,
999
- required: F,
1000
- clearable: L,
1001
- fullWidth: De
1002
- }),
1003
- xt(),
1004
- S && Y && /* @__PURE__ */ O("input", {
1005
- type: "hidden",
1006
- name: S,
1007
- value: re(Y, R, U)
1008
- })
1009
- ]
1010
- }) : /* @__PURE__ */ k("div", {
1011
- className: s("date-picker", A && `color-${A}`, De && "full-width", Oe),
1012
- style: ke,
1013
- children: [
1014
- /* @__PURE__ */ O("div", {
1015
- ref: Je,
1016
- className: "date-picker-input-anchor",
1017
- children: /* @__PURE__ */ O(ue, {
1018
- value: Be,
1019
- onChange: it,
1020
- onBlur: at,
1021
- onKeyDown: ot,
1022
- onClear: st,
1023
- type: "text",
1024
- inputMode: R ? "text" : "numeric",
1025
- autoComplete: "off",
1026
- maxLength: St,
1027
- placeholder: Ct,
1028
- disabled: y,
1029
- readOnly: x,
1030
- id: se,
1031
- variant: ce,
1032
- size: le,
1033
- color: A,
1034
- label: j,
1035
- helperText: M,
1036
- error: Qe,
1037
- errorText: $e,
1038
- required: F,
1039
- clearable: L,
1040
- fullWidth: De,
1041
- endIcon: /* @__PURE__ */ O("button", {
1042
- type: "button",
1043
- className: "date-picker-toggle",
1044
- onMouseDown: (e) => e.preventDefault(),
1045
- onClick: ct,
1046
- "aria-label": "Open calendar",
1047
- disabled: y || x,
1048
- children: /* @__PURE__ */ O(i, {})
1049
- })
1050
- })
1051
- }),
1052
- S && Y && /* @__PURE__ */ O("input", {
1053
- type: "hidden",
1054
- name: S,
1055
- value: re(Y, R, U)
1056
- }),
1057
- /* @__PURE__ */ O(oe, {
1058
- className: "date-picker-popover",
1059
- style: { "--color-rgb": pe(A) },
1060
- open: Me,
1061
- anchorRef: Je,
1062
- onClose: () => Ne(!1),
1063
- placement: "bottom-start",
1064
- children: xt()
1065
- })
1066
- ]
1067
- });
1068
- }
1069
- function K({ items: e, selected: t, onSelect: n, label: r }) {
1070
- let i = fe(null);
1071
- w(() => {
1072
- if (t === void 0 || !i.current) return;
1073
- let e = i.current.querySelector(`[data-value="${t}"]`);
1074
- if (e) {
1075
- let t = i.current;
1076
- t.scrollTop = e.offsetTop - t.clientHeight / 2 + e.offsetHeight / 2;
1077
- }
1078
- }, [t]);
1079
- let a = (e) => typeof e == "number" ? e.toString().padStart(2, "0") : e;
1080
- return /* @__PURE__ */ k("div", {
1081
- className: "date-picker-time-column",
1082
- children: [/* @__PURE__ */ O("div", {
1083
- className: "date-picker-time-column-label",
1084
- children: r
1085
- }), /* @__PURE__ */ O("div", {
1086
- ref: i,
1087
- className: "date-picker-time-column-list",
1088
- children: e.map((e) => /* @__PURE__ */ O("button", {
1089
- type: "button",
1090
- "data-value": e,
1091
- className: s("date-picker-time-column-item", e === t && "selected"),
1092
- onClick: () => n(e),
1093
- children: a(e)
1094
- }, e))
1095
- })]
1096
- });
1097
- }
1098
- //#endregion
1099
- //#region src/components/dropdowns/MTimePicker/MTimePicker.tsx
1100
- function Ce(e) {
1101
- let t = e.hours >= 12 ? "PM" : "AM";
1102
- return {
1103
- hours: e.hours % 12 || 12,
1104
- minutes: e.minutes,
1105
- seconds: e.seconds,
1106
- meridiem: t
1107
- };
1108
- }
1109
- function we(e, t) {
1110
- return t === "AM" ? e === 12 ? 0 : e : e === 12 ? 12 : e + 12;
1111
- }
1112
- function Te(e, t, n, r, i) {
1113
- if (i === "24h") return m(e, t, n, r);
1114
- let a = Ce({
1115
- hours: e,
1116
- minutes: t,
1117
- seconds: n
1118
- }), o = `${a.hours.toString().padStart(2, "0")}:${a.minutes.toString().padStart(2, "0")}`;
1119
- return `${r ? `${o}:${a.seconds.toString().padStart(2, "0")}` : o} ${a.meridiem}`;
1120
- }
1121
- function Ee(e, t) {
1122
- if (t === "24h") return te(e);
1123
- let n = e.trim().toUpperCase().match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?\s*(AM|PM)$/);
1124
- if (n) {
1125
- let e = parseInt(n[1], 10), t = parseInt(n[2], 10), r = n[3] ? parseInt(n[3], 10) : 0, i = n[4];
1126
- return e < 1 || e > 12 || t > 59 || r > 59 ? null : {
1127
- hours: we(e, i),
1128
- minutes: t,
1129
- seconds: r
1130
- };
1131
- }
1132
- return te(e);
1133
- }
1134
- function De(e, t) {
1135
- return e.hours === t.hours ? e.minutes === t.minutes ? e.seconds - t.seconds : e.minutes - t.minutes : e.hours - t.hours;
1136
- }
1137
- function Oe(e, t, n) {
1138
- return (!t || De(e, t) >= 0) && (!n || De(e, n) <= 0);
1139
- }
1140
- function ke({ value: e, defaultValue: t, onChange: n, format: i = "24h", showSeconds: o = !1, minuteStep: c = 1, min: l, max: u, placeholder: d, disabled: f = !1, readOnly: p = !1, name: m, id: h, variant: ee = "outlined", size: g = "md", color: te, label: _, helperText: v, errorText: y, error: b = !1, required: ne = !1, clearable: re = !1, fullWidth: ie = !1, className: ae, style: x }) {
1141
- let [S, se] = E(!1), [ce, le] = E(t ?? ""), ue = fe(null), de = e === void 0 ? ce : e, w = b || !!y, D = Ee(de, i), A = Ee(l ?? "", i), j = Ee(u ?? "", i), M = D ? Ce(D) : null, N = D ? Te(D.hours, D.minutes, D.seconds, o, i) : de, P = T(() => {
1142
- let e = [], t = i === "12h" ? 12 : 23, n = +(i === "12h");
1143
- for (let r = n; r <= t; r++) e.push(r);
1144
- return e;
1145
- }, [i]), F = T(() => {
1146
- let e = [];
1147
- for (let t = 0; t < 60; t += c) e.push(t);
1148
- return e;
1149
- }, [c]), I = T(() => {
1150
- if (!o) return [];
1151
- let e = [];
1152
- for (let t = 0; t < 60; t++) e.push(t);
1153
- return e;
1154
- }, [o]), L = C((e, t, n = 0) => Oe({
1155
- hours: e,
1156
- minutes: t,
1157
- seconds: n
1158
- }, A, j), [j, A]), R = C((t, r, a = 0) => {
1159
- if (!L(t, r, a)) return;
1160
- let s = Te(t, r, a, o, i);
1161
- e === void 0 && le(s), n?.(s);
1162
- }, [
1163
- i,
1164
- L,
1165
- n,
1166
- o,
1167
- e
1168
- ]), pe = C((t) => {
1169
- let n = t.target.value;
1170
- e === void 0 && le(n);
1171
- }, [e]), me = C(() => {
1172
- let t = Ee(de, i);
1173
- if (t && Oe(t, A, j)) {
1174
- let r = Te(t.hours, t.minutes, t.seconds, o, i);
1175
- e === void 0 && le(r), n?.(r);
1176
- }
1177
- }, [
1178
- de,
1179
- i,
1180
- j,
1181
- A,
1182
- n,
1183
- o,
1184
- e
1185
- ]), z = C((e) => {
1186
- let t = M?.hours ?? 12, n = D?.minutes ?? 0, r = D?.seconds ?? 0;
1187
- R(we(t, e), n, r);
1188
- }, [
1189
- M?.hours,
1190
- R,
1191
- D?.minutes,
1192
- D?.seconds
1193
- ]), B = C((t) => {
1194
- t.stopPropagation(), e === void 0 && le(""), n?.("");
1195
- }, [n, e]);
1196
- return /* @__PURE__ */ k("div", {
1197
- className: s("time picker", te && `color-${te}`, ie && "full-width", ae),
1198
- style: x,
1199
- children: [
1200
- _ && /* @__PURE__ */ O("label", {
1201
- htmlFor: h,
1202
- className: s("field-label", S && "focused", w && "error", ne && "required"),
1203
- children: _
1204
- }),
1205
- /* @__PURE__ */ k("div", {
1206
- ref: ue,
1207
- className: s("time trigger", `field-${ee}`, `field-${g}`, S && "focused", w && "error", f && "disabled"),
1208
- onClick: () => !f && !p && se(!0),
1209
- children: [
1210
- /* @__PURE__ */ O("span", {
1211
- className: "time icon",
1212
- children: /* @__PURE__ */ O(r, {})
1213
- }),
1214
- /* @__PURE__ */ O("input", {
1215
- type: "text",
1216
- className: "time input",
1217
- value: N,
1218
- onChange: pe,
1219
- onBlur: me,
1220
- placeholder: d ?? (i === "12h" ? o ? "hh:mm:ss AM" : "hh:mm AM" : o ? "HH:MM:SS" : "HH:MM"),
1221
- disabled: f,
1222
- readOnly: p,
1223
- id: h,
1224
- "aria-invalid": w || void 0
1225
- }),
1226
- re && de && !f && /* @__PURE__ */ O("button", {
1227
- type: "button",
1228
- className: "time clear clear-btn-base",
1229
- onClick: B,
1230
- tabIndex: -1,
1231
- "aria-label": "Clear time",
1232
- children: /* @__PURE__ */ O(a, {})
1233
- })
1234
- ]
1235
- }),
1236
- m && /* @__PURE__ */ O("input", {
1237
- type: "hidden",
1238
- name: m,
1239
- value: N
1240
- }),
1241
- /* @__PURE__ */ O(oe, {
1242
- className: "time picker popover",
1243
- open: S,
1244
- anchorRef: ue,
1245
- onClose: () => se(!1),
1246
- placement: "bottom-start",
1247
- children: /* @__PURE__ */ k("div", {
1248
- className: "time columns",
1249
- children: [
1250
- /* @__PURE__ */ O(q, {
1251
- items: P,
1252
- selected: i === "12h" ? M?.hours : D?.hours,
1253
- onSelect: (e) => R(i === "12h" ? we(e, M?.meridiem ?? "AM") : e, D?.minutes ?? 0, D?.seconds ?? 0),
1254
- isDisabled: (e) => !L(i === "12h" ? we(e, M?.meridiem ?? "AM") : e, D?.minutes ?? 0, D?.seconds ?? 0),
1255
- label: "Hr"
1256
- }),
1257
- /* @__PURE__ */ O(q, {
1258
- items: F,
1259
- selected: D?.minutes,
1260
- onSelect: (e) => R(D?.hours ?? 0, e, D?.seconds ?? 0),
1261
- isDisabled: (e) => !L(D?.hours ?? 0, e, D?.seconds ?? 0),
1262
- label: "Min"
1263
- }),
1264
- o && /* @__PURE__ */ O(q, {
1265
- items: I,
1266
- selected: D?.seconds,
1267
- onSelect: (e) => R(D?.hours ?? 0, D?.minutes ?? 0, e),
1268
- isDisabled: (e) => !L(D?.hours ?? 0, D?.minutes ?? 0, e),
1269
- label: "Sec"
1270
- }),
1271
- i === "12h" && /* @__PURE__ */ O(q, {
1272
- items: ["AM", "PM"],
1273
- selected: M?.meridiem,
1274
- onSelect: z,
1275
- label: "AM/PM"
1276
- })
1277
- ]
1278
- })
1279
- }),
1280
- (y || v) && /* @__PURE__ */ O("div", {
1281
- className: "time bottom",
1282
- children: y ? /* @__PURE__ */ O("span", {
1283
- className: "field-error",
1284
- role: "alert",
1285
- children: y
1286
- }) : /* @__PURE__ */ O("span", {
1287
- className: "time helper",
1288
- children: v
1289
- })
1290
- })
1291
- ]
1292
- });
1293
- }
1294
- function q({ items: e, selected: t, onSelect: n, isDisabled: r, label: i }) {
1295
- let a = fe(null);
1296
- w(() => {
1297
- if (t === void 0 || !a.current) return;
1298
- let e = a.current.querySelector(`[data-value="${t}"]`);
1299
- if (e) {
1300
- let t = a.current;
1301
- t.scrollTop = e.offsetTop - t.clientHeight / 2 + e.offsetHeight / 2;
1302
- }
1303
- }, [t]);
1304
- let o = (e) => typeof e == "number" ? e.toString().padStart(2, "0") : e;
1305
- return /* @__PURE__ */ k("div", {
1306
- className: "time column",
1307
- children: [/* @__PURE__ */ O("div", {
1308
- className: "time column label",
1309
- children: i
1310
- }), /* @__PURE__ */ O("div", {
1311
- ref: a,
1312
- className: "time column list",
1313
- children: e.map((e) => {
1314
- let i = r?.(e) ?? !1;
1315
- return /* @__PURE__ */ O("button", {
1316
- type: "button",
1317
- "data-value": e,
1318
- className: s("time column item", e === t && "selected", i && "disabled"),
1319
- onClick: () => n(e),
1320
- disabled: i,
1321
- children: o(e)
1322
- }, e);
1323
- })
1324
- })]
1325
- });
1326
- }
1327
- //#endregion
1328
- //#region src/components/dropdowns/MDateRangePicker/MDateRangePicker.tsx
1329
- function J(e) {
1330
- if (!e) return null;
1331
- if (e instanceof Date) return f(e);
1332
- let t = new Date(e);
1333
- return isNaN(t.getTime()) ? null : f(t);
1334
- }
1335
- function Ae(e, t) {
1336
- return e.getTime() <= t.getTime() ? {
1337
- start: e,
1338
- end: t
1339
- } : {
1340
- start: t,
1341
- end: e
1342
- };
1343
- }
1344
- function je(e, t, n) {
1345
- if (!t || !n) return !1;
1346
- let r = e.getTime();
1347
- return r > t.getTime() && r < n.getTime();
1348
- }
1349
- function Me(e, t, n) {
1350
- return e && t ? `${y(e, n)} - ${y(t, n)}` : e ? `${y(e, n)} - ...` : "";
1351
- }
1352
- function Ne(e) {
1353
- return new Date(e.getFullYear(), e.getMonth(), 1);
1354
- }
1355
- function Pe(e) {
1356
- return new Date(e.getFullYear(), e.getMonth() + 1, 0);
1357
- }
1358
- function Fe(e) {
1359
- let t = f(/* @__PURE__ */ new Date());
1360
- return t.setDate(t.getDate() - (e - 1)), t;
1361
- }
1362
- function Ie(e) {
1363
- let t = f(/* @__PURE__ */ new Date());
1364
- return new Date(t.getFullYear(), t.getMonth() - e, t.getDate());
1365
- }
1366
- function Le(e) {
1367
- let t = f(/* @__PURE__ */ new Date()), n = new Date(t.getFullYear(), t.getMonth() - 1, 1);
1368
- return [
1369
- {
1370
- label: e.presets.today,
1371
- value: {
1372
- start: t,
1373
- end: t
1374
- }
1375
- },
1376
- {
1377
- label: e.presets.days2,
1378
- value: {
1379
- start: Fe(2),
1380
- end: t
1381
- }
1382
- },
1383
- {
1384
- label: e.presets.days3,
1385
- value: {
1386
- start: Fe(3),
1387
- end: t
1388
- }
1389
- },
1390
- {
1391
- label: e.presets.days7,
1392
- value: {
1393
- start: Fe(7),
1394
- end: t
1395
- }
1396
- },
1397
- {
1398
- label: e.presets.days14,
1399
- value: {
1400
- start: Fe(14),
1401
- end: t
1402
- }
1403
- },
1404
- {
1405
- label: e.presets.days31,
1406
- value: {
1407
- start: Fe(31),
1408
- end: t
1409
- }
1410
- },
1411
- {
1412
- label: e.presets.thisMonth,
1413
- value: {
1414
- start: Ne(t),
1415
- end: Pe(t)
1416
- }
1417
- },
1418
- {
1419
- label: e.presets.previousMonth,
1420
- value: {
1421
- start: Ne(n),
1422
- end: Pe(n)
1423
- }
1424
- },
1425
- {
1426
- label: e.presets.months2,
1427
- value: {
1428
- start: Ie(2),
1429
- end: t
1430
- }
1431
- },
1432
- {
1433
- label: e.presets.months3,
1434
- value: {
1435
- start: Ie(3),
1436
- end: t
1437
- }
1438
- },
1439
- {
1440
- label: e.presets.months6,
1441
- value: {
1442
- start: Ie(6),
1443
- end: t
1444
- }
1445
- },
1446
- {
1447
- label: e.presets.year1,
1448
- value: {
1449
- start: Ie(12),
1450
- end: t
1451
- }
1452
- }
1453
- ];
1454
- }
1455
- function Re(e, t) {
1456
- let n = e.getFullYear(), r = e.getMonth(), i = _(n, r), a = p(n, r);
1457
- t === 1 && (a = a === 0 ? 6 : a - 1);
1458
- let o = [], s = r === 0 ? 11 : r - 1, c = r === 0 ? n - 1 : n, l = _(c, s);
1459
- for (let e = a - 1; e >= 0; --e) o.push({
1460
- date: new Date(c, s, l - e),
1461
- currentMonth: !1
1462
- });
1463
- for (let e = 1; e <= i; e += 1) o.push({
1464
- date: new Date(n, r, e),
1465
- currentMonth: !0
1466
- });
1467
- let u = 42 - o.length, d = r === 11 ? 0 : r + 1, f = r === 11 ? n + 1 : n;
1468
- for (let e = 1; e <= u; e += 1) o.push({
1469
- date: new Date(f, d, e),
1470
- currentMonth: !1
1471
- });
1472
- return o;
1473
- }
1474
- function ze({ value: e, defaultValue: n, onChange: r, format: c = "dd.MM.yyyy", locale: l, min: u, max: d, disabledDates: p, placeholder: m, disabled: g = !1, readOnly: te = !1, name: _, id: v, variant: ne = "outlined", size: re = "md", color: x, label: S, helperText: se, errorText: ce, error: le = !1, required: ue = !1, clearable: D = !1, inline: A = !1, showTodayButton: j = !0, presets: M = !1, presetsSidebar: N = !1, firstDayOfWeek: P = 1, fullWidth: F = !1, allowSameDay: I = !0, className: R, style: me }) {
1475
- let z = de(l), B = e ? {
1476
- start: J(e.start),
1477
- end: J(e.end)
1478
- } : null, [he, ge] = E(() => ({
1479
- start: J(n?.start),
1480
- end: J(n?.end)
1481
- })), [_e, V] = E(null), [ve, H] = E(!1), U = fe(null), ye = B ?? he, W = ye.start, G = ye.end, be = J(u), xe = J(d), Se = le || !!ce, K = L(), Ce = ae(z, P), we = h(z), Te = T(() => M === !0 || N && !M ? Le(K) : Array.isArray(M) ? M : [], [
1482
- M,
1483
- N,
1484
- K
1485
- ]), [Ee, De] = E(() => {
1486
- let e = W ?? /* @__PURE__ */ new Date();
1487
- return new Date(e.getFullYear(), e.getMonth(), 1);
1488
- }), Oe = W?.getTime() ?? null;
1489
- w(() => {
1490
- if (!Oe) return;
1491
- let e = new Date(Oe);
1492
- De(new Date(e.getFullYear(), e.getMonth(), 1));
1493
- }, [Oe]);
1494
- let ke = C((e) => ee(e, be, xe) ? Array.isArray(p) ? p.some((t) => b(t, e)) : typeof p == "function" ? p(e) : !1 : !0, [
1495
- p,
1496
- xe,
1497
- be
1498
- ]), q = C((t) => {
1499
- e === void 0 && ge(t), r?.(t);
1500
- }, [r, e]), Ne = C((e) => {
1501
- if (!ke(e)) {
1502
- if (!W || W && G) {
1503
- q({
1504
- start: e,
1505
- end: null
1506
- }), V(null);
1507
- return;
1508
- }
1509
- !I && b(e, W) || (q(Ae(W, e)), V(null), A || H(!1));
1510
- }
1511
- }, [
1512
- I,
1513
- q,
1514
- G,
1515
- A,
1516
- ke,
1517
- W
1518
- ]), Pe = C((e) => {
1519
- e.stopPropagation(), q({
1520
- start: null,
1521
- end: null
1522
- }), V(null);
1523
- }, [q]), Fe = C(() => {
1524
- let e = f(/* @__PURE__ */ new Date());
1525
- ke(e) || (q({
1526
- start: e,
1527
- end: e
1528
- }), De(new Date(e.getFullYear(), e.getMonth(), 1)), V(null), A || H(!1));
1529
- }, [
1530
- q,
1531
- A,
1532
- ke
1533
- ]), Ie = C((e) => {
1534
- let t = J(e.value.start), n = J(e.value.end);
1535
- if (!t || !n) return;
1536
- let r = Ae(t, n);
1537
- ke(r.start) || ke(r.end) || (q(r), De(new Date(r.start.getFullYear(), r.start.getMonth(), 1)), V(null), A || H(!1));
1538
- }, [
1539
- q,
1540
- A,
1541
- ke
1542
- ]), ze = W && !G ? _e : null, Y = Ee, Be = ie(Ee, 1), Ve = f(/* @__PURE__ */ new Date()), He = T(() => Me(W, G, c), [
1543
- G,
1544
- c,
1545
- W
1546
- ]), Ue = T(() => [Y, Be].map((e) => ({
1547
- monthDate: e,
1548
- days: Re(e, P)
1549
- })), [
1550
- P,
1551
- Y,
1552
- Be
1553
- ]), We = W && G ? `${y(W, c)} - ${y(G, c)}` : W ? `${y(W, c)} - ...` : m ?? K.defaultRangePlaceholder, Ge = N && Te.length > 0, Ke = !N && Te.length > 0, qe = () => /* @__PURE__ */ O("div", {
1554
- className: "presets-sidebar",
1555
- children: Te.map((e) => /* @__PURE__ */ O("button", {
1556
- type: "button",
1557
- className: "preset-sidebar-btn",
1558
- onClick: () => Ie(e),
1559
- children: e.label
1560
- }, e.label))
1561
- }), Je = () => /* @__PURE__ */ k("div", {
1562
- className: "calendar-body",
1563
- children: [
1564
- /* @__PURE__ */ k("div", {
1565
- className: "calendar-top",
1566
- children: [/* @__PURE__ */ k("div", {
1567
- className: "calendar-caption",
1568
- children: [/* @__PURE__ */ k("span", {
1569
- className: "caption-title",
1570
- children: [
1571
- we[Y.getMonth()],
1572
- " ",
1573
- Y.getFullYear()
1574
- ]
1575
- }), /* @__PURE__ */ O("span", {
1576
- className: "caption-subtitle",
1577
- children: K.rangeSubtitle
1578
- })]
1579
- }), /* @__PURE__ */ k("div", {
1580
- className: "nav-actions",
1581
- children: [/* @__PURE__ */ O("button", {
1582
- type: "button",
1583
- className: "nav-btn",
1584
- onClick: () => De(ie(Ee, -1)),
1585
- "aria-label": K.previousMonth,
1586
- children: /* @__PURE__ */ O(t, {})
1587
- }), /* @__PURE__ */ O("button", {
1588
- type: "button",
1589
- className: "nav-btn",
1590
- onClick: () => De(ie(Ee, 1)),
1591
- "aria-label": K.nextMonth,
1592
- children: /* @__PURE__ */ O(o, {})
1593
- })]
1594
- })]
1595
- }),
1596
- Ke && /* @__PURE__ */ O("div", {
1597
- className: "presets",
1598
- children: Te.map((e) => /* @__PURE__ */ O("button", {
1599
- type: "button",
1600
- className: "preset-btn",
1601
- onClick: () => Ie(e),
1602
- children: e.label
1603
- }, e.label))
1604
- }),
1605
- /* @__PURE__ */ O("div", {
1606
- className: "months",
1607
- children: Ue.map(({ monthDate: e, days: t }) => /* @__PURE__ */ k("div", {
1608
- className: "month-panel",
1609
- children: [
1610
- /* @__PURE__ */ k("div", {
1611
- className: "month-title",
1612
- children: [
1613
- we[e.getMonth()],
1614
- " ",
1615
- e.getFullYear()
1616
- ]
1617
- }),
1618
- /* @__PURE__ */ O("div", {
1619
- className: "day-names",
1620
- children: Ce.map((t) => /* @__PURE__ */ O("span", {
1621
- className: "day-name",
1622
- children: t
1623
- }, `${e.toISOString()}-${t}`))
1624
- }),
1625
- /* @__PURE__ */ O("div", {
1626
- className: "day-grid",
1627
- children: t.map(({ date: t, currentMonth: n }, r) => {
1628
- let i = ke(t), a = W ? b(t, W) : !1, o = G ? b(t, G) : !1, c = je(t, W, G), l = !G && W && ze ? Ae(W, ze) : null, u = l ? je(t, l.start, l.end) : !1, d = l ? b(t, l.start) || b(t, l.end) : !1;
1629
- return /* @__PURE__ */ O("button", {
1630
- type: "button",
1631
- className: s("day", !n && "other-month", b(t, Ve) && "today", a && "range-start selected", o && "range-end selected", c && "in-range", u && !d && "preview-range", i && "disabled"),
1632
- onClick: () => Ne(t),
1633
- onMouseEnter: () => W && !G && V(t),
1634
- onFocus: () => W && !G && V(t),
1635
- disabled: i,
1636
- tabIndex: -1,
1637
- children: t.getDate()
1638
- }, `${e.toISOString()}-${r}`);
1639
- })
1640
- })
1641
- ]
1642
- }, e.toISOString()))
1643
- }),
1644
- /* @__PURE__ */ k("div", {
1645
- className: "footer",
1646
- children: [/* @__PURE__ */ O("span", {
1647
- className: "summary",
1648
- children: We
1649
- }), /* @__PURE__ */ k("div", {
1650
- className: "footer-actions",
1651
- children: [D && (W || G) && /* @__PURE__ */ O("button", {
1652
- type: "button",
1653
- className: "footer-btn",
1654
- onClick: (e) => {
1655
- e.preventDefault(), q({
1656
- start: null,
1657
- end: null
1658
- }), V(null);
1659
- },
1660
- children: K.clear
1661
- }), j && /* @__PURE__ */ O("button", {
1662
- type: "button",
1663
- className: "footer-btn",
1664
- onClick: Fe,
1665
- children: K.today
1666
- })]
1667
- })]
1668
- })
1669
- ]
1670
- }), Ye = () => /* @__PURE__ */ k("div", {
1671
- className: s("date-range-calendar", Ge && "with-sidebar"),
1672
- children: [Ge && qe(), Je()]
1673
- });
1674
- return A ? /* @__PURE__ */ k("div", {
1675
- className: s("date-range-picker", x && `color-${x}`, F && "full-width", R),
1676
- style: me,
1677
- children: [S && /* @__PURE__ */ O("label", {
1678
- className: s("field-label", Se && "error", ue && "required"),
1679
- children: S
1680
- }), Ye()]
1681
- }) : /* @__PURE__ */ k("div", {
1682
- className: s("date-range-picker", x && `color-${x}`, F && "full-width", R),
1683
- style: me,
1684
- children: [
1685
- S && /* @__PURE__ */ O("label", {
1686
- htmlFor: v,
1687
- className: s("field-label", ve && "focused", Se && "error", ue && "required"),
1688
- children: S
1689
- }),
1690
- /* @__PURE__ */ k("div", {
1691
- ref: U,
1692
- className: s("trigger", `field-${ne}`, `field-${re}`, ve && "focused", Se && "error", g && "disabled"),
1693
- onClick: () => !g && !te && H(!0),
1694
- children: [
1695
- /* @__PURE__ */ O("span", {
1696
- className: "icon",
1697
- children: /* @__PURE__ */ O(i, {})
1698
- }),
1699
- /* @__PURE__ */ O("input", {
1700
- type: "text",
1701
- className: "input",
1702
- value: He,
1703
- placeholder: m ?? K.defaultRangePlaceholder,
1704
- disabled: g,
1705
- readOnly: !0,
1706
- id: v,
1707
- "aria-invalid": Se || void 0
1708
- }),
1709
- D && (W || G) && !g && /* @__PURE__ */ O("button", {
1710
- type: "button",
1711
- className: "clear-btn clear-btn-base",
1712
- onClick: Pe,
1713
- tabIndex: -1,
1714
- "aria-label": K.clear,
1715
- children: /* @__PURE__ */ O(a, {})
1716
- })
1717
- ]
1718
- }),
1719
- _ && W && G && /* @__PURE__ */ O("input", {
1720
- type: "hidden",
1721
- name: _,
1722
- value: `${W.toISOString().split("T")[0]}:${G.toISOString().split("T")[0]}`
1723
- }),
1724
- /* @__PURE__ */ O(oe, {
1725
- className: "date-range-picker-popover",
1726
- style: { "--color-rgb": pe(x) },
1727
- open: ve,
1728
- anchorRef: U,
1729
- onClose: () => {
1730
- H(!1), V(null);
1731
- },
1732
- placement: "bottom-start",
1733
- children: Ye()
1734
- }),
1735
- (ce || se) && /* @__PURE__ */ O("div", {
1736
- className: "bottom-row",
1737
- children: ce ? /* @__PURE__ */ O("span", {
1738
- className: "field-error",
1739
- role: "alert",
1740
- children: ce
1741
- }) : /* @__PURE__ */ O("span", {
1742
- className: "helper-text",
1743
- children: se
1744
- })
1745
- })
1746
- ]
1747
- });
1748
- }
1749
- //#endregion
1750
- export { A as a, P as i, ke as n, Se as r, ze as t };
1751
-
1752
- //# sourceMappingURL=dropdowns-BwAVoncd.js.map