@nextcloud/vue 8.0.0-beta.7 → 8.0.0-beta.9

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 (583) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/dist/Components/NcActionButton.cjs +49 -1
  3. package/dist/Components/NcActionButton.cjs.map +1 -1
  4. package/dist/Components/NcActionButton.mjs +49 -13
  5. package/dist/Components/NcActionButton.mjs.map +1 -1
  6. package/dist/Components/NcActionButtonGroup.cjs +30 -1
  7. package/dist/Components/NcActionButtonGroup.cjs.map +1 -1
  8. package/dist/Components/NcActionButtonGroup.mjs +30 -9
  9. package/dist/Components/NcActionButtonGroup.mjs.map +1 -1
  10. package/dist/Components/NcActionCaption.cjs +29 -1
  11. package/dist/Components/NcActionCaption.cjs.map +1 -1
  12. package/dist/Components/NcActionCaption.mjs +29 -9
  13. package/dist/Components/NcActionCaption.mjs.map +1 -1
  14. package/dist/Components/NcActionCheckbox.cjs +78 -1
  15. package/dist/Components/NcActionCheckbox.cjs.map +1 -1
  16. package/dist/Components/NcActionCheckbox.mjs +80 -19
  17. package/dist/Components/NcActionCheckbox.mjs.map +1 -1
  18. package/dist/Components/NcActionInput.cjs +231 -1
  19. package/dist/Components/NcActionInput.cjs.map +1 -1
  20. package/dist/Components/NcActionInput.mjs +235 -70
  21. package/dist/Components/NcActionInput.mjs.map +1 -1
  22. package/dist/Components/NcActionLink.cjs +69 -1
  23. package/dist/Components/NcActionLink.cjs.map +1 -1
  24. package/dist/Components/NcActionLink.mjs +66 -14
  25. package/dist/Components/NcActionLink.mjs.map +1 -1
  26. package/dist/Components/NcActionRadio.cjs +85 -1
  27. package/dist/Components/NcActionRadio.cjs.map +1 -1
  28. package/dist/Components/NcActionRadio.mjs +87 -19
  29. package/dist/Components/NcActionRadio.mjs.map +1 -1
  30. package/dist/Components/NcActionRouter.cjs +42 -1
  31. package/dist/Components/NcActionRouter.cjs.map +1 -1
  32. package/dist/Components/NcActionRouter.mjs +41 -12
  33. package/dist/Components/NcActionRouter.mjs.map +1 -1
  34. package/dist/Components/NcActionSeparator.cjs +20 -1
  35. package/dist/Components/NcActionSeparator.cjs.map +1 -1
  36. package/dist/Components/NcActionSeparator.mjs +20 -9
  37. package/dist/Components/NcActionSeparator.mjs.map +1 -1
  38. package/dist/Components/NcActionText.cjs +23 -1
  39. package/dist/Components/NcActionText.cjs.map +1 -1
  40. package/dist/Components/NcActionText.mjs +21 -9
  41. package/dist/Components/NcActionText.mjs.map +1 -1
  42. package/dist/Components/NcActionTextEditable.cjs +81 -1
  43. package/dist/Components/NcActionTextEditable.cjs.map +1 -1
  44. package/dist/Components/NcActionTextEditable.mjs +79 -22
  45. package/dist/Components/NcActionTextEditable.mjs.map +1 -1
  46. package/dist/Components/NcActions.cjs +459 -1
  47. package/dist/Components/NcActions.cjs.map +1 -1
  48. package/dist/Components/NcActions.mjs +463 -100
  49. package/dist/Components/NcActions.mjs.map +1 -1
  50. package/dist/Components/NcAppContent.cjs +218 -1
  51. package/dist/Components/NcAppContent.cjs.map +1 -1
  52. package/dist/Components/NcAppContent.mjs +220 -66
  53. package/dist/Components/NcAppContent.mjs.map +1 -1
  54. package/dist/Components/NcAppContentDetails.cjs +19 -1
  55. package/dist/Components/NcAppContentDetails.cjs.map +1 -1
  56. package/dist/Components/NcAppContentDetails.mjs +18 -7
  57. package/dist/Components/NcAppContentDetails.mjs.map +1 -1
  58. package/dist/Components/NcAppContentList.cjs +29 -1
  59. package/dist/Components/NcAppContentList.cjs.map +1 -1
  60. package/dist/Components/NcAppContentList.mjs +29 -8
  61. package/dist/Components/NcAppContentList.mjs.map +1 -1
  62. package/dist/Components/NcAppNavigation.cjs +66 -1
  63. package/dist/Components/NcAppNavigation.cjs.map +1 -1
  64. package/dist/Components/NcAppNavigation.mjs +67 -28
  65. package/dist/Components/NcAppNavigation.mjs.map +1 -1
  66. package/dist/Components/NcAppNavigationCaption.cjs +44 -1
  67. package/dist/Components/NcAppNavigationCaption.cjs.map +1 -1
  68. package/dist/Components/NcAppNavigationCaption.mjs +40 -9
  69. package/dist/Components/NcAppNavigationCaption.mjs.map +1 -1
  70. package/dist/Components/NcAppNavigationIconBullet.cjs +40 -1
  71. package/dist/Components/NcAppNavigationIconBullet.cjs.map +1 -1
  72. package/dist/Components/NcAppNavigationIconBullet.mjs +40 -15
  73. package/dist/Components/NcAppNavigationIconBullet.mjs.map +1 -1
  74. package/dist/Components/NcAppNavigationItem.cjs +386 -1
  75. package/dist/Components/NcAppNavigationItem.cjs.map +1 -1
  76. package/dist/Components/NcAppNavigationItem.mjs +382 -81
  77. package/dist/Components/NcAppNavigationItem.mjs.map +1 -1
  78. package/dist/Components/NcAppNavigationNew.cjs +50 -1
  79. package/dist/Components/NcAppNavigationNew.cjs.map +1 -1
  80. package/dist/Components/NcAppNavigationNew.mjs +51 -14
  81. package/dist/Components/NcAppNavigationNew.mjs.map +1 -1
  82. package/dist/Components/NcAppNavigationNewItem.cjs +87 -1
  83. package/dist/Components/NcAppNavigationNewItem.cjs.map +1 -1
  84. package/dist/Components/NcAppNavigationNewItem.mjs +83 -17
  85. package/dist/Components/NcAppNavigationNewItem.mjs.map +1 -1
  86. package/dist/Components/NcAppNavigationSettings.cjs +69 -1
  87. package/dist/Components/NcAppNavigationSettings.cjs.map +1 -1
  88. package/dist/Components/NcAppNavigationSettings.mjs +60 -21
  89. package/dist/Components/NcAppNavigationSettings.mjs.map +1 -1
  90. package/dist/Components/NcAppNavigationSpacer.cjs +20 -1
  91. package/dist/Components/NcAppNavigationSpacer.cjs.map +1 -1
  92. package/dist/Components/NcAppNavigationSpacer.mjs +20 -9
  93. package/dist/Components/NcAppNavigationSpacer.mjs.map +1 -1
  94. package/dist/Components/NcAppNavigationToggle.cjs +25 -1
  95. package/dist/Components/NcAppNavigationToggle.cjs.map +1 -1
  96. package/dist/Components/NcAppNavigationToggle.mjs +21 -1
  97. package/dist/Components/NcAppNavigationToggle.mjs.map +1 -1
  98. package/dist/Components/NcAppSettingsDialog.cjs +156 -1
  99. package/dist/Components/NcAppSettingsDialog.cjs.map +1 -1
  100. package/dist/Components/NcAppSettingsDialog.mjs +160 -50
  101. package/dist/Components/NcAppSettingsDialog.mjs.map +1 -1
  102. package/dist/Components/NcAppSettingsSection.cjs +39 -1
  103. package/dist/Components/NcAppSettingsSection.cjs.map +1 -1
  104. package/dist/Components/NcAppSettingsSection.mjs +39 -13
  105. package/dist/Components/NcAppSettingsSection.mjs.map +1 -1
  106. package/dist/Components/NcAppSidebar.cjs +443 -1
  107. package/dist/Components/NcAppSidebar.cjs.map +1 -1
  108. package/dist/Components/NcAppSidebar.mjs +409 -92
  109. package/dist/Components/NcAppSidebar.mjs.map +1 -1
  110. package/dist/Components/NcAppSidebarTab.cjs +83 -1
  111. package/dist/Components/NcAppSidebarTab.cjs.map +1 -1
  112. package/dist/Components/NcAppSidebarTab.mjs +83 -20
  113. package/dist/Components/NcAppSidebarTab.mjs.map +1 -1
  114. package/dist/Components/NcAvatar.cjs +3 -1
  115. package/dist/Components/NcAvatar.cjs.map +1 -1
  116. package/dist/Components/NcAvatar.mjs +1 -1
  117. package/dist/Components/NcBreadcrumb.cjs +175 -1
  118. package/dist/Components/NcBreadcrumb.cjs.map +1 -1
  119. package/dist/Components/NcBreadcrumb.mjs +175 -35
  120. package/dist/Components/NcBreadcrumb.mjs.map +1 -1
  121. package/dist/Components/NcBreadcrumbs.cjs +372 -1
  122. package/dist/Components/NcBreadcrumbs.cjs.map +1 -1
  123. package/dist/Components/NcBreadcrumbs.mjs +373 -142
  124. package/dist/Components/NcBreadcrumbs.mjs.map +1 -1
  125. package/dist/Components/NcButton.cjs +226 -1
  126. package/dist/Components/NcButton.cjs.map +1 -1
  127. package/dist/Components/NcButton.mjs +226 -24
  128. package/dist/Components/NcButton.mjs.map +1 -1
  129. package/dist/Components/NcCheckboxRadioSwitch.cjs +352 -1
  130. package/dist/Components/NcCheckboxRadioSwitch.cjs.map +1 -1
  131. package/dist/Components/NcCheckboxRadioSwitch.mjs +360 -59
  132. package/dist/Components/NcCheckboxRadioSwitch.mjs.map +1 -1
  133. package/dist/Components/NcColorPicker.cjs +118 -1
  134. package/dist/Components/NcColorPicker.cjs.map +1 -1
  135. package/dist/Components/NcColorPicker.mjs +124 -46
  136. package/dist/Components/NcColorPicker.mjs.map +1 -1
  137. package/dist/Components/NcContent.cjs +25 -1
  138. package/dist/Components/NcContent.cjs.map +1 -1
  139. package/dist/Components/NcContent.mjs +24 -8
  140. package/dist/Components/NcContent.mjs.map +1 -1
  141. package/dist/Components/NcCounterBubble.cjs +47 -1
  142. package/dist/Components/NcCounterBubble.cjs.map +1 -1
  143. package/dist/Components/NcCounterBubble.mjs +46 -12
  144. package/dist/Components/NcCounterBubble.mjs.map +1 -1
  145. package/dist/Components/NcDashboardWidget.cjs +133 -1
  146. package/dist/Components/NcDashboardWidget.cjs.map +1 -1
  147. package/dist/Components/NcDashboardWidget.mjs +128 -39
  148. package/dist/Components/NcDashboardWidget.mjs.map +1 -1
  149. package/dist/Components/NcDashboardWidgetItem.cjs +138 -1
  150. package/dist/Components/NcDashboardWidgetItem.cjs.map +1 -1
  151. package/dist/Components/NcDashboardWidgetItem.mjs +130 -23
  152. package/dist/Components/NcDashboardWidgetItem.mjs.map +1 -1
  153. package/dist/Components/NcDateTime.cjs +125 -1
  154. package/dist/Components/NcDateTime.cjs.map +1 -1
  155. package/dist/Components/NcDateTime.mjs +126 -41
  156. package/dist/Components/NcDateTime.mjs.map +1 -1
  157. package/dist/Components/NcDateTimePicker.cjs +217 -1
  158. package/dist/Components/NcDateTimePicker.cjs.map +1 -1
  159. package/dist/Components/NcDateTimePicker.mjs +212 -53
  160. package/dist/Components/NcDateTimePicker.mjs.map +1 -1
  161. package/dist/Components/NcDateTimePickerNative.cjs +199 -1
  162. package/dist/Components/NcDateTimePickerNative.cjs.map +1 -1
  163. package/dist/Components/NcDateTimePickerNative.mjs +195 -58
  164. package/dist/Components/NcDateTimePickerNative.mjs.map +1 -1
  165. package/dist/Components/NcDialog.cjs +171 -0
  166. package/dist/Components/NcDialog.cjs.map +1 -0
  167. package/dist/Components/NcDialog.mjs +177 -0
  168. package/dist/Components/NcDialog.mjs.map +1 -0
  169. package/dist/Components/NcDialogButton.cjs +69 -0
  170. package/dist/Components/NcDialogButton.cjs.map +1 -0
  171. package/dist/Components/NcDialogButton.mjs +74 -0
  172. package/dist/Components/NcDialogButton.mjs.map +1 -0
  173. package/dist/Components/NcEllipsisedOption.cjs +74 -1
  174. package/dist/Components/NcEllipsisedOption.cjs.map +1 -1
  175. package/dist/Components/NcEllipsisedOption.mjs +73 -20
  176. package/dist/Components/NcEllipsisedOption.mjs.map +1 -1
  177. package/dist/Components/NcEmojiPicker.cjs +175 -1
  178. package/dist/Components/NcEmojiPicker.cjs.map +1 -1
  179. package/dist/Components/NcEmojiPicker.mjs +172 -52
  180. package/dist/Components/NcEmojiPicker.mjs.map +1 -1
  181. package/dist/Components/NcEmptyContent.cjs +54 -1
  182. package/dist/Components/NcEmptyContent.cjs.map +1 -1
  183. package/dist/Components/NcEmptyContent.mjs +46 -10
  184. package/dist/Components/NcEmptyContent.mjs.map +1 -1
  185. package/dist/Components/NcGuestContent.cjs +26 -1
  186. package/dist/Components/NcGuestContent.cjs.map +1 -1
  187. package/dist/Components/NcGuestContent.mjs +24 -11
  188. package/dist/Components/NcGuestContent.mjs.map +1 -1
  189. package/dist/Components/NcHeaderMenu.cjs +167 -1
  190. package/dist/Components/NcHeaderMenu.cjs.map +1 -1
  191. package/dist/Components/NcHeaderMenu.mjs +161 -49
  192. package/dist/Components/NcHeaderMenu.mjs.map +1 -1
  193. package/dist/Components/NcHighlight.cjs +3 -1
  194. package/dist/Components/NcHighlight.cjs.map +1 -1
  195. package/dist/Components/NcHighlight.mjs +1 -1
  196. package/dist/Components/NcIconSvgWrapper.cjs +59 -1
  197. package/dist/Components/NcIconSvgWrapper.cjs.map +1 -1
  198. package/dist/Components/NcIconSvgWrapper.mjs +60 -12
  199. package/dist/Components/NcIconSvgWrapper.mjs.map +1 -1
  200. package/dist/Components/NcInputField.cjs +210 -1
  201. package/dist/Components/NcInputField.cjs.map +1 -1
  202. package/dist/Components/NcInputField.mjs +211 -38
  203. package/dist/Components/NcInputField.mjs.map +1 -1
  204. package/dist/Components/NcListItem.cjs +237 -1
  205. package/dist/Components/NcListItem.cjs.map +1 -1
  206. package/dist/Components/NcListItem.mjs +233 -57
  207. package/dist/Components/NcListItem.mjs.map +1 -1
  208. package/dist/Components/NcListItemIcon.cjs +158 -1
  209. package/dist/Components/NcListItemIcon.cjs.map +1 -1
  210. package/dist/Components/NcListItemIcon.mjs +154 -30
  211. package/dist/Components/NcListItemIcon.mjs.map +1 -1
  212. package/dist/Components/NcLoadingIcon.cjs +54 -1
  213. package/dist/Components/NcLoadingIcon.cjs.map +1 -1
  214. package/dist/Components/NcLoadingIcon.mjs +54 -14
  215. package/dist/Components/NcLoadingIcon.mjs.map +1 -1
  216. package/dist/Components/NcModal.cjs +403 -1
  217. package/dist/Components/NcModal.cjs.map +1 -1
  218. package/dist/Components/NcModal.mjs +392 -96
  219. package/dist/Components/NcModal.mjs.map +1 -1
  220. package/dist/Components/NcNoteCard.cjs +71 -1
  221. package/dist/Components/NcNoteCard.cjs.map +1 -1
  222. package/dist/Components/NcNoteCard.mjs +72 -38
  223. package/dist/Components/NcNoteCard.mjs.map +1 -1
  224. package/dist/Components/NcPasswordField.cjs +163 -1
  225. package/dist/Components/NcPasswordField.cjs.map +1 -1
  226. package/dist/Components/NcPasswordField.mjs +169 -54
  227. package/dist/Components/NcPasswordField.mjs.map +1 -1
  228. package/dist/Components/NcPopover.cjs +125 -1
  229. package/dist/Components/NcPopover.cjs.map +1 -1
  230. package/dist/Components/NcPopover.mjs +124 -41
  231. package/dist/Components/NcPopover.mjs.map +1 -1
  232. package/dist/Components/NcProgressBar.cjs +57 -1
  233. package/dist/Components/NcProgressBar.cjs.map +1 -1
  234. package/dist/Components/NcProgressBar.mjs +57 -15
  235. package/dist/Components/NcProgressBar.mjs.map +1 -1
  236. package/dist/Components/NcRelatedResourcesPanel.cjs +184 -1
  237. package/dist/Components/NcRelatedResourcesPanel.cjs.map +1 -1
  238. package/dist/Components/NcRelatedResourcesPanel.mjs +183 -61
  239. package/dist/Components/NcRelatedResourcesPanel.mjs.map +1 -1
  240. package/dist/Components/NcRichContenteditable.cjs +478 -1
  241. package/dist/Components/NcRichContenteditable.cjs.map +1 -1
  242. package/dist/Components/NcRichContenteditable.mjs +447 -127
  243. package/dist/Components/NcRichContenteditable.mjs.map +1 -1
  244. package/dist/Components/NcRichText.cjs +44 -1
  245. package/dist/Components/NcRichText.cjs.map +1 -1
  246. package/dist/Components/NcRichText.mjs +25 -4
  247. package/dist/Components/NcRichText.mjs.map +1 -1
  248. package/dist/Components/NcSavingIndicatorIcon.cjs +59 -1
  249. package/dist/Components/NcSavingIndicatorIcon.cjs.map +1 -1
  250. package/dist/Components/NcSavingIndicatorIcon.mjs +56 -9
  251. package/dist/Components/NcSavingIndicatorIcon.mjs.map +1 -1
  252. package/dist/Components/NcSelect.cjs +411 -1
  253. package/dist/Components/NcSelect.cjs.map +1 -1
  254. package/dist/Components/NcSelect.mjs +405 -47
  255. package/dist/Components/NcSelect.mjs.map +1 -1
  256. package/dist/Components/NcSelectTags.cjs +251 -2
  257. package/dist/Components/NcSelectTags.cjs.map +1 -1
  258. package/dist/Components/NcSelectTags.mjs +236 -73
  259. package/dist/Components/NcSelectTags.mjs.map +1 -1
  260. package/dist/Components/NcSettingsInputText.cjs +90 -1
  261. package/dist/Components/NcSettingsInputText.cjs.map +1 -1
  262. package/dist/Components/NcSettingsInputText.mjs +88 -19
  263. package/dist/Components/NcSettingsInputText.mjs.map +1 -1
  264. package/dist/Components/NcSettingsSection.cjs +62 -1
  265. package/dist/Components/NcSettingsSection.cjs.map +1 -1
  266. package/dist/Components/NcSettingsSection.mjs +62 -15
  267. package/dist/Components/NcSettingsSection.mjs.map +1 -1
  268. package/dist/Components/NcSettingsSelectGroup.cjs +26 -1
  269. package/dist/Components/NcSettingsSelectGroup.cjs.map +1 -1
  270. package/dist/Components/NcSettingsSelectGroup.mjs +22 -1
  271. package/dist/Components/NcSettingsSelectGroup.mjs.map +1 -1
  272. package/dist/Components/NcTextArea.cjs +167 -0
  273. package/dist/Components/NcTextArea.cjs.map +1 -0
  274. package/dist/Components/NcTextArea.mjs +172 -0
  275. package/dist/Components/NcTextArea.mjs.map +1 -0
  276. package/dist/Components/NcTextField.cjs +98 -1
  277. package/dist/Components/NcTextField.cjs.map +1 -1
  278. package/dist/Components/NcTextField.mjs +102 -22
  279. package/dist/Components/NcTextField.mjs.map +1 -1
  280. package/dist/Components/NcTimezonePicker.cjs +4387 -614
  281. package/dist/Components/NcTimezonePicker.cjs.map +1 -1
  282. package/dist/Components/NcTimezonePicker.mjs +4372 -663
  283. package/dist/Components/NcTimezonePicker.mjs.map +1 -1
  284. package/dist/Components/NcUserBubble.cjs +189 -1
  285. package/dist/Components/NcUserBubble.cjs.map +1 -1
  286. package/dist/Components/NcUserBubble.mjs +190 -47
  287. package/dist/Components/NcUserBubble.mjs.map +1 -1
  288. package/dist/Components/NcVNodes.cjs +35 -1
  289. package/dist/Components/NcVNodes.cjs.map +1 -1
  290. package/dist/Components/NcVNodes.mjs +35 -8
  291. package/dist/Components/NcVNodes.mjs.map +1 -1
  292. package/dist/Directives/Focus.cjs +30 -1
  293. package/dist/Directives/Focus.cjs.map +1 -1
  294. package/dist/Directives/Focus.mjs +28 -5
  295. package/dist/Directives/Focus.mjs.map +1 -1
  296. package/dist/Directives/Linkify.cjs +8 -1
  297. package/dist/Directives/Linkify.cjs.map +1 -1
  298. package/dist/Directives/Linkify.mjs +6 -6
  299. package/dist/Directives/Linkify.mjs.map +1 -1
  300. package/dist/Directives/Tooltip.cjs +37 -1
  301. package/dist/Directives/Tooltip.cjs.map +1 -1
  302. package/dist/Directives/Tooltip.mjs +29 -4
  303. package/dist/Directives/Tooltip.mjs.map +1 -1
  304. package/dist/Functions/emoji.cjs +36 -1
  305. package/dist/Functions/emoji.cjs.map +1 -1
  306. package/dist/Functions/emoji.mjs +32 -11
  307. package/dist/Functions/emoji.mjs.map +1 -1
  308. package/dist/Functions/usernameToColor.cjs +39 -1
  309. package/dist/Functions/usernameToColor.cjs.map +1 -1
  310. package/dist/Functions/usernameToColor.mjs +32 -11
  311. package/dist/Functions/usernameToColor.mjs.map +1 -1
  312. package/dist/Mixins/clickOutsideOptions.cjs +40 -1
  313. package/dist/Mixins/clickOutsideOptions.cjs.map +1 -1
  314. package/dist/Mixins/clickOutsideOptions.mjs +39 -4
  315. package/dist/Mixins/clickOutsideOptions.mjs.map +1 -1
  316. package/dist/Mixins/isFullscreen.cjs +44 -1
  317. package/dist/Mixins/isFullscreen.cjs.map +1 -1
  318. package/dist/Mixins/isFullscreen.mjs +42 -11
  319. package/dist/Mixins/isFullscreen.mjs.map +1 -1
  320. package/dist/Mixins/isMobile.cjs +87 -1
  321. package/dist/Mixins/isMobile.cjs.map +1 -1
  322. package/dist/Mixins/isMobile.mjs +86 -11
  323. package/dist/Mixins/isMobile.mjs.map +1 -1
  324. package/dist/Mixins/richEditor.cjs +10 -1
  325. package/dist/Mixins/richEditor.cjs.map +1 -1
  326. package/dist/Mixins/richEditor.mjs +2 -2
  327. package/dist/assets/NcAppNavigationToggle-2cc5b864.css +35 -0
  328. package/dist/assets/NcInputConfirmCancel-2ba60a52.css +51 -0
  329. package/dist/assets/NcMentionBubble-6e887c5f.css +81 -0
  330. package/dist/assets/{index-23405a74.css → NcSettingsSelectGroup-0d38d76b.css} +15 -2
  331. package/dist/assets/index-0adc989c.css +96 -0
  332. package/dist/assets/index-1151d229.css +41 -0
  333. package/dist/assets/index-1beccc92.css +140 -0
  334. package/dist/assets/index-236620b0.css +150 -0
  335. package/dist/assets/{index-823ec431.css → index-24f6c355.css} +67 -3
  336. package/dist/assets/index-2a8e4ca1.css +540 -0
  337. package/dist/assets/{index-29421a2e.css → index-2d4de2fc.css} +19 -2
  338. package/dist/assets/{NcSettingsSelectGroup-e88cbf1a.css → index-30e099f7.css} +17 -2
  339. package/dist/assets/index-34dfc54e.css +88 -0
  340. package/dist/assets/index-3764a447.css +99 -0
  341. package/dist/assets/index-400b48a6.css +60 -0
  342. package/dist/assets/{index-1d28ce70.css → index-441b6552.css} +25 -2
  343. package/dist/assets/{NcInputConfirmCancel-c1d05dd9.css → index-4611417f.css} +31 -2
  344. package/dist/assets/index-4a775ba1.css +204 -0
  345. package/dist/assets/index-4b75fe20.css +79 -0
  346. package/dist/assets/index-4ebacc78.css +107 -0
  347. package/dist/assets/index-4ef32afd.css +128 -0
  348. package/dist/assets/index-50b0766d.css +202 -0
  349. package/dist/assets/index-574438d6.css +884 -0
  350. package/dist/assets/index-57b305d3.css +44 -0
  351. package/dist/assets/index-5ee8a575.css +295 -0
  352. package/dist/assets/index-5fa0ac5a.css +46 -0
  353. package/dist/assets/index-61b63a8f.css +57 -0
  354. package/dist/assets/index-6416f636.css +83 -0
  355. package/dist/assets/index-6c47e88a.css +46 -0
  356. package/dist/assets/index-6f721577.css +80 -0
  357. package/dist/assets/index-73867d38.css +133 -0
  358. package/dist/assets/index-76a58945.css +68 -0
  359. package/dist/assets/index-76dd9f11.css +5 -0
  360. package/dist/assets/index-7813bab3.css +66 -0
  361. package/dist/assets/index-793eae6b.css +234 -0
  362. package/dist/assets/index-8304db49.css +129 -0
  363. package/dist/assets/index-8aa4712e.css +51 -0
  364. package/dist/assets/{index-3e8ea1d6.css → index-8f52a20f.css} +16 -2
  365. package/dist/assets/index-93ad846c.css +259 -0
  366. package/dist/assets/index-9dcf6260.css +151 -0
  367. package/dist/assets/index-9e44e336.css +59 -0
  368. package/dist/assets/index-9e9587e1.css +45 -0
  369. package/dist/assets/index-a2b51bce.css +47 -0
  370. package/dist/assets/index-a2d55f92.css +204 -0
  371. package/dist/assets/index-a9e4fe04.css +46 -0
  372. package/dist/assets/index-abb90c97.css +164 -0
  373. package/dist/assets/{index-3b76db9b.css → index-af72a30b.css} +78 -3
  374. package/dist/assets/{NcAppNavigationToggle-110970cd.css → index-b8f13a1f.css} +13 -2
  375. package/dist/assets/index-b991895f.css +87 -0
  376. package/dist/assets/{index-25b448e3.css → index-baf8711a.css} +67 -3
  377. package/dist/assets/index-c06ad941.css +175 -0
  378. package/dist/assets/index-c5ae3bc4.css +303 -0
  379. package/dist/assets/index-c6f0da2e.css +69 -0
  380. package/dist/assets/index-d211cae8.css +93 -0
  381. package/dist/assets/index-d646553d.css +41 -0
  382. package/dist/assets/index-dc612aa3.css +112 -0
  383. package/dist/assets/index-e7c55791.css +243 -0
  384. package/dist/assets/index-e7eadba7.css +82 -0
  385. package/dist/assets/index-e828b286.css +76 -0
  386. package/dist/assets/index-ed4adf1d.css +115 -0
  387. package/dist/assets/{index-19f059f6.css → index-edee3304.css} +33 -2
  388. package/dist/assets/index-eea65531.css +129 -0
  389. package/dist/assets/index-f85aa003.css +78 -0
  390. package/dist/assets/index-fc61f2d8.css +41 -0
  391. package/dist/assets/referencePickerModal-3a127978.css +482 -0
  392. package/dist/chunks/GenColors-38246c38.mjs +46 -0
  393. package/dist/chunks/{GenColors-8097de04.cjs.map → GenColors-38246c38.mjs.map} +1 -1
  394. package/dist/chunks/GenColors-eedcc70a.cjs +45 -0
  395. package/dist/chunks/{GenColors-85cb6194.mjs.map → GenColors-eedcc70a.cjs.map} +1 -1
  396. package/dist/{assets/index-cb18d6f3.css → chunks/GenRandomId-c214d235.cjs} +8 -5
  397. package/dist/chunks/{GenRandomId-67df40eb.cjs.map → GenRandomId-c214d235.cjs.map} +1 -1
  398. package/dist/chunks/GenRandomId-cb9ccebe.mjs +25 -0
  399. package/dist/chunks/{GenRandomId-1e1b509a.mjs.map → GenRandomId-cb9ccebe.mjs.map} +1 -1
  400. package/dist/chunks/Linkify-39f20c9a.mjs +33 -0
  401. package/dist/chunks/{Linkify-a0faf443.mjs.map → Linkify-39f20c9a.mjs.map} +1 -1
  402. package/dist/chunks/Linkify-40cdd635.cjs +32 -0
  403. package/dist/chunks/{Linkify-a4db36a9.cjs.map → Linkify-40cdd635.cjs.map} +1 -1
  404. package/dist/chunks/NcAppNavigationToggle-841d3015.cjs +49 -0
  405. package/dist/chunks/NcAppNavigationToggle-841d3015.cjs.map +1 -0
  406. package/dist/chunks/NcAppNavigationToggle-e358aa47.mjs +55 -0
  407. package/dist/chunks/NcAppNavigationToggle-e358aa47.mjs.map +1 -0
  408. package/dist/chunks/NcInputConfirmCancel-44052477.mjs +96 -0
  409. package/dist/chunks/NcInputConfirmCancel-44052477.mjs.map +1 -0
  410. package/dist/chunks/NcInputConfirmCancel-6bea0fdc.cjs +90 -0
  411. package/dist/chunks/NcInputConfirmCancel-6bea0fdc.cjs.map +1 -0
  412. package/dist/chunks/NcRichText-332fe454.cjs +289 -0
  413. package/dist/chunks/{NcRichText-bb9d3893.mjs.map → NcRichText-332fe454.cjs.map} +1 -1
  414. package/dist/chunks/NcRichText-8fda53c8.mjs +302 -0
  415. package/dist/chunks/{NcRichText-3c54a3cc.cjs.map → NcRichText-8fda53c8.mjs.map} +1 -1
  416. package/dist/chunks/NcSettingsSelectGroup-a5ff8c36.cjs +183 -0
  417. package/dist/chunks/NcSettingsSelectGroup-a5ff8c36.cjs.map +1 -0
  418. package/dist/chunks/NcSettingsSelectGroup-fdd3309c.mjs +192 -0
  419. package/dist/chunks/NcSettingsSelectGroup-fdd3309c.mjs.map +1 -0
  420. package/dist/chunks/ScopeComponent-9519afcc.mjs +29 -0
  421. package/dist/chunks/{ScopeComponent-1f3a7612.mjs.map → ScopeComponent-9519afcc.mjs.map} +1 -1
  422. package/dist/chunks/ScopeComponent-e060526a.cjs +28 -0
  423. package/dist/chunks/{ScopeComponent-4b8bd1ee.cjs.map → ScopeComponent-e060526a.cjs.map} +1 -1
  424. package/dist/chunks/_plugin-vue2_normalizer-71e2aa87.mjs +32 -0
  425. package/dist/chunks/_plugin-vue2_normalizer-71e2aa87.mjs.map +1 -0
  426. package/dist/chunks/_plugin-vue2_normalizer-7f9efb60.cjs +31 -0
  427. package/dist/chunks/_plugin-vue2_normalizer-7f9efb60.cjs.map +1 -0
  428. package/dist/chunks/actionGlobal-8c1c28c9.mjs +50 -0
  429. package/dist/chunks/{actionGlobal-cda46023.mjs.map → actionGlobal-8c1c28c9.mjs.map} +1 -1
  430. package/dist/chunks/actionGlobal-9e29e11b.cjs +49 -0
  431. package/dist/chunks/{actionGlobal-ec7003e8.cjs.map → actionGlobal-9e29e11b.cjs.map} +1 -1
  432. package/dist/chunks/actionText-54bc24a6.cjs +120 -0
  433. package/dist/chunks/{actionText-bef01778.cjs.map → actionText-54bc24a6.cjs.map} +1 -1
  434. package/dist/chunks/actionText-a64be267.mjs +121 -0
  435. package/dist/chunks/{actionText-6c35d3fc.mjs.map → actionText-a64be267.mjs.map} +1 -1
  436. package/dist/chunks/focusTrap-14985831.cjs +26 -0
  437. package/dist/chunks/{focusTrap-173aba65.mjs.map → focusTrap-14985831.cjs.map} +1 -1
  438. package/dist/chunks/focusTrap-5d0f71d4.mjs +27 -0
  439. package/dist/chunks/{focusTrap-139520e2.cjs.map → focusTrap-5d0f71d4.mjs.map} +1 -1
  440. package/dist/chunks/index-032137a6.cjs +468 -0
  441. package/dist/chunks/index-032137a6.cjs.map +1 -0
  442. package/dist/chunks/index-20a9ace9.mjs +149 -0
  443. package/dist/chunks/{index-cd3f1f8f.mjs.map → index-20a9ace9.mjs.map} +1 -1
  444. package/dist/chunks/index-4398f925.cjs +149 -0
  445. package/dist/chunks/{index-858938bd.cjs.map → index-4398f925.cjs.map} +1 -1
  446. package/dist/chunks/index-5f2a5f57.mjs +155 -0
  447. package/dist/chunks/{index-377488aa.mjs.map → index-5f2a5f57.mjs.map} +1 -1
  448. package/dist/chunks/index-e894376a.cjs +148 -0
  449. package/dist/chunks/{index-df3f51c6.cjs.map → index-e894376a.cjs.map} +1 -1
  450. package/dist/chunks/index-fb2ee22c.mjs +481 -0
  451. package/dist/chunks/index-fb2ee22c.mjs.map +1 -0
  452. package/dist/chunks/l10n-05a09c66.mjs +31 -0
  453. package/dist/chunks/l10n-05a09c66.mjs.map +1 -0
  454. package/dist/chunks/l10n-9aa6482d.mjs +10 -0
  455. package/dist/chunks/l10n-9aa6482d.mjs.map +1 -0
  456. package/dist/chunks/l10n-b1d264c7.cjs +29 -0
  457. package/dist/chunks/l10n-b1d264c7.cjs.map +1 -0
  458. package/dist/chunks/l10n-c7bd0ea6.cjs +8 -0
  459. package/dist/chunks/l10n-c7bd0ea6.cjs.map +1 -0
  460. package/dist/chunks/logger-3612e664.mjs +25 -0
  461. package/dist/chunks/{logger-01af1a78.cjs.map → logger-3612e664.mjs.map} +1 -1
  462. package/dist/chunks/logger-4998b668.cjs +24 -0
  463. package/dist/chunks/{logger-ccc7ee65.mjs.map → logger-4998b668.cjs.map} +1 -1
  464. package/dist/chunks/referencePickerModal-279a483d.cjs +858 -0
  465. package/dist/chunks/referencePickerModal-279a483d.cjs.map +1 -0
  466. package/dist/chunks/referencePickerModal-443a4c57.mjs +877 -0
  467. package/dist/chunks/referencePickerModal-443a4c57.mjs.map +1 -0
  468. package/dist/index.cjs +257 -1
  469. package/dist/index.cjs.map +1 -1
  470. package/dist/index.mjs +301 -150
  471. package/dist/index.mjs.map +1 -1
  472. package/package.json +7 -4
  473. package/dist/assets/NcMentionBubble-67378a12.css +0 -21
  474. package/dist/assets/index-2cedaf24.css +0 -21
  475. package/dist/assets/index-30d74459.css +0 -42
  476. package/dist/assets/index-317f55be.css +0 -21
  477. package/dist/assets/index-34f6bb3f.css +0 -21
  478. package/dist/assets/index-37970f20.css +0 -21
  479. package/dist/assets/index-3aba62de.css +0 -21
  480. package/dist/assets/index-47fab7bf.css +0 -21
  481. package/dist/assets/index-49a0d570.css +0 -21
  482. package/dist/assets/index-4a4c1700.css +0 -21
  483. package/dist/assets/index-4a4c2637.css +0 -21
  484. package/dist/assets/index-4efbac36.css +0 -21
  485. package/dist/assets/index-6140ff62.css +0 -21
  486. package/dist/assets/index-66b19339.css +0 -21
  487. package/dist/assets/index-6cb0dc4a.css +0 -21
  488. package/dist/assets/index-6f63d18f.css +0 -42
  489. package/dist/assets/index-76287c8f.css +0 -21
  490. package/dist/assets/index-7a7195d0.css +0 -21
  491. package/dist/assets/index-7e084b52.css +0 -21
  492. package/dist/assets/index-7f55fed2.css +0 -21
  493. package/dist/assets/index-7ffde264.css +0 -21
  494. package/dist/assets/index-81f5e4c8.css +0 -21
  495. package/dist/assets/index-82b5969a.css +0 -21
  496. package/dist/assets/index-852d8576.css +0 -21
  497. package/dist/assets/index-8f58dd75.css +0 -21
  498. package/dist/assets/index-935fa6f9.css +0 -42
  499. package/dist/assets/index-939ba6f0.css +0 -21
  500. package/dist/assets/index-a17dfbc4.css +0 -21
  501. package/dist/assets/index-a4a40fa3.css +0 -21
  502. package/dist/assets/index-a50a8de6.css +0 -1
  503. package/dist/assets/index-a513dcd5.css +0 -21
  504. package/dist/assets/index-a8c5cf75.css +0 -21
  505. package/dist/assets/index-a999ba9f.css +0 -21
  506. package/dist/assets/index-afc15e11.css +0 -21
  507. package/dist/assets/index-b814f5fa.css +0 -21
  508. package/dist/assets/index-ba6ad1b4.css +0 -21
  509. package/dist/assets/index-bf10e8e1.css +0 -21
  510. package/dist/assets/index-bf46edd7.css +0 -21
  511. package/dist/assets/index-c6d7f3b0.css +0 -21
  512. package/dist/assets/index-c736204a.css +0 -21
  513. package/dist/assets/index-cb76ef23.css +0 -21
  514. package/dist/assets/index-cc70a006.css +0 -21
  515. package/dist/assets/index-dd464a52.css +0 -21
  516. package/dist/assets/index-e0ceef85.css +0 -21
  517. package/dist/assets/index-ecdb616f.css +0 -42
  518. package/dist/assets/index-ee410fad.css +0 -21
  519. package/dist/assets/index-ef0bca81.css +0 -42
  520. package/dist/assets/index-f1030e54.css +0 -21
  521. package/dist/assets/index-f6ca40ca.css +0 -21
  522. package/dist/assets/index-f8466b88.css +0 -21
  523. package/dist/assets/referencePickerModal-41e4705a.css +0 -21
  524. package/dist/chunks/GenColors-8097de04.cjs +0 -1
  525. package/dist/chunks/GenColors-85cb6194.mjs +0 -25
  526. package/dist/chunks/GenRandomId-1e1b509a.mjs +0 -4
  527. package/dist/chunks/GenRandomId-67df40eb.cjs +0 -1
  528. package/dist/chunks/IsMobileState-151fc57d.cjs +0 -1
  529. package/dist/chunks/IsMobileState-151fc57d.cjs.map +0 -1
  530. package/dist/chunks/IsMobileState-e1fe5f58.mjs +0 -15
  531. package/dist/chunks/IsMobileState-e1fe5f58.mjs.map +0 -1
  532. package/dist/chunks/Linkify-a0faf443.mjs +0 -5
  533. package/dist/chunks/Linkify-a4db36a9.cjs +0 -1
  534. package/dist/chunks/NcAppNavigationToggle-5f3b9b9a.cjs +0 -1
  535. package/dist/chunks/NcAppNavigationToggle-5f3b9b9a.cjs.map +0 -1
  536. package/dist/chunks/NcAppNavigationToggle-86cc2542.mjs +0 -23
  537. package/dist/chunks/NcAppNavigationToggle-86cc2542.mjs.map +0 -1
  538. package/dist/chunks/NcInputConfirmCancel-0cd93e0e.mjs +0 -43
  539. package/dist/chunks/NcInputConfirmCancel-0cd93e0e.mjs.map +0 -1
  540. package/dist/chunks/NcInputConfirmCancel-17c8ddfb.cjs +0 -1
  541. package/dist/chunks/NcInputConfirmCancel-17c8ddfb.cjs.map +0 -1
  542. package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_357e6d0e_lang-072bbb05.cjs.map +0 -1
  543. package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_357e6d0e_lang-55016398.mjs.map +0 -1
  544. package/dist/chunks/NcRichText-3c54a3cc.cjs +0 -1
  545. package/dist/chunks/NcRichText-bb9d3893.mjs +0 -123
  546. package/dist/chunks/NcSettingsSelectGroup-0be1fe91.mjs +0 -58
  547. package/dist/chunks/NcSettingsSelectGroup-0be1fe91.mjs.map +0 -1
  548. package/dist/chunks/NcSettingsSelectGroup-62ca94a9.cjs +0 -1
  549. package/dist/chunks/NcSettingsSelectGroup-62ca94a9.cjs.map +0 -1
  550. package/dist/chunks/ScopeComponent-1f3a7612.mjs +0 -8
  551. package/dist/chunks/ScopeComponent-4b8bd1ee.cjs +0 -1
  552. package/dist/chunks/_plugin-vue2_normalizer-5b4c43a4.mjs +0 -24
  553. package/dist/chunks/_plugin-vue2_normalizer-5b4c43a4.mjs.map +0 -1
  554. package/dist/chunks/_plugin-vue2_normalizer-764a4c12.cjs +0 -1
  555. package/dist/chunks/_plugin-vue2_normalizer-764a4c12.cjs.map +0 -1
  556. package/dist/chunks/actionGlobal-cda46023.mjs +0 -15
  557. package/dist/chunks/actionGlobal-ec7003e8.cjs +0 -1
  558. package/dist/chunks/actionText-6c35d3fc.mjs +0 -23
  559. package/dist/chunks/actionText-bef01778.cjs +0 -1
  560. package/dist/chunks/focusTrap-139520e2.cjs +0 -1
  561. package/dist/chunks/focusTrap-173aba65.mjs +0 -6
  562. package/dist/chunks/index-197226c7.mjs +0 -171
  563. package/dist/chunks/index-197226c7.mjs.map +0 -1
  564. package/dist/chunks/index-377488aa.mjs +0 -46
  565. package/dist/chunks/index-858938bd.cjs +0 -3
  566. package/dist/chunks/index-cd3f1f8f.mjs +0 -43
  567. package/dist/chunks/index-cebd6e80.cjs +0 -1
  568. package/dist/chunks/index-cebd6e80.cjs.map +0 -1
  569. package/dist/chunks/index-df3f51c6.cjs +0 -1
  570. package/dist/chunks/l10n-05baf7da.mjs +0 -5
  571. package/dist/chunks/l10n-05baf7da.mjs.map +0 -1
  572. package/dist/chunks/l10n-46d0c1c0.cjs +0 -1
  573. package/dist/chunks/l10n-46d0c1c0.cjs.map +0 -1
  574. package/dist/chunks/l10n-9a5a6afc.mjs +0 -18
  575. package/dist/chunks/l10n-9a5a6afc.mjs.map +0 -1
  576. package/dist/chunks/l10n-dacb6440.cjs +0 -1
  577. package/dist/chunks/l10n-dacb6440.cjs.map +0 -1
  578. package/dist/chunks/logger-01af1a78.cjs +0 -1
  579. package/dist/chunks/logger-ccc7ee65.mjs +0 -5
  580. package/dist/chunks/referencePickerModal-6120a321.cjs +0 -1
  581. package/dist/chunks/referencePickerModal-6120a321.cjs.map +0 -1
  582. package/dist/chunks/referencePickerModal-d0573462.mjs +0 -428
  583. package/dist/chunks/referencePickerModal-d0573462.mjs.map +0 -1
@@ -1 +1,125 @@
1
- "use strict";const s=require("@nextcloud/l10n"),n=require("../chunks/l10n-46d0c1c0.cjs"),m=require("../chunks/_plugin-vue2_normalizer-764a4c12.cjs"),l={long:n.t("a few seconds ago"),short:n.t("seconds ago"),narrow:n.t("sec. ago")},d={name:"NcDateTime",props:{timestamp:{type:[Date,Number],required:!0},format:{type:Object,default:()=>({timeStyle:"medium",dateStyle:"short"})},relativeTime:{type:[Boolean,String],default:"long",validator:t=>t===!1||["long","short","narrow"].includes(t)},ignoreSeconds:{type:Boolean,default:!1}},data(){return{currentTime:Date.now(),intervalId:void 0}},computed:{dateObject(){return new Date(this.timestamp)},formattedTime(){if(this.relativeTime!==!1){const t=new Intl.RelativeTimeFormat(s.getCanonicalLocale(),{numeric:"auto",style:this.relativeTime}),e=(this.dateObject-new Date(this.currentTime))/1e3;if(Math.abs(e)<=90)return this.ignoreSeconds?l[this.relativeTime]:t.format(Math.round(e),"second");const a=e/60;if(Math.abs(a)<=90)return t.format(Math.round(a),"minute");const i=a/60;if(Math.abs(i)<=72)return t.format(Math.round(i),"hour");const r=i/24;if(Math.abs(r)<=6)return t.format(Math.round(r),"day");const o=r/7;return Math.abs(o)<=52?t.format(Math.round(o),"week"):t.format(Math.round(r/365),"year")}return this.formattedFullTime},formattedFullTime(){return new Intl.DateTimeFormat(s.getCanonicalLocale(),this.format).format(this.dateObject)}},watch:{relativeTime(t,e){window.clearInterval(this.intervalId),this.intervalId=void 0,t&&(this.intervalId=window.setInterval(this.setCurrentTime,1e3))}},mounted(){this.relativeTime!==!1&&(this.intervalId=window.setInterval(this.setCurrentTime,1e3))},destroyed(){window.clearInterval(this.intervalId)},methods:{setCurrentTime(){this.currentTime=Date.now()}}};var u=function(){var t=this,e=t._self._c;return e("span",{staticClass:"nc-datetime",attrs:{"data-timestamp":t.timestamp,title:t.formattedFullTime}},[t._v(t._s(t.formattedTime))])},h=[],c=m.normalizeComponent(d,u,h,!1,null,null,null,null);const f=c.exports;module.exports=f;
1
+ "use strict";
2
+ const l = require("@nextcloud/l10n"), s = require("../chunks/l10n-b1d264c7.cjs"), m = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), d = {
3
+ long: s.t("a few seconds ago"),
4
+ short: s.t("seconds ago"),
5
+ // FOR TRANSLATORS: Shorter version of 'a few seconds ago'
6
+ narrow: s.t("sec. ago")
7
+ // FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'
8
+ }, u = {
9
+ name: "NcDateTime",
10
+ props: {
11
+ /**
12
+ * The timestamp to display, either an unix timestamp (in milliseconds) or a Date object
13
+ */
14
+ timestamp: {
15
+ type: [Date, Number],
16
+ required: !0
17
+ },
18
+ /**
19
+ * The format used for displaying, or if relative time is used the format used for the title (optional)
20
+ *
21
+ * @type {Intl.DateTimeFormatOptions}
22
+ */
23
+ format: {
24
+ type: Object,
25
+ default: () => ({ timeStyle: "medium", dateStyle: "short" })
26
+ },
27
+ /**
28
+ * Wether to display the timestamp as time from now (optional)
29
+ *
30
+ * - `false`: Disable relative time
31
+ * - `'long'`: Long text, like *2 seconds ago* (default)
32
+ * - `'short'`: Short text, like *2 sec. ago*
33
+ * - `'narrow'`: Even shorter text (same as `'short'` on some languages)
34
+ */
35
+ relativeTime: {
36
+ type: [Boolean, String],
37
+ default: "long",
38
+ validator: (t) => t === !1 || ["long", "short", "narrow"].includes(t)
39
+ },
40
+ /**
41
+ * Ignore seconds when displaying the relative time and just show `a few seconds ago`
42
+ */
43
+ ignoreSeconds: {
44
+ type: Boolean,
45
+ default: !1
46
+ }
47
+ },
48
+ data() {
49
+ return {
50
+ /** Current time in ms */
51
+ currentTime: Date.now(),
52
+ /** ID of the current time interval */
53
+ intervalId: void 0
54
+ };
55
+ },
56
+ computed: {
57
+ /** ECMA Date object of the timestamp */
58
+ dateObject() {
59
+ return new Date(this.timestamp);
60
+ },
61
+ /** Time string formatted for main text */
62
+ formattedTime() {
63
+ if (this.relativeTime !== !1) {
64
+ const t = new Intl.RelativeTimeFormat(l.getCanonicalLocale(), { numeric: "auto", style: this.relativeTime }), r = (this.dateObject - new Date(this.currentTime)) / 1e3;
65
+ if (Math.abs(r) <= 90)
66
+ return this.ignoreSeconds ? d[this.relativeTime] : t.format(Math.round(r), "second");
67
+ const n = r / 60;
68
+ if (Math.abs(n) <= 90)
69
+ return t.format(Math.round(n), "minute");
70
+ const i = n / 60;
71
+ if (Math.abs(i) <= 72)
72
+ return t.format(Math.round(i), "hour");
73
+ const a = i / 24;
74
+ if (Math.abs(a) <= 6)
75
+ return t.format(Math.round(a), "day");
76
+ const o = a / 7;
77
+ return Math.abs(o) <= 52 ? t.format(Math.round(o), "week") : t.format(Math.round(a / 365), "year");
78
+ }
79
+ return this.formattedFullTime;
80
+ },
81
+ formattedFullTime() {
82
+ return new Intl.DateTimeFormat(l.getCanonicalLocale(), this.format).format(this.dateObject);
83
+ }
84
+ },
85
+ watch: {
86
+ /**
87
+ * Set or clear interval if relative time is dis/enabled
88
+ *
89
+ * @param {boolean} newValue The new value of the relativeTime property
90
+ * @param {boolean} _oldValue The old value of the relativeTime property
91
+ */
92
+ relativeTime(t, e) {
93
+ window.clearInterval(this.intervalId), this.intervalId = void 0, t && (this.intervalId = window.setInterval(this.setCurrentTime, 1e3));
94
+ }
95
+ },
96
+ mounted() {
97
+ this.relativeTime !== !1 && (this.intervalId = window.setInterval(this.setCurrentTime, 1e3));
98
+ },
99
+ destroyed() {
100
+ window.clearInterval(this.intervalId);
101
+ },
102
+ methods: {
103
+ /**
104
+ * Set `currentTime` to the current timestamp, required as Date.now() is not reactive.
105
+ */
106
+ setCurrentTime() {
107
+ this.currentTime = Date.now();
108
+ }
109
+ }
110
+ };
111
+ var c = function() {
112
+ var e = this, r = e._self._c;
113
+ return r("span", { staticClass: "nc-datetime", attrs: { "data-timestamp": e.timestamp, title: e.formattedFullTime } }, [e._v(e._s(e.formattedTime))]);
114
+ }, f = [], h = /* @__PURE__ */ m.normalizeComponent(
115
+ u,
116
+ c,
117
+ f,
118
+ !1,
119
+ null,
120
+ null,
121
+ null,
122
+ null
123
+ );
124
+ const v = h.exports;
125
+ module.exports = v;
@@ -1 +1 @@
1
- {"version":3,"file":"NcDateTime.cjs","sources":["../../src/components/NcDateTime/NcDateTime.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n\n### General description\n\nThis components purpose is to display a timestamp in the users local time format.\nIt also supports relative time, for examples *6 seconds ago*.\n\n#### Standard usage\n\nWithout any optional parameters the timestamp is displayed as a relative datetime and a title with the full date is added.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Ignore seconds\n\nIf you do not want the seconds to be counted up until minutes are reached you can simply use the `ignore-seconds` property.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" :ignore-seconds=\"true\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Custom date or time format\n\nThe component allows to format the full date for the title by settings the `format` property.\nIt is also possible to disable relative time by setting the `relativeTime` property to `false`.\n\n```vue\n<template>\n\t<div>\n\t\t<h4>Short relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" relative-time=\"short\" />\n\n\t\t<h4>Custom title format</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" />\n\n\t\t<h4>Without relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" :relative-time=\"false\" />\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t/** For allowed formats see the Intl.DateTimeFormat options */\n\t\t\t\ttimeFormat: {\n\t\t\t\t\tdateStyle: 'short',\n\t\t\t\t\ttimeStyle: 'full'\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style>\nh4 {\n\tfont-weight: bold;\n\tmargin-top: 12px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<span class=\"nc-datetime\"\n\t\t:data-timestamp=\"timestamp\"\n\t\t:title=\"formattedFullTime\">{{ formattedTime }}</span>\n</template>\n\n<script>\nimport { getCanonicalLocale } from '@nextcloud/l10n'\nimport { t } from '../../l10n.js'\n\nconst FEW_SECONDS_AGO = {\n\tlong: t('a few seconds ago'),\n\tshort: t('seconds ago'), // FOR TRANSLATORS: Shorter version of 'a few seconds ago'\n\tnarrow: t('sec. ago'), // FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'\n}\n\nexport default {\n\tname: 'NcDateTime',\n\n\tprops: {\n\t\t/**\n\t\t * The timestamp to display, either an unix timestamp (in milliseconds) or a Date object\n\t\t */\n\t\ttimestamp: {\n\t\t\ttype: [Date, Number],\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * The format used for displaying, or if relative time is used the format used for the title (optional)\n\t\t *\n\t\t * @type {Intl.DateTimeFormatOptions}\n\t\t */\n\t\tformat: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ timeStyle: 'medium', dateStyle: 'short' }),\n\t\t},\n\t\t/**\n\t\t * Wether to display the timestamp as time from now (optional)\n\t\t *\n\t\t * - `false`: Disable relative time\n\t\t * - `'long'`: Long text, like *2 seconds ago* (default)\n\t\t * - `'short'`: Short text, like *2 sec. ago*\n\t\t * - `'narrow'`: Even shorter text (same as `'short'` on some languages)\n\t\t */\n\t\trelativeTime: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: 'long',\n\t\t\tvalidator: (v) => v === false || ['long', 'short', 'narrow'].includes(v),\n\t\t},\n\t\t/**\n\t\t * Ignore seconds when displaying the relative time and just show `a few seconds ago`\n\t\t */\n\t\tignoreSeconds: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Current time in ms */\n\t\t\tcurrentTime: Date.now(),\n\t\t\t/** ID of the current time interval */\n\t\t\tintervalId: undefined,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** ECMA Date object of the timestamp */\n\t\tdateObject() {\n\t\t\treturn new Date(this.timestamp)\n\t\t},\n\t\t/** Time string formatted for main text */\n\t\tformattedTime() {\n\t\t\tif (this.relativeTime !== false) {\n\t\t\t\tconst formatter = new Intl.RelativeTimeFormat(getCanonicalLocale(), { numeric: 'auto', style: this.relativeTime })\n\n\t\t\t\tconst diff = this.dateObject - new Date(this.currentTime)\n\t\t\t\tconst seconds = diff / 1000\n\t\t\t\tif (Math.abs(seconds) <= 90) {\n\t\t\t\t\tif (this.ignoreSeconds) {\n\t\t\t\t\t\treturn FEW_SECONDS_AGO[this.relativeTime]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn formatter.format(Math.round(seconds), 'second')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst minutes = seconds / 60\n\t\t\t\tif (Math.abs(minutes) <= 90) {\n\t\t\t\t\treturn formatter.format(Math.round(minutes), 'minute')\n\t\t\t\t}\n\t\t\t\tconst hours = minutes / 60\n\t\t\t\tif (Math.abs(hours) <= 72) {\n\t\t\t\t\treturn formatter.format(Math.round(hours), 'hour')\n\t\t\t\t}\n\t\t\t\tconst days = hours / 24\n\t\t\t\tif (Math.abs(days) <= 6) {\n\t\t\t\t\treturn formatter.format(Math.round(days), 'day')\n\t\t\t\t}\n\t\t\t\tconst weeks = days / 7\n\t\t\t\tif (Math.abs(weeks) <= 52) {\n\t\t\t\t\treturn formatter.format(Math.round(weeks), 'week')\n\t\t\t\t}\n\t\t\t\treturn formatter.format(Math.round(days / 365), 'year')\n\t\t\t}\n\t\t\treturn this.formattedFullTime\n\t\t},\n\t\tformattedFullTime() {\n\t\t\tconst formatter = new Intl.DateTimeFormat(getCanonicalLocale(), this.format)\n\t\t\treturn formatter.format(this.dateObject)\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Set or clear interval if relative time is dis/enabled\n\t\t *\n\t\t * @param {boolean} newValue The new value of the relativeTime property\n\t\t * @param {boolean} _oldValue The old value of the relativeTime property\n\t\t */\n\t\trelativeTime(newValue, _oldValue) {\n\t\t\twindow.clearInterval(this.intervalId)\n\t\t\tthis.intervalId = undefined\n\t\t\tif (newValue) {\n\t\t\t\tthis.intervalId = window.setInterval(this.setCurrentTime, 1000)\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Start the interval for setting the current time if relative time is enabled\n\t\tif (this.relativeTime !== false) {\n\t\t\tthis.intervalId = window.setInterval(this.setCurrentTime, 1000)\n\t\t}\n\t},\n\n\tdestroyed() {\n\t\t// ensure interval is cleared\n\t\twindow.clearInterval(this.intervalId)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Set `currentTime` to the current timestamp, required as Date.now() is not reactive.\n\t\t */\n\t\tsetCurrentTime() {\n\t\t\tthis.currentTime = Date.now()\n\t\t},\n\t},\n}\n</script>\n"],"names":["FEW_SECONDS_AGO","t","_sfc_main","v","formatter","getCanonicalLocale","seconds","minutes","hours","days","weeks","newValue","_oldValue"],"mappings":"qJAsHAA,EAAA,CACA,KAAAC,EAAA,EAAA,mBAAA,EACA,MAAAA,EAAA,EAAA,aAAA,EACA,OAAAA,EAAA,EAAA,UAAA,CACA,EAEAC,EAAA,CACA,KAAA,aAEA,MAAA,CAIA,UAAA,CACA,KAAA,CAAA,KAAA,MAAA,EACA,SAAA,EACA,EAMA,OAAA,CACA,KAAA,OACA,QAAA,KAAA,CAAA,UAAA,SAAA,UAAA,OAAA,EACA,EASA,aAAA,CACA,KAAA,CAAA,QAAA,MAAA,EACA,QAAA,OACA,UAAAC,GAAAA,IAAA,IAAA,CAAA,OAAA,QAAA,QAAA,EAAA,SAAAA,CAAA,CACA,EAIA,cAAA,CACA,KAAA,QACA,QAAA,EACA,CACA,EAEA,MAAA,CACA,MAAA,CAEA,YAAA,KAAA,IAAA,EAEA,WAAA,MACA,CACA,EAEA,SAAA,CAEA,YAAA,CACA,OAAA,IAAA,KAAA,KAAA,SAAA,CACA,EAEA,eAAA,CACA,GAAA,KAAA,eAAA,GAAA,CACA,MAAAC,EAAA,IAAA,KAAA,mBAAAC,EAAAA,mBAAA,EAAA,CAAA,QAAA,OAAA,MAAA,KAAA,YAAA,CAAA,EAGAC,GADA,KAAA,WAAA,IAAA,KAAA,KAAA,WAAA,GACA,IACA,GAAA,KAAA,IAAAA,CAAA,GAAA,GACA,OAAA,KAAA,cACAN,EAAA,KAAA,YAAA,EAEAI,EAAA,OAAA,KAAA,MAAAE,CAAA,EAAA,QAAA,EAGA,MAAAC,EAAAD,EAAA,GACA,GAAA,KAAA,IAAAC,CAAA,GAAA,GACA,OAAAH,EAAA,OAAA,KAAA,MAAAG,CAAA,EAAA,QAAA,EAEA,MAAAC,EAAAD,EAAA,GACA,GAAA,KAAA,IAAAC,CAAA,GAAA,GACA,OAAAJ,EAAA,OAAA,KAAA,MAAAI,CAAA,EAAA,MAAA,EAEA,MAAAC,EAAAD,EAAA,GACA,GAAA,KAAA,IAAAC,CAAA,GAAA,EACA,OAAAL,EAAA,OAAA,KAAA,MAAAK,CAAA,EAAA,KAAA,EAEA,MAAAC,EAAAD,EAAA,EACA,OAAA,KAAA,IAAAC,CAAA,GAAA,GACAN,EAAA,OAAA,KAAA,MAAAM,CAAA,EAAA,MAAA,EAEAN,EAAA,OAAA,KAAA,MAAAK,EAAA,GAAA,EAAA,MAAA,CAAA,CAEA,OAAA,KAAA,iBACA,EACA,mBAAA,CAEA,OADA,IAAA,KAAA,eAAAJ,EAAAA,mBAAA,EAAA,KAAA,MAAA,EACA,OAAA,KAAA,UAAA,CACA,CACA,EAEA,MAAA,CAOA,aAAAM,EAAAC,EAAA,CACA,OAAA,cAAA,KAAA,UAAA,EACA,KAAA,WAAA,OACAD,IACA,KAAA,WAAA,OAAA,YAAA,KAAA,eAAA,GAAA,EAEA,CACA,EAEA,SAAA,CAEA,KAAA,eAAA,KACA,KAAA,WAAA,OAAA,YAAA,KAAA,eAAA,GAAA,EAEA,EAEA,WAAA,CAEA,OAAA,cAAA,KAAA,UAAA,CACA,EAEA,QAAA,CAIA,gBAAA,CACA,KAAA,YAAA,KAAA,IAAA,CACA,CACA,CACA"}
1
+ {"version":3,"file":"NcDateTime.cjs","sources":["../../src/components/NcDateTime/NcDateTime.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n\n### General description\n\nThis components purpose is to display a timestamp in the users local time format.\nIt also supports relative time, for examples *6 seconds ago*.\n\n#### Standard usage\n\nWithout any optional parameters the timestamp is displayed as a relative datetime and a title with the full date is added.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Ignore seconds\n\nIf you do not want the seconds to be counted up until minutes are reached you can simply use the `ignore-seconds` property.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" :ignore-seconds=\"true\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Custom date or time format\n\nThe component allows to format the full date for the title by settings the `format` property.\nIt is also possible to disable relative time by setting the `relativeTime` property to `false`.\n\n```vue\n<template>\n\t<div>\n\t\t<h4>Short relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" relative-time=\"short\" />\n\n\t\t<h4>Custom title format</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" />\n\n\t\t<h4>Without relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" :relative-time=\"false\" />\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t/** For allowed formats see the Intl.DateTimeFormat options */\n\t\t\t\ttimeFormat: {\n\t\t\t\t\tdateStyle: 'short',\n\t\t\t\t\ttimeStyle: 'full'\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style>\nh4 {\n\tfont-weight: bold;\n\tmargin-top: 12px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<span class=\"nc-datetime\"\n\t\t:data-timestamp=\"timestamp\"\n\t\t:title=\"formattedFullTime\">{{ formattedTime }}</span>\n</template>\n\n<script>\nimport { getCanonicalLocale } from '@nextcloud/l10n'\nimport { t } from '../../l10n.js'\n\nconst FEW_SECONDS_AGO = {\n\tlong: t('a few seconds ago'),\n\tshort: t('seconds ago'), // FOR TRANSLATORS: Shorter version of 'a few seconds ago'\n\tnarrow: t('sec. ago'), // FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'\n}\n\nexport default {\n\tname: 'NcDateTime',\n\n\tprops: {\n\t\t/**\n\t\t * The timestamp to display, either an unix timestamp (in milliseconds) or a Date object\n\t\t */\n\t\ttimestamp: {\n\t\t\ttype: [Date, Number],\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * The format used for displaying, or if relative time is used the format used for the title (optional)\n\t\t *\n\t\t * @type {Intl.DateTimeFormatOptions}\n\t\t */\n\t\tformat: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ timeStyle: 'medium', dateStyle: 'short' }),\n\t\t},\n\t\t/**\n\t\t * Wether to display the timestamp as time from now (optional)\n\t\t *\n\t\t * - `false`: Disable relative time\n\t\t * - `'long'`: Long text, like *2 seconds ago* (default)\n\t\t * - `'short'`: Short text, like *2 sec. ago*\n\t\t * - `'narrow'`: Even shorter text (same as `'short'` on some languages)\n\t\t */\n\t\trelativeTime: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: 'long',\n\t\t\tvalidator: (v) => v === false || ['long', 'short', 'narrow'].includes(v),\n\t\t},\n\t\t/**\n\t\t * Ignore seconds when displaying the relative time and just show `a few seconds ago`\n\t\t */\n\t\tignoreSeconds: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Current time in ms */\n\t\t\tcurrentTime: Date.now(),\n\t\t\t/** ID of the current time interval */\n\t\t\tintervalId: undefined,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** ECMA Date object of the timestamp */\n\t\tdateObject() {\n\t\t\treturn new Date(this.timestamp)\n\t\t},\n\t\t/** Time string formatted for main text */\n\t\tformattedTime() {\n\t\t\tif (this.relativeTime !== false) {\n\t\t\t\tconst formatter = new Intl.RelativeTimeFormat(getCanonicalLocale(), { numeric: 'auto', style: this.relativeTime })\n\n\t\t\t\tconst diff = this.dateObject - new Date(this.currentTime)\n\t\t\t\tconst seconds = diff / 1000\n\t\t\t\tif (Math.abs(seconds) <= 90) {\n\t\t\t\t\tif (this.ignoreSeconds) {\n\t\t\t\t\t\treturn FEW_SECONDS_AGO[this.relativeTime]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn formatter.format(Math.round(seconds), 'second')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst minutes = seconds / 60\n\t\t\t\tif (Math.abs(minutes) <= 90) {\n\t\t\t\t\treturn formatter.format(Math.round(minutes), 'minute')\n\t\t\t\t}\n\t\t\t\tconst hours = minutes / 60\n\t\t\t\tif (Math.abs(hours) <= 72) {\n\t\t\t\t\treturn formatter.format(Math.round(hours), 'hour')\n\t\t\t\t}\n\t\t\t\tconst days = hours / 24\n\t\t\t\tif (Math.abs(days) <= 6) {\n\t\t\t\t\treturn formatter.format(Math.round(days), 'day')\n\t\t\t\t}\n\t\t\t\tconst weeks = days / 7\n\t\t\t\tif (Math.abs(weeks) <= 52) {\n\t\t\t\t\treturn formatter.format(Math.round(weeks), 'week')\n\t\t\t\t}\n\t\t\t\treturn formatter.format(Math.round(days / 365), 'year')\n\t\t\t}\n\t\t\treturn this.formattedFullTime\n\t\t},\n\t\tformattedFullTime() {\n\t\t\tconst formatter = new Intl.DateTimeFormat(getCanonicalLocale(), this.format)\n\t\t\treturn formatter.format(this.dateObject)\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Set or clear interval if relative time is dis/enabled\n\t\t *\n\t\t * @param {boolean} newValue The new value of the relativeTime property\n\t\t * @param {boolean} _oldValue The old value of the relativeTime property\n\t\t */\n\t\trelativeTime(newValue, _oldValue) {\n\t\t\twindow.clearInterval(this.intervalId)\n\t\t\tthis.intervalId = undefined\n\t\t\tif (newValue) {\n\t\t\t\tthis.intervalId = window.setInterval(this.setCurrentTime, 1000)\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Start the interval for setting the current time if relative time is enabled\n\t\tif (this.relativeTime !== false) {\n\t\t\tthis.intervalId = window.setInterval(this.setCurrentTime, 1000)\n\t\t}\n\t},\n\n\tdestroyed() {\n\t\t// ensure interval is cleared\n\t\twindow.clearInterval(this.intervalId)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Set `currentTime` to the current timestamp, required as Date.now() is not reactive.\n\t\t */\n\t\tsetCurrentTime() {\n\t\t\tthis.currentTime = Date.now()\n\t\t},\n\t},\n}\n</script>\n"],"names":["FEW_SECONDS_AGO","t","_sfc_main","v","formatter","getCanonicalLocale","seconds","minutes","hours","days","weeks","newValue","_oldValue"],"mappings":"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"}
@@ -1,44 +1,129 @@
1
- import { getCanonicalLocale as s } from "@nextcloud/l10n";
2
- import { t as n } from "../chunks/l10n-9a5a6afc.mjs";
3
- import { n as m } from "../chunks/_plugin-vue2_normalizer-5b4c43a4.mjs";
4
- const l = { long: n("a few seconds ago"), short: n("seconds ago"), narrow: n("sec. ago") }, d = { name: "NcDateTime", props: { timestamp: { type: [Date, Number], required: !0 }, format: { type: Object, default: () => ({ timeStyle: "medium", dateStyle: "short" }) }, relativeTime: { type: [Boolean, String], default: "long", validator: (t) => t === !1 || ["long", "short", "narrow"].includes(t) }, ignoreSeconds: { type: Boolean, default: !1 } }, data() {
5
- return { currentTime: Date.now(), intervalId: void 0 };
6
- }, computed: { dateObject() {
7
- return new Date(this.timestamp);
8
- }, formattedTime() {
9
- if (this.relativeTime !== !1) {
10
- const t = new Intl.RelativeTimeFormat(s(), { numeric: "auto", style: this.relativeTime }), e = (this.dateObject - new Date(this.currentTime)) / 1e3;
11
- if (Math.abs(e) <= 90)
12
- return this.ignoreSeconds ? l[this.relativeTime] : t.format(Math.round(e), "second");
13
- const r = e / 60;
14
- if (Math.abs(r) <= 90)
15
- return t.format(Math.round(r), "minute");
16
- const i = r / 60;
17
- if (Math.abs(i) <= 72)
18
- return t.format(Math.round(i), "hour");
19
- const a = i / 24;
20
- if (Math.abs(a) <= 6)
21
- return t.format(Math.round(a), "day");
22
- const o = a / 7;
23
- return Math.abs(o) <= 52 ? t.format(Math.round(o), "week") : t.format(Math.round(a / 365), "year");
1
+ import { getCanonicalLocale as m } from "@nextcloud/l10n";
2
+ import { t as o } from "../chunks/l10n-05a09c66.mjs";
3
+ import { n as l } from "../chunks/_plugin-vue2_normalizer-71e2aa87.mjs";
4
+ const d = {
5
+ long: o("a few seconds ago"),
6
+ short: o("seconds ago"),
7
+ // FOR TRANSLATORS: Shorter version of 'a few seconds ago'
8
+ narrow: o("sec. ago")
9
+ // FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'
10
+ }, u = {
11
+ name: "NcDateTime",
12
+ props: {
13
+ /**
14
+ * The timestamp to display, either an unix timestamp (in milliseconds) or a Date object
15
+ */
16
+ timestamp: {
17
+ type: [Date, Number],
18
+ required: !0
19
+ },
20
+ /**
21
+ * The format used for displaying, or if relative time is used the format used for the title (optional)
22
+ *
23
+ * @type {Intl.DateTimeFormatOptions}
24
+ */
25
+ format: {
26
+ type: Object,
27
+ default: () => ({ timeStyle: "medium", dateStyle: "short" })
28
+ },
29
+ /**
30
+ * Wether to display the timestamp as time from now (optional)
31
+ *
32
+ * - `false`: Disable relative time
33
+ * - `'long'`: Long text, like *2 seconds ago* (default)
34
+ * - `'short'`: Short text, like *2 sec. ago*
35
+ * - `'narrow'`: Even shorter text (same as `'short'` on some languages)
36
+ */
37
+ relativeTime: {
38
+ type: [Boolean, String],
39
+ default: "long",
40
+ validator: (t) => t === !1 || ["long", "short", "narrow"].includes(t)
41
+ },
42
+ /**
43
+ * Ignore seconds when displaying the relative time and just show `a few seconds ago`
44
+ */
45
+ ignoreSeconds: {
46
+ type: Boolean,
47
+ default: !1
48
+ }
49
+ },
50
+ data() {
51
+ return {
52
+ /** Current time in ms */
53
+ currentTime: Date.now(),
54
+ /** ID of the current time interval */
55
+ intervalId: void 0
56
+ };
57
+ },
58
+ computed: {
59
+ /** ECMA Date object of the timestamp */
60
+ dateObject() {
61
+ return new Date(this.timestamp);
62
+ },
63
+ /** Time string formatted for main text */
64
+ formattedTime() {
65
+ if (this.relativeTime !== !1) {
66
+ const t = new Intl.RelativeTimeFormat(m(), { numeric: "auto", style: this.relativeTime }), r = (this.dateObject - new Date(this.currentTime)) / 1e3;
67
+ if (Math.abs(r) <= 90)
68
+ return this.ignoreSeconds ? d[this.relativeTime] : t.format(Math.round(r), "second");
69
+ const n = r / 60;
70
+ if (Math.abs(n) <= 90)
71
+ return t.format(Math.round(n), "minute");
72
+ const i = n / 60;
73
+ if (Math.abs(i) <= 72)
74
+ return t.format(Math.round(i), "hour");
75
+ const a = i / 24;
76
+ if (Math.abs(a) <= 6)
77
+ return t.format(Math.round(a), "day");
78
+ const s = a / 7;
79
+ return Math.abs(s) <= 52 ? t.format(Math.round(s), "week") : t.format(Math.round(a / 365), "year");
80
+ }
81
+ return this.formattedFullTime;
82
+ },
83
+ formattedFullTime() {
84
+ return new Intl.DateTimeFormat(m(), this.format).format(this.dateObject);
85
+ }
86
+ },
87
+ watch: {
88
+ /**
89
+ * Set or clear interval if relative time is dis/enabled
90
+ *
91
+ * @param {boolean} newValue The new value of the relativeTime property
92
+ * @param {boolean} _oldValue The old value of the relativeTime property
93
+ */
94
+ relativeTime(t, e) {
95
+ window.clearInterval(this.intervalId), this.intervalId = void 0, t && (this.intervalId = window.setInterval(this.setCurrentTime, 1e3));
96
+ }
97
+ },
98
+ mounted() {
99
+ this.relativeTime !== !1 && (this.intervalId = window.setInterval(this.setCurrentTime, 1e3));
100
+ },
101
+ destroyed() {
102
+ window.clearInterval(this.intervalId);
103
+ },
104
+ methods: {
105
+ /**
106
+ * Set `currentTime` to the current timestamp, required as Date.now() is not reactive.
107
+ */
108
+ setCurrentTime() {
109
+ this.currentTime = Date.now();
110
+ }
24
111
  }
25
- return this.formattedFullTime;
26
- }, formattedFullTime() {
27
- return new Intl.DateTimeFormat(s(), this.format).format(this.dateObject);
28
- } }, watch: { relativeTime(t, e) {
29
- window.clearInterval(this.intervalId), this.intervalId = void 0, t && (this.intervalId = window.setInterval(this.setCurrentTime, 1e3));
30
- } }, mounted() {
31
- this.relativeTime !== !1 && (this.intervalId = window.setInterval(this.setCurrentTime, 1e3));
32
- }, destroyed() {
33
- window.clearInterval(this.intervalId);
34
- }, methods: { setCurrentTime() {
35
- this.currentTime = Date.now();
36
- } } };
37
- var u = function() {
38
- var t = this, e = t._self._c;
39
- return e("span", { staticClass: "nc-datetime", attrs: { "data-timestamp": t.timestamp, title: t.formattedFullTime } }, [t._v(t._s(t.formattedTime))]);
40
- }, h = [], c = m(d, u, h, !1, null, null, null, null);
41
- const w = c.exports;
112
+ };
113
+ var f = function() {
114
+ var e = this, r = e._self._c;
115
+ return r("span", { staticClass: "nc-datetime", attrs: { "data-timestamp": e.timestamp, title: e.formattedFullTime } }, [e._v(e._s(e.formattedTime))]);
116
+ }, c = [], h = /* @__PURE__ */ l(
117
+ u,
118
+ f,
119
+ c,
120
+ !1,
121
+ null,
122
+ null,
123
+ null,
124
+ null
125
+ );
126
+ const p = h.exports;
42
127
  export {
43
- w as default
128
+ p as default
44
129
  };
@@ -1 +1 @@
1
- {"version":3,"file":"NcDateTime.mjs","sources":["../../src/components/NcDateTime/NcDateTime.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n\n### General description\n\nThis components purpose is to display a timestamp in the users local time format.\nIt also supports relative time, for examples *6 seconds ago*.\n\n#### Standard usage\n\nWithout any optional parameters the timestamp is displayed as a relative datetime and a title with the full date is added.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Ignore seconds\n\nIf you do not want the seconds to be counted up until minutes are reached you can simply use the `ignore-seconds` property.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" :ignore-seconds=\"true\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Custom date or time format\n\nThe component allows to format the full date for the title by settings the `format` property.\nIt is also possible to disable relative time by setting the `relativeTime` property to `false`.\n\n```vue\n<template>\n\t<div>\n\t\t<h4>Short relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" relative-time=\"short\" />\n\n\t\t<h4>Custom title format</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" />\n\n\t\t<h4>Without relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" :relative-time=\"false\" />\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t/** For allowed formats see the Intl.DateTimeFormat options */\n\t\t\t\ttimeFormat: {\n\t\t\t\t\tdateStyle: 'short',\n\t\t\t\t\ttimeStyle: 'full'\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style>\nh4 {\n\tfont-weight: bold;\n\tmargin-top: 12px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<span class=\"nc-datetime\"\n\t\t:data-timestamp=\"timestamp\"\n\t\t:title=\"formattedFullTime\">{{ formattedTime }}</span>\n</template>\n\n<script>\nimport { getCanonicalLocale } from '@nextcloud/l10n'\nimport { t } from '../../l10n.js'\n\nconst FEW_SECONDS_AGO = {\n\tlong: t('a few seconds ago'),\n\tshort: t('seconds ago'), // FOR TRANSLATORS: Shorter version of 'a few seconds ago'\n\tnarrow: t('sec. ago'), // FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'\n}\n\nexport default {\n\tname: 'NcDateTime',\n\n\tprops: {\n\t\t/**\n\t\t * The timestamp to display, either an unix timestamp (in milliseconds) or a Date object\n\t\t */\n\t\ttimestamp: {\n\t\t\ttype: [Date, Number],\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * The format used for displaying, or if relative time is used the format used for the title (optional)\n\t\t *\n\t\t * @type {Intl.DateTimeFormatOptions}\n\t\t */\n\t\tformat: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ timeStyle: 'medium', dateStyle: 'short' }),\n\t\t},\n\t\t/**\n\t\t * Wether to display the timestamp as time from now (optional)\n\t\t *\n\t\t * - `false`: Disable relative time\n\t\t * - `'long'`: Long text, like *2 seconds ago* (default)\n\t\t * - `'short'`: Short text, like *2 sec. ago*\n\t\t * - `'narrow'`: Even shorter text (same as `'short'` on some languages)\n\t\t */\n\t\trelativeTime: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: 'long',\n\t\t\tvalidator: (v) => v === false || ['long', 'short', 'narrow'].includes(v),\n\t\t},\n\t\t/**\n\t\t * Ignore seconds when displaying the relative time and just show `a few seconds ago`\n\t\t */\n\t\tignoreSeconds: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Current time in ms */\n\t\t\tcurrentTime: Date.now(),\n\t\t\t/** ID of the current time interval */\n\t\t\tintervalId: undefined,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** ECMA Date object of the timestamp */\n\t\tdateObject() {\n\t\t\treturn new Date(this.timestamp)\n\t\t},\n\t\t/** Time string formatted for main text */\n\t\tformattedTime() {\n\t\t\tif (this.relativeTime !== false) {\n\t\t\t\tconst formatter = new Intl.RelativeTimeFormat(getCanonicalLocale(), { numeric: 'auto', style: this.relativeTime })\n\n\t\t\t\tconst diff = this.dateObject - new Date(this.currentTime)\n\t\t\t\tconst seconds = diff / 1000\n\t\t\t\tif (Math.abs(seconds) <= 90) {\n\t\t\t\t\tif (this.ignoreSeconds) {\n\t\t\t\t\t\treturn FEW_SECONDS_AGO[this.relativeTime]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn formatter.format(Math.round(seconds), 'second')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst minutes = seconds / 60\n\t\t\t\tif (Math.abs(minutes) <= 90) {\n\t\t\t\t\treturn formatter.format(Math.round(minutes), 'minute')\n\t\t\t\t}\n\t\t\t\tconst hours = minutes / 60\n\t\t\t\tif (Math.abs(hours) <= 72) {\n\t\t\t\t\treturn formatter.format(Math.round(hours), 'hour')\n\t\t\t\t}\n\t\t\t\tconst days = hours / 24\n\t\t\t\tif (Math.abs(days) <= 6) {\n\t\t\t\t\treturn formatter.format(Math.round(days), 'day')\n\t\t\t\t}\n\t\t\t\tconst weeks = days / 7\n\t\t\t\tif (Math.abs(weeks) <= 52) {\n\t\t\t\t\treturn formatter.format(Math.round(weeks), 'week')\n\t\t\t\t}\n\t\t\t\treturn formatter.format(Math.round(days / 365), 'year')\n\t\t\t}\n\t\t\treturn this.formattedFullTime\n\t\t},\n\t\tformattedFullTime() {\n\t\t\tconst formatter = new Intl.DateTimeFormat(getCanonicalLocale(), this.format)\n\t\t\treturn formatter.format(this.dateObject)\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Set or clear interval if relative time is dis/enabled\n\t\t *\n\t\t * @param {boolean} newValue The new value of the relativeTime property\n\t\t * @param {boolean} _oldValue The old value of the relativeTime property\n\t\t */\n\t\trelativeTime(newValue, _oldValue) {\n\t\t\twindow.clearInterval(this.intervalId)\n\t\t\tthis.intervalId = undefined\n\t\t\tif (newValue) {\n\t\t\t\tthis.intervalId = window.setInterval(this.setCurrentTime, 1000)\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Start the interval for setting the current time if relative time is enabled\n\t\tif (this.relativeTime !== false) {\n\t\t\tthis.intervalId = window.setInterval(this.setCurrentTime, 1000)\n\t\t}\n\t},\n\n\tdestroyed() {\n\t\t// ensure interval is cleared\n\t\twindow.clearInterval(this.intervalId)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Set `currentTime` to the current timestamp, required as Date.now() is not reactive.\n\t\t */\n\t\tsetCurrentTime() {\n\t\t\tthis.currentTime = Date.now()\n\t\t},\n\t},\n}\n</script>\n"],"names":["FEW_SECONDS_AGO","t","_sfc_main","v","formatter","getCanonicalLocale","seconds","minutes","hours","days","weeks","newValue","_oldValue"],"mappings":";;;AAsHA,MAAAA,IAAA,EACA,MAAAC,EAAA,mBAAA,GACA,OAAAA,EAAA,aAAA,GACA,QAAAA,EAAA,UAAA,EACA,GAEAC,IAAA,EACA,MAAA,cAEA,OAAA,EAIA,WAAA,EACA,MAAA,CAAA,MAAA,MAAA,GACA,UAAA,GACA,GAMA,QAAA,EACA,MAAA,QACA,SAAA,OAAA,EAAA,WAAA,UAAA,WAAA,QAAA,GACA,GASA,cAAA,EACA,MAAA,CAAA,SAAA,MAAA,GACA,SAAA,QACA,WAAAC,OAAAA,MAAA,MAAA,CAAA,QAAA,SAAA,QAAA,EAAA,SAAAA,CAAA,EACA,GAIA,eAAA,EACA,MAAA,SACA,SAAA,GACA,EACA,GAEA,OAAA;AACA,SAAA,EAEA,aAAA,KAAA,IAAA,GAEA,YAAA,OACA;AACA,GAEA,UAAA,EAEA,aAAA;AACA,SAAA,IAAA,KAAA,KAAA,SAAA;AACA,GAEA,gBAAA;AACA,MAAA,KAAA,iBAAA,IAAA;AACA,UAAAC,IAAA,IAAA,KAAA,mBAAAC,EAAA,GAAA,EAAA,SAAA,QAAA,OAAA,KAAA,aAAA,CAAA,GAGAC,KADA,KAAA,aAAA,IAAA,KAAA,KAAA,WAAA,KACA;AACA,QAAA,KAAA,IAAAA,CAAA,KAAA;AACA,aAAA,KAAA,gBACAN,EAAA,KAAA,YAAA,IAEAI,EAAA,OAAA,KAAA,MAAAE,CAAA,GAAA,QAAA;AAGA,UAAAC,IAAAD,IAAA;AACA,QAAA,KAAA,IAAAC,CAAA,KAAA;AACA,aAAAH,EAAA,OAAA,KAAA,MAAAG,CAAA,GAAA,QAAA;AAEA,UAAAC,IAAAD,IAAA;AACA,QAAA,KAAA,IAAAC,CAAA,KAAA;AACA,aAAAJ,EAAA,OAAA,KAAA,MAAAI,CAAA,GAAA,MAAA;AAEA,UAAAC,IAAAD,IAAA;AACA,QAAA,KAAA,IAAAC,CAAA,KAAA;AACA,aAAAL,EAAA,OAAA,KAAA,MAAAK,CAAA,GAAA,KAAA;AAEA,UAAAC,IAAAD,IAAA;AACA,WAAA,KAAA,IAAAC,CAAA,KAAA,KACAN,EAAA,OAAA,KAAA,MAAAM,CAAA,GAAA,MAAA,IAEAN,EAAA,OAAA,KAAA,MAAAK,IAAA,GAAA,GAAA,MAAA;AAAA,EAAA;AAEA,SAAA,KAAA;AACA,GACA,oBAAA;AAEA,SADA,IAAA,KAAA,eAAAJ,EAAA,GAAA,KAAA,MAAA,EACA,OAAA,KAAA,UAAA;AACA,EACA,GAEA,OAAA,EAOA,aAAAM,GAAAC,GAAA;AACA,SAAA,cAAA,KAAA,UAAA,GACA,KAAA,aAAA,QACAD,MACA,KAAA,aAAA,OAAA,YAAA,KAAA,gBAAA,GAAA;AAEA,EACA,GAEA,UAAA;AAEA,OAAA,iBAAA,OACA,KAAA,aAAA,OAAA,YAAA,KAAA,gBAAA,GAAA;AAEA,GAEA,YAAA;AAEA,SAAA,cAAA,KAAA,UAAA;AACA,GAEA,SAAA,EAIA,iBAAA;AACA,OAAA,cAAA,KAAA,IAAA;AACA,EACA,EACA;;;;;;"}
1
+ {"version":3,"file":"NcDateTime.mjs","sources":["../../src/components/NcDateTime/NcDateTime.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2023 Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n\n### General description\n\nThis components purpose is to display a timestamp in the users local time format.\nIt also supports relative time, for examples *6 seconds ago*.\n\n#### Standard usage\n\nWithout any optional parameters the timestamp is displayed as a relative datetime and a title with the full date is added.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Ignore seconds\n\nIf you do not want the seconds to be counted up until minutes are reached you can simply use the `ignore-seconds` property.\n\n```vue\n<template>\n\t<NcDateTime :timestamp=\"timestamp\" :ignore-seconds=\"true\" />\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t}\n\t\t},\n\t}\n</script>\n```\n\n#### Custom date or time format\n\nThe component allows to format the full date for the title by settings the `format` property.\nIt is also possible to disable relative time by setting the `relativeTime` property to `false`.\n\n```vue\n<template>\n\t<div>\n\t\t<h4>Short relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" relative-time=\"short\" />\n\n\t\t<h4>Custom title format</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" />\n\n\t\t<h4>Without relative time</h4>\n\t\t<NcDateTime :timestamp=\"timestamp\" :format=\"timeFormat\" :relative-time=\"false\" />\n\t</div>\n</template>\n<script>\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\t/** For allowed formats see the Intl.DateTimeFormat options */\n\t\t\t\ttimeFormat: {\n\t\t\t\t\tdateStyle: 'short',\n\t\t\t\t\ttimeStyle: 'full'\n\t\t\t\t},\n\t\t\t}\n\t\t},\n\t}\n</script>\n<style>\nh4 {\n\tfont-weight: bold;\n\tmargin-top: 12px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<span class=\"nc-datetime\"\n\t\t:data-timestamp=\"timestamp\"\n\t\t:title=\"formattedFullTime\">{{ formattedTime }}</span>\n</template>\n\n<script>\nimport { getCanonicalLocale } from '@nextcloud/l10n'\nimport { t } from '../../l10n.js'\n\nconst FEW_SECONDS_AGO = {\n\tlong: t('a few seconds ago'),\n\tshort: t('seconds ago'), // FOR TRANSLATORS: Shorter version of 'a few seconds ago'\n\tnarrow: t('sec. ago'), // FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'\n}\n\nexport default {\n\tname: 'NcDateTime',\n\n\tprops: {\n\t\t/**\n\t\t * The timestamp to display, either an unix timestamp (in milliseconds) or a Date object\n\t\t */\n\t\ttimestamp: {\n\t\t\ttype: [Date, Number],\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * The format used for displaying, or if relative time is used the format used for the title (optional)\n\t\t *\n\t\t * @type {Intl.DateTimeFormatOptions}\n\t\t */\n\t\tformat: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({ timeStyle: 'medium', dateStyle: 'short' }),\n\t\t},\n\t\t/**\n\t\t * Wether to display the timestamp as time from now (optional)\n\t\t *\n\t\t * - `false`: Disable relative time\n\t\t * - `'long'`: Long text, like *2 seconds ago* (default)\n\t\t * - `'short'`: Short text, like *2 sec. ago*\n\t\t * - `'narrow'`: Even shorter text (same as `'short'` on some languages)\n\t\t */\n\t\trelativeTime: {\n\t\t\ttype: [Boolean, String],\n\t\t\tdefault: 'long',\n\t\t\tvalidator: (v) => v === false || ['long', 'short', 'narrow'].includes(v),\n\t\t},\n\t\t/**\n\t\t * Ignore seconds when displaying the relative time and just show `a few seconds ago`\n\t\t */\n\t\tignoreSeconds: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** Current time in ms */\n\t\t\tcurrentTime: Date.now(),\n\t\t\t/** ID of the current time interval */\n\t\t\tintervalId: undefined,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** ECMA Date object of the timestamp */\n\t\tdateObject() {\n\t\t\treturn new Date(this.timestamp)\n\t\t},\n\t\t/** Time string formatted for main text */\n\t\tformattedTime() {\n\t\t\tif (this.relativeTime !== false) {\n\t\t\t\tconst formatter = new Intl.RelativeTimeFormat(getCanonicalLocale(), { numeric: 'auto', style: this.relativeTime })\n\n\t\t\t\tconst diff = this.dateObject - new Date(this.currentTime)\n\t\t\t\tconst seconds = diff / 1000\n\t\t\t\tif (Math.abs(seconds) <= 90) {\n\t\t\t\t\tif (this.ignoreSeconds) {\n\t\t\t\t\t\treturn FEW_SECONDS_AGO[this.relativeTime]\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn formatter.format(Math.round(seconds), 'second')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst minutes = seconds / 60\n\t\t\t\tif (Math.abs(minutes) <= 90) {\n\t\t\t\t\treturn formatter.format(Math.round(minutes), 'minute')\n\t\t\t\t}\n\t\t\t\tconst hours = minutes / 60\n\t\t\t\tif (Math.abs(hours) <= 72) {\n\t\t\t\t\treturn formatter.format(Math.round(hours), 'hour')\n\t\t\t\t}\n\t\t\t\tconst days = hours / 24\n\t\t\t\tif (Math.abs(days) <= 6) {\n\t\t\t\t\treturn formatter.format(Math.round(days), 'day')\n\t\t\t\t}\n\t\t\t\tconst weeks = days / 7\n\t\t\t\tif (Math.abs(weeks) <= 52) {\n\t\t\t\t\treturn formatter.format(Math.round(weeks), 'week')\n\t\t\t\t}\n\t\t\t\treturn formatter.format(Math.round(days / 365), 'year')\n\t\t\t}\n\t\t\treturn this.formattedFullTime\n\t\t},\n\t\tformattedFullTime() {\n\t\t\tconst formatter = new Intl.DateTimeFormat(getCanonicalLocale(), this.format)\n\t\t\treturn formatter.format(this.dateObject)\n\t\t},\n\t},\n\n\twatch: {\n\t\t/**\n\t\t * Set or clear interval if relative time is dis/enabled\n\t\t *\n\t\t * @param {boolean} newValue The new value of the relativeTime property\n\t\t * @param {boolean} _oldValue The old value of the relativeTime property\n\t\t */\n\t\trelativeTime(newValue, _oldValue) {\n\t\t\twindow.clearInterval(this.intervalId)\n\t\t\tthis.intervalId = undefined\n\t\t\tif (newValue) {\n\t\t\t\tthis.intervalId = window.setInterval(this.setCurrentTime, 1000)\n\t\t\t}\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// Start the interval for setting the current time if relative time is enabled\n\t\tif (this.relativeTime !== false) {\n\t\t\tthis.intervalId = window.setInterval(this.setCurrentTime, 1000)\n\t\t}\n\t},\n\n\tdestroyed() {\n\t\t// ensure interval is cleared\n\t\twindow.clearInterval(this.intervalId)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Set `currentTime` to the current timestamp, required as Date.now() is not reactive.\n\t\t */\n\t\tsetCurrentTime() {\n\t\t\tthis.currentTime = Date.now()\n\t\t},\n\t},\n}\n</script>\n"],"names":["FEW_SECONDS_AGO","t","_sfc_main","v","formatter","getCanonicalLocale","seconds","minutes","hours","days","weeks","newValue","_oldValue"],"mappings":"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"}
@@ -1 +1,217 @@
1
- var v=require("../assets/index-82b5969a.css");const o=require("../chunks/l10n-46d0c1c0.cjs"),u=require("./NcTimezonePicker.cjs"),p=require("./NcPopover.cjs"),c=require("../chunks/l10n-dacb6440.cjs"),m=require("vue-material-design-icons/CalendarBlank.vue"),d=require("vue-material-design-icons/Web.vue"),n=require("@nextcloud/l10n"),h=require("vue2-datepicker"),f=require("../chunks/_plugin-vue2_normalizer-764a4c12.cjs"),y=require("../chunks/ScopeComponent-4b8bd1ee.cjs");const l={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD H:mm:ss",year:"YYYY",month:"YYYY-MM",time:"H:mm:ss",week:"w"},k={name:"NcDateTimePicker",components:{CalendarBlank:m,DatePicker:h,NcPopover:p,NcTimezonePicker:u,Web:d},mixins:[c.l10n],inheritAttrs:!1,props:{clearable:{type:Boolean,default:!1},minuteStep:{type:Number,default:10},type:{type:String,default:"date"},format:{type:String,default:null},formatter:{type:Object,default:null},lang:{type:Object,default:null},value:{default:()=>new Date},timezoneId:{type:String,default:"UTC"},showTimezoneSelect:{type:Boolean,default:!1},highlightTimezone:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},showWeekNumber:{type:Boolean,default:!1},placeholder:{type:String,default:null}},emits:["update:value","update:timezone-id"],data(){return{showTimezonePopover:!1,tzVal:this.timezoneId}},computed:{defaultLang(){return{formatLocale:{months:n.getMonthNames(),monthsShort:n.getMonthNamesShort(),weekdays:n.getDayNames(),weekdaysShort:n.getDayNamesShort(),weekdaysMin:n.getDayNamesMin(),firstDayOfWeek:n.getFirstDay()},monthFormat:"MMM"}},defaultPlaceholder(){return this.type==="time"?o.t("Pick a time"):this.type==="month"?o.t("Pick a month"):this.type==="year"?o.t("Pick a year"):this.type==="week"?o.t("Pick a week"):this.type==="date"?o.t("Pick a date"):o.t("Pick a date and a time")},formatTypeMap(){var e;return(e=l[this.type])!=null?e:l.date}},methods:{handleSelectYear(e){const t=this.$refs.datepicker.currentValue;if(t)try{const a=new Date(new Date(t).setFullYear(e));this.$refs.datepicker.selectDate(a)}catch{console.error("Invalid value",t,e)}},handleSelectMonth(e){const t=this.$refs.datepicker.currentValue;if(t)try{const a=new Date(new Date(t).setMonth(e));this.$refs.datepicker.selectDate(a)}catch{console.error("Invalid value",t,e)}},toggleTimezonePopover(){this.showTimezoneSelect&&(this.showTimezonePopover=!this.showTimezonePopover)}}};var w=function(){var e=this,t=e._self._c;return t("DatePicker",e._g(e._b({ref:"datepicker",attrs:{"append-to-body":e.appendToBody,clearable:e.clearable,format:e.format?e.format:e.formatTypeMap,formatter:e.formatter,lang:e.lang?e.lang:e.defaultLang,"minute-step":e.minuteStep,placeholder:e.placeholder?e.placeholder:e.defaultPlaceholder,"popup-class":{"show-week-number":e.showWeekNumber},"show-week-number":e.showWeekNumber,type:e.type,value:e.value},on:{"select-year":e.handleSelectYear,"select-month":e.handleSelectMonth,"update:value":function(a){return e.$emit("update:value",e.value)}},scopedSlots:e._u([{key:"icon-calendar",fn:function(){return[e.showTimezoneSelect?t("NcPopover",{attrs:{shown:e.showTimezonePopover,"popover-base-class":"timezone-select__popper"},on:{"update:shown":function(a){e.showTimezonePopover=a}},scopedSlots:e._u([{key:"trigger",fn:function(){return[t("button",{staticClass:"datetime-picker-inline-icon",class:{"datetime-picker-inline-icon--highlighted":e.highlightTimezone},on:{mousedown:function(a){return a.stopPropagation(),a.preventDefault(),(()=>{}).apply(null,arguments)}}},[t("Web",{attrs:{size:20}})],1)]},proxy:!0}],null,!1,3375037618)},[t("div",{staticClass:"timezone-popover-wrapper__label"},[t("strong",[e._v(" "+e._s(e.t("Please select a time zone:"))+" ")])]),t("NcTimezonePicker",{staticClass:"timezone-popover-wrapper__timezone-select",on:{input:function(a){return e.$emit("update:timezone-id",arguments[0])}},model:{value:e.tzVal,callback:function(a){e.tzVal=a},expression:"tzVal"}})],1):t("CalendarBlank",{attrs:{size:20}})]},proxy:!0},e._l(e.$scopedSlots,function(a,r){return{key:r,fn:function(s){return[e._t(r,null,null,s)]}}})],null,!0)},"DatePicker",e.$attrs,!1),e.$listeners))},g=[],z=f.normalizeComponent(k,w,g,!1,null,"26676d3b",null,null);const i=z.exports;y.ScopeComponent(i),module.exports=i;
1
+ var T = require("../assets/index-574438d6.css");
2
+ const o = require("../chunks/l10n-b1d264c7.cjs"), p = require("./NcTimezonePicker.cjs"), d = require("./NcPopover.cjs"), m = require("../chunks/l10n-c7bd0ea6.cjs"), f = require("vue-material-design-icons/CalendarBlank.vue"), h = require("vue-material-design-icons/Web.vue"), r = require("@nextcloud/l10n"), _ = require("vue2-datepicker"), y = require("../chunks/_plugin-vue2_normalizer-7f9efb60.cjs"), k = require("../chunks/ScopeComponent-e060526a.cjs"), l = (t) => t && t.__esModule ? t : { default: t }, v = /* @__PURE__ */ l(f), g = /* @__PURE__ */ l(h), w = /* @__PURE__ */ l(_);
3
+ const s = {
4
+ date: "YYYY-MM-DD",
5
+ datetime: "YYYY-MM-DD H:mm:ss",
6
+ year: "YYYY",
7
+ month: "YYYY-MM",
8
+ time: "H:mm:ss",
9
+ week: "w"
10
+ }, z = {
11
+ name: "NcDateTimePicker",
12
+ components: {
13
+ CalendarBlank: v.default,
14
+ DatePicker: w.default,
15
+ NcPopover: d,
16
+ NcTimezonePicker: p,
17
+ Web: g.default
18
+ },
19
+ mixins: [m.l10n],
20
+ inheritAttrs: !1,
21
+ props: {
22
+ clearable: {
23
+ type: Boolean,
24
+ default: !1
25
+ },
26
+ minuteStep: {
27
+ type: Number,
28
+ default: 10
29
+ },
30
+ type: {
31
+ type: String,
32
+ default: "date"
33
+ },
34
+ format: {
35
+ type: String,
36
+ default: null
37
+ },
38
+ formatter: {
39
+ type: Object,
40
+ default: null
41
+ },
42
+ lang: {
43
+ type: Object,
44
+ default: null
45
+ },
46
+ /**
47
+ * The value to initialize, but also two-way bind the selected date. The date is – like the `Date` object in
48
+ * JavaScript – tied to UTC. The selected time zone does not have an influence of the selected time and date
49
+ * value. You have to translate the time yourself when you want to factor in time zones.
50
+ */
51
+ // eslint-disable-next-line
52
+ value: {
53
+ default: () => /* @__PURE__ */ new Date()
54
+ },
55
+ /**
56
+ * The preselected IANA time zone ID for the time zone picker, only relevant in combination with `:show-timezone-select="true"`. Example: `Europe/Berlin`. The prop supports two-way binding through the .sync modifier.
57
+ */
58
+ timezoneId: {
59
+ type: String,
60
+ default: "UTC"
61
+ },
62
+ showTimezoneSelect: {
63
+ type: Boolean,
64
+ default: !1
65
+ },
66
+ highlightTimezone: {
67
+ type: Boolean,
68
+ default: !1
69
+ },
70
+ appendToBody: {
71
+ type: Boolean,
72
+ default: !1
73
+ },
74
+ showWeekNumber: {
75
+ type: Boolean,
76
+ default: !1
77
+ },
78
+ placeholder: {
79
+ type: String,
80
+ default: null
81
+ }
82
+ },
83
+ emits: [
84
+ "update:value",
85
+ "update:timezone-id"
86
+ ],
87
+ data() {
88
+ return {
89
+ showTimezonePopover: !1,
90
+ tzVal: this.timezoneId
91
+ };
92
+ },
93
+ computed: {
94
+ /**
95
+ * Datepicker language
96
+ * https://github.com/mengxiong10/vue2-datepicker/blob/master/locale.md
97
+ *
98
+ * @return {object}
99
+ */
100
+ defaultLang() {
101
+ return {
102
+ formatLocale: {
103
+ months: r.getMonthNames(),
104
+ monthsShort: r.getMonthNamesShort(),
105
+ weekdays: r.getDayNames(),
106
+ weekdaysShort: r.getDayNamesShort(),
107
+ weekdaysMin: r.getDayNamesMin(),
108
+ // 0 = sunday, 1 = monday
109
+ firstDayOfWeek: r.getFirstDay()
110
+ },
111
+ monthFormat: "MMM"
112
+ };
113
+ },
114
+ /**
115
+ * Translated placeholder
116
+ *
117
+ * @return {string}
118
+ */
119
+ defaultPlaceholder() {
120
+ return this.type === "time" ? o.t("Pick a time") : this.type === "month" ? o.t("Pick a month") : this.type === "year" ? o.t("Pick a year") : this.type === "week" ? o.t("Pick a week") : this.type === "date" ? o.t("Pick a date") : o.t("Pick a date and a time");
121
+ },
122
+ /**
123
+ * If format is not provided, try to match the type
124
+ * or fallback to 'date'
125
+ *
126
+ * @return {string}
127
+ */
128
+ formatTypeMap() {
129
+ var t;
130
+ return (t = s[this.type]) != null ? t : s.date;
131
+ }
132
+ },
133
+ methods: {
134
+ handleSelectYear(t) {
135
+ const e = this.$refs.datepicker.currentValue;
136
+ if (e)
137
+ try {
138
+ const a = new Date(new Date(e).setFullYear(t));
139
+ this.$refs.datepicker.selectDate(a);
140
+ } catch {
141
+ console.error("Invalid value", e, t);
142
+ }
143
+ },
144
+ handleSelectMonth(t) {
145
+ const e = this.$refs.datepicker.currentValue;
146
+ if (e)
147
+ try {
148
+ const a = new Date(new Date(e).setMonth(t));
149
+ this.$refs.datepicker.selectDate(a);
150
+ } catch {
151
+ console.error("Invalid value", e, t);
152
+ }
153
+ },
154
+ /**
155
+ * Toggles the visibility of the time zone popover
156
+ */
157
+ toggleTimezonePopover() {
158
+ this.showTimezoneSelect && (this.showTimezonePopover = !this.showTimezonePopover);
159
+ }
160
+ }
161
+ };
162
+ var P = function() {
163
+ var e = this, a = e._self._c;
164
+ return a("DatePicker", e._g(e._b({ ref: "datepicker", attrs: { "append-to-body": e.appendToBody, clearable: e.clearable, format: e.format ? e.format : e.formatTypeMap, formatter: e.formatter, lang: e.lang ? e.lang : e.defaultLang, "minute-step": e.minuteStep, placeholder: e.placeholder ? e.placeholder : e.defaultPlaceholder, "popup-class": { "show-week-number": e.showWeekNumber }, "show-week-number": e.showWeekNumber, type: e.type, value: e.value }, on: { "select-year": e.handleSelectYear, "select-month": e.handleSelectMonth, "update:value": function(n) {
165
+ return e.$emit("update:value", e.value);
166
+ } }, scopedSlots: e._u([{ key: "icon-calendar", fn: function() {
167
+ return [e.showTimezoneSelect ? a("NcPopover", { attrs: { shown: e.showTimezonePopover, "popover-base-class": "timezone-select__popper" }, on: { "update:shown": function(n) {
168
+ e.showTimezonePopover = n;
169
+ } }, scopedSlots: e._u([{ key: "trigger", fn: function() {
170
+ return [a("button", { staticClass: "datetime-picker-inline-icon", class: { "datetime-picker-inline-icon--highlighted": e.highlightTimezone }, on: { mousedown: function(n) {
171
+ return n.stopPropagation(), n.preventDefault(), (() => {
172
+ }).apply(null, arguments);
173
+ } } }, [a("Web", { attrs: { size: 20 } })], 1)];
174
+ }, proxy: !0 }], null, !1, 3375037618) }, [a("div", { staticClass: "timezone-popover-wrapper__label" }, [a("strong", [e._v(" " + e._s(e.t("Please select a time zone:")) + " ")])]), a("NcTimezonePicker", { staticClass: "timezone-popover-wrapper__timezone-select", on: { input: function(n) {
175
+ return e.$emit("update:timezone-id", arguments[0]);
176
+ } }, model: { value: e.tzVal, callback: function(n) {
177
+ e.tzVal = n;
178
+ }, expression: "tzVal" } })], 1) : a("CalendarBlank", { attrs: { size: 20 } })];
179
+ }, proxy: !0 }, e._l(e.$scopedSlots, function(n, i) {
180
+ return { key: i, fn: function(u) {
181
+ return [e._t(i, null, null, u)];
182
+ } };
183
+ })], null, !0) }, "DatePicker", e.$attrs, !1), e.$listeners));
184
+ }, D = [], b = /* @__PURE__ */ y.normalizeComponent(
185
+ z,
186
+ P,
187
+ D,
188
+ !1,
189
+ null,
190
+ "26676d3b",
191
+ null,
192
+ null
193
+ );
194
+ const c = b.exports;
195
+ /**
196
+ * @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
197
+ *
198
+ * @author John Molakvoæ <skjnldsv@protonmail.com>
199
+ *
200
+ * @license AGPL-3.0-or-later
201
+ *
202
+ * This program is free software: you can redistribute it and/or modify
203
+ * it under the terms of the GNU Affero General Public License as
204
+ * published by the Free Software Foundation, either version 3 of the
205
+ * License, or (at your option) any later version.
206
+ *
207
+ * This program is distributed in the hope that it will be useful,
208
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
209
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
210
+ * GNU Affero General Public License for more details.
211
+ *
212
+ * You should have received a copy of the GNU Affero General Public License
213
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
214
+ *
215
+ */
216
+ k.ScopeComponent(c);
217
+ module.exports = c;