@quidgest/ui 0.17.2 → 0.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/dist/json/api.json +11 -1
  2. package/dist/ui.esm.js +980 -9022
  3. package/dist/ui.js +971 -45
  4. package/dist/ui.min.js +817 -900
  5. package/dist/ui.scss +1 -1
  6. package/esm/_virtual/_plugin-vue_export-helper.js +7 -8
  7. package/esm/_virtual/_rolldown/runtime.js +11 -0
  8. package/esm/components/QAccordion/QAccordion.vue.js +45 -43
  9. package/esm/components/QAccordion/QAccordion2.vue.js +5 -0
  10. package/esm/components/QAccordion/QAccordionItem.vue.js +33 -39
  11. package/esm/components/QAccordion/QAccordionItem2.vue.js +5 -0
  12. package/esm/components/QAccordion/index.js +7 -8
  13. package/esm/components/QAvatar/QAvatar.vue.js +41 -48
  14. package/esm/components/QAvatar/QAvatar2.vue.js +5 -0
  15. package/esm/components/QAvatar/index.js +6 -6
  16. package/esm/components/QBadge/QBadge.vue.js +98 -142
  17. package/esm/components/QBadge/QBadge2.vue.js +5 -0
  18. package/esm/components/QBadge/constants.js +4 -11
  19. package/esm/components/QBadge/index.js +6 -6
  20. package/esm/components/QBadgeIndicator/QBadgeIndicator.vue.js +38 -49
  21. package/esm/components/QBadgeIndicator/QBadgeIndicator2.vue.js +5 -0
  22. package/esm/components/QBadgeIndicator/index.js +6 -6
  23. package/esm/components/QButton/QButton.vue.js +73 -84
  24. package/esm/components/QButton/QButton2.vue.js +5 -0
  25. package/esm/components/QButton/index.js +6 -6
  26. package/esm/components/QButtonGroup/QButtonGroup.vue.js +33 -37
  27. package/esm/components/QButtonGroup/QButtonGroup2.vue.js +5 -0
  28. package/esm/components/QButtonGroup/index.js +6 -6
  29. package/esm/components/QCard/QCard.vue.js +91 -133
  30. package/esm/components/QCard/QCard2.vue.js +5 -0
  31. package/esm/components/QCard/index.js +6 -6
  32. package/esm/components/QCarousel/QCarousel.vue.js +247 -354
  33. package/esm/components/QCarousel/QCarousel2.vue.js +5 -0
  34. package/esm/components/QCarousel/constants.js +10 -15
  35. package/esm/components/QCarousel/index.js +6 -6
  36. package/esm/components/QCheckbox/QCheckbox.vue.js +133 -143
  37. package/esm/components/QCheckbox/QCheckbox2.vue.js +5 -0
  38. package/esm/components/QCheckbox/QCheckboxLabel.vue.js +31 -32
  39. package/esm/components/QCheckbox/QCheckboxLabel2.vue.js +5 -0
  40. package/esm/components/QCheckbox/constants.js +6 -10
  41. package/esm/components/QCheckbox/index.js +7 -8
  42. package/esm/components/QCollapsible/QCollapsible.vue.js +90 -136
  43. package/esm/components/QCollapsible/QCollapsible2.vue.js +5 -0
  44. package/esm/components/QCollapsible/constants.js +5 -7
  45. package/esm/components/QCollapsible/index.js +6 -6
  46. package/esm/components/QColorPicker/QColorPicker.vue.js +96 -100
  47. package/esm/components/QColorPicker/QColorPicker2.vue.js +5 -0
  48. package/esm/components/QColorPicker/constants.js +4 -6
  49. package/esm/components/QColorPicker/index.js +6 -6
  50. package/esm/components/QCombobox/QCombobox.vue.js +316 -364
  51. package/esm/components/QCombobox/QCombobox2.vue.js +5 -0
  52. package/esm/components/QCombobox/constants.js +12 -13
  53. package/esm/components/QCombobox/index.js +6 -6
  54. package/esm/components/QDateTimePicker/QDateTimePicker.d.ts +5 -0
  55. package/esm/components/QDateTimePicker/QDateTimePicker.d.ts.map +1 -1
  56. package/esm/components/QDateTimePicker/QDateTimePicker.vue.js +1119 -1449
  57. package/esm/components/QDateTimePicker/QDateTimePicker2.vue.js +5 -0
  58. package/esm/components/QDateTimePicker/constants.js +72 -91
  59. package/esm/components/QDateTimePicker/index.d.ts +12 -0
  60. package/esm/components/QDateTimePicker/index.d.ts.map +1 -1
  61. package/esm/components/QDateTimePicker/index.js +6 -6
  62. package/esm/components/QDefaultsProvider/QDefaultsProvider.vue.js +15 -15
  63. package/esm/components/QDefaultsProvider/QDefaultsProvider2.vue.js +5 -0
  64. package/esm/components/QDefaultsProvider/index.js +6 -6
  65. package/esm/components/QDialog/QDialog.vue.js +175 -226
  66. package/esm/components/QDialog/QDialog2.vue.js +5 -0
  67. package/esm/components/QDialog/QDialogProvider.vue.js +26 -35
  68. package/esm/components/QDialog/QDialogProvider2.vue.js +5 -0
  69. package/esm/components/QDialog/constants.js +11 -23
  70. package/esm/components/QDialog/index.js +7 -8
  71. package/esm/components/QDismissibleLayer/QDismissibleLayer.vue.js +63 -69
  72. package/esm/components/QDismissibleLayer/QDismissibleLayer2.vue.js +5 -0
  73. package/esm/components/QDismissibleLayer/index.js +6 -6
  74. package/esm/components/QDivider/QDivider.vue.js +39 -62
  75. package/esm/components/QDivider/QDivider2.vue.js +5 -0
  76. package/esm/components/QDivider/index.js +6 -6
  77. package/esm/components/QDropdownMenu/QDropdownMenu.vue.js +54 -64
  78. package/esm/components/QDropdownMenu/QDropdownMenu2.vue.js +5 -0
  79. package/esm/components/QDropdownMenu/QDropdownMenuContent.vue.js +196 -215
  80. package/esm/components/QDropdownMenu/QDropdownMenuContent2.vue.js +5 -0
  81. package/esm/components/QDropdownMenu/constants.js +4 -8
  82. package/esm/components/QDropdownMenu/index.js +6 -6
  83. package/esm/components/QField/QField.vue.js +74 -90
  84. package/esm/components/QField/QField2.vue.js +5 -0
  85. package/esm/components/QField/index.js +6 -6
  86. package/esm/components/QFileUpload/QFileUpload.vue.js +156 -241
  87. package/esm/components/QFileUpload/QFileUpload2.vue.js +5 -0
  88. package/esm/components/QFileUpload/constants.js +16 -27
  89. package/esm/components/QFileUpload/index.js +6 -6
  90. package/esm/components/QFocusWrap/QFocusWrap.vue.js +89 -118
  91. package/esm/components/QFocusWrap/QFocusWrap2.vue.js +5 -0
  92. package/esm/components/QFocusWrap/index.js +6 -6
  93. package/esm/components/QGrid/QCol.vue.js +33 -48
  94. package/esm/components/QGrid/QCol2.vue.js +5 -0
  95. package/esm/components/QGrid/QContainer.vue.js +11 -23
  96. package/esm/components/QGrid/QContainer2.vue.js +5 -0
  97. package/esm/components/QGrid/QRow.vue.js +24 -35
  98. package/esm/components/QGrid/QRow2.vue.js +5 -0
  99. package/esm/components/QGrid/QSpacer.vue.js +9 -9
  100. package/esm/components/QGrid/index.js +9 -12
  101. package/esm/components/QGroupBox/QGroupBox.vue.js +32 -43
  102. package/esm/components/QGroupBox/QGroupBox2.vue.js +5 -0
  103. package/esm/components/QGroupBox/index.js +6 -6
  104. package/esm/components/QIcon/InlineSvg.js +92 -129
  105. package/esm/components/QIcon/QIcon.vue.js +40 -42
  106. package/esm/components/QIcon/QIcon2.vue.js +5 -0
  107. package/esm/components/QIcon/QIconFont.vue.js +26 -20
  108. package/esm/components/QIcon/QIconFont2.vue.js +5 -0
  109. package/esm/components/QIcon/QIconImg.vue.js +23 -19
  110. package/esm/components/QIcon/QIconImg2.vue.js +5 -0
  111. package/esm/components/QIcon/QIconSvg.vue.js +40 -31
  112. package/esm/components/QIcon/QIconSvg2.vue.js +5 -0
  113. package/esm/components/QIcon/index.js +9 -12
  114. package/esm/components/QInputGroup/QInputGroup.vue.js +62 -89
  115. package/esm/components/QInputGroup/QInputGroup2.vue.js +5 -0
  116. package/esm/components/QInputGroup/index.js +6 -6
  117. package/esm/components/QLabel/QLabel.vue.js +33 -43
  118. package/esm/components/QLabel/QLabel2.vue.js +5 -0
  119. package/esm/components/QLabel/index.js +6 -6
  120. package/esm/components/QLineLoader/QLineLoader.vue.js +26 -26
  121. package/esm/components/QLineLoader/QLineLoader2.vue.js +5 -0
  122. package/esm/components/QLineLoader/index.js +6 -6
  123. package/esm/components/QList/QList.vue.js +229 -241
  124. package/esm/components/QList/QList2.vue.js +5 -0
  125. package/esm/components/QList/QListItem.vue.js +84 -118
  126. package/esm/components/QList/QListItem2.vue.js +5 -0
  127. package/esm/components/QList/QListItemGroup.vue.js +25 -28
  128. package/esm/components/QList/QListItemGroup2.vue.js +5 -0
  129. package/esm/components/QList/constants.js +6 -10
  130. package/esm/components/QList/index.js +8 -10
  131. package/esm/components/QMeter/QMeter.vue.js +39 -61
  132. package/esm/components/QMeter/QMeter2.vue.js +5 -0
  133. package/esm/components/QMeter/index.js +6 -6
  134. package/esm/components/QOverlay/QOverlay.vue.js +282 -322
  135. package/esm/components/QOverlay/QOverlay2.vue.js +5 -0
  136. package/esm/components/QOverlay/index.js +6 -6
  137. package/esm/components/QPasswordField/QPasswordField.vue.js +142 -163
  138. package/esm/components/QPasswordField/QPasswordField2.vue.js +5 -0
  139. package/esm/components/QPasswordField/QPasswordFieldMessages.vue.js +11 -27
  140. package/esm/components/QPasswordField/QPasswordFieldMessages2.vue.js +5 -0
  141. package/esm/components/QPasswordField/QPasswordFieldMeterOverlay.vue.js +82 -103
  142. package/esm/components/QPasswordField/QPasswordFieldMeterOverlay2.vue.js +5 -0
  143. package/esm/components/QPasswordField/constants.js +6 -10
  144. package/esm/components/QPasswordField/index.js +6 -6
  145. package/esm/components/QPopover/QPopover.vue.js +74 -95
  146. package/esm/components/QPopover/QPopover2.vue.js +5 -0
  147. package/esm/components/QPopover/index.js +6 -6
  148. package/esm/components/QPropertyList/QPropertyList.vue.js +109 -154
  149. package/esm/components/QPropertyList/QPropertyList2.vue.js +5 -0
  150. package/esm/components/QPropertyList/QPropertyListGroup.vue.js +46 -68
  151. package/esm/components/QPropertyList/QPropertyListGroup2.vue.js +5 -0
  152. package/esm/components/QPropertyList/QPropertyListPanel.vue.js +24 -47
  153. package/esm/components/QPropertyList/QPropertyListPanel2.vue.js +5 -0
  154. package/esm/components/QPropertyList/QPropertyListRow.vue.js +60 -80
  155. package/esm/components/QPropertyList/QPropertyListRow2.vue.js +5 -0
  156. package/esm/components/QPropertyList/constants.js +6 -13
  157. package/esm/components/QPropertyList/index.js +9 -12
  158. package/esm/components/QRadioGroup/QRadioButton.vue.js +99 -96
  159. package/esm/components/QRadioGroup/QRadioButton2.vue.js +5 -0
  160. package/esm/components/QRadioGroup/QRadioGroup.vue.js +79 -87
  161. package/esm/components/QRadioGroup/QRadioGroup2.vue.js +5 -0
  162. package/esm/components/QRadioGroup/index.js +7 -8
  163. package/esm/components/QRemoveScrollBar/QRemoveScrollBar.vue.js +49 -51
  164. package/esm/components/QRemoveScrollBar/QRemoveScrollBar2.vue.js +5 -0
  165. package/esm/components/QRemoveScrollBar/constants.js +4 -8
  166. package/esm/components/QRemoveScrollBar/index.js +6 -6
  167. package/esm/components/QRemoveScrollBar/utils/gap.js +24 -22
  168. package/esm/components/QRemoveScrollBar/utils/stylesheet.js +19 -20
  169. package/esm/components/QSelect/QSelect.vue.js +399 -583
  170. package/esm/components/QSelect/QSelect2.vue.js +5 -0
  171. package/esm/components/QSelect/constants.js +14 -15
  172. package/esm/components/QSelect/index.js +6 -6
  173. package/esm/components/QSidebar/QSidebar.vue.js +133 -157
  174. package/esm/components/QSidebar/QSidebar2.vue.js +5 -0
  175. package/esm/components/QSidebar/QSidebarAnchor.vue.js +79 -110
  176. package/esm/components/QSidebar/QSidebarAnchor2.vue.js +5 -0
  177. package/esm/components/QSidebar/QSidebarPanel.vue.js +68 -88
  178. package/esm/components/QSidebar/QSidebarPanel2.vue.js +5 -0
  179. package/esm/components/QSidebar/index.js +6 -6
  180. package/esm/components/QSkeletonLoader/QSkeletonLoader.vue.js +28 -35
  181. package/esm/components/QSkeletonLoader/QSkeletonLoader2.vue.js +5 -0
  182. package/esm/components/QSkeletonLoader/index.js +6 -6
  183. package/esm/components/QSpinnerLoader/QSpinnerLoader.vue.js +19 -21
  184. package/esm/components/QSpinnerLoader/QSpinnerLoader2.vue.js +5 -0
  185. package/esm/components/QSpinnerLoader/index.js +6 -6
  186. package/esm/components/QSwitch/QSwitch.vue.js +83 -124
  187. package/esm/components/QSwitch/QSwitch2.vue.js +5 -0
  188. package/esm/components/QSwitch/index.js +6 -6
  189. package/esm/components/QTextArea/QTextArea.vue.js +113 -110
  190. package/esm/components/QTextArea/QTextArea2.vue.js +5 -0
  191. package/esm/components/QTextArea/index.js +6 -6
  192. package/esm/components/QTextField/QTextField.vue.js +115 -118
  193. package/esm/components/QTextField/QTextField2.vue.js +5 -0
  194. package/esm/components/QTextField/index.js +7 -6
  195. package/esm/components/QTextField/types.js +5 -7
  196. package/esm/components/QThemeProvider/QThemeProvider.vue.js +31 -33
  197. package/esm/components/QThemeProvider/QThemeProvider2.vue.js +5 -0
  198. package/esm/components/QThemeProvider/index.js +6 -6
  199. package/esm/components/QToast/QToast.vue.js +140 -213
  200. package/esm/components/QToast/QToast2.vue.js +5 -0
  201. package/esm/components/QToast/QToaster.vue.js +38 -47
  202. package/esm/components/QToast/QToaster2.vue.js +5 -0
  203. package/esm/components/QToast/constants.js +4 -8
  204. package/esm/components/QToast/index.js +7 -8
  205. package/esm/components/QToggle/QToggle.vue.js +39 -42
  206. package/esm/components/QToggle/QToggle2.vue.js +5 -0
  207. package/esm/components/QToggle/index.js +6 -6
  208. package/esm/components/QToggleGroup/QToggleGroup.vue.js +55 -49
  209. package/esm/components/QToggleGroup/QToggleGroup2.vue.js +5 -0
  210. package/esm/components/QToggleGroup/QToggleGroupItem.vue.js +33 -43
  211. package/esm/components/QToggleGroup/QToggleGroupItem2.vue.js +5 -0
  212. package/esm/components/QToggleGroup/index.js +7 -8
  213. package/esm/components/QTooltip/QTooltip.vue.js +93 -113
  214. package/esm/components/QTooltip/QTooltip2.vue.js +5 -0
  215. package/esm/components/QTooltip/index.js +6 -6
  216. package/esm/components/__internal__/QChevron/QChevron.vue.js +28 -30
  217. package/esm/components/__internal__/QChevron/QChevron2.vue.js +5 -0
  218. package/esm/components/__internal__/QChevron/constants.js +4 -8
  219. package/esm/components/__internal__/QChevron/index.js +6 -6
  220. package/esm/components/__internal__/QClearButton/QClearButton.vue.js +39 -44
  221. package/esm/components/__internal__/QClearButton/QClearButton2.vue.js +5 -0
  222. package/esm/components/__internal__/QClearButton/constants.js +4 -11
  223. package/esm/components/__internal__/QClearButton/index.js +6 -6
  224. package/esm/components/index.js +117 -113
  225. package/esm/composables/defaults.js +22 -27
  226. package/esm/composables/overlay.js +125 -135
  227. package/esm/composables/theme.js +13 -20
  228. package/esm/composables/uid.js +7 -8
  229. package/esm/composables/useColor/index.js +41 -42
  230. package/esm/composables/useDialog/index.js +28 -27
  231. package/esm/composables/useDismissibleLayerStack/index.js +31 -30
  232. package/esm/composables/useDropZone/index.js +43 -61
  233. package/esm/composables/useGroup/index.js +33 -39
  234. package/esm/composables/useInputMask/index.d.ts.map +1 -1
  235. package/esm/composables/useInputMask/index.js +384 -396
  236. package/esm/composables/useTextareaAutosize/index.js +18 -21
  237. package/esm/composables/useToast/index.js +30 -32
  238. package/esm/composables/useToast/types.js +4 -4
  239. package/esm/framework.js +56 -59
  240. package/esm/index.js +14 -18
  241. package/esm/symbols/dismissibleLayer.js +4 -4
  242. package/esm/templates/index.js +9 -5
  243. package/esm/templates/theme.js +109 -110
  244. package/esm/utils/color/contrast.js +10 -11
  245. package/esm/utils/color/conversion.js +44 -54
  246. package/esm/utils/color/manipulate.js +14 -19
  247. package/esm/utils/color/merge.js +43 -48
  248. package/esm/utils/color/parse.js +23 -23
  249. package/esm/utils/date.js +456 -463
  250. package/esm/utils/download.js +14 -15
  251. package/esm/utils/getElement.js +5 -5
  252. package/esm/utils/index.js +48 -44
  253. package/esm/utils/isEmpty.js +5 -5
  254. package/esm/utils/isObject.js +5 -5
  255. package/esm/utils/merge.js +12 -16
  256. package/esm/utils/setupPropsProxy.js +21 -28
  257. package/esm/utils/string.js +7 -7
  258. package/esm/utils/theme.js +41 -57
  259. package/esm/vendors/uuid/dist/native.js +3 -4
  260. package/esm/vendors/uuid/dist/rng.js +10 -12
  261. package/esm/vendors/uuid/dist/stringify.js +7 -8
  262. package/esm/vendors/uuid/dist/v4.js +18 -15
  263. package/package.json +12 -12
  264. package/esm/components/QAccordion/QAccordion.vue2.js +0 -4
  265. package/esm/components/QAccordion/QAccordionItem.vue2.js +0 -4
  266. package/esm/components/QAvatar/QAvatar.vue2.js +0 -4
  267. package/esm/components/QBadge/QBadge.vue2.js +0 -4
  268. package/esm/components/QBadgeIndicator/QBadgeIndicator.vue2.js +0 -4
  269. package/esm/components/QButton/QButton.vue2.js +0 -4
  270. package/esm/components/QButtonGroup/QButtonGroup.vue2.js +0 -4
  271. package/esm/components/QCard/QCard.vue2.js +0 -4
  272. package/esm/components/QCarousel/QCarousel.vue2.js +0 -4
  273. package/esm/components/QCheckbox/QCheckbox.vue2.js +0 -4
  274. package/esm/components/QCheckbox/QCheckboxLabel.vue2.js +0 -4
  275. package/esm/components/QCollapsible/QCollapsible.vue2.js +0 -4
  276. package/esm/components/QColorPicker/QColorPicker.vue2.js +0 -4
  277. package/esm/components/QCombobox/QCombobox.vue2.js +0 -4
  278. package/esm/components/QDateTimePicker/QDateTimePicker.vue2.js +0 -4
  279. package/esm/components/QDefaultsProvider/QDefaultsProvider.vue2.js +0 -4
  280. package/esm/components/QDialog/QDialog.vue2.js +0 -4
  281. package/esm/components/QDialog/QDialogProvider.vue2.js +0 -4
  282. package/esm/components/QDismissibleLayer/QDismissibleLayer.vue2.js +0 -4
  283. package/esm/components/QDivider/QDivider.vue2.js +0 -4
  284. package/esm/components/QDropdownMenu/QDropdownMenu.vue2.js +0 -4
  285. package/esm/components/QDropdownMenu/QDropdownMenuContent.vue2.js +0 -4
  286. package/esm/components/QField/QField.vue2.js +0 -4
  287. package/esm/components/QFileUpload/QFileUpload.vue2.js +0 -4
  288. package/esm/components/QFocusWrap/QFocusWrap.vue2.js +0 -4
  289. package/esm/components/QGrid/QCol.vue2.js +0 -4
  290. package/esm/components/QGrid/QContainer.vue2.js +0 -4
  291. package/esm/components/QGrid/QRow.vue2.js +0 -4
  292. package/esm/components/QGroupBox/QGroupBox.vue2.js +0 -4
  293. package/esm/components/QIcon/QIcon.vue2.js +0 -4
  294. package/esm/components/QIcon/QIconFont.vue2.js +0 -4
  295. package/esm/components/QIcon/QIconImg.vue2.js +0 -4
  296. package/esm/components/QIcon/QIconSvg.vue2.js +0 -4
  297. package/esm/components/QInputGroup/QInputGroup.vue2.js +0 -4
  298. package/esm/components/QLabel/QLabel.vue2.js +0 -4
  299. package/esm/components/QLineLoader/QLineLoader.vue2.js +0 -4
  300. package/esm/components/QList/QList.vue2.js +0 -4
  301. package/esm/components/QList/QListItem.vue2.js +0 -4
  302. package/esm/components/QList/QListItemGroup.vue2.js +0 -4
  303. package/esm/components/QMeter/QMeter.vue2.js +0 -4
  304. package/esm/components/QOverlay/QOverlay.vue2.js +0 -4
  305. package/esm/components/QPasswordField/QPasswordField.vue2.js +0 -4
  306. package/esm/components/QPasswordField/QPasswordFieldMessages.vue2.js +0 -4
  307. package/esm/components/QPasswordField/QPasswordFieldMeterOverlay.vue2.js +0 -4
  308. package/esm/components/QPopover/QPopover.vue2.js +0 -4
  309. package/esm/components/QPropertyList/QPropertyList.vue2.js +0 -4
  310. package/esm/components/QPropertyList/QPropertyListGroup.vue2.js +0 -4
  311. package/esm/components/QPropertyList/QPropertyListPanel.vue2.js +0 -4
  312. package/esm/components/QPropertyList/QPropertyListRow.vue2.js +0 -4
  313. package/esm/components/QRadioGroup/QRadioButton.vue2.js +0 -4
  314. package/esm/components/QRadioGroup/QRadioGroup.vue2.js +0 -4
  315. package/esm/components/QRemoveScrollBar/QRemoveScrollBar.vue2.js +0 -4
  316. package/esm/components/QSelect/QSelect.vue2.js +0 -4
  317. package/esm/components/QSidebar/QSidebar.vue2.js +0 -4
  318. package/esm/components/QSidebar/QSidebarAnchor.vue2.js +0 -4
  319. package/esm/components/QSidebar/QSidebarPanel.vue2.js +0 -4
  320. package/esm/components/QSkeletonLoader/QSkeletonLoader.vue2.js +0 -4
  321. package/esm/components/QSpinnerLoader/QSpinnerLoader.vue2.js +0 -4
  322. package/esm/components/QSwitch/QSwitch.vue2.js +0 -4
  323. package/esm/components/QTextArea/QTextArea.vue2.js +0 -4
  324. package/esm/components/QTextField/QTextField.vue2.js +0 -4
  325. package/esm/components/QThemeProvider/QThemeProvider.vue2.js +0 -4
  326. package/esm/components/QToast/QToast.vue2.js +0 -4
  327. package/esm/components/QToast/QToaster.vue2.js +0 -4
  328. package/esm/components/QToggle/QToggle.vue2.js +0 -4
  329. package/esm/components/QToggleGroup/QToggleGroup.vue2.js +0 -4
  330. package/esm/components/QToggleGroup/QToggleGroupItem.vue2.js +0 -4
  331. package/esm/components/QTooltip/QTooltip.vue2.js +0 -4
  332. package/esm/components/__internal__/QChevron/QChevron.vue2.js +0 -4
  333. package/esm/components/__internal__/QClearButton/QClearButton.vue2.js +0 -4
@@ -1,1450 +1,1120 @@
1
- import { defineComponent as Gn, mergeModels as Xn, useModel as Zn, computed as s, ref as C, useTemplateRef as ce, watch as fe, onBeforeUnmount as Jn, createElementBlock as S, openBlock as m, Fragment as Y, createVNode as i, createBlock as W, createCommentVNode as x, unref as o, mergeProps as Q, createSlots as ea, withCtx as b, renderSlot as ta, createElementVNode as k, normalizeProps as G, guardReactiveProps as X, renderList as _e, toDisplayString as Xe, normalizeClass as na, nextTick as q } from "vue";
2
- import { WEEKDAY_NAMES as Ze, MONTH_NAMES as Je, DEFAULT_TEXTS as aa, DEFAULT_ICONS as ra } from "./constants.js";
3
- import { QButton as p } from "../QButton/index.js";
4
- import { QIcon as I } from "../QIcon/index.js";
5
- import { QOverlay as la } from "../QOverlay/index.js";
6
- import { QSwitch as ua } from "../QSwitch/index.js";
7
- import { QTextField as Fe } from "../QTextField/index.js";
8
- import { useInputMask as oa, applyMask as Re, clampNumericSegments as St, resolveCursorPosition as ia } from "../../composables/useInputMask/index.js";
9
- import { formatUsesTime as sa, formatUsesSeconds as ca, uses12HourFormat as fa, isTimeOnlyFormat as da, formatDate as V, getFirstDayOfMonth as va, getDaysInMonth as Ct, isBetween as ma, isSameDay as Ne, convertDatePatternToMask as pa, parseDate as de, parseIsoDate as et, padNumber as tt, parseDateWithCompletion as nt, inputIncludesTimePortion as qt } from "../../utils/date.js";
10
- const ga = {
11
- key: 0,
12
- ref: "calendar",
13
- class: "q-date-time-picker__calendar"
14
- }, ya = { class: "q-date-time-picker__header" }, ha = { class: "q-date-time-picker__weekdays" }, ba = { class: "q-date-time-picker__time" }, ka = {
15
- key: 0,
16
- class: "q-date-time-picker__time-period"
17
- }, _a = { class: "q-date-time-picker__time-inputs" }, Da = { class: "q-date-time-picker__time-input-group" }, wa = { class: "q-date-time-picker__time-input-group" }, Ma = { class: "q-date-time-picker__time-input-group" }, Ta = { class: "q-date-time-picker__month-grid" }, xa = { class: "q-date-time-picker__year" }, Ia = { class: "q-date-time-picker__year-change" }, Ha = { class: "q-date-time-picker__year-interval" }, Sa = { class: "q-date-time-picker__year-grid" }, Ca = { class: "q-date-time-picker__bottom-bar" }, Z = 1001, J = 9999, ve = 26, Ft = 'a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]), [contenteditable]', La = /* @__PURE__ */ Gn({
18
- inheritAttrs: !1,
19
- __name: "QDateTimePicker",
20
- props: /* @__PURE__ */ Xn({
21
- id: {},
22
- class: {},
23
- label: {},
24
- required: { type: Boolean },
25
- for: {},
26
- labelPosition: {},
27
- size: {},
28
- readonly: { type: Boolean },
29
- disabled: { type: Boolean },
30
- invalid: { type: Boolean },
31
- placeholder: {},
32
- inline: { type: Boolean, default: !1 },
33
- clearable: { type: Boolean },
34
- format: { default: "dd/MM/yyyy HH:mm" },
35
- range: { type: Boolean },
36
- icons: { default: () => ra },
37
- texts: { default: () => aa }
38
- }, {
39
- modelValue: {},
40
- modelModifiers: {}
41
- }),
42
- emits: ["update:modelValue"],
43
- setup(at) {
44
- const r = at, rt = Zn(at, "modelValue"), c = s({
45
- get: () => rt.value,
46
- set: (e) => rt.value = e || void 0
47
- }), Rt = s(
48
- () => r.readonly || r.disabled ? void 0 : r.placeholder
49
- ), re = s(() => sa(r.format)), De = s(() => ca(r.format)), ee = s(() => fa(r.format)), E = s(() => da(r.format)), Nt = s(
50
- () => y.value === (/* @__PURE__ */ new Date()).getMonth() && h.value === (/* @__PURE__ */ new Date()).getFullYear()
51
- ), H = C(!1), Ve = C(!1), g = C(""), D = C(null), F = C(!1);
52
- let me = 0;
53
- const w = C("date"), y = C((/* @__PURE__ */ new Date()).getMonth()), h = C((/* @__PURE__ */ new Date()).getFullYear()), le = C((/* @__PURE__ */ new Date()).getFullYear());
54
- let ue = null, A = !1, pe = !1, te = !1, oe = null;
55
- function lt() {
56
- queueMicrotask(() => {
57
- requestAnimationFrame(() => {
58
- var a;
59
- const e = ae(), t = document.activeElement;
60
- e && (t === e || t instanceof Node && ((a = R.value) != null && a.contains(t))) && (A = !0);
61
- });
62
- });
63
- }
64
- const L = ce("field"), R = ce("menu"), Ee = ce("calendar"), Vt = ce("monthHeader"), Et = ce("yearHeader"), Pt = ce("toggleTime"), Pe = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Map();
65
- function we(e) {
66
- if (!e) return null;
67
- if (e instanceof HTMLElement) return e;
68
- if (typeof e == "object" && "$el" in e) {
69
- const t = e.$el;
70
- return t instanceof HTMLElement ? t : null;
71
- }
72
- return null;
73
- }
74
- function Yt(e, t) {
75
- const a = we(e);
76
- a ? Pe.set(t, a) : Pe.delete(t);
77
- }
78
- function At(e, t) {
79
- const a = we(e);
80
- a ? Ye.set(t, a) : Ye.delete(t);
81
- }
82
- function Lt(e) {
83
- var t;
84
- (t = we(e)) == null || t.focus();
85
- }
86
- const O = s(() => ({
87
- getMonthIndex: (e, t) => {
88
- const a = e.toLowerCase();
89
- return Je.findIndex((n) => {
90
- const l = r.texts[n] ?? n;
91
- return (t ? l.substring(0, 3) : l).toLowerCase() === a;
92
- });
93
- },
94
- getWeekdayIndex: (e, t) => {
95
- const a = e.toLowerCase();
96
- for (let n = 0; n < 7; n++) {
97
- const l = (n + 6) % 7, u = Ze[l], f = r.texts[u] ?? u;
98
- if ((t ? f.substring(0, 3) : f).toLowerCase() === a) return n;
99
- }
100
- return null;
101
- }
102
- })), M = s(() => {
103
- const e = c.value;
104
- return e ? e instanceof Date ? e : Array.isArray(e) && e.length > 0 ? e[0] : typeof e == "string" ? ne(e) : null : null;
105
- }), Me = s(() => {
106
- const e = c.value;
107
- return Array.isArray(e) && e.length > 1 ? e[1] : null;
108
- }), v = C(null), ie = C(null), B = C(null), $ = C(!1), Ot = s(() => !$.value || !v.value ? M.value : B.value && B.value < v.value ? B.value : v.value), Bt = s(() => {
109
- if (!r.range) return M.value;
110
- if (!$.value || !v.value)
111
- return Me.value;
112
- const e = B.value ?? ie.value;
113
- return e ? e < v.value ? v.value : e : null;
114
- }), N = s(() => ({
115
- getMonthName: (e, t) => {
116
- const a = xe(e);
117
- return t ? a.substring(0, 3) : a;
118
- },
119
- getWeekdayName: (e, t) => {
120
- const a = (e + 6) % 7, n = Ze[a], l = r.texts[n] ?? n;
121
- return t ? l.substring(0, 3) : l;
122
- }
123
- })), $t = s(() => {
124
- const e = c.value;
125
- if (!e) return "";
126
- if (Array.isArray(e))
127
- return e.map(
128
- (t) => t instanceof Date ? V(t, r.format, N.value) : t
129
- ).join(" - ");
130
- if (e instanceof Date)
131
- return V(e, r.format, N.value);
132
- if (typeof e == "string") {
133
- const t = ne(e);
134
- return t ? V(t, r.format, N.value) : String(e);
135
- }
136
- return String(e);
137
- }), ut = s(() => D.value ?? $t.value);
138
- function Te() {
139
- g.value = ut.value;
140
- }
141
- fe(
142
- ut,
143
- () => {
144
- Ve.value || Te();
145
- },
146
- { immediate: !0 }
147
- );
148
- const ot = s(() => {
149
- const e = va(new Date(h.value, y.value, 1)), t = Ct(y.value, h.value), a = (e.getDay() + 6) % 7, n = [], l = y.value === 0 ? 11 : y.value - 1, u = y.value === 0 ? h.value - 1 : h.value, f = Ct(l, u);
150
- for (let d = a - 1; d >= 0; d--) {
151
- const T = new Date(u, l, f - d);
152
- Ae(n, T, !1);
153
- }
154
- for (let d = 1; d <= t; d++) {
155
- const T = new Date(h.value, y.value, d);
156
- Ae(n, T, !0);
157
- }
158
- const _ = 7 - n.length % 7, j = _ === 7 ? 0 : _;
159
- for (let d = 1; d <= j; d++) {
160
- const T = new Date(h.value, y.value + 1, d);
161
- Ae(n, T, !1);
162
- }
163
- return n;
164
- });
165
- function Ae(e, t, a) {
166
- const n = Ot.value, l = Bt.value, u = t.getFullYear(), f = u < Z || u > J;
167
- e.push({
168
- date: t,
169
- isCurrentMonth: a,
170
- isToday: Ne(t, /* @__PURE__ */ new Date()),
171
- isSelected: n ? Ne(t, n) : !1,
172
- isRangeStart: !!n && Ne(t, n),
173
- isRangeEnd: !!l && Ne(t, l),
174
- isInRange: n && l ? ma(t, n, l) : !1,
175
- isDisabled: f
176
- });
177
- }
178
- const zt = s(() => Ze.map((e) => {
179
- var a;
180
- const t = e;
181
- return ((a = r.texts[t]) == null ? void 0 : a.substring(0, 2)) ?? e;
182
- })), Kt = s(
183
- () => Array.from({ length: 12 }, (e, t) => xe(t, 3))
184
- );
185
- function xe(e, t = 0) {
186
- const a = Je[e], n = r.texts[a] ?? Je[e];
187
- return t <= 0 ? n : n.substring(0, t);
188
- }
189
- function it(e) {
190
- const t = Math.floor(ve / 2);
191
- let a = e - t, n = a + ve;
192
- return a < Z && (a = Z, n = Math.min(a + ve, J)), n > J && (n = J, a = Math.max(Z, n - ve)), { startYear: a, endYear: n };
193
- }
194
- function Ut(e) {
195
- const { startYear: t, endYear: a } = it(e);
196
- return Array.from({ length: a - t + 1 }, (n, l) => t + l);
197
- }
198
- function jt() {
199
- st.value && (le.value -= ve);
200
- }
201
- function Wt() {
202
- ct.value && (le.value += ve);
203
- }
204
- const Ie = s(() => it(le.value)), st = s(
205
- () => Ie.value.startYear > Z
206
- ), ct = s(() => Ie.value.endYear < J), Qt = s(() => y.value === 0 ? h.value - 1 : h.value), Gt = s(() => y.value === 11 ? h.value + 1 : h.value), ft = s(() => Qt.value >= Z), dt = s(() => Gt.value <= J), Xt = s(() => Ut(le.value)), Zt = s(() => E.value ? r.icons.clock : r.icons.calendar), ge = s(() => pa(r.format)), Le = s(
207
- () => `${ge.value} - ${ge.value}`
208
- );
209
- oa(
210
- () => {
211
- var e;
212
- return (e = L == null ? void 0 : L.value) == null ? void 0 : e.inputRef;
213
- },
214
- () => r.range ? Le.value : ge.value
215
- ), fe(
216
- () => {
217
- var e;
218
- return (e = L == null ? void 0 : L.value) == null ? void 0 : e.inputRef;
219
- },
220
- (e, t, a) => {
221
- const n = Tt(e);
222
- oe = n, n && (n.addEventListener("click", wt), n.addEventListener("paste", _t, !0), a(() => {
223
- oe = null, n.removeEventListener("click", wt), n.removeEventListener("paste", _t, !0);
224
- }));
225
- },
226
- { flush: "post" }
227
- ), fe(c, () => {
228
- D.value = null, Te();
229
- });
230
- function Jt(e) {
231
- return e === void 0 ? !1 : typeof e == "string" ? e.trim().length > 0 : e instanceof Date ? !0 : Array.isArray(e) ? e.length > 0 : !1;
232
- }
233
- const Oe = s(
234
- () => r.clearable && !r.readonly && !r.disabled && Jt(c.value)
235
- );
236
- function en() {
237
- Oe.value && ($e(), c.value = void 0, g.value = "", We());
238
- }
239
- function Be(e) {
240
- !r.range || !$.value || !v.value || e.getFullYear() < Z || e.getFullYear() > J || (B.value = new Date(e));
241
- }
242
- function vt() {
243
- B.value = null;
244
- }
245
- function tn(e) {
246
- const t = e.currentTarget, a = e.relatedTarget;
247
- !t || a && t.contains(a) || vt();
248
- }
249
- function mt(e) {
250
- if (!r.range || !$.value || !v.value) return;
251
- const t = e.touches.item(0);
252
- if (!t) return;
253
- const a = document.elementFromPoint(t.clientX, t.clientY), n = a == null ? void 0 : a.closest("[data-day-index]");
254
- if (!n) return;
255
- const l = Number(n.dataset.dayIndex);
256
- if (Number.isNaN(l)) return;
257
- const u = ot.value[l];
258
- u && Be(u.date);
259
- }
260
- function nn(e) {
261
- if (!(r.readonly || r.disabled) && !(e.getFullYear() < Z || e.getFullYear() > J))
262
- if (r.range)
263
- if ($.value) {
264
- const t = v.value ?? new Date(e), a = new Date(e), [n, l] = a < t ? [a, t] : [t, a];
265
- re.value && l.setHours(23, 59, De.value ? 59 : 0, 0), c.value = [n, l], v.value = null, ie.value = null, B.value = null, $.value = !1;
266
- } else {
267
- const t = new Date(e);
268
- re.value && v.value && t.setHours(
269
- v.value.getHours(),
270
- v.value.getMinutes(),
271
- v.value.getSeconds(),
272
- v.value.getMilliseconds()
273
- ), v.value = t, ie.value = null, B.value = null, $.value = !0;
274
- }
275
- else {
276
- const t = new Date(e);
277
- M.value && !Hn(M.value) ? t.setHours(
278
- M.value.getHours(),
279
- M.value.getMinutes(),
280
- M.value.getSeconds()
281
- ) : re.value && kt(t), c.value = t;
282
- }
283
- }
284
- function se(e, t) {
285
- h.value = e, t && qe("year");
286
- }
287
- function z(e, t) {
288
- y.value = e, t && qe("month");
289
- }
290
- function an() {
291
- ft.value && (y.value === 0 ? (z(11), se(h.value - 1)) : z(y.value - 1));
292
- }
293
- function rn() {
294
- dt.value && (y.value === 11 ? (z(0), se(h.value + 1)) : z(y.value + 1));
295
- }
296
- function ln() {
297
- z((/* @__PURE__ */ new Date()).getMonth()), se((/* @__PURE__ */ new Date()).getFullYear()), Ce();
298
- }
299
- function un() {
300
- let e = M.value;
301
- const t = c.value;
302
- if (r.range && Array.isArray(t) && t.length > 0) {
303
- const a = t[0];
304
- a instanceof Date ? e = a : typeof a == "string" && (e = de(a, r.format, O.value));
305
- }
306
- e = e ?? /* @__PURE__ */ new Date(), z(e.getMonth()), se(e.getFullYear()), Ce();
307
- }
308
- function ye(e) {
309
- return r.range ? e === 1 ? Me.value ?? ie.value : M.value ?? v.value : M.value;
310
- }
311
- function $e() {
312
- v.value = null, ie.value = null, B.value = null, $.value = !1;
313
- }
314
- function on(e, t) {
315
- return t < e ? [new Date(t), new Date(e)] : [new Date(e), new Date(t)];
316
- }
317
- function sn() {
318
- if (!r.range || !E.value) return;
319
- const e = c.value;
320
- if (!Array.isArray(e) || e.length < 2) return;
321
- const t = e[0], a = e[1];
322
- !(t instanceof Date) || !(a instanceof Date) || a >= t || (c.value = on(t, a));
323
- }
324
- function cn(e, t) {
325
- if (!r.range) {
326
- c.value = t;
327
- return;
328
- }
329
- if (E.value) {
330
- e === 0 ? v.value = t : ie.value = t;
331
- const l = e === 0 ? t : M.value ?? v.value, u = e === 1 ? t : Me.value;
332
- if (!l || !u) return;
333
- c.value = [new Date(l), new Date(u)], $e();
334
- return;
335
- }
336
- if ($.value) {
337
- e === 0 && (v.value = t);
338
- return;
339
- }
340
- const a = M.value, n = Me.value;
341
- !a || !n || (c.value = e === 1 ? [a, t] : [t, n]);
342
- }
343
- function P(e, t) {
344
- const a = ye(e) ?? (() => {
345
- const l = /* @__PURE__ */ new Date();
346
- return l.setHours(0, 0, 0, 0), l;
347
- })(), n = new Date(a);
348
- t(n), cn(e, n);
349
- }
350
- function fn(e) {
351
- const t = ye(e);
352
- if (!t) return ee.value ? 12 : 0;
353
- const a = t.getHours();
354
- return ee.value ? a % 12 || 12 : a;
355
- }
356
- function dn(e) {
357
- var t;
358
- return ((t = ye(e)) == null ? void 0 : t.getMinutes()) ?? 0;
359
- }
360
- function vn(e) {
361
- var t;
362
- return ((t = ye(e)) == null ? void 0 : t.getSeconds()) ?? 0;
363
- }
364
- function mn(e) {
365
- const t = ye(e);
366
- return t ? t.getHours() >= 12 : !1;
367
- }
368
- function He(e, t) {
369
- return t ? e === 12 ? 12 : e + 12 : e === 12 ? 0 : e;
370
- }
371
- function pn(e) {
372
- P(e, (t) => {
373
- if (ee.value) {
374
- const a = t.getHours() % 12 || 12, n = a >= 12 ? 1 : a + 1, l = t.getHours() >= 12;
375
- t.setHours(He(n, l));
376
- } else
377
- t.setHours(t.getHours() >= 23 ? 0 : t.getHours() + 1);
378
- });
379
- }
380
- function gn(e) {
381
- P(e, (t) => {
382
- if (ee.value) {
383
- const a = t.getHours() % 12 || 12, n = a <= 1 ? 12 : a - 1, l = t.getHours() >= 12;
384
- t.setHours(He(n, l));
385
- } else
386
- t.setHours(t.getHours() <= 0 ? 23 : t.getHours() - 1);
387
- });
388
- }
389
- function yn(e) {
390
- P(e, (t) => {
391
- t.setMinutes(t.getMinutes() >= 59 ? 0 : t.getMinutes() + 1);
392
- });
393
- }
394
- function hn(e) {
395
- P(e, (t) => {
396
- t.setMinutes(t.getMinutes() <= 0 ? 59 : t.getMinutes() - 1);
397
- });
398
- }
399
- function bn(e) {
400
- P(e, (t) => {
401
- t.setSeconds(t.getSeconds() >= 59 ? 0 : t.getSeconds() + 1);
402
- });
403
- }
404
- function kn(e) {
405
- P(e, (t) => {
406
- t.setSeconds(t.getSeconds() <= 0 ? 59 : t.getSeconds() - 1);
407
- });
408
- }
409
- function ze(e) {
410
- return (e ?? "").replace(/\D/g, "");
411
- }
412
- function _n(e) {
413
- return Math.min(23, Math.max(0, e));
414
- }
415
- function Dn(e) {
416
- return Math.min(12, Math.max(1, e));
417
- }
418
- function pt(e) {
419
- return Math.min(59, Math.max(0, e));
420
- }
421
- function gt(e, t) {
422
- const a = ze(e).slice(0, 2);
423
- if (a === "") return;
424
- const n = Number.parseInt(a, 10);
425
- if (Number.isNaN(n)) return;
426
- const l = ee.value ? Dn(n) : _n(n);
427
- P(t, (u) => {
428
- ee.value ? u.setHours(He(l, u.getHours() >= 12)) : u.setHours(l);
429
- });
430
- }
431
- function yt(e, t) {
432
- const a = ze(e).slice(0, 2);
433
- if (a === "") return;
434
- const n = Number.parseInt(a, 10);
435
- if (Number.isNaN(n)) return;
436
- const l = pt(n);
437
- P(t, (u) => {
438
- u.setMinutes(l);
439
- });
440
- }
441
- function ht(e, t) {
442
- const a = ze(e).slice(0, 2);
443
- if (a === "") return;
444
- const n = Number.parseInt(a, 10);
445
- if (Number.isNaN(n)) return;
446
- const l = pt(n);
447
- P(t, (u) => {
448
- u.setSeconds(l);
449
- });
450
- }
451
- async function Ke(e, t, a) {
452
- if (e.ctrlKey || e.altKey || e.metaKey || !/^\d$/.test(e.key)) return;
453
- const n = e.target;
454
- if (!n) return;
455
- const l = n.selectionStart, u = n.selectionEnd;
456
- if (l === null || u === null || l !== u || n.maxLength <= 0 || n.value.length < n.maxLength || l >= n.value.length)
457
- return;
458
- e.preventDefault();
459
- const f = `${n.value.slice(0, l)}${e.key}${n.value.slice(l + 1)}`;
460
- t === "hours" ? gt(f, a) : t === "minutes" ? yt(f, a) : ht(f, a);
461
- const _ = Math.min(l + 1, n.maxLength);
462
- await q(), n.setSelectionRange(_, _);
463
- }
464
- function wn(e, t) {
465
- P(t, (a) => {
466
- const n = a.getHours() % 12 || 12;
467
- a.setHours(He(n, e));
468
- });
469
- }
470
- async function Ue(e, t, a, n) {
471
- if (!e) return;
472
- const l = ia(t, a, n), u = () => e.setSelectionRange(l, l);
473
- u(), await q(), u(), await new Promise((f) => {
474
- requestAnimationFrame(() => {
475
- u(), f();
476
- });
477
- });
478
- }
479
- async function bt(e, t, a, n) {
480
- if (a === t) {
481
- g.value !== a && (g.value = a);
482
- return;
483
- }
484
- g.value = a, await Ue(e, t, a, n);
485
- }
486
- function ne(e, t) {
487
- const a = e.trim();
488
- if (!a) return null;
489
- const n = de(a, r.format, O.value);
490
- if (n) return n;
491
- const l = et(a);
492
- if (l) return l;
493
- const u = Mt(a);
494
- return u || (t != null && t.complete ? nt(a, r.format, O.value) : null);
495
- }
496
- async function Mn(e) {
497
- if (me > 0) return;
498
- if (r.readonly || r.disabled) {
499
- Te();
500
- return;
501
- }
502
- const t = ae(), a = (t == null ? void 0 : t.selectionStart) ?? 0, n = e ?? "";
503
- if (!n) {
504
- c.value = void 0, D.value = null, g.value = "", F.value = !1;
505
- return;
506
- }
507
- if (r.range) {
508
- const d = Se(n);
509
- if (d) {
510
- c.value = d, D.value = null, g.value = d.map((ke) => V(ke, r.format, N.value)).join(" - "), F.value = !1;
511
- return;
512
- }
513
- const T = Re(n, Le.value);
514
- await bt(t, n, T, a), D.value = T;
515
- const Ge = Se(T);
516
- if (Ge) {
517
- c.value = Ge, D.value = null;
518
- const ke = Ge.map((Qn) => V(Qn, r.format, N.value)).join(" - ");
519
- ke !== T && (g.value = ke, await Ue(t, T, ke, a)), F.value = !1;
520
- }
521
- return;
522
- }
523
- const l = ne(n);
524
- if (l) {
525
- const d = K(l, n);
526
- c.value = d, D.value = null, g.value = V(d, r.format, N.value), F.value = !1;
527
- return;
528
- }
529
- const u = Re(n, ge.value), f = St(u, r.format);
530
- let _ = f, j = de(f, r.format, O.value);
531
- if (!j) {
532
- const d = de(n, r.format, O.value);
533
- d && (_ = n, j = d);
534
- }
535
- if (await bt(t, n, _, a), D.value = _, j) {
536
- const d = K(j, n);
537
- c.value = d, D.value = null;
538
- const T = V(d, r.format, N.value);
539
- T !== _ && (g.value = T, await Ue(t, _, T, a)), F.value = !1;
540
- }
541
- }
542
- function Se(e, t) {
543
- const a = e.split(" - ");
544
- if (a.length !== 2) return null;
545
- const n = (f) => ne(f, t), l = n(a[0] ?? ""), u = n(a[1] ?? "");
546
- return !l || !u ? null : u < l ? [u, l] : [l, u];
547
- }
548
- function Tn() {
549
- if (r.readonly || r.disabled) return !1;
550
- const e = D.value ?? g.value;
551
- if (!e) return !1;
552
- if (r.range) {
553
- const f = Re(e, Le.value), _ = Se(f, { complete: !0 });
554
- return _ ? (c.value = _, D.value = null, F.value = !1, g.value = _.map((j) => V(j, r.format, N.value)).join(" - "), !0) : (D.value = null, c.value = void 0, F.value = !0, g.value = "", !1);
555
- }
556
- const t = Re(e, ge.value), a = St(t, r.format), n = ne(e, { complete: !0 }) ?? nt(a, r.format, O.value);
557
- if (!n)
558
- return D.value = null, c.value = void 0, F.value = !0, g.value = "", !1;
559
- const u = !!ne(e) || qt(a, r.format) ? n : K(n, a);
560
- return c.value = u, D.value = null, F.value = !1, g.value = V(u, r.format, N.value), !0;
561
- }
562
- function xn(e) {
563
- const t = e.replace(/[\sT]+(?:'[^']*'|HH|H|hh|h|mm|m|ss|s|SSS|S|a).*$/i, "").trim();
564
- return t && t !== e ? t : null;
565
- }
566
- function In(e) {
567
- return !re.value || ne(e) || qt(e, r.format) ? !0 : /\dT\d|\d{1,2}:\d{2}/.test(e);
568
- }
569
- function Hn(e) {
570
- return e.getHours() === 0 && e.getMinutes() === 0 && e.getSeconds() === 0 && e.getMilliseconds() === 0;
571
- }
572
- function kt(e) {
573
- const t = /* @__PURE__ */ new Date();
574
- e.setHours(
575
- t.getHours(),
576
- t.getMinutes(),
577
- De.value ? t.getSeconds() : 0,
578
- De.value ? t.getMilliseconds() : 0
579
- );
580
- }
581
- function K(e, t) {
582
- if (r.range || !re.value || t !== void 0 && In(t)) return e;
583
- const a = new Date(e);
584
- return kt(a), a;
585
- }
586
- function Sn(e) {
587
- if (r.range)
588
- return Se(e);
589
- const t = de(e, r.format, O.value);
590
- if (t) return K(t, e);
591
- const a = et(e);
592
- if (a) return K(a, e);
593
- const n = Mt(e);
594
- if (n) return K(n, e);
595
- const l = nt(e, r.format, O.value);
596
- if (l) return K(l, e);
597
- const u = xn(r.format);
598
- if (u) {
599
- const f = de(e, u, O.value);
600
- if (f) return K(f, e);
601
- }
602
- return null;
603
- }
604
- async function Cn(e) {
605
- if (F.value = !1, D.value = null, Array.isArray(e)) {
606
- const a = e.map((n) => V(n, r.format, N.value)).join(" - ");
607
- me += 1, c.value = e, g.value = a, await q(), me -= 1;
608
- return;
609
- }
610
- const t = V(e, r.format, N.value);
611
- me += 1, c.value = e, g.value = t, await q(), me -= 1;
612
- }
613
- function _t(e) {
614
- var n, l, u, f;
615
- if (r.readonly || r.disabled) {
616
- e.preventDefault();
617
- return;
618
- }
619
- const t = ((l = (n = e.clipboardData) == null ? void 0 : n.getData("text/plain")) == null ? void 0 : l.trim()) || ((f = (u = e.clipboardData) == null ? void 0 : u.getData("text")) == null ? void 0 : f.trim()) || "";
620
- if (!t) {
621
- e.preventDefault();
622
- return;
623
- }
624
- const a = Sn(t);
625
- if (!a) {
626
- e.preventDefault();
627
- return;
628
- }
629
- e.preventDefault(), Cn(a);
630
- }
631
- function qn(e) {
632
- const t = e.target;
633
- if (!(t instanceof Element) || !R.value) return null;
634
- const a = t.closest(
635
- "button, input, select, textarea, a[href], [tabindex], [contenteditable]"
636
- );
637
- return a && R.value.contains(a) ? a : null;
638
- }
639
- function Fn(e) {
640
- return !(e.matches(":disabled") || e.getAttribute("aria-disabled") === "true" || e.getAttribute("tabindex") === "-1");
641
- }
642
- function Rn(e) {
643
- var a;
644
- if (!(e.target instanceof Node) || !((a = R.value) != null && a.contains(e.target))) return;
645
- pe = !0;
646
- const t = qn(e);
647
- t && !Fn(t) && e.preventDefault();
648
- }
649
- function Dt() {
650
- return R.value ? Array.from(R.value.querySelectorAll(Ft)).filter(
651
- (e) => e.offsetWidth > 0 || e.offsetHeight > 0 || e.getClientRects().length > 0
652
- ) : [];
653
- }
654
- function Nn() {
655
- var n;
656
- const e = ae();
657
- if (!e) return;
658
- const t = Array.from(
659
- document.querySelectorAll(Ft)
660
- ).filter(
661
- (l) => l.offsetWidth > 0 || l.offsetHeight > 0 || l.getClientRects().length > 0
662
- ), a = t.indexOf(e);
663
- a >= 0 && a < t.length - 1 && ((n = t[a + 1]) == null || n.focus());
664
- }
665
- function Vn(e) {
666
- if (e.key !== "Tab" || !H.value || r.readonly || r.disabled) return;
667
- if (e.shiftKey) {
668
- A = !1, H.value = !1;
669
- return;
670
- }
671
- const [t] = Dt();
672
- t && (e.preventDefault(), pe = !0, t.focus());
673
- }
674
- async function En(e) {
675
- if (e.key !== "Tab") return;
676
- const t = Dt();
677
- if (!t.length) return;
678
- const a = t[0], n = t[t.length - 1], l = document.activeElement;
679
- if (e.shiftKey) {
680
- if (l !== a) return;
681
- e.preventDefault(), pe = !0, We();
682
- return;
683
- }
684
- l === n && (e.preventDefault(), te = !0, H.value = !1, await q(), Nn());
685
- }
686
- async function Pn(e) {
687
- var l, u;
688
- if (Tn(), pe) {
689
- pe = !1;
690
- return;
691
- }
692
- const t = e == null ? void 0 : e.relatedTarget;
693
- if (t instanceof Node && ((l = R.value) != null && l.contains(t)))
694
- return;
695
- await q();
696
- const a = ae(), n = document.activeElement;
697
- a !== n && (n instanceof Node && ((u = R.value) != null && u.contains(n)) || (A = !1, H.value = !1, Ve.value = !1, Te()));
698
- }
699
- function Yn() {
700
- if (!(r.readonly || r.disabled)) {
701
- if (Ve.value = !0, A) {
702
- A = !1;
703
- return;
704
- }
705
- H.value || (H.value = !0);
706
- }
707
- }
708
- function wt() {
709
- r.readonly || r.disabled || (A = !1, H.value = !0);
710
- }
711
- function An(e) {
712
- e || lt(), H.value = e;
713
- }
714
- function Mt(e) {
715
- const t = et(e);
716
- if (t) return t;
717
- const a = /[A-Za-z]/.test(e), n = /^\d{4}[-/]\d{1,2}[-/]\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?$/.test(
718
- e
719
- );
720
- if (!a && !n) return null;
721
- const l = new Date(e);
722
- return Number.isNaN(l.getTime()) ? null : l;
723
- }
724
- function Tt(e) {
725
- return e instanceof HTMLInputElement ? e : typeof e == "object" && e !== null && "value" in e && e.value instanceof HTMLInputElement ? e.value : null;
726
- }
727
- function ae() {
728
- var n, l;
729
- if (oe) return oe;
730
- const e = Tt((n = L.value) == null ? void 0 : n.inputRef);
731
- if (e)
732
- return oe = e, e;
733
- const t = we(
734
- (l = L.value) == null ? void 0 : l.fieldRef
735
- ), a = (t == null ? void 0 : t.querySelector(".q-text-field__input")) ?? null;
736
- return a ? (oe = a, a) : null;
737
- }
738
- function Ln(e) {
739
- return e.isSelected || e.isRangeStart || e.isRangeEnd ? "bold" : e.isInRange ? "tonal" : "ghost";
740
- }
741
- function he(e) {
742
- var t;
743
- (t = R.value) == null || t.style.setProperty("--q-date-view-height", `${Math.max(0, e)}px`);
744
- }
745
- async function xt() {
746
- var e;
747
- if (!H.value || E.value) {
748
- he(0);
749
- return;
750
- }
751
- w.value === "date" && (await q(), he(((e = Ee.value) == null ? void 0 : e.getBoundingClientRect().height) ?? 0));
752
- }
753
- function U() {
754
- ue == null || ue.disconnect(), ue = null;
755
- }
756
- async function It() {
757
- !H.value || E.value || w.value !== "date" || (await q(), Ee.value && (U(), ue = new MutationObserver(() => {
758
- xt();
759
- }), ue.observe(Ee.value, {
760
- childList: !0,
761
- subtree: !0,
762
- attributes: !0,
763
- characterData: !0
764
- }), xt()));
765
- }
766
- function je() {
767
- w.value = "time", U();
768
- }
769
- function Ce() {
770
- w.value = "date", It();
771
- }
772
- async function qe(e) {
773
- var a;
774
- (a = R.value) == null || a.focus(), Ce(), await q();
775
- const t = e === "year" ? Et.value : e === "month" ? Vt.value : e === "time" ? Pt.value : null;
776
- Lt(t);
777
- }
778
- function On() {
779
- const e = w.value;
780
- e !== "date" && qe(e);
781
- }
782
- async function Bn() {
783
- U(), w.value = "month", await q();
784
- const e = Pe.get(y.value);
785
- e == null || e.scrollIntoView({ block: "center" }), e == null || e.focus();
786
- }
787
- async function $n() {
788
- var e;
789
- U(), le.value = h.value, w.value = "year", await q(), (e = Ye.get(le.value)) == null || e.scrollIntoView({ block: "center" });
790
- }
791
- async function be(e) {
792
- if (e.key !== "Escape") return;
793
- if (A = !0, w.value === "date" || E.value) {
794
- e.preventDefault(), H.value = !1, await q(), Qe();
795
- return;
796
- }
797
- e.preventDefault();
798
- const t = w.value;
799
- await qe(t);
800
- }
801
- function We() {
802
- var e;
803
- (e = ae()) == null || e.focus();
804
- }
805
- function zn(e) {
806
- return !e || e === document.body || e === document.documentElement;
807
- }
808
- function Kn(e, t) {
809
- if (e.closest(".q-date-time-picker__menu")) return !1;
810
- const a = t.closest(".q-date-time-picker");
811
- return a != null && a.contains(e) || !(e instanceof HTMLElement) ? !1 : e.tabIndex >= 0 || e.matches(
812
- 'input, select, textarea, button, a[href], [tabindex]:not([tabindex="-1"])'
813
- );
814
- }
815
- function Un(e) {
816
- var a;
817
- const t = ae();
818
- return t ? e === t || !e || !e.isConnected || zn(e) || (a = R.value) != null && a.contains(e) ? !0 : !Kn(e, t) : !1;
819
- }
820
- function jn() {
821
- if (te) return;
822
- const e = ae();
823
- !e || !Un(document.activeElement) || (A = !0, e.focus());
824
- }
825
- function Qe() {
826
- q().then(() => {
827
- requestAnimationFrame(() => {
828
- requestAnimationFrame(() => {
829
- jn();
830
- });
831
- });
832
- });
833
- }
834
- function Wn() {
835
- if (te) {
836
- te = !1;
837
- return;
838
- }
839
- Qe();
840
- }
841
- function Ht() {
842
- lt();
843
- const e = te;
844
- te && (te = !1), e || (A = !0, Qe());
845
- }
846
- return fe(c, () => {
847
- M.value && (z(M.value.getMonth()), se(M.value.getFullYear()));
848
- }), fe(H, (e, t) => {
849
- if (E.value) {
850
- U(), he(0), e ? (document.addEventListener("keydown", be, { capture: !0 }), je()) : (t && (sn(), Ht()), document.removeEventListener("keydown", be, { capture: !0 }));
851
- return;
852
- }
853
- $e(), e ? (document.addEventListener("keydown", be, { capture: !0 }), un(), It()) : (t && Ht(), document.removeEventListener("keydown", be, { capture: !0 }), U(), he(0));
854
- }), fe(
855
- E,
856
- (e) => {
857
- e && U(), H.value = !1, e && he(0), e ? je() : Ce();
858
- },
859
- { immediate: !0 }
860
- ), Jn(() => {
861
- U(), document.removeEventListener("keydown", be, { capture: !0 });
862
- }), (e, t) => {
863
- var a;
864
- return m(), S(
865
- Y,
866
- null,
867
- [
868
- i(o(Fe), Q({
869
- id: r.id,
870
- ref: "field",
871
- "model-value": g.value,
872
- class: ["q-date-time-picker", r.class],
873
- clearable: Oe.value,
874
- "aria-label": r.label,
875
- label: r.label,
876
- "label-position": r.labelPosition,
877
- readonly: r.readonly,
878
- disabled: r.disabled,
879
- placeholder: Rt.value,
880
- required: r.required,
881
- size: r.size,
882
- invalid: r.invalid || F.value
883
- }, e.$attrs, {
884
- onBlur: Pn,
885
- "onClick:clear": We,
886
- onFocusin: Yn,
887
- onKeydown: Vn,
888
- "onUpdate:modelValue": Mn
889
- }), ea({
890
- prepend: b(() => [
891
- i(
892
- o(I),
893
- Q({ class: "q-date-time-picker__input-icon" }, Zt.value),
894
- null,
895
- 16
896
- /* FULL_PROPS */
897
- )
898
- ]),
899
- _: 2
900
- /* DYNAMIC */
901
- }, [
902
- e.$slots.extras ? {
903
- name: "extras",
904
- fn: b(() => [
905
- ta(e.$slots, "extras")
906
- ]),
907
- key: "0"
908
- } : void 0
909
- ]), 1040, ["id", "model-value", "class", "clearable", "aria-label", "label", "label-position", "readonly", "disabled", "placeholder", "required", "size", "invalid"]),
910
- !r.readonly && !r.disabled ? (m(), W(o(la), {
911
- key: 0,
912
- "model-value": H.value,
913
- anchor: (a = L.value) == null ? void 0 : a.fieldRef,
914
- inline: r.inline,
915
- offset: 8,
916
- placement: "bottom",
917
- trigger: "manual",
918
- arrow: "",
919
- "non-modal": "",
920
- spy: "",
921
- onLeave: Wn,
922
- "onUpdate:modelValue": An
923
- }, {
924
- default: b(() => [
925
- k(
926
- "div",
927
- {
928
- ref: "menu",
929
- class: "q-date-time-picker__menu",
930
- tabindex: "-1",
931
- onPointerdownCapture: Rn,
932
- onKeydown: En
933
- },
934
- [
935
- x(" Calendar View "),
936
- w.value === "date" ? (m(), S(
937
- "div",
938
- ga,
939
- [
940
- x(" Header "),
941
- k("div", ya, [
942
- i(o(p), {
943
- variant: "ghost",
944
- disabled: !ft.value,
945
- title: r.texts.previousMonth,
946
- onClick: an
947
- }, {
948
- default: b(() => [
949
- i(
950
- o(I),
951
- G(X(r.icons.back)),
952
- null,
953
- 16
954
- /* FULL_PROPS */
955
- )
956
- ]),
957
- _: 1
958
- /* STABLE */
959
- }, 8, ["disabled", "title"]),
960
- i(o(p), {
961
- ref: "monthHeader",
962
- "data-testid": "q-date-time-picker-month-header",
963
- variant: "ghost",
964
- label: xe(y.value, 3),
965
- title: r.texts.pickMonth,
966
- onClick: Bn
967
- }, null, 8, ["label", "title"]),
968
- i(o(p), {
969
- ref: "yearHeader",
970
- "data-testid": "q-date-time-picker-year-header",
971
- variant: "ghost",
972
- label: h.value.toString(),
973
- title: r.texts.pickYear,
974
- onClick: $n
975
- }, null, 8, ["label", "title"]),
976
- i(o(p), {
977
- variant: "ghost",
978
- disabled: !dt.value,
979
- title: r.texts.nextMonth,
980
- onClick: rn
981
- }, {
982
- default: b(() => [
983
- i(
984
- o(I),
985
- G(X(r.icons.forward)),
986
- null,
987
- 16
988
- /* FULL_PROPS */
989
- )
990
- ]),
991
- _: 1
992
- /* STABLE */
993
- }, 8, ["disabled", "title"])
994
- ]),
995
- x(" Weekday Headers "),
996
- k("div", ha, [
997
- (m(!0), S(
998
- Y,
999
- null,
1000
- _e(zt.value, (n) => (m(), S(
1001
- "div",
1002
- {
1003
- key: n,
1004
- class: "q-date-time-picker__weekday"
1005
- },
1006
- Xe(n),
1007
- 1
1008
- /* TEXT */
1009
- ))),
1010
- 128
1011
- /* KEYED_FRAGMENT */
1012
- ))
1013
- ]),
1014
- x(" Days Grid "),
1015
- k(
1016
- "div",
1017
- {
1018
- class: "q-date-time-picker__days",
1019
- onMouseleave: vt,
1020
- onFocusout: tn,
1021
- onTouchstartPassive: mt,
1022
- onTouchmovePassive: mt
1023
- },
1024
- [
1025
- (m(!0), S(
1026
- Y,
1027
- null,
1028
- _e(ot.value, (n, l) => (m(), W(o(p), {
1029
- key: l,
1030
- "data-day-index": l,
1031
- class: na([
1032
- "q-date-time-picker__day",
1033
- {
1034
- "q-date-time-picker__day--other-month": !n.isCurrentMonth,
1035
- "q-date-time-picker__day--today": n.isToday,
1036
- "q-date-time-picker__day--selected": n.isSelected,
1037
- "q-date-time-picker__day--in-range": n.isInRange,
1038
- "q-date-time-picker__day--range-start": n.isRangeStart,
1039
- "q-date-time-picker__day--range-end": n.isRangeEnd
1040
- }
1041
- ]),
1042
- label: n.date.getDate().toString(),
1043
- variant: Ln(n),
1044
- disabled: n.isDisabled,
1045
- onMouseenter: () => Be(n.date),
1046
- onFocus: () => Be(n.date),
1047
- onClick: () => nn(n.date)
1048
- }, null, 8, ["data-day-index", "class", "label", "variant", "disabled", "onMouseenter", "onFocus", "onClick"]))),
1049
- 128
1050
- /* KEYED_FRAGMENT */
1051
- ))
1052
- ],
1053
- 32
1054
- /* NEED_HYDRATION */
1055
- )
1056
- ],
1057
- 512
1058
- /* NEED_PATCH */
1059
- )) : w.value === "time" ? (m(), S(
1060
- Y,
1061
- { key: 1 },
1062
- [
1063
- x(" Time View "),
1064
- k("div", ba, [
1065
- (m(!0), S(
1066
- Y,
1067
- null,
1068
- _e(r.range ? 2 : 1, (n) => (m(), S("div", {
1069
- key: n,
1070
- class: "q-date-time-picker__time-group"
1071
- }, [
1072
- ee.value ? (m(), S("div", ka, [
1073
- i(o(ua), {
1074
- "model-value": mn(n - 1),
1075
- "show-state-labels": "",
1076
- size: "small",
1077
- "false-label": r.texts.am,
1078
- "true-label": r.texts.pm,
1079
- "onUpdate:modelValue": (l) => wn(l ?? !1, n - 1)
1080
- }, null, 8, ["model-value", "false-label", "true-label", "onUpdate:modelValue"])
1081
- ])) : x("v-if", !0),
1082
- x(" Time Inputs "),
1083
- k("div", _a, [
1084
- k("div", Da, [
1085
- i(o(p), {
1086
- variant: "ghost",
1087
- title: r.texts.increaseHour,
1088
- onClick: (l) => pn(n - 1)
1089
- }, {
1090
- default: b(() => [
1091
- i(
1092
- o(I),
1093
- Q({ ref_for: !0 }, r.icons.up),
1094
- null,
1095
- 16
1096
- /* FULL_PROPS */
1097
- )
1098
- ]),
1099
- _: 1
1100
- /* STABLE */
1101
- }, 8, ["title", "onClick"]),
1102
- i(o(Fe), {
1103
- class: "q-date-time-picker__time-number",
1104
- size: "small",
1105
- inputmode: "numeric",
1106
- "max-length": 2,
1107
- "model-value": o(tt)(fn(n - 1)),
1108
- onKeydown: (l) => Ke(l, "hours", n - 1),
1109
- "onUpdate:modelValue": (l) => gt(l, n - 1)
1110
- }, null, 8, ["model-value", "onKeydown", "onUpdate:modelValue"]),
1111
- i(o(p), {
1112
- variant: "ghost",
1113
- title: r.texts.decreaseHour,
1114
- onClick: (l) => gn(n - 1)
1115
- }, {
1116
- default: b(() => [
1117
- i(
1118
- o(I),
1119
- Q({ ref_for: !0 }, r.icons.down),
1120
- null,
1121
- 16
1122
- /* FULL_PROPS */
1123
- )
1124
- ]),
1125
- _: 1
1126
- /* STABLE */
1127
- }, 8, ["title", "onClick"])
1128
- ]),
1129
- t[1] || (t[1] = k(
1130
- "div",
1131
- { class: "q-date-time-picker__time-separator" },
1132
- ":",
1133
- -1
1134
- /* CACHED */
1135
- )),
1136
- k("div", wa, [
1137
- i(o(p), {
1138
- variant: "ghost",
1139
- title: r.texts.increaseMinute,
1140
- onClick: (l) => yn(n - 1)
1141
- }, {
1142
- default: b(() => [
1143
- i(
1144
- o(I),
1145
- Q({ ref_for: !0 }, r.icons.up),
1146
- null,
1147
- 16
1148
- /* FULL_PROPS */
1149
- )
1150
- ]),
1151
- _: 1
1152
- /* STABLE */
1153
- }, 8, ["title", "onClick"]),
1154
- i(o(Fe), {
1155
- class: "q-date-time-picker__time-number",
1156
- size: "small",
1157
- inputmode: "numeric",
1158
- "max-length": 2,
1159
- "model-value": o(tt)(dn(n - 1)),
1160
- onKeydown: (l) => Ke(l, "minutes", n - 1),
1161
- "onUpdate:modelValue": (l) => yt(l, n - 1)
1162
- }, null, 8, ["model-value", "onKeydown", "onUpdate:modelValue"]),
1163
- i(o(p), {
1164
- variant: "ghost",
1165
- title: r.texts.decreaseMinute,
1166
- onClick: (l) => hn(n - 1)
1167
- }, {
1168
- default: b(() => [
1169
- i(
1170
- o(I),
1171
- Q({ ref_for: !0 }, r.icons.down),
1172
- null,
1173
- 16
1174
- /* FULL_PROPS */
1175
- )
1176
- ]),
1177
- _: 1
1178
- /* STABLE */
1179
- }, 8, ["title", "onClick"])
1180
- ]),
1181
- De.value ? (m(), S(
1182
- Y,
1183
- { key: 0 },
1184
- [
1185
- t[0] || (t[0] = k(
1186
- "div",
1187
- { class: "q-date-time-picker__time-separator" },
1188
- ":",
1189
- -1
1190
- /* CACHED */
1191
- )),
1192
- k("div", Ma, [
1193
- i(o(p), {
1194
- variant: "ghost",
1195
- title: r.texts.increaseSecond,
1196
- onClick: (l) => bn(n - 1)
1197
- }, {
1198
- default: b(() => [
1199
- i(
1200
- o(I),
1201
- Q({ ref_for: !0 }, r.icons.up),
1202
- null,
1203
- 16
1204
- /* FULL_PROPS */
1205
- )
1206
- ]),
1207
- _: 1
1208
- /* STABLE */
1209
- }, 8, ["title", "onClick"]),
1210
- i(o(Fe), {
1211
- class: "q-date-time-picker__time-number",
1212
- size: "small",
1213
- inputmode: "numeric",
1214
- "max-length": 2,
1215
- "model-value": o(tt)(vn(n - 1)),
1216
- onKeydown: (l) => Ke(l, "seconds", n - 1),
1217
- "onUpdate:modelValue": (l) => ht(l, n - 1)
1218
- }, null, 8, ["model-value", "onKeydown", "onUpdate:modelValue"]),
1219
- i(o(p), {
1220
- variant: "ghost",
1221
- title: r.texts.decreaseSecond,
1222
- onClick: (l) => kn(n - 1)
1223
- }, {
1224
- default: b(() => [
1225
- i(
1226
- o(I),
1227
- Q({ ref_for: !0 }, r.icons.down),
1228
- null,
1229
- 16
1230
- /* FULL_PROPS */
1231
- )
1232
- ]),
1233
- _: 1
1234
- /* STABLE */
1235
- }, 8, ["title", "onClick"])
1236
- ])
1237
- ],
1238
- 64
1239
- /* STABLE_FRAGMENT */
1240
- )) : x("v-if", !0)
1241
- ])
1242
- ]))),
1243
- 128
1244
- /* KEYED_FRAGMENT */
1245
- ))
1246
- ])
1247
- ],
1248
- 2112
1249
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
1250
- )) : w.value === "month" ? (m(), S(
1251
- Y,
1252
- { key: 2 },
1253
- [
1254
- x(" Month View "),
1255
- k("div", Ta, [
1256
- (m(!0), S(
1257
- Y,
1258
- null,
1259
- _e(Kt.value, (n, l) => (m(), W(o(p), {
1260
- key: l,
1261
- ref_for: !0,
1262
- ref: (u) => Yt(u, l),
1263
- "data-testid": "q-date-time-picker-month-option",
1264
- "data-month-index": l,
1265
- disabled: y.value === l,
1266
- label: n,
1267
- title: xe(l),
1268
- variant: "ghost",
1269
- onClick: () => z(l, !0)
1270
- }, null, 8, ["data-month-index", "disabled", "label", "title", "onClick"]))),
1271
- 128
1272
- /* KEYED_FRAGMENT */
1273
- ))
1274
- ])
1275
- ],
1276
- 2112
1277
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
1278
- )) : w.value === "year" ? (m(), S(
1279
- Y,
1280
- { key: 3 },
1281
- [
1282
- x(" Year View "),
1283
- k("div", xa, [
1284
- k("div", Ia, [
1285
- i(o(p), {
1286
- variant: "ghost",
1287
- disabled: !st.value,
1288
- title: r.texts.previousYears,
1289
- onClick: jt
1290
- }, {
1291
- default: b(() => [
1292
- i(
1293
- o(I),
1294
- G(X(r.icons.back)),
1295
- null,
1296
- 16
1297
- /* FULL_PROPS */
1298
- )
1299
- ]),
1300
- _: 1
1301
- /* STABLE */
1302
- }, 8, ["disabled", "title"]),
1303
- k(
1304
- "div",
1305
- Ha,
1306
- Xe(Ie.value.startYear) + " - " + Xe(Ie.value.endYear),
1307
- 1
1308
- /* TEXT */
1309
- ),
1310
- i(o(p), {
1311
- variant: "ghost",
1312
- disabled: !ct.value,
1313
- title: r.texts.nextYears,
1314
- onClick: Wt
1315
- }, {
1316
- default: b(() => [
1317
- i(
1318
- o(I),
1319
- G(X(r.icons.forward)),
1320
- null,
1321
- 16
1322
- /* FULL_PROPS */
1323
- )
1324
- ]),
1325
- _: 1
1326
- /* STABLE */
1327
- }, 8, ["disabled", "title"])
1328
- ]),
1329
- k("div", Sa, [
1330
- (m(!0), S(
1331
- Y,
1332
- null,
1333
- _e(Xt.value, (n, l) => (m(), W(o(p), {
1334
- key: l,
1335
- ref_for: !0,
1336
- ref: (u) => At(u, n),
1337
- "data-testid": "q-date-time-picker-year-option",
1338
- "data-year": n,
1339
- disabled: h.value === n,
1340
- label: n.toString(),
1341
- title: n,
1342
- variant: "ghost",
1343
- onClick: () => se(n, !0)
1344
- }, null, 8, ["data-year", "disabled", "label", "title", "onClick"]))),
1345
- 128
1346
- /* KEYED_FRAGMENT */
1347
- ))
1348
- ])
1349
- ])
1350
- ],
1351
- 2112
1352
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
1353
- )) : x("v-if", !0),
1354
- k("div", Ca, [
1355
- E.value ? x("v-if", !0) : (m(), W(o(p), {
1356
- key: 0,
1357
- variant: "ghost",
1358
- disabled: Nt.value,
1359
- title: r.texts.today,
1360
- onClick: ln
1361
- }, {
1362
- default: b(() => [
1363
- i(
1364
- o(I),
1365
- G(X(r.icons.today)),
1366
- null,
1367
- 16
1368
- /* FULL_PROPS */
1369
- )
1370
- ]),
1371
- _: 1
1372
- /* STABLE */
1373
- }, 8, ["disabled", "title"])),
1374
- re.value && w.value === "date" ? (m(), W(o(p), {
1375
- key: 1,
1376
- ref: "toggleTime",
1377
- "data-testid": "q-date-time-picker-toggle-time",
1378
- variant: "ghost",
1379
- title: r.texts.toggleMode,
1380
- onClick: je
1381
- }, {
1382
- default: b(() => [
1383
- i(
1384
- o(I),
1385
- G(X(r.icons.clock)),
1386
- null,
1387
- 16
1388
- /* FULL_PROPS */
1389
- )
1390
- ]),
1391
- _: 1
1392
- /* STABLE */
1393
- }, 8, ["title"])) : w.value !== "date" && !E.value ? (m(), W(o(p), {
1394
- key: 2,
1395
- "data-testid": "q-date-time-picker-toggle-date",
1396
- variant: "ghost",
1397
- title: r.texts.toggleMode,
1398
- onClick: On
1399
- }, {
1400
- default: b(() => [
1401
- i(
1402
- o(I),
1403
- G(X(r.icons.calendar)),
1404
- null,
1405
- 16
1406
- /* FULL_PROPS */
1407
- )
1408
- ]),
1409
- _: 1
1410
- /* STABLE */
1411
- }, 8, ["title"])) : x("v-if", !0),
1412
- r.clearable ? (m(), W(o(p), {
1413
- key: 3,
1414
- "data-testid": "q-date-time-picker-clear",
1415
- variant: "ghost",
1416
- disabled: !Oe.value,
1417
- title: r.texts.clearValue,
1418
- onClick: en
1419
- }, {
1420
- default: b(() => [
1421
- i(
1422
- o(I),
1423
- G(X(r.icons.delete)),
1424
- null,
1425
- 16
1426
- /* FULL_PROPS */
1427
- )
1428
- ]),
1429
- _: 1
1430
- /* STABLE */
1431
- }, 8, ["disabled", "title"])) : x("v-if", !0)
1432
- ])
1433
- ],
1434
- 544
1435
- /* NEED_HYDRATION, NEED_PATCH */
1436
- )
1437
- ]),
1438
- _: 1
1439
- /* STABLE */
1440
- }, 8, ["model-value", "anchor", "inline"])) : x("v-if", !0)
1441
- ],
1442
- 64
1443
- /* STABLE_FRAGMENT */
1444
- );
1445
- };
1446
- }
1
+ import { QButton as e } from "../QButton/index.js";
2
+ import { QIcon as t } from "../QIcon/index.js";
3
+ import { QTextField as n } from "../QTextField/index.js";
4
+ import { QOverlay as r } from "../QOverlay/index.js";
5
+ import { DEFAULT_ICONS as i, DEFAULT_TEXTS as a, MONTH_NAMES as o, WEEKDAY_NAMES as s } from "./constants.js";
6
+ import { QSwitch as ee } from "../QSwitch/index.js";
7
+ import { applyMask as te, clampNumericSegments as ne, resolveCursorPosition as re, useInputMask as ie } from "../../composables/useInputMask/index.js";
8
+ import { convertDatePatternToMask as ae, formatDate as c, formatUsesSeconds as oe, formatUsesTime as se, getDaysInMonth as ce, getFirstDayOfMonth as le, inputIncludesTimePortion as ue, isBetween as de, isSameDay as fe, isTimeOnlyFormat as pe, padNumber as me, parseDate as l, parseDateWithCompletion as he, parseIsoDate as ge, uses12HourFormat as _e } from "../../utils/date.js";
9
+ import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createSlots as ve, createVNode as g, defineComponent as _, guardReactiveProps as v, mergeModels as ye, mergeProps as y, nextTick as b, normalizeClass as be, normalizeProps as x, onBeforeUnmount as xe, openBlock as S, ref as C, renderList as Se, renderSlot as Ce, toDisplayString as we, unref as w, useModel as Te, useTemplateRef as T, watch as Ee, withCtx as E } from "vue";
10
+ //#region src/components/QDateTimePicker/QDateTimePicker.vue?vue&type=script&setup=true&lang.ts
11
+ var De = {
12
+ key: 0,
13
+ ref: "calendar",
14
+ class: "q-date-time-picker__calendar"
15
+ }, Oe = { class: "q-date-time-picker__header" }, ke = { class: "q-date-time-picker__weekdays" }, Ae = { class: "q-date-time-picker__time" }, je = {
16
+ key: 0,
17
+ class: "q-date-time-picker__time-period"
18
+ }, Me = { class: "q-date-time-picker__time-inputs" }, Ne = { class: "q-date-time-picker__time-input-group" }, Pe = { class: "q-date-time-picker__time-input-group" }, Fe = { class: "q-date-time-picker__time-input-group" }, Ie = { class: "q-date-time-picker__month-grid" }, Le = { class: "q-date-time-picker__year" }, Re = { class: "q-date-time-picker__year-change" }, ze = { class: "q-date-time-picker__year-interval" }, Be = { class: "q-date-time-picker__year-grid" }, Ve = { class: "q-date-time-picker__bottom-bar" }, D = 1001, O = 9999, He = 26, Ue = "a[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex=\"-1\"]), [contenteditable]", We = /*@__PURE__*/ _({
19
+ inheritAttrs: !1,
20
+ __name: "QDateTimePicker",
21
+ props: /*@__PURE__*/ ye({
22
+ id: {},
23
+ class: {},
24
+ label: {},
25
+ required: { type: Boolean },
26
+ for: {},
27
+ labelPosition: {},
28
+ size: {},
29
+ readonly: { type: Boolean },
30
+ disabled: { type: Boolean },
31
+ invalid: { type: Boolean },
32
+ placeholder: {},
33
+ inline: {
34
+ type: Boolean,
35
+ default: !1
36
+ },
37
+ clearable: { type: Boolean },
38
+ format: { default: "dd/MM/yyyy HH:mm" },
39
+ range: { type: Boolean },
40
+ icons: { default: () => i },
41
+ texts: { default: () => a }
42
+ }, {
43
+ modelValue: {},
44
+ modelModifiers: {}
45
+ }),
46
+ emits: /*@__PURE__*/ ye(["open", "close"], ["update:modelValue"]),
47
+ setup(i, { emit: a }) {
48
+ let _ = i, ye = a, We = Te(i, "modelValue"), k = d({
49
+ get: () => We.value,
50
+ set: (e) => We.value = e || void 0
51
+ }), Ge = d(() => _.readonly || _.disabled ? void 0 : _.placeholder), Ke = d(() => se(_.format)), qe = d(() => oe(_.format)), A = d(() => _e(_.format)), j = d(() => pe(_.format)), Je = d(() => L.value === (/* @__PURE__ */ new Date()).getMonth() && R.value === (/* @__PURE__ */ new Date()).getFullYear()), M = C(!1), Ye = C(!1), N = C(""), P = C(null), F = C(!1), Xe = 0, I = C("date"), L = C((/* @__PURE__ */ new Date()).getMonth()), R = C((/* @__PURE__ */ new Date()).getFullYear()), z = C((/* @__PURE__ */ new Date()).getFullYear()), Ze = null, B = !1, Qe = !1, $e = !1, et = null;
52
+ function tt() {
53
+ queueMicrotask(() => {
54
+ requestAnimationFrame(() => {
55
+ let e = Q(), t = document.activeElement;
56
+ e && (t === e || t instanceof Node && V.value?.contains(t)) && (B = !0);
57
+ });
58
+ });
59
+ }
60
+ let nt = T("field"), V = T("menu"), rt = T("calendar"), it = T("monthHeader"), at = T("yearHeader"), ot = T("toggleTime"), st = /* @__PURE__ */ new Map(), ct = /* @__PURE__ */ new Map();
61
+ function lt(e) {
62
+ if (!e) return null;
63
+ if (e instanceof HTMLElement) return e;
64
+ if (typeof e == "object" && "$el" in e) {
65
+ let t = e.$el;
66
+ return t instanceof HTMLElement ? t : null;
67
+ }
68
+ return null;
69
+ }
70
+ function ut(e, t) {
71
+ let n = lt(e);
72
+ n ? st.set(t, n) : st.delete(t);
73
+ }
74
+ function dt(e, t) {
75
+ let n = lt(e);
76
+ n ? ct.set(t, n) : ct.delete(t);
77
+ }
78
+ function ft(e) {
79
+ lt(e)?.focus();
80
+ }
81
+ let H = d(() => ({
82
+ getMonthIndex: (e, t) => {
83
+ let n = e.toLowerCase();
84
+ return o.findIndex((e) => {
85
+ let r = _.texts[e] ?? e;
86
+ return (t ? r.substring(0, 3) : r).toLowerCase() === n;
87
+ });
88
+ },
89
+ getWeekdayIndex: (e, t) => {
90
+ let n = e.toLowerCase();
91
+ for (let e = 0; e < 7; e++) {
92
+ let r = s[(e + 6) % 7], i = _.texts[r] ?? r;
93
+ if ((t ? i.substring(0, 3) : i).toLowerCase() === n) return e;
94
+ }
95
+ return null;
96
+ }
97
+ })), U = d(() => {
98
+ let e = k.value;
99
+ return e ? e instanceof Date ? e : Array.isArray(e) && e.length > 0 ? e[0] : typeof e == "string" ? X(e) : null : null;
100
+ }), pt = d(() => {
101
+ let e = k.value;
102
+ return Array.isArray(e) && e.length > 1 ? e[1] : null;
103
+ }), W = C(null), mt = C(null), G = C(null), K = C(!1), ht = d(() => !K.value || !W.value ? U.value : G.value && G.value < W.value ? G.value : W.value), gt = d(() => {
104
+ if (!_.range) return U.value;
105
+ if (!K.value || !W.value) return pt.value;
106
+ let e = G.value ?? mt.value;
107
+ return e ? e < W.value ? W.value : e : null;
108
+ }), q = d(() => ({
109
+ getMonthName: (e, t) => {
110
+ let n = wt(e);
111
+ return t ? n.substring(0, 3) : n;
112
+ },
113
+ getWeekdayName: (e, t) => {
114
+ let n = s[(e + 6) % 7], r = _.texts[n] ?? n;
115
+ return t ? r.substring(0, 3) : r;
116
+ }
117
+ })), _t = d(() => {
118
+ let e = k.value;
119
+ if (!e) return "";
120
+ if (Array.isArray(e)) return e.map((e) => e instanceof Date ? c(e, _.format, q.value) : e).join(" - ");
121
+ if (e instanceof Date) return c(e, _.format, q.value);
122
+ if (typeof e == "string") {
123
+ let t = X(e);
124
+ return t ? c(t, _.format, q.value) : String(e);
125
+ }
126
+ return String(e);
127
+ }), vt = d(() => P.value ?? _t.value);
128
+ function yt() {
129
+ N.value = vt.value;
130
+ }
131
+ Ee(vt, () => {
132
+ Ye.value || yt();
133
+ }, { immediate: !0 });
134
+ let bt = d(() => {
135
+ let e = le(new Date(R.value, L.value, 1)), t = ce(L.value, R.value), n = (e.getDay() + 6) % 7, r = [], i = L.value === 0 ? 11 : L.value - 1, a = L.value === 0 ? R.value - 1 : R.value, o = ce(i, a);
136
+ for (let e = n - 1; e >= 0; e--) xt(r, new Date(a, i, o - e), !1);
137
+ for (let e = 1; e <= t; e++) xt(r, new Date(R.value, L.value, e), !0);
138
+ let s = 7 - r.length % 7, ee = s === 7 ? 0 : s;
139
+ for (let e = 1; e <= ee; e++) xt(r, new Date(R.value, L.value + 1, e), !1);
140
+ return r;
141
+ });
142
+ function xt(e, t, n) {
143
+ let r = ht.value, i = gt.value, a = t.getFullYear(), o = a < D || a > O;
144
+ e.push({
145
+ date: t,
146
+ isCurrentMonth: n,
147
+ isToday: fe(t, /* @__PURE__ */ new Date()),
148
+ isSelected: r ? fe(t, r) : !1,
149
+ isRangeStart: !!r && fe(t, r),
150
+ isRangeEnd: !!i && fe(t, i),
151
+ isInRange: r && i ? de(t, r, i) : !1,
152
+ isDisabled: o
153
+ });
154
+ }
155
+ let St = d(() => s.map((e) => {
156
+ let t = e;
157
+ return _.texts[t]?.substring(0, 2) ?? e;
158
+ })), Ct = d(() => Array.from({ length: 12 }, (e, t) => wt(t, 3)));
159
+ function wt(e, t = 0) {
160
+ let n = o[e], r = _.texts[n] ?? o[e];
161
+ return t <= 0 ? r : r.substring(0, t);
162
+ }
163
+ function Tt(e) {
164
+ let t = e - Math.floor(He / 2), n = t + He;
165
+ return t < D && (t = D, n = Math.min(t + He, O)), n > O && (n = O, t = Math.max(D, n - He)), {
166
+ startYear: t,
167
+ endYear: n
168
+ };
169
+ }
170
+ function Et(e) {
171
+ let { startYear: t, endYear: n } = Tt(e);
172
+ return Array.from({ length: n - t + 1 }, (e, n) => t + n);
173
+ }
174
+ function Dt() {
175
+ At.value && (z.value -= He);
176
+ }
177
+ function Ot() {
178
+ jt.value && (z.value += He);
179
+ }
180
+ let kt = d(() => Tt(z.value)), At = d(() => kt.value.startYear > D), jt = d(() => kt.value.endYear < O), Mt = d(() => L.value === 0 ? R.value - 1 : R.value), Nt = d(() => L.value === 11 ? R.value + 1 : R.value), Pt = d(() => Mt.value >= D), Ft = d(() => Nt.value <= O), It = d(() => Et(z.value)), Lt = d(() => j.value ? _.icons.clock : _.icons.calendar), Rt = d(() => ae(_.format)), zt = d(() => `${Rt.value} - ${Rt.value}`);
181
+ ie(() => nt?.value?.inputRef, () => _.range ? zt.value : Rt.value), Ee(() => nt?.value?.inputRef, (e, t, n) => {
182
+ let r = Yn(e);
183
+ et = r, r && (r.addEventListener("click", Kn), r.addEventListener("paste", In, !0), n(() => {
184
+ et = null, r.removeEventListener("click", Kn), r.removeEventListener("paste", In, !0);
185
+ }));
186
+ }, { flush: "post" }), Ee(k, () => {
187
+ P.value = null, yt();
188
+ });
189
+ function Bt(e) {
190
+ return e === void 0 ? !1 : typeof e == "string" ? e.trim().length > 0 : e instanceof Date ? !0 : Array.isArray(e) ? e.length > 0 : !1;
191
+ }
192
+ let Vt = d(() => _.clearable && !_.readonly && !_.disabled && Bt(k.value));
193
+ function Ht() {
194
+ Vt.value && (en(), k.value = void 0, N.value = "", sr());
195
+ }
196
+ function Ut(e) {
197
+ !_.range || !K.value || !W.value || e.getFullYear() < D || e.getFullYear() > O || (G.value = new Date(e));
198
+ }
199
+ function Wt() {
200
+ G.value = null;
201
+ }
202
+ function Gt(e) {
203
+ let t = e.currentTarget, n = e.relatedTarget;
204
+ !t || n && t.contains(n) || Wt();
205
+ }
206
+ function Kt(e) {
207
+ if (!_.range || !K.value || !W.value) return;
208
+ let t = e.touches.item(0);
209
+ if (!t) return;
210
+ let n = document.elementFromPoint(t.clientX, t.clientY)?.closest("[data-day-index]");
211
+ if (!n) return;
212
+ let r = Number(n.dataset.dayIndex);
213
+ if (Number.isNaN(r)) return;
214
+ let i = bt.value[r];
215
+ i && Ut(i.date);
216
+ }
217
+ function qt(e) {
218
+ if (!(_.readonly || _.disabled) && !(e.getFullYear() < D || e.getFullYear() > O)) if (_.range) if (K.value) {
219
+ let t = W.value ?? new Date(e), n = new Date(e), [r, i] = n < t ? [n, t] : [t, n];
220
+ Ke.value && i.setHours(23, 59, qe.value ? 59 : 0, 0), k.value = [r, i], W.value = null, mt.value = null, G.value = null, K.value = !1;
221
+ } else {
222
+ let t = new Date(e);
223
+ Ke.value && W.value && t.setHours(W.value.getHours(), W.value.getMinutes(), W.value.getSeconds(), W.value.getMilliseconds()), W.value = t, mt.value = null, G.value = null, K.value = !0;
224
+ }
225
+ else {
226
+ let t = new Date(e);
227
+ U.value && !Mn(U.value) ? t.setHours(U.value.getHours(), U.value.getMinutes(), U.value.getSeconds()) : Ke.value && Nn(t), k.value = t;
228
+ }
229
+ }
230
+ function Jt(e, t) {
231
+ R.value = e, t && nr("year");
232
+ }
233
+ function J(e, t) {
234
+ L.value = e, t && nr("month");
235
+ }
236
+ function Yt() {
237
+ Pt.value && (L.value === 0 ? (J(11), Jt(R.value - 1)) : J(L.value - 1));
238
+ }
239
+ function Xt() {
240
+ Ft.value && (L.value === 11 ? (J(0), Jt(R.value + 1)) : J(L.value + 1));
241
+ }
242
+ function Zt() {
243
+ J((/* @__PURE__ */ new Date()).getMonth()), Jt((/* @__PURE__ */ new Date()).getFullYear()), tr();
244
+ }
245
+ function Qt() {
246
+ let e = U.value, t = k.value;
247
+ if (_.range && Array.isArray(t) && t.length > 0) {
248
+ let n = t[0];
249
+ n instanceof Date ? e = n : typeof n == "string" && (e = l(n, _.format, H.value));
250
+ }
251
+ e ??= /* @__PURE__ */ new Date(), J(e.getMonth()), Jt(e.getFullYear()), tr();
252
+ }
253
+ function $t(e) {
254
+ return _.range ? e === 1 ? pt.value ?? mt.value : U.value ?? W.value : U.value;
255
+ }
256
+ function en() {
257
+ W.value = null, mt.value = null, G.value = null, K.value = !1;
258
+ }
259
+ function tn(e, t) {
260
+ return t < e ? [new Date(t), new Date(e)] : [new Date(e), new Date(t)];
261
+ }
262
+ function nn() {
263
+ if (!_.range || !j.value) return;
264
+ let e = k.value;
265
+ if (!Array.isArray(e) || e.length < 2) return;
266
+ let t = e[0], n = e[1];
267
+ !(t instanceof Date) || !(n instanceof Date) || n >= t || (k.value = tn(t, n));
268
+ }
269
+ function rn(e, t) {
270
+ if (!_.range) {
271
+ k.value = t;
272
+ return;
273
+ }
274
+ if (j.value) {
275
+ e === 0 ? W.value = t : mt.value = t;
276
+ let n = e === 0 ? t : U.value ?? W.value, r = e === 1 ? t : pt.value;
277
+ if (!n || !r) return;
278
+ k.value = [new Date(n), new Date(r)], en();
279
+ return;
280
+ }
281
+ if (K.value) {
282
+ e === 0 && (W.value = t);
283
+ return;
284
+ }
285
+ let n = U.value, r = pt.value;
286
+ !n || !r || (k.value = e === 1 ? [n, t] : [t, r]);
287
+ }
288
+ function Y(e, t) {
289
+ let n = $t(e) ?? (() => {
290
+ let e = /* @__PURE__ */ new Date();
291
+ return e.setHours(0, 0, 0, 0), e;
292
+ })(), r = new Date(n);
293
+ t(r), rn(e, r);
294
+ }
295
+ function an(e) {
296
+ let t = $t(e);
297
+ if (!t) return A.value ? 12 : 0;
298
+ let n = t.getHours();
299
+ return A.value ? n % 12 || 12 : n;
300
+ }
301
+ function on(e) {
302
+ return $t(e)?.getMinutes() ?? 0;
303
+ }
304
+ function sn(e) {
305
+ return $t(e)?.getSeconds() ?? 0;
306
+ }
307
+ function cn(e) {
308
+ let t = $t(e);
309
+ return t ? t.getHours() >= 12 : !1;
310
+ }
311
+ function ln(e, t) {
312
+ return t ? e === 12 ? 12 : e + 12 : e === 12 ? 0 : e;
313
+ }
314
+ function un(e) {
315
+ Y(e, (e) => {
316
+ if (A.value) {
317
+ let t = e.getHours() % 12 || 12, n = t >= 12 ? 1 : t + 1, r = e.getHours() >= 12;
318
+ e.setHours(ln(n, r));
319
+ } else e.setHours(e.getHours() >= 23 ? 0 : e.getHours() + 1);
320
+ });
321
+ }
322
+ function dn(e) {
323
+ Y(e, (e) => {
324
+ if (A.value) {
325
+ let t = e.getHours() % 12 || 12, n = t <= 1 ? 12 : t - 1, r = e.getHours() >= 12;
326
+ e.setHours(ln(n, r));
327
+ } else e.setHours(e.getHours() <= 0 ? 23 : e.getHours() - 1);
328
+ });
329
+ }
330
+ function fn(e) {
331
+ Y(e, (e) => {
332
+ e.setMinutes(e.getMinutes() >= 59 ? 0 : e.getMinutes() + 1);
333
+ });
334
+ }
335
+ function pn(e) {
336
+ Y(e, (e) => {
337
+ e.setMinutes(e.getMinutes() <= 0 ? 59 : e.getMinutes() - 1);
338
+ });
339
+ }
340
+ function mn(e) {
341
+ Y(e, (e) => {
342
+ e.setSeconds(e.getSeconds() >= 59 ? 0 : e.getSeconds() + 1);
343
+ });
344
+ }
345
+ function hn(e) {
346
+ Y(e, (e) => {
347
+ e.setSeconds(e.getSeconds() <= 0 ? 59 : e.getSeconds() - 1);
348
+ });
349
+ }
350
+ function gn(e) {
351
+ return (e ?? "").replace(/\D/g, "");
352
+ }
353
+ function _n(e) {
354
+ return Math.min(23, Math.max(0, e));
355
+ }
356
+ function vn(e) {
357
+ return Math.min(12, Math.max(1, e));
358
+ }
359
+ function yn(e) {
360
+ return Math.min(59, Math.max(0, e));
361
+ }
362
+ function bn(e, t) {
363
+ let n = gn(e).slice(0, 2);
364
+ if (n === "") return;
365
+ let r = Number.parseInt(n, 10);
366
+ if (Number.isNaN(r)) return;
367
+ let i = A.value ? vn(r) : _n(r);
368
+ Y(t, (e) => {
369
+ A.value ? e.setHours(ln(i, e.getHours() >= 12)) : e.setHours(i);
370
+ });
371
+ }
372
+ function xn(e, t) {
373
+ let n = gn(e).slice(0, 2);
374
+ if (n === "") return;
375
+ let r = Number.parseInt(n, 10);
376
+ if (Number.isNaN(r)) return;
377
+ let i = yn(r);
378
+ Y(t, (e) => {
379
+ e.setMinutes(i);
380
+ });
381
+ }
382
+ function Sn(e, t) {
383
+ let n = gn(e).slice(0, 2);
384
+ if (n === "") return;
385
+ let r = Number.parseInt(n, 10);
386
+ if (Number.isNaN(r)) return;
387
+ let i = yn(r);
388
+ Y(t, (e) => {
389
+ e.setSeconds(i);
390
+ });
391
+ }
392
+ async function Cn(e, t, n) {
393
+ if (e.ctrlKey || e.altKey || e.metaKey || !/^\d$/.test(e.key)) return;
394
+ let r = e.target;
395
+ if (!r) return;
396
+ let i = r.selectionStart, a = r.selectionEnd;
397
+ if (i === null || a === null || i !== a || r.maxLength <= 0 || r.value.length < r.maxLength || i >= r.value.length) return;
398
+ e.preventDefault();
399
+ let o = `${r.value.slice(0, i)}${e.key}${r.value.slice(i + 1)}`;
400
+ t === "hours" ? bn(o, n) : t === "minutes" ? xn(o, n) : Sn(o, n);
401
+ let s = Math.min(i + 1, r.maxLength);
402
+ await b(), r.setSelectionRange(s, s);
403
+ }
404
+ function wn(e, t) {
405
+ Y(t, (t) => {
406
+ let n = t.getHours() % 12 || 12;
407
+ t.setHours(ln(n, e));
408
+ });
409
+ }
410
+ async function Tn(e, t, n, r) {
411
+ if (!e) return;
412
+ let i = re(t, n, r), a = () => e.setSelectionRange(i, i);
413
+ a(), await b(), a(), await new Promise((e) => {
414
+ requestAnimationFrame(() => {
415
+ a(), e();
416
+ });
417
+ });
418
+ }
419
+ async function En(e, t, n, r) {
420
+ if (n === t) {
421
+ N.value !== n && (N.value = n);
422
+ return;
423
+ }
424
+ N.value = n, await Tn(e, t, n, r);
425
+ }
426
+ function X(e, t) {
427
+ let n = e.trim();
428
+ return n ? l(n, _.format, H.value) || ge(n) || Jn(n) || (t?.complete ? he(n, _.format, H.value) : null) : null;
429
+ }
430
+ async function Dn(e) {
431
+ if (Xe > 0) return;
432
+ if (_.readonly || _.disabled) {
433
+ yt();
434
+ return;
435
+ }
436
+ let t = Q(), n = t?.selectionStart ?? 0, r = e ?? "";
437
+ if (!r) {
438
+ k.value = void 0, P.value = null, N.value = "", F.value = !1;
439
+ return;
440
+ }
441
+ if (_.range) {
442
+ let e = On(r);
443
+ if (e) {
444
+ k.value = e, P.value = null, N.value = e.map((e) => c(e, _.format, q.value)).join(" - "), F.value = !1;
445
+ return;
446
+ }
447
+ let i = te(r, zt.value);
448
+ await En(t, r, i, n), P.value = i;
449
+ let a = On(i);
450
+ if (a) {
451
+ k.value = a, P.value = null;
452
+ let e = a.map((e) => c(e, _.format, q.value)).join(" - ");
453
+ e !== i && (N.value = e, await Tn(t, i, e, n)), F.value = !1;
454
+ }
455
+ return;
456
+ }
457
+ let i = X(r);
458
+ if (i) {
459
+ let e = Z(i, r);
460
+ k.value = e, P.value = null, N.value = c(e, _.format, q.value), F.value = !1;
461
+ return;
462
+ }
463
+ let a = ne(te(r, Rt.value), _.format), o = a, s = l(a, _.format, H.value);
464
+ if (!s) {
465
+ let e = l(r, _.format, H.value);
466
+ e && (o = r, s = e);
467
+ }
468
+ if (!s) {
469
+ let e = An(_.format);
470
+ e && (s = l(a, e, H.value) ?? l(r, e, H.value));
471
+ }
472
+ if (await En(t, r, o, n), P.value = o, s) {
473
+ let e = Z(s, r);
474
+ k.value = e, P.value = null;
475
+ let i = c(e, _.format, q.value);
476
+ i !== o && (N.value = i, await Tn(t, o, i, n)), F.value = !1;
477
+ }
478
+ }
479
+ function On(e, t) {
480
+ let n = e.split(" - ");
481
+ if (n.length !== 2) return null;
482
+ let r = (e) => X(e, t), i = r(n[0] ?? ""), a = r(n[1] ?? "");
483
+ return !i || !a ? null : a < i ? [a, i] : [i, a];
484
+ }
485
+ function kn() {
486
+ if (_.readonly || _.disabled) return !1;
487
+ let e = P.value ?? N.value;
488
+ if (!e) return !1;
489
+ if (_.range) {
490
+ let t = On(te(e, zt.value), { complete: !0 });
491
+ return t ? (k.value = t, P.value = null, F.value = !1, N.value = t.map((e) => c(e, _.format, q.value)).join(" - "), !0) : (P.value = null, k.value = void 0, F.value = !0, N.value = "", !1);
492
+ }
493
+ let t = ne(te(e, Rt.value), _.format), n = X(e, { complete: !0 }) ?? he(t, _.format, H.value);
494
+ if (!n) return P.value = null, k.value = void 0, F.value = !0, N.value = "", !1;
495
+ let r = X(e) || ue(t, _.format) ? n : Z(n, t);
496
+ return k.value = r, P.value = null, F.value = !1, N.value = c(r, _.format, q.value), !0;
497
+ }
498
+ function An(e) {
499
+ let t = e.replace(/[\sT]+(?:'[^']*'|HH|H|hh|h|mm|m|ss|s|SSS|S|a).*$/i, "").trim();
500
+ return t && t !== e ? t : null;
501
+ }
502
+ function jn(e) {
503
+ return !Ke.value || X(e) || ue(e, _.format) ? !0 : /\dT\d|\d{1,2}:\d{2}/.test(e);
504
+ }
505
+ function Mn(e) {
506
+ return e.getHours() === 0 && e.getMinutes() === 0 && e.getSeconds() === 0 && e.getMilliseconds() === 0;
507
+ }
508
+ function Nn(e) {
509
+ let t = /* @__PURE__ */ new Date();
510
+ e.setHours(t.getHours(), t.getMinutes(), qe.value ? t.getSeconds() : 0, qe.value ? t.getMilliseconds() : 0);
511
+ }
512
+ function Z(e, t) {
513
+ if (_.range || !Ke.value || t !== void 0 && jn(t)) return e;
514
+ let n = new Date(e);
515
+ return Nn(n), n;
516
+ }
517
+ function Pn(e) {
518
+ if (_.range) return On(e);
519
+ let t = l(e, _.format, H.value);
520
+ if (t) return Z(t, e);
521
+ let n = ge(e);
522
+ if (n) return Z(n, e);
523
+ let r = Jn(e);
524
+ if (r) return Z(r, e);
525
+ let i = he(e, _.format, H.value);
526
+ if (i) return Z(i, e);
527
+ let a = An(_.format);
528
+ if (a) {
529
+ let t = l(e, a, H.value);
530
+ if (t) return Z(t, e);
531
+ }
532
+ return null;
533
+ }
534
+ async function Fn(e) {
535
+ if (F.value = !1, P.value = null, Array.isArray(e)) {
536
+ let t = e.map((e) => c(e, _.format, q.value)).join(" - ");
537
+ Xe += 1, k.value = e, N.value = t, await b(), --Xe;
538
+ return;
539
+ }
540
+ let t = c(e, _.format, q.value);
541
+ Xe += 1, k.value = e, N.value = t, await b(), --Xe;
542
+ }
543
+ function In(e) {
544
+ if (_.readonly || _.disabled) {
545
+ e.preventDefault();
546
+ return;
547
+ }
548
+ let t = e.clipboardData?.getData("text/plain")?.trim() || e.clipboardData?.getData("text")?.trim() || "";
549
+ if (!t) {
550
+ e.preventDefault();
551
+ return;
552
+ }
553
+ let n = Pn(t);
554
+ if (!n) {
555
+ e.preventDefault();
556
+ return;
557
+ }
558
+ e.preventDefault(), Fn(n);
559
+ }
560
+ function Ln(e) {
561
+ let t = e.target;
562
+ if (!(t instanceof Element) || !V.value) return null;
563
+ let n = t.closest("button, input, select, textarea, a[href], [tabindex], [contenteditable]");
564
+ return n && V.value.contains(n) ? n : null;
565
+ }
566
+ function Rn(e) {
567
+ return !(e.matches(":disabled") || e.getAttribute("aria-disabled") === "true" || e.getAttribute("tabindex") === "-1");
568
+ }
569
+ function zn(e) {
570
+ if (!(e.target instanceof Node) || !V.value?.contains(e.target)) return;
571
+ Qe = !0;
572
+ let t = Ln(e);
573
+ t && !Rn(t) && e.preventDefault();
574
+ }
575
+ function Bn() {
576
+ return V.value ? Array.from(V.value.querySelectorAll(Ue)).filter((e) => e.offsetWidth > 0 || e.offsetHeight > 0 || e.getClientRects().length > 0) : [];
577
+ }
578
+ function Vn() {
579
+ let e = Q();
580
+ if (!e) return;
581
+ let t = Array.from(document.querySelectorAll(Ue)).filter((e) => e.offsetWidth > 0 || e.offsetHeight > 0 || e.getClientRects().length > 0), n = t.indexOf(e);
582
+ n >= 0 && n < t.length - 1 && t[n + 1]?.focus();
583
+ }
584
+ function Hn(e) {
585
+ if (e.key !== "Tab" || !M.value || _.readonly || _.disabled) return;
586
+ if (e.shiftKey) {
587
+ B = !1, M.value = !1;
588
+ return;
589
+ }
590
+ let [t] = Bn();
591
+ t && (e.preventDefault(), Qe = !0, t.focus());
592
+ }
593
+ async function Un(e) {
594
+ if (e.key !== "Tab") return;
595
+ let t = Bn();
596
+ if (!t.length) return;
597
+ let n = t[0], r = t[t.length - 1], i = document.activeElement;
598
+ if (e.shiftKey) {
599
+ if (i !== n) return;
600
+ e.preventDefault(), Qe = !0, sr();
601
+ return;
602
+ }
603
+ i === r && (e.preventDefault(), $e = !0, M.value = !1, await b(), Vn());
604
+ }
605
+ async function Wn(e) {
606
+ if (kn(), Qe) {
607
+ Qe = !1;
608
+ return;
609
+ }
610
+ let t = e?.relatedTarget;
611
+ if (t instanceof Node && V.value?.contains(t)) return;
612
+ await b();
613
+ let n = Q(), r = document.activeElement;
614
+ n !== r && (r instanceof Node && V.value?.contains(r) || (B = !1, M.value = !1, Ye.value = !1, yt()));
615
+ }
616
+ function Gn() {
617
+ if (!(_.readonly || _.disabled)) {
618
+ if (Ye.value = !0, B) {
619
+ B = !1;
620
+ return;
621
+ }
622
+ M.value ||= !0;
623
+ }
624
+ }
625
+ function Kn() {
626
+ _.readonly || _.disabled || (B = !1, M.value = !0);
627
+ }
628
+ function qn(e) {
629
+ e || tt(), M.value = e;
630
+ }
631
+ function Jn(e) {
632
+ let t = ge(e);
633
+ if (t) return t;
634
+ let n = /[A-Za-z]/.test(e), r = /^\d{4}[-/]\d{1,2}[-/]\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?$/.test(e);
635
+ if (!n && !r) return null;
636
+ let i = new Date(e);
637
+ return Number.isNaN(i.getTime()) ? null : i;
638
+ }
639
+ function Yn(e) {
640
+ return e instanceof HTMLInputElement ? e : typeof e == "object" && e && "value" in e && e.value instanceof HTMLInputElement ? e.value : null;
641
+ }
642
+ function Q() {
643
+ if (et) return et;
644
+ let e = Yn(nt.value?.inputRef);
645
+ if (e) return et = e, e;
646
+ let t = lt(nt.value?.fieldRef)?.querySelector(".q-text-field__input") ?? null;
647
+ return t ? (et = t, t) : null;
648
+ }
649
+ function Xn(e) {
650
+ return e.isSelected || e.isRangeStart || e.isRangeEnd ? "bold" : e.isInRange ? "tonal" : "ghost";
651
+ }
652
+ function Zn(e) {
653
+ V.value?.style.setProperty("--q-date-view-height", `${Math.max(0, e)}px`);
654
+ }
655
+ async function Qn() {
656
+ if (!M.value || j.value) {
657
+ Zn(0);
658
+ return;
659
+ }
660
+ I.value === "date" && (await b(), Zn(rt.value?.getBoundingClientRect().height ?? 0));
661
+ }
662
+ function $() {
663
+ Ze?.disconnect(), Ze = null;
664
+ }
665
+ async function $n() {
666
+ !M.value || j.value || I.value !== "date" || (await b(), rt.value && ($(), Ze = new MutationObserver(() => {
667
+ Qn();
668
+ }), Ze.observe(rt.value, {
669
+ childList: !0,
670
+ subtree: !0,
671
+ attributes: !0,
672
+ characterData: !0
673
+ }), Qn()));
674
+ }
675
+ function er() {
676
+ I.value = "time", $();
677
+ }
678
+ function tr() {
679
+ I.value = "date", $n();
680
+ }
681
+ async function nr(e) {
682
+ V.value?.focus(), tr(), await b(), ft(e === "year" ? at.value : e === "month" ? it.value : e === "time" ? ot.value : null);
683
+ }
684
+ function rr() {
685
+ let e = I.value;
686
+ e !== "date" && nr(e);
687
+ }
688
+ async function ir() {
689
+ $(), I.value = "month", await b();
690
+ let e = st.get(L.value);
691
+ e?.scrollIntoView({ block: "center" }), e?.focus();
692
+ }
693
+ async function ar() {
694
+ $(), z.value = R.value, I.value = "year", await b(), ct.get(z.value)?.scrollIntoView({ block: "center" });
695
+ }
696
+ async function or(e) {
697
+ if (e.key !== "Escape") return;
698
+ if (B = !0, I.value === "date" || j.value) {
699
+ e.preventDefault(), M.value = !1, await b(), fr();
700
+ return;
701
+ }
702
+ e.preventDefault();
703
+ let t = I.value;
704
+ await nr(t);
705
+ }
706
+ function sr() {
707
+ Q()?.focus();
708
+ }
709
+ function cr(e) {
710
+ return !e || e === document.body || e === document.documentElement;
711
+ }
712
+ function lr(e, t) {
713
+ return e.closest(".q-date-time-picker__menu") || t.closest(".q-date-time-picker")?.contains(e) || !(e instanceof HTMLElement) ? !1 : e.tabIndex >= 0 || e.matches("input, select, textarea, button, a[href], [tabindex]:not([tabindex=\"-1\"])");
714
+ }
715
+ function ur(e) {
716
+ let t = Q();
717
+ return t ? e === t || !e || !e.isConnected || cr(e) || V.value?.contains(e) ? !0 : !lr(e, t) : !1;
718
+ }
719
+ function dr() {
720
+ if ($e) return;
721
+ let e = Q();
722
+ !e || !ur(document.activeElement) || (B = !0, e.focus());
723
+ }
724
+ function fr() {
725
+ b().then(() => {
726
+ requestAnimationFrame(() => {
727
+ requestAnimationFrame(() => {
728
+ dr();
729
+ });
730
+ });
731
+ });
732
+ }
733
+ function pr() {
734
+ if ($e) {
735
+ $e = !1;
736
+ return;
737
+ }
738
+ fr();
739
+ }
740
+ function mr() {
741
+ tt();
742
+ let e = $e;
743
+ $e &&= !1, e || (B = !0, fr());
744
+ }
745
+ return Ee(k, () => {
746
+ U.value && (J(U.value.getMonth()), Jt(U.value.getFullYear()));
747
+ }), Ee(M, (e, t) => {
748
+ if (e && t === !1 ? ye("open") : !e && t === !0 && ye("close"), j.value) {
749
+ $(), Zn(0), e ? (document.addEventListener("keydown", or, { capture: !0 }), er()) : (t && (nn(), mr()), document.removeEventListener("keydown", or, { capture: !0 }));
750
+ return;
751
+ }
752
+ en(), e ? (document.addEventListener("keydown", or, { capture: !0 }), Qt(), $n()) : (t && mr(), document.removeEventListener("keydown", or, { capture: !0 }), $(), Zn(0));
753
+ }), Ee(j, (e) => {
754
+ e && $(), M.value = !1, e && Zn(0), e ? er() : tr();
755
+ }, { immediate: !0 }), xe(() => {
756
+ $(), document.removeEventListener("keydown", or, { capture: !0 });
757
+ }), (i, a) => (S(), m(u, null, [g(w(n), y({
758
+ id: _.id,
759
+ ref: "field",
760
+ "model-value": N.value,
761
+ class: ["q-date-time-picker", _.class],
762
+ clearable: Vt.value,
763
+ "aria-label": _.label,
764
+ label: _.label,
765
+ "label-position": _.labelPosition,
766
+ readonly: _.readonly,
767
+ disabled: _.disabled,
768
+ placeholder: Ge.value,
769
+ required: _.required,
770
+ size: _.size,
771
+ invalid: _.invalid || F.value
772
+ }, i.$attrs, {
773
+ onBlur: Wn,
774
+ "onClick:clear": sr,
775
+ onFocusin: Gn,
776
+ onKeydown: Hn,
777
+ "onUpdate:modelValue": Dn
778
+ }), ve({
779
+ prepend: E(() => [g(w(t), y({ class: "q-date-time-picker__input-icon" }, Lt.value), null, 16)]),
780
+ _: 2
781
+ }, [i.$slots.extras ? {
782
+ name: "extras",
783
+ fn: E(() => [Ce(i.$slots, "extras")]),
784
+ key: "0"
785
+ } : void 0]), 1040, [
786
+ "id",
787
+ "model-value",
788
+ "class",
789
+ "clearable",
790
+ "aria-label",
791
+ "label",
792
+ "label-position",
793
+ "readonly",
794
+ "disabled",
795
+ "placeholder",
796
+ "required",
797
+ "size",
798
+ "invalid"
799
+ ]), !_.readonly && !_.disabled ? (S(), f(w(r), {
800
+ key: 0,
801
+ "model-value": M.value,
802
+ anchor: nt.value?.fieldRef,
803
+ inline: _.inline,
804
+ offset: 8,
805
+ placement: "bottom",
806
+ trigger: "manual",
807
+ arrow: "",
808
+ "non-modal": "",
809
+ spy: "",
810
+ onLeave: pr,
811
+ "onUpdate:modelValue": qn
812
+ }, {
813
+ default: E(() => [h("div", {
814
+ ref: "menu",
815
+ class: "q-date-time-picker__menu",
816
+ tabindex: "-1",
817
+ onPointerdownCapture: zn,
818
+ onKeydown: Un
819
+ }, [
820
+ p(" Calendar View "),
821
+ I.value === "date" ? (S(), m("div", De, [
822
+ p(" Header "),
823
+ h("div", Oe, [
824
+ g(w(e), {
825
+ variant: "ghost",
826
+ disabled: !Pt.value,
827
+ title: _.texts.previousMonth,
828
+ onClick: Yt
829
+ }, {
830
+ default: E(() => [g(w(t), x(v(_.icons.back)), null, 16)]),
831
+ _: 1
832
+ }, 8, ["disabled", "title"]),
833
+ g(w(e), {
834
+ ref: "monthHeader",
835
+ "data-testid": "q-date-time-picker-month-header",
836
+ variant: "ghost",
837
+ label: wt(L.value, 3),
838
+ title: _.texts.pickMonth,
839
+ onClick: ir
840
+ }, null, 8, ["label", "title"]),
841
+ g(w(e), {
842
+ ref: "yearHeader",
843
+ "data-testid": "q-date-time-picker-year-header",
844
+ variant: "ghost",
845
+ label: R.value.toString(),
846
+ title: _.texts.pickYear,
847
+ onClick: ar
848
+ }, null, 8, ["label", "title"]),
849
+ g(w(e), {
850
+ variant: "ghost",
851
+ disabled: !Ft.value,
852
+ title: _.texts.nextMonth,
853
+ onClick: Xt
854
+ }, {
855
+ default: E(() => [g(w(t), x(v(_.icons.forward)), null, 16)]),
856
+ _: 1
857
+ }, 8, ["disabled", "title"])
858
+ ]),
859
+ p(" Weekday Headers "),
860
+ h("div", ke, [(S(!0), m(u, null, Se(St.value, (e) => (S(), m("div", {
861
+ key: e,
862
+ class: "q-date-time-picker__weekday"
863
+ }, we(e), 1))), 128))]),
864
+ p(" Days Grid "),
865
+ h("div", {
866
+ class: "q-date-time-picker__days",
867
+ onMouseleave: Wt,
868
+ onFocusout: Gt,
869
+ onTouchstartPassive: Kt,
870
+ onTouchmovePassive: Kt
871
+ }, [(S(!0), m(u, null, Se(bt.value, (t, n) => (S(), f(w(e), {
872
+ key: n,
873
+ "data-day-index": n,
874
+ class: be(["q-date-time-picker__day", {
875
+ "q-date-time-picker__day--other-month": !t.isCurrentMonth,
876
+ "q-date-time-picker__day--today": t.isToday,
877
+ "q-date-time-picker__day--selected": t.isSelected,
878
+ "q-date-time-picker__day--in-range": t.isInRange,
879
+ "q-date-time-picker__day--range-start": t.isRangeStart,
880
+ "q-date-time-picker__day--range-end": t.isRangeEnd
881
+ }]),
882
+ label: t.date.getDate().toString(),
883
+ variant: Xn(t),
884
+ disabled: t.isDisabled,
885
+ onMouseenter: () => Ut(t.date),
886
+ onFocus: () => Ut(t.date),
887
+ onClick: () => qt(t.date)
888
+ }, null, 8, [
889
+ "data-day-index",
890
+ "class",
891
+ "label",
892
+ "variant",
893
+ "disabled",
894
+ "onMouseenter",
895
+ "onFocus",
896
+ "onClick"
897
+ ]))), 128))], 32)
898
+ ], 512)) : I.value === "time" ? (S(), m(u, { key: 1 }, [p(" Time View "), h("div", Ae, [(S(!0), m(u, null, Se(_.range ? 2 : 1, (r) => (S(), m("div", {
899
+ key: r,
900
+ class: "q-date-time-picker__time-group"
901
+ }, [
902
+ A.value ? (S(), m("div", je, [g(w(ee), {
903
+ "model-value": cn(r - 1),
904
+ "show-state-labels": "",
905
+ size: "small",
906
+ "false-label": _.texts.am,
907
+ "true-label": _.texts.pm,
908
+ "onUpdate:modelValue": (e) => wn(e ?? !1, r - 1)
909
+ }, null, 8, [
910
+ "model-value",
911
+ "false-label",
912
+ "true-label",
913
+ "onUpdate:modelValue"
914
+ ])])) : p("v-if", !0),
915
+ p(" Time Inputs "),
916
+ h("div", Me, [
917
+ h("div", Ne, [
918
+ g(w(e), {
919
+ variant: "ghost",
920
+ title: _.texts.increaseHour,
921
+ onClick: (e) => un(r - 1)
922
+ }, {
923
+ default: E(() => [g(w(t), y({ ref_for: !0 }, _.icons.up), null, 16)]),
924
+ _: 1
925
+ }, 8, ["title", "onClick"]),
926
+ g(w(n), {
927
+ class: "q-date-time-picker__time-number",
928
+ size: "small",
929
+ inputmode: "numeric",
930
+ "max-length": 2,
931
+ "model-value": w(me)(an(r - 1)),
932
+ onKeydown: (e) => Cn(e, "hours", r - 1),
933
+ "onUpdate:modelValue": (e) => bn(e, r - 1)
934
+ }, null, 8, [
935
+ "model-value",
936
+ "onKeydown",
937
+ "onUpdate:modelValue"
938
+ ]),
939
+ g(w(e), {
940
+ variant: "ghost",
941
+ title: _.texts.decreaseHour,
942
+ onClick: (e) => dn(r - 1)
943
+ }, {
944
+ default: E(() => [g(w(t), y({ ref_for: !0 }, _.icons.down), null, 16)]),
945
+ _: 1
946
+ }, 8, ["title", "onClick"])
947
+ ]),
948
+ a[1] ||= h("div", { class: "q-date-time-picker__time-separator" }, ":", -1),
949
+ h("div", Pe, [
950
+ g(w(e), {
951
+ variant: "ghost",
952
+ title: _.texts.increaseMinute,
953
+ onClick: (e) => fn(r - 1)
954
+ }, {
955
+ default: E(() => [g(w(t), y({ ref_for: !0 }, _.icons.up), null, 16)]),
956
+ _: 1
957
+ }, 8, ["title", "onClick"]),
958
+ g(w(n), {
959
+ class: "q-date-time-picker__time-number",
960
+ size: "small",
961
+ inputmode: "numeric",
962
+ "max-length": 2,
963
+ "model-value": w(me)(on(r - 1)),
964
+ onKeydown: (e) => Cn(e, "minutes", r - 1),
965
+ "onUpdate:modelValue": (e) => xn(e, r - 1)
966
+ }, null, 8, [
967
+ "model-value",
968
+ "onKeydown",
969
+ "onUpdate:modelValue"
970
+ ]),
971
+ g(w(e), {
972
+ variant: "ghost",
973
+ title: _.texts.decreaseMinute,
974
+ onClick: (e) => pn(r - 1)
975
+ }, {
976
+ default: E(() => [g(w(t), y({ ref_for: !0 }, _.icons.down), null, 16)]),
977
+ _: 1
978
+ }, 8, ["title", "onClick"])
979
+ ]),
980
+ qe.value ? (S(), m(u, { key: 0 }, [a[0] ||= h("div", { class: "q-date-time-picker__time-separator" }, ":", -1), h("div", Fe, [
981
+ g(w(e), {
982
+ variant: "ghost",
983
+ title: _.texts.increaseSecond,
984
+ onClick: (e) => mn(r - 1)
985
+ }, {
986
+ default: E(() => [g(w(t), y({ ref_for: !0 }, _.icons.up), null, 16)]),
987
+ _: 1
988
+ }, 8, ["title", "onClick"]),
989
+ g(w(n), {
990
+ class: "q-date-time-picker__time-number",
991
+ size: "small",
992
+ inputmode: "numeric",
993
+ "max-length": 2,
994
+ "model-value": w(me)(sn(r - 1)),
995
+ onKeydown: (e) => Cn(e, "seconds", r - 1),
996
+ "onUpdate:modelValue": (e) => Sn(e, r - 1)
997
+ }, null, 8, [
998
+ "model-value",
999
+ "onKeydown",
1000
+ "onUpdate:modelValue"
1001
+ ]),
1002
+ g(w(e), {
1003
+ variant: "ghost",
1004
+ title: _.texts.decreaseSecond,
1005
+ onClick: (e) => hn(r - 1)
1006
+ }, {
1007
+ default: E(() => [g(w(t), y({ ref_for: !0 }, _.icons.down), null, 16)]),
1008
+ _: 1
1009
+ }, 8, ["title", "onClick"])
1010
+ ])], 64)) : p("v-if", !0)
1011
+ ])
1012
+ ]))), 128))])], 2112)) : I.value === "month" ? (S(), m(u, { key: 2 }, [p(" Month View "), h("div", Ie, [(S(!0), m(u, null, Se(Ct.value, (t, n) => (S(), f(w(e), {
1013
+ key: n,
1014
+ ref_for: !0,
1015
+ ref: (e) => ut(e, n),
1016
+ "data-testid": "q-date-time-picker-month-option",
1017
+ "data-month-index": n,
1018
+ disabled: L.value === n,
1019
+ label: t,
1020
+ title: wt(n),
1021
+ variant: "ghost",
1022
+ onClick: () => J(n, !0)
1023
+ }, null, 8, [
1024
+ "data-month-index",
1025
+ "disabled",
1026
+ "label",
1027
+ "title",
1028
+ "onClick"
1029
+ ]))), 128))])], 2112)) : I.value === "year" ? (S(), m(u, { key: 3 }, [p(" Year View "), h("div", Le, [h("div", Re, [
1030
+ g(w(e), {
1031
+ variant: "ghost",
1032
+ disabled: !At.value,
1033
+ title: _.texts.previousYears,
1034
+ onClick: Dt
1035
+ }, {
1036
+ default: E(() => [g(w(t), x(v(_.icons.back)), null, 16)]),
1037
+ _: 1
1038
+ }, 8, ["disabled", "title"]),
1039
+ h("div", ze, we(kt.value.startYear) + " - " + we(kt.value.endYear), 1),
1040
+ g(w(e), {
1041
+ variant: "ghost",
1042
+ disabled: !jt.value,
1043
+ title: _.texts.nextYears,
1044
+ onClick: Ot
1045
+ }, {
1046
+ default: E(() => [g(w(t), x(v(_.icons.forward)), null, 16)]),
1047
+ _: 1
1048
+ }, 8, ["disabled", "title"])
1049
+ ]), h("div", Be, [(S(!0), m(u, null, Se(It.value, (t, n) => (S(), f(w(e), {
1050
+ key: n,
1051
+ ref_for: !0,
1052
+ ref: (e) => dt(e, t),
1053
+ "data-testid": "q-date-time-picker-year-option",
1054
+ "data-year": t,
1055
+ disabled: R.value === t,
1056
+ label: t.toString(),
1057
+ title: t,
1058
+ variant: "ghost",
1059
+ onClick: () => Jt(t, !0)
1060
+ }, null, 8, [
1061
+ "data-year",
1062
+ "disabled",
1063
+ "label",
1064
+ "title",
1065
+ "onClick"
1066
+ ]))), 128))])])], 2112)) : p("v-if", !0),
1067
+ h("div", Ve, [
1068
+ j.value ? p("v-if", !0) : (S(), f(w(e), {
1069
+ key: 0,
1070
+ variant: "ghost",
1071
+ disabled: Je.value,
1072
+ title: _.texts.today,
1073
+ onClick: Zt
1074
+ }, {
1075
+ default: E(() => [g(w(t), x(v(_.icons.today)), null, 16)]),
1076
+ _: 1
1077
+ }, 8, ["disabled", "title"])),
1078
+ Ke.value && I.value === "date" ? (S(), f(w(e), {
1079
+ key: 1,
1080
+ ref: "toggleTime",
1081
+ "data-testid": "q-date-time-picker-toggle-time",
1082
+ variant: "ghost",
1083
+ title: _.texts.toggleMode,
1084
+ onClick: er
1085
+ }, {
1086
+ default: E(() => [g(w(t), x(v(_.icons.clock)), null, 16)]),
1087
+ _: 1
1088
+ }, 8, ["title"])) : I.value !== "date" && !j.value ? (S(), f(w(e), {
1089
+ key: 2,
1090
+ "data-testid": "q-date-time-picker-toggle-date",
1091
+ variant: "ghost",
1092
+ title: _.texts.toggleMode,
1093
+ onClick: rr
1094
+ }, {
1095
+ default: E(() => [g(w(t), x(v(_.icons.calendar)), null, 16)]),
1096
+ _: 1
1097
+ }, 8, ["title"])) : p("v-if", !0),
1098
+ _.clearable ? (S(), f(w(e), {
1099
+ key: 3,
1100
+ "data-testid": "q-date-time-picker-clear",
1101
+ variant: "ghost",
1102
+ disabled: !Vt.value,
1103
+ title: _.texts.clearValue,
1104
+ onClick: Ht
1105
+ }, {
1106
+ default: E(() => [g(w(t), x(v(_.icons.delete)), null, 16)]),
1107
+ _: 1
1108
+ }, 8, ["disabled", "title"])) : p("v-if", !0)
1109
+ ])
1110
+ ], 544)]),
1111
+ _: 1
1112
+ }, 8, [
1113
+ "model-value",
1114
+ "anchor",
1115
+ "inline"
1116
+ ])) : p("v-if", !0)], 64));
1117
+ }
1447
1118
  });
1448
- export {
1449
- La as default
1450
- };
1119
+ //#endregion
1120
+ export { We as default };