nuance-ui 0.1.38 → 0.1.39

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 (274) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/action-icon/action-icon-group.d.vue.ts +2 -2
  3. package/dist/runtime/components/action-icon/action-icon-group.vue.d.ts +2 -2
  4. package/dist/runtime/components/action-icon/action-icon-section.d.vue.ts +2 -2
  5. package/dist/runtime/components/action-icon/action-icon-section.vue.d.ts +2 -2
  6. package/dist/runtime/components/action-icon/action-icon.d.vue.ts +2 -2
  7. package/dist/runtime/components/action-icon/action-icon.vue.d.ts +2 -2
  8. package/dist/runtime/components/alert.d.vue.ts +3 -3
  9. package/dist/runtime/components/alert.vue.d.ts +3 -3
  10. package/dist/runtime/components/app-shell/app-shell-aside.d.vue.ts +2 -2
  11. package/dist/runtime/components/app-shell/app-shell-aside.vue.d.ts +2 -2
  12. package/dist/runtime/components/app-shell/app-shell-footer.d.vue.ts +2 -2
  13. package/dist/runtime/components/app-shell/app-shell-footer.vue.d.ts +2 -2
  14. package/dist/runtime/components/app-shell/app-shell-header.d.vue.ts +2 -2
  15. package/dist/runtime/components/app-shell/app-shell-header.vue.d.ts +2 -2
  16. package/dist/runtime/components/app-shell/app-shell-main.d.vue.ts +2 -2
  17. package/dist/runtime/components/app-shell/app-shell-main.vue.d.ts +2 -2
  18. package/dist/runtime/components/app-shell/app-shell-navbar.d.vue.ts +2 -2
  19. package/dist/runtime/components/app-shell/app-shell-navbar.vue.d.ts +2 -2
  20. package/dist/runtime/components/app-shell/app-shell-section.d.vue.ts +2 -2
  21. package/dist/runtime/components/app-shell/app-shell-section.vue.d.ts +2 -2
  22. package/dist/runtime/components/app-shell/app-shell.d.vue.ts +2 -2
  23. package/dist/runtime/components/app-shell/app-shell.vue.d.ts +2 -2
  24. package/dist/runtime/components/avatar/avatar-group.d.vue.ts +2 -2
  25. package/dist/runtime/components/avatar/avatar-group.vue.d.ts +2 -2
  26. package/dist/runtime/components/avatar/avatar.d.vue.ts +2 -2
  27. package/dist/runtime/components/avatar/avatar.vue.d.ts +2 -2
  28. package/dist/runtime/components/badge.d.vue.ts +4 -4
  29. package/dist/runtime/components/badge.vue +45 -24
  30. package/dist/runtime/components/badge.vue.d.ts +4 -4
  31. package/dist/runtime/components/box.d.vue.ts +2 -2
  32. package/dist/runtime/components/box.vue.d.ts +2 -2
  33. package/dist/runtime/components/breadcrumbs.d.vue.ts +4 -4
  34. package/dist/runtime/components/breadcrumbs.vue.d.ts +4 -4
  35. package/dist/runtime/components/button/button-group.d.vue.ts +2 -2
  36. package/dist/runtime/components/button/button-group.vue.d.ts +2 -2
  37. package/dist/runtime/components/button/button.d.vue.ts +8 -8
  38. package/dist/runtime/components/button/button.module.css +1 -1
  39. package/dist/runtime/components/button/button.vue.d.ts +8 -8
  40. package/dist/runtime/components/button/unstyled-button.d.vue.ts +2 -2
  41. package/dist/runtime/components/button/unstyled-button.vue +2 -2
  42. package/dist/runtime/components/button/unstyled-button.vue.d.ts +2 -2
  43. package/dist/runtime/components/calendar/calendar.d.vue.ts +20 -8
  44. package/dist/runtime/components/calendar/calendar.vue +1 -1
  45. package/dist/runtime/components/calendar/calendar.vue.d.ts +20 -8
  46. package/dist/runtime/components/calendar/lib/context.d.ts +1 -1
  47. package/dist/runtime/components/calendar/lib/use-calendar-selection.js +5 -4
  48. package/dist/runtime/components/calendar/model.d.ts +3 -2
  49. package/dist/runtime/components/calendar/ui/core/calendar-cell.d.vue.ts +2 -2
  50. package/dist/runtime/components/calendar/ui/core/calendar-cell.vue +22 -13
  51. package/dist/runtime/components/calendar/ui/core/calendar-cell.vue.d.ts +2 -2
  52. package/dist/runtime/components/calendar/ui/core/calendar-header.d.vue.ts +2 -2
  53. package/dist/runtime/components/calendar/ui/core/calendar-header.vue +22 -17
  54. package/dist/runtime/components/calendar/ui/core/calendar-header.vue.d.ts +2 -2
  55. package/dist/runtime/components/calendar/ui/core/calendar-root.d.vue.ts +19 -9
  56. package/dist/runtime/components/calendar/ui/core/calendar-root.vue +6 -7
  57. package/dist/runtime/components/calendar/ui/core/calendar-root.vue.d.ts +19 -9
  58. package/dist/runtime/components/calendar/ui/levels/calendar-decade.d.vue.ts +1 -1
  59. package/dist/runtime/components/calendar/ui/levels/calendar-decade.vue.d.ts +1 -1
  60. package/dist/runtime/components/calendar/ui/levels/calendar-month.d.vue.ts +3 -3
  61. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue +9 -16
  62. package/dist/runtime/components/calendar/ui/levels/calendar-month.vue.d.ts +3 -3
  63. package/dist/runtime/components/calendar/ui/levels/calendar-year.d.vue.ts +1 -1
  64. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue +9 -5
  65. package/dist/runtime/components/calendar/ui/levels/calendar-year.vue.d.ts +1 -1
  66. package/dist/runtime/components/card/card-section.d.vue.ts +2 -2
  67. package/dist/runtime/components/card/card-section.vue.d.ts +2 -2
  68. package/dist/runtime/components/card/card.d.vue.ts +2 -2
  69. package/dist/runtime/components/card/card.vue.d.ts +2 -2
  70. package/dist/runtime/components/checkbox/checkbox-card.d.vue.ts +2 -2
  71. package/dist/runtime/components/checkbox/checkbox-card.vue.d.ts +2 -2
  72. package/dist/runtime/components/checkbox/checkbox-group.d.vue.ts +5 -5
  73. package/dist/runtime/components/checkbox/checkbox-group.vue.d.ts +5 -5
  74. package/dist/runtime/components/checkbox/checkbox-indicator.d.vue.ts +2 -2
  75. package/dist/runtime/components/checkbox/checkbox-indicator.vue.d.ts +2 -2
  76. package/dist/runtime/components/checkbox/checkbox.d.vue.ts +2 -2
  77. package/dist/runtime/components/checkbox/checkbox.vue.d.ts +2 -2
  78. package/dist/runtime/components/chip/chip-group.d.vue.ts +10 -6
  79. package/dist/runtime/components/chip/chip-group.vue.d.ts +10 -6
  80. package/dist/runtime/components/chip/chip.d.vue.ts +2 -2
  81. package/dist/runtime/components/chip/chip.vue.d.ts +2 -2
  82. package/dist/runtime/components/combobox/combobox-dropdown.d.vue.ts +2 -2
  83. package/dist/runtime/components/combobox/combobox-dropdown.vue.d.ts +2 -2
  84. package/dist/runtime/components/combobox/combobox-empty.d.vue.ts +2 -2
  85. package/dist/runtime/components/combobox/combobox-empty.vue.d.ts +2 -2
  86. package/dist/runtime/components/combobox/combobox-group.d.vue.ts +10 -6
  87. package/dist/runtime/components/combobox/combobox-group.vue.d.ts +10 -6
  88. package/dist/runtime/components/combobox/combobox-option-list.d.vue.ts +2 -2
  89. package/dist/runtime/components/combobox/combobox-option-list.vue.d.ts +2 -2
  90. package/dist/runtime/components/combobox/combobox-option.d.vue.ts +8 -4
  91. package/dist/runtime/components/combobox/combobox-option.vue.d.ts +8 -4
  92. package/dist/runtime/components/combobox/combobox-options-dropdown.d.vue.ts +10 -7
  93. package/dist/runtime/components/combobox/combobox-options-dropdown.vue +1 -3
  94. package/dist/runtime/components/combobox/combobox-options-dropdown.vue.d.ts +10 -7
  95. package/dist/runtime/components/combobox/combobox-root.d.vue.ts +2 -2
  96. package/dist/runtime/components/combobox/combobox-root.vue +2 -2
  97. package/dist/runtime/components/combobox/combobox-root.vue.d.ts +2 -2
  98. package/dist/runtime/components/combobox/combobox-target.d.vue.ts +2 -2
  99. package/dist/runtime/components/combobox/combobox-target.vue +1 -1
  100. package/dist/runtime/components/combobox/combobox-target.vue.d.ts +2 -2
  101. package/dist/runtime/components/container.d.vue.ts +2 -2
  102. package/dist/runtime/components/container.vue.d.ts +2 -2
  103. package/dist/runtime/components/date-time-picker.d.vue.ts +47 -0
  104. package/dist/runtime/components/date-time-picker.vue +151 -0
  105. package/dist/runtime/components/date-time-picker.vue.d.ts +47 -0
  106. package/dist/runtime/components/dialog/index.d.ts +4 -4
  107. package/dist/runtime/components/dialog/{dialog-close-button.d.vue.ts → ui/dialog-close-button.d.vue.ts} +3 -3
  108. package/dist/runtime/components/dialog/{dialog-close-button.vue → ui/dialog-close-button.vue} +2 -2
  109. package/dist/runtime/components/dialog/{dialog-close-button.vue.d.ts → ui/dialog-close-button.vue.d.ts} +3 -3
  110. package/dist/runtime/components/dialog/{dialog-header.d.vue.ts → ui/dialog-header.d.vue.ts} +3 -3
  111. package/dist/runtime/components/dialog/{dialog-header.vue → ui/dialog-header.vue} +1 -1
  112. package/dist/runtime/components/dialog/{dialog-header.vue.d.ts → ui/dialog-header.vue.d.ts} +3 -3
  113. package/dist/runtime/components/dialog/{dialog-root.d.vue.ts → ui/dialog-root.d.vue.ts} +5 -5
  114. package/dist/runtime/components/dialog/{dialog-root.vue → ui/dialog-root.vue} +5 -5
  115. package/dist/runtime/components/dialog/{dialog-root.vue.d.ts → ui/dialog-root.vue.d.ts} +5 -5
  116. package/dist/runtime/components/dialog/{dialog-title.d.vue.ts → ui/dialog-title.d.vue.ts} +3 -3
  117. package/dist/runtime/components/dialog/{dialog-title.vue → ui/dialog-title.vue} +2 -2
  118. package/dist/runtime/components/dialog/{dialog-title.vue.d.ts → ui/dialog-title.vue.d.ts} +3 -3
  119. package/dist/runtime/components/dialog/ui/dialog.module.css +1 -0
  120. package/dist/runtime/components/drawer/drawer-close-button.d.vue.ts +2 -2
  121. package/dist/runtime/components/drawer/drawer-close-button.vue +1 -1
  122. package/dist/runtime/components/drawer/drawer-close-button.vue.d.ts +2 -2
  123. package/dist/runtime/components/drawer/drawer-header.d.vue.ts +2 -2
  124. package/dist/runtime/components/drawer/drawer-header.vue +1 -1
  125. package/dist/runtime/components/drawer/drawer-header.vue.d.ts +2 -2
  126. package/dist/runtime/components/drawer/drawer-root.d.vue.ts +2 -2
  127. package/dist/runtime/components/drawer/drawer-root.vue +3 -3
  128. package/dist/runtime/components/drawer/drawer-root.vue.d.ts +2 -2
  129. package/dist/runtime/components/drawer/drawer-title.d.vue.ts +2 -2
  130. package/dist/runtime/components/drawer/drawer-title.vue +2 -2
  131. package/dist/runtime/components/drawer/drawer-title.vue.d.ts +2 -2
  132. package/dist/runtime/components/drawer/drawer.module.css +1 -1
  133. package/dist/runtime/components/file-upload.d.vue.ts +9 -5
  134. package/dist/runtime/components/file-upload.vue.d.ts +9 -5
  135. package/dist/runtime/components/index.d.ts +1 -0
  136. package/dist/runtime/components/input/date-picker.d.vue.ts +44 -0
  137. package/dist/runtime/components/input/date-picker.vue +174 -0
  138. package/dist/runtime/components/input/date-picker.vue.d.ts +44 -0
  139. package/dist/runtime/components/input/email-input.d.vue.ts +6 -6
  140. package/dist/runtime/components/input/email-input.vue +9 -5
  141. package/dist/runtime/components/input/email-input.vue.d.ts +6 -6
  142. package/dist/runtime/components/input/index.d.ts +2 -1
  143. package/dist/runtime/components/input/lib/input-wrapper.context.d.ts +2 -2
  144. package/dist/runtime/components/input/lib/input-wrapper.context.js +1 -2
  145. package/dist/runtime/components/input/number-input.d.vue.ts +5 -5
  146. package/dist/runtime/components/input/number-input.vue +19 -18
  147. package/dist/runtime/components/input/number-input.vue.d.ts +5 -5
  148. package/dist/runtime/components/input/password-input.d.vue.ts +6 -6
  149. package/dist/runtime/components/input/password-input.vue +8 -1
  150. package/dist/runtime/components/input/password-input.vue.d.ts +6 -6
  151. package/dist/runtime/components/input/text-input.d.vue.ts +21 -11
  152. package/dist/runtime/components/input/text-input.vue +34 -15
  153. package/dist/runtime/components/input/text-input.vue.d.ts +21 -11
  154. package/dist/runtime/components/input/types/index.d.ts +2 -0
  155. package/dist/runtime/components/input/ui/button-input.d.vue.ts +42 -0
  156. package/dist/runtime/components/input/ui/button-input.vue +103 -0
  157. package/dist/runtime/components/input/ui/button-input.vue.d.ts +42 -0
  158. package/dist/runtime/components/input/ui/input-base.d.vue.ts +11 -63
  159. package/dist/runtime/components/input/ui/input-base.vue +55 -78
  160. package/dist/runtime/components/input/ui/input-base.vue.d.ts +11 -63
  161. package/dist/runtime/components/input/ui/input-inline.d.vue.ts +5 -5
  162. package/dist/runtime/components/input/ui/input-inline.vue +2 -6
  163. package/dist/runtime/components/input/ui/input-inline.vue.d.ts +5 -5
  164. package/dist/runtime/components/input/ui/input-label.vue +2 -5
  165. package/dist/runtime/components/input/ui/input-wrapper.d.vue.ts +5 -5
  166. package/dist/runtime/components/input/ui/input-wrapper.vue +11 -5
  167. package/dist/runtime/components/input/ui/input-wrapper.vue.d.ts +5 -5
  168. package/dist/runtime/components/input/ui/spin-input.d.vue.ts +25 -0
  169. package/dist/runtime/components/input/ui/spin-input.vue +155 -0
  170. package/dist/runtime/components/input/ui/spin-input.vue.d.ts +25 -0
  171. package/dist/runtime/components/link/link-button.d.vue.ts +4 -4
  172. package/dist/runtime/components/link/link-button.vue.d.ts +4 -4
  173. package/dist/runtime/components/link/link.d.vue.ts +2 -2
  174. package/dist/runtime/components/link/link.vue +1 -1
  175. package/dist/runtime/components/link/link.vue.d.ts +2 -2
  176. package/dist/runtime/components/modal/modal-close-button.d.vue.ts +2 -2
  177. package/dist/runtime/components/modal/modal-close-button.vue +1 -1
  178. package/dist/runtime/components/modal/modal-close-button.vue.d.ts +2 -2
  179. package/dist/runtime/components/modal/modal-header.d.vue.ts +2 -2
  180. package/dist/runtime/components/modal/modal-header.vue +1 -1
  181. package/dist/runtime/components/modal/modal-header.vue.d.ts +2 -2
  182. package/dist/runtime/components/modal/modal-root.d.vue.ts +2 -2
  183. package/dist/runtime/components/modal/modal-root.vue +3 -3
  184. package/dist/runtime/components/modal/modal-root.vue.d.ts +2 -2
  185. package/dist/runtime/components/modal/modal-title.d.vue.ts +2 -2
  186. package/dist/runtime/components/modal/modal-title.vue +2 -2
  187. package/dist/runtime/components/modal/modal-title.vue.d.ts +2 -2
  188. package/dist/runtime/components/nav-link/nav-icon-link.d.vue.ts +2 -2
  189. package/dist/runtime/components/nav-link/nav-icon-link.vue.d.ts +2 -2
  190. package/dist/runtime/components/nav-link/nav-link.d.vue.ts +5 -5
  191. package/dist/runtime/components/nav-link/nav-link.vue.d.ts +5 -5
  192. package/dist/runtime/components/paper.d.vue.ts +2 -2
  193. package/dist/runtime/components/paper.vue.d.ts +2 -2
  194. package/dist/runtime/components/popover/lib/use-popover.d.ts +1 -0
  195. package/dist/runtime/components/popover/lib/use-popover.js +2 -1
  196. package/dist/runtime/components/popover/popover-dropdown.vue +2 -0
  197. package/dist/runtime/components/popover/popover-target.d.vue.ts +7 -3
  198. package/dist/runtime/components/popover/popover-target.vue +10 -2
  199. package/dist/runtime/components/popover/popover-target.vue.d.ts +7 -3
  200. package/dist/runtime/components/popover/popover.vue +1 -1
  201. package/dist/runtime/components/progress/progress-label.d.vue.ts +2 -2
  202. package/dist/runtime/components/progress/progress-label.vue.d.ts +2 -2
  203. package/dist/runtime/components/progress/progress-root.d.vue.ts +2 -2
  204. package/dist/runtime/components/progress/progress-root.vue.d.ts +2 -2
  205. package/dist/runtime/components/progress/progress-section.d.vue.ts +2 -2
  206. package/dist/runtime/components/progress/progress-section.vue.d.ts +2 -2
  207. package/dist/runtime/components/renderless/renderless.d.vue.ts +2 -2
  208. package/dist/runtime/components/renderless/renderless.vue.d.ts +2 -2
  209. package/dist/runtime/components/roving-focus/roving-focus-item.d.vue.ts +2 -2
  210. package/dist/runtime/components/roving-focus/roving-focus-item.vue.d.ts +2 -2
  211. package/dist/runtime/components/roving-focus/roving-focus.d.vue.ts +2 -2
  212. package/dist/runtime/components/roving-focus/roving-focus.vue.d.ts +2 -2
  213. package/dist/runtime/components/select/select.d.vue.ts +12 -8
  214. package/dist/runtime/components/select/select.vue +9 -11
  215. package/dist/runtime/components/select/select.vue.d.ts +12 -8
  216. package/dist/runtime/components/table/table.d.vue.ts +10 -6
  217. package/dist/runtime/components/table/table.vue +1 -1
  218. package/dist/runtime/components/table/table.vue.d.ts +10 -6
  219. package/dist/runtime/components/tabs/tabs-list.d.vue.ts +2 -2
  220. package/dist/runtime/components/tabs/tabs-list.vue +1 -1
  221. package/dist/runtime/components/tabs/tabs-list.vue.d.ts +2 -2
  222. package/dist/runtime/components/tabs/tabs-panel.d.vue.ts +2 -2
  223. package/dist/runtime/components/tabs/tabs-panel.vue.d.ts +2 -2
  224. package/dist/runtime/components/tabs/tabs-root.d.vue.ts +2 -2
  225. package/dist/runtime/components/tabs/tabs-root.vue.d.ts +2 -2
  226. package/dist/runtime/components/tabs/tabs-tab.d.vue.ts +4 -4
  227. package/dist/runtime/components/tabs/tabs-tab.vue.d.ts +4 -4
  228. package/dist/runtime/components/text.d.vue.ts +2 -2
  229. package/dist/runtime/components/text.vue +1 -1
  230. package/dist/runtime/components/text.vue.d.ts +2 -2
  231. package/dist/runtime/components/textarea.d.vue.ts +11 -9
  232. package/dist/runtime/components/textarea.vue +42 -30
  233. package/dist/runtime/components/textarea.vue.d.ts +11 -9
  234. package/dist/runtime/components/time-picker/index.d.ts +6 -0
  235. package/dist/runtime/components/time-picker/index.js +5 -0
  236. package/dist/runtime/components/time-picker/lib/clamp-time.d.ts +13 -0
  237. package/dist/runtime/components/time-picker/lib/clamp-time.js +23 -0
  238. package/dist/runtime/components/time-picker/lib/get-parsed-time.d.ts +16 -0
  239. package/dist/runtime/components/time-picker/lib/get-parsed-time.js +26 -0
  240. package/dist/runtime/components/time-picker/lib/get-time-string.d.ts +13 -0
  241. package/dist/runtime/components/time-picker/lib/get-time-string.js +41 -0
  242. package/dist/runtime/components/time-picker/lib/pad-time.d.ts +1 -0
  243. package/dist/runtime/components/time-picker/lib/pad-time.js +3 -0
  244. package/dist/runtime/components/time-picker/lib/split-time-string.d.ts +5 -0
  245. package/dist/runtime/components/time-picker/lib/split-time-string.js +4 -0
  246. package/dist/runtime/components/time-picker/lib/use-time-picker.d.ts +29 -0
  247. package/dist/runtime/components/time-picker/lib/use-time-picker.js +103 -0
  248. package/dist/runtime/components/time-picker/model.d.ts +17 -0
  249. package/dist/runtime/components/time-picker/model.js +0 -0
  250. package/dist/runtime/components/time-picker/time-picker.d.vue.ts +88 -0
  251. package/dist/runtime/components/time-picker/time-picker.vue +313 -0
  252. package/dist/runtime/components/time-picker/time-picker.vue.d.ts +88 -0
  253. package/dist/runtime/components/title.d.vue.ts +2 -2
  254. package/dist/runtime/components/title.vue +1 -1
  255. package/dist/runtime/components/title.vue.d.ts +2 -2
  256. package/dist/runtime/components/tree/_ui/tree-root.d.vue.ts +2 -2
  257. package/dist/runtime/components/tree/_ui/tree-root.vue.d.ts +2 -2
  258. package/dist/runtime/components/visually-hidden/visually-hidden-input.d.vue.ts +10 -6
  259. package/dist/runtime/components/visually-hidden/visually-hidden-input.vue.d.ts +10 -6
  260. package/dist/runtime/components/visually-hidden/visually-hidden.d.vue.ts +2 -2
  261. package/dist/runtime/components/visually-hidden/visually-hidden.vue.d.ts +2 -2
  262. package/dist/runtime/composals/use-date-config.d.ts +11 -1
  263. package/dist/runtime/composals/use-date-config.js +8 -5
  264. package/dist/runtime/helpers/date/create-months.d.ts +1 -7
  265. package/dist/runtime/helpers/date/create-months.js +1 -1
  266. package/dist/runtime/helpers/date/get-days-between.js +4 -1
  267. package/dist/runtime/types/index.d.ts +1 -1
  268. package/package.json +18 -18
  269. package/dist/runtime/components/dialog/dialog.module.css +0 -1
  270. package/dist/runtime/components/input/input.d.vue.ts +0 -38
  271. package/dist/runtime/components/input/input.vue +0 -47
  272. package/dist/runtime/components/input/input.vue.d.ts +0 -38
  273. /package/dist/runtime/components/dialog/{types/index.d.ts → model.d.ts} +0 -0
  274. /package/dist/runtime/components/dialog/{types/index.js → model.js} +0 -0
@@ -1,9 +1,9 @@
1
1
  <script setup>
2
- import { useTextareaAutosize } from "@vueuse/core";
3
- import { useId, useTemplateRef } from "vue";
2
+ import { unrefElement, useTextareaAutosize } from "@vueuse/core";
3
+ import { useTemplateRef } from "vue";
4
4
  import InputBase from "./input/ui/input-base.vue";
5
5
  import InputWrapper from "./input/ui/input-wrapper.vue";
6
- const { id: uid, ...props } = defineProps({
6
+ const props = defineProps({
7
7
  error: { type: String, required: false },
8
8
  description: { type: String, required: false },
9
9
  label: { type: String, required: false },
@@ -13,49 +13,61 @@ const { id: uid, ...props } = defineProps({
13
13
  size: { type: String, required: false },
14
14
  variant: { type: String, required: false },
15
15
  multiline: { type: Boolean, required: false },
16
- resize: { type: null, required: false },
16
+ resize: { type: void 0, required: false },
17
17
  leftSectionPE: { type: null, required: false },
18
- rightSectionPE: { type: null, required: false }
18
+ rightSectionPE: { type: null, required: false },
19
+ readonly: { type: Boolean, required: false },
20
+ disabled: { type: Boolean, required: false }
19
21
  });
20
- const modelValue = defineModel({ type: String });
21
- const inputRef = useTemplateRef("inputRef");
22
+ const model = defineModel({ type: String });
23
+ const ref = useTemplateRef("input");
22
24
  const { input } = useTextareaAutosize({
23
- input: modelValue.value,
25
+ input: model.value,
24
26
  styleProp: "minHeight",
25
- element: inputRef.value?.ref
27
+ element: unrefElement(ref.value)
28
+ });
29
+ defineExpose({
30
+ $el: unrefElement(ref.value)
26
31
  });
27
- const id = uid ?? useId();
28
32
  </script>
29
33
 
30
34
  <template>
31
- <InputWrapper :id v-bind='props' :multiline :class='$attrs?.class'>
32
- <template #label>
35
+ <InputWrapper v-bind='props' :multiline :class='$attrs?.class'>
36
+ <InputBase>
37
+ <template v-if='!!$slots.leftSection' #leftSection>
38
+ <slot name='leftSection' />
39
+ </template>
40
+
41
+ <template #default='{ id, css }'>
42
+ <textarea
43
+ v-bind='{ ...$attrs, class: void 0 }'
44
+ :id
45
+ ref='input'
46
+ v-model='model'
47
+ :class='[css, $style.textarea]'
48
+ :required='props.required'
49
+ :disabled='props.required'
50
+ :readonly='props.readonly'
51
+ />
52
+ </template>
53
+
54
+ <template v-if='!!$slots.rightSection' #rightSection>
55
+ <slot name='rightSection' />
56
+ </template>
57
+ </InputBase>
58
+
59
+ <template v-if='!!$slots.label' #label>
33
60
  <slot name='label' />
34
61
  </template>
35
- <template #error>
62
+ <template v-if='!!$slots.error' #error>
36
63
  <slot name='error' />
37
64
  </template>
38
- <template #description>
65
+ <template v-if='!!$slots.description' #description>
39
66
  <slot name='description' />
40
67
  </template>
41
-
42
- <InputBase
43
- is='textarea'
44
- v-bind='{ ...$attrs, id, class: $style.input }'
45
- ref='inputRef'
46
- v-model='input'
47
- :required='props?.required'
48
- >
49
- <template #leftSection>
50
- <slot name='leftSection' />
51
- </template>
52
- <template #rightSection>
53
- <slot name='rightSection' />
54
- </template>
55
- </InputBase>
56
68
  </InputWrapper>
57
69
  </template>
58
70
 
59
71
  <style module>
60
- .input{scrollbar-width:none;-ms-overflow-style:none}.input::-webkit-scrollbar{display:none}
72
+ .textarea{height:auto;scrollbar-width:none;-ms-overflow-style:none}.textarea::-webkit-scrollbar{display:none}
61
73
  </style>
@@ -1,24 +1,26 @@
1
- import type { InputWrapperProps } from './input/index.js';
2
- export interface TextareaProps extends InputWrapperProps {
1
+ import type { InputBaseProps, InputWrapperProps } from './input/index.js';
2
+ export interface TextareaProps extends InputWrapperProps, InputBaseProps {
3
3
  }
4
4
  type __VLS_Props = TextareaProps;
5
5
  type __VLS_ModelProps = {
6
6
  modelValue?: string;
7
7
  };
8
8
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
- declare var __VLS_7: {}, __VLS_10: {}, __VLS_13: {}, __VLS_22: {}, __VLS_25: {};
9
+ declare var __VLS_15: {}, __VLS_19: {}, __VLS_22: {}, __VLS_25: {}, __VLS_28: {};
10
10
  type __VLS_Slots = {} & {
11
- label?: (props: typeof __VLS_7) => any;
11
+ leftSection?: (props: typeof __VLS_15) => any;
12
12
  } & {
13
- error?: (props: typeof __VLS_10) => any;
13
+ rightSection?: (props: typeof __VLS_19) => any;
14
14
  } & {
15
- description?: (props: typeof __VLS_13) => any;
15
+ label?: (props: typeof __VLS_22) => any;
16
16
  } & {
17
- leftSection?: (props: typeof __VLS_22) => any;
17
+ error?: (props: typeof __VLS_25) => any;
18
18
  } & {
19
- rightSection?: (props: typeof __VLS_25) => any;
19
+ description?: (props: typeof __VLS_28) => any;
20
20
  };
21
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
22
+ $el: HTMLTextAreaElement | null | undefined;
23
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
24
  "update:modelValue": (value: string | undefined) => any;
23
25
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
24
26
  "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
@@ -0,0 +1,6 @@
1
+ export * from './lib/clamp-time.js';
2
+ export * from './lib/get-time-string.js';
3
+ export * from './lib/pad-time.js';
4
+ export * from './lib/split-time-string.js';
5
+ export * from './model.js';
6
+ export type * from './time-picker.vue';
@@ -0,0 +1,5 @@
1
+ export * from "./lib/clamp-time.js";
2
+ export * from "./lib/get-time-string.js";
3
+ export * from "./lib/pad-time.js";
4
+ export * from "./lib/split-time-string.js";
5
+ export * from "./model.js";
@@ -0,0 +1,13 @@
1
+ export declare function timeToSeconds(timeStr: string): number;
2
+ export declare function secondsToTime(seconds: number): {
3
+ timeString: string;
4
+ hours: number;
5
+ minutes: number;
6
+ seconds: number;
7
+ };
8
+ export declare function clampTime(time: string, min: string | undefined, max: string | undefined): {
9
+ timeString: string;
10
+ hours: number;
11
+ minutes: number;
12
+ seconds: number;
13
+ };
@@ -0,0 +1,23 @@
1
+ import { padTime } from "./pad-time.js";
2
+ export function timeToSeconds(timeStr) {
3
+ const [hours = 0, minutes = 0, seconds = 0] = timeStr.split(":").map(Number);
4
+ return hours * 3600 + minutes * 60 + seconds;
5
+ }
6
+ export function secondsToTime(seconds) {
7
+ const hours = Math.floor(seconds / 3600);
8
+ const minutes = Math.floor(seconds % 3600 / 60);
9
+ const secs = seconds % 60;
10
+ return {
11
+ timeString: `${padTime(hours)}:${padTime(minutes)}:${padTime(secs)}`,
12
+ hours,
13
+ minutes,
14
+ seconds: secs
15
+ };
16
+ }
17
+ export function clampTime(time, min, max) {
18
+ const timeInSeconds = timeToSeconds(time);
19
+ const minInSeconds = min ? timeToSeconds(min) : -Infinity;
20
+ const maxInSeconds = max ? timeToSeconds(max) : Infinity;
21
+ const clampedSeconds = Math.max(minInSeconds, Math.min(timeInSeconds, maxInSeconds));
22
+ return secondsToTime(clampedSeconds);
23
+ }
@@ -0,0 +1,16 @@
1
+ import type { TimePickerAmPmLabels, TimePickerFormat } from '../model.js';
2
+ export declare function getParsedTime({ time, format, amPmLabels }: {
3
+ time: string;
4
+ format: TimePickerFormat;
5
+ amPmLabels: TimePickerAmPmLabels;
6
+ }): {
7
+ hours: number;
8
+ minutes: number | null;
9
+ seconds: number | null;
10
+ amPm: string;
11
+ } | {
12
+ amPm: null;
13
+ hours: number | null;
14
+ minutes: number | null;
15
+ seconds: number | null;
16
+ };
@@ -0,0 +1,26 @@
1
+ import { splitTimeString } from "./split-time-string.js";
2
+ function convertTimeTo12HourFormat({
3
+ hours,
4
+ minutes,
5
+ seconds,
6
+ amPmLabels
7
+ }) {
8
+ if (hours === null)
9
+ return { hours: null, minutes: null, seconds: null, amPm: null };
10
+ const amPm = hours >= 12 ? amPmLabels.pm : amPmLabels.am;
11
+ const hour12 = hours % 12 === 0 ? 12 : hours % 12;
12
+ return {
13
+ hours: hour12,
14
+ minutes: typeof minutes === "number" ? minutes : null,
15
+ seconds: typeof seconds === "number" ? seconds : null,
16
+ amPm
17
+ };
18
+ }
19
+ export function getParsedTime({ time, format, amPmLabels }) {
20
+ if (time === "")
21
+ return { hours: null, minutes: null, seconds: null, amPm: null };
22
+ const parsed = splitTimeString(time);
23
+ if (format === "12h")
24
+ return convertTimeTo12HourFormat({ ...parsed, amPmLabels });
25
+ return { ...parsed, amPm: null };
26
+ }
@@ -0,0 +1,13 @@
1
+ import type { TimePickerAmPmLabels, TimePickerFormat } from '../model.js';
2
+ export declare function getTimeString({ hours, minutes, seconds, format, withSeconds, amPm, amPmLabels, }: {
3
+ hours: number | null;
4
+ minutes: number | null;
5
+ seconds: number | null;
6
+ format: TimePickerFormat;
7
+ withSeconds: boolean;
8
+ amPm: string | null;
9
+ amPmLabels: TimePickerAmPmLabels;
10
+ }): {
11
+ valid: boolean;
12
+ value: string;
13
+ };
@@ -0,0 +1,41 @@
1
+ import { padTime } from "./pad-time.js";
2
+ function convertTo24HourFormat({
3
+ hours,
4
+ minutes,
5
+ seconds,
6
+ amPm,
7
+ amPmLabels,
8
+ withSeconds
9
+ }) {
10
+ let _hours = hours;
11
+ if (amPm === amPmLabels.pm && hours !== 12) {
12
+ _hours += 12;
13
+ } else if (amPm === amPmLabels.am && hours === 12) {
14
+ _hours = 0;
15
+ }
16
+ return `${padTime(_hours)}:${padTime(minutes)}${withSeconds ? `:${padTime(seconds || 0)}` : ""}`;
17
+ }
18
+ export function getTimeString({
19
+ hours,
20
+ minutes,
21
+ seconds,
22
+ format,
23
+ withSeconds,
24
+ amPm,
25
+ amPmLabels
26
+ }) {
27
+ if (hours === null || minutes === null)
28
+ return { valid: false, value: "" };
29
+ if (withSeconds && seconds === null)
30
+ return { valid: false, value: "" };
31
+ if (format === "24h") {
32
+ const value = `${padTime(hours)}:${padTime(minutes)}${withSeconds ? `:${padTime(seconds)}` : ""}`;
33
+ return { valid: true, value };
34
+ }
35
+ if (amPm === null)
36
+ return { valid: false, value: "" };
37
+ return {
38
+ valid: true,
39
+ value: convertTo24HourFormat({ hours, minutes, seconds, amPm, amPmLabels, withSeconds })
40
+ };
41
+ }
@@ -0,0 +1 @@
1
+ export declare function padTime(value: number): string;
@@ -0,0 +1,3 @@
1
+ export function padTime(value) {
2
+ return value < 10 ? `0${value}` : `${value}`;
3
+ }
@@ -0,0 +1,5 @@
1
+ export declare function splitTimeString(timeString: string): {
2
+ hours: number | null;
3
+ minutes: number | null;
4
+ seconds: number | null;
5
+ };
@@ -0,0 +1,4 @@
1
+ export function splitTimeString(timeString) {
2
+ const [hours = null, minutes = null, seconds = null] = timeString.split(":").map(Number);
3
+ return { hours, minutes, seconds };
4
+ }
@@ -0,0 +1,29 @@
1
+ import type { ModelRef } from 'vue';
2
+ import type { TimePickerAmPmLabels, TimePickerFormat, TimePickerPasteSplit } from '../model.js';
3
+ type TimeField = 'hours' | 'minutes' | 'seconds' | 'amPm';
4
+ export declare function useTimePicker({ model, format, amPmLabels, withSeconds, min, max, pasteSplit, }: {
5
+ model: ModelRef<string | undefined>;
6
+ format: TimePickerFormat;
7
+ amPmLabels: TimePickerAmPmLabels;
8
+ withSeconds?: boolean;
9
+ min?: string;
10
+ max?: string;
11
+ pasteSplit?: TimePickerPasteSplit;
12
+ }): {
13
+ values: {
14
+ hours: import("vue").WritableComputedRef<number | null, number | null>;
15
+ minutes: import("vue").WritableComputedRef<number | null, number | null>;
16
+ seconds: import("vue").WritableComputedRef<number | null, number | null>;
17
+ amPm: import("vue").WritableComputedRef<string | null, string | null>;
18
+ };
19
+ refs: {
20
+ hoursRef: import("vue").ShallowRef<HTMLInputElement | null, HTMLInputElement | null>;
21
+ minutesRef: import("vue").ShallowRef<HTMLInputElement | null, HTMLInputElement | null>;
22
+ secondsRef: import("vue").ShallowRef<HTMLInputElement | null, HTMLInputElement | null>;
23
+ amPmRef: import("vue").ShallowRef<HTMLSelectElement | null, HTMLSelectElement | null>;
24
+ };
25
+ focus: (field: TimeField) => void | undefined;
26
+ clear: () => void;
27
+ onPaste: (event: ClipboardEvent) => void;
28
+ };
29
+ export {};
@@ -0,0 +1,103 @@
1
+ import { unrefElement } from "@vueuse/core";
2
+ import { computed, ref, shallowRef, watch } from "vue";
3
+ import { clampTime } from "./clamp-time.js";
4
+ import { getParsedTime } from "./get-parsed-time.js";
5
+ import { getTimeString } from "./get-time-string.js";
6
+ export function useTimePicker({
7
+ model,
8
+ format,
9
+ amPmLabels,
10
+ withSeconds = false,
11
+ min = "00:00:00",
12
+ max = "23:59:59",
13
+ pasteSplit
14
+ }) {
15
+ const intermediate = ref({
16
+ hours: null,
17
+ minutes: null,
18
+ seconds: null,
19
+ amPm: null
20
+ });
21
+ const parsed = computed(() => getParsedTime({ time: model.value ?? "", format, amPmLabels }));
22
+ watch(parsed, (v) => intermediate.value = v, { immediate: true });
23
+ const updateModel = (field, value) => {
24
+ intermediate.value = { ...intermediate.value, [field]: value };
25
+ const timeString = getTimeString({
26
+ ...intermediate.value,
27
+ format,
28
+ withSeconds,
29
+ amPmLabels
30
+ });
31
+ model.value = timeString.valid ? timeString.value : "";
32
+ };
33
+ const hours = computed({
34
+ get: () => parsed.value.hours,
35
+ set: (value) => {
36
+ let adjustedValue = value;
37
+ if (format === "12h" && typeof value === "number" && value > 12)
38
+ adjustedValue = (value - 1) % 12 + 1;
39
+ updateModel("hours", adjustedValue);
40
+ }
41
+ });
42
+ const minutes = computed({
43
+ get: () => parsed.value.minutes,
44
+ set: (value) => updateModel("minutes", value)
45
+ });
46
+ const seconds = computed({
47
+ get: () => parsed.value.seconds,
48
+ set: (value) => updateModel("seconds", value)
49
+ });
50
+ const amPm = computed({
51
+ get: () => parsed.value.amPm,
52
+ set: (value) => updateModel("amPm", value)
53
+ });
54
+ const hoursRef = shallowRef(null);
55
+ const minutesRef = shallowRef(null);
56
+ const secondsRef = shallowRef(null);
57
+ const amPmRef = shallowRef(null);
58
+ const refs = {
59
+ hours: hoursRef,
60
+ minutes: minutesRef,
61
+ seconds: secondsRef,
62
+ amPm: amPmRef
63
+ };
64
+ const focus = (field) => unrefElement(refs[field].value)?.focus();
65
+ const clear = () => {
66
+ model.value = "";
67
+ focus("hours");
68
+ };
69
+ const onPaste = (event) => {
70
+ event.preventDefault();
71
+ const pastedValue = event.clipboardData?.getData("text") ?? "";
72
+ const parsed2 = (pasteSplit ?? getParsedTime)({
73
+ time: pastedValue,
74
+ format,
75
+ amPmLabels
76
+ });
77
+ const timeString = getTimeString({
78
+ ...parsed2,
79
+ format,
80
+ withSeconds,
81
+ amPmLabels
82
+ });
83
+ if (timeString.valid)
84
+ model.value = clampTime(timeString.value, min, max).timeString;
85
+ };
86
+ return {
87
+ values: {
88
+ hours,
89
+ minutes,
90
+ seconds,
91
+ amPm
92
+ },
93
+ refs: {
94
+ hoursRef,
95
+ minutesRef,
96
+ secondsRef,
97
+ amPmRef
98
+ },
99
+ focus,
100
+ clear,
101
+ onPaste
102
+ };
103
+ }
@@ -0,0 +1,17 @@
1
+ export type TimePickerFormat = '12h' | '24h';
2
+ export interface TimePickerAmPmLabels {
3
+ am: string;
4
+ pm: string;
5
+ }
6
+ export interface TimePickerPasteSplitInput {
7
+ time: string;
8
+ format: TimePickerFormat;
9
+ amPmLabels: TimePickerAmPmLabels;
10
+ }
11
+ export interface TimePickerPasteSplitReturnType {
12
+ hours: number | null;
13
+ minutes: number | null;
14
+ seconds: number | null;
15
+ amPm: string | null;
16
+ }
17
+ export type TimePickerPasteSplit = (input: TimePickerPasteSplitInput) => TimePickerPasteSplitReturnType;
File without changes
@@ -0,0 +1,88 @@
1
+ import type { Classes } from '@nui/types';
2
+ import type { InputBaseProps } from '../input/index.js';
3
+ import type { InputWrapperProps } from '../input/ui/input-wrapper.vue.js';
4
+ import type { TimePickerAmPmLabels, TimePickerFormat, TimePickerPasteSplit } from './model.js';
5
+ /**
6
+ * - presets
7
+ * - dropdown select
8
+ * - am/pm select
9
+ * - blur
10
+ * - paste
11
+ */
12
+ interface FieldStep {
13
+ /** Number by which hours are incremented/decremented @default `1` */
14
+ hours?: number;
15
+ /** Number by which minutes are incremented/decremented @default `1` */
16
+ minutes?: number;
17
+ /** Number by which seconds are incremented/decremented @default `1` */
18
+ seconds?: number;
19
+ }
20
+ interface FieldPlaceholder {
21
+ /** Hours input placeholder, @default `--` */
22
+ hours?: string;
23
+ /** Minutes input placeholder, @default `--` */
24
+ minutes?: string;
25
+ /** Seconds input placeholder, @default `--` */
26
+ seconds?: string;
27
+ }
28
+ export interface TimePickerProps extends InputWrapperProps, InputBaseProps {
29
+ /** Determines whether the clear button should be displayed @default `false` */
30
+ clearable?: boolean;
31
+ /** `name` prop passed down to the hidden input */
32
+ name?: string;
33
+ /** Min possible time value in `hh:mm:ss` format @default `00:00:00` */
34
+ min?: string;
35
+ /** Max possible time value in `hh:mm:ss` format @default `23:59:59` */
36
+ max?: string;
37
+ /** Time format, @default `24h` */
38
+ format?: TimePickerFormat;
39
+ /** Number by which fields are incremented/decremented @default `1` */
40
+ step?: number | FieldStep;
41
+ /** Fields placeholder @default `--` */
42
+ placeholder?: string | FieldPlaceholder;
43
+ /** Determines whether the seconds input should be displayed @default `false` */
44
+ withSeconds?: boolean;
45
+ /** `aria-label` of hours input */
46
+ hoursInputLabel?: string;
47
+ /** `aria-label` of minutes input */
48
+ minutesInputLabel?: string;
49
+ /** `aria-label` of seconds input */
50
+ secondsInputLabel?: string;
51
+ /** `aria-label` of am/pm input @todo @deprecated */
52
+ amPmInputLabel?: string;
53
+ /** Labels used for am/pm values @default `{ am: 'AM', pm: 'PM' }` @todo @deprecated */
54
+ amPmLabels?: TimePickerAmPmLabels;
55
+ /** A function to transform pasted values, by default time in 24h format can be parsed on paste for example `23:34:22` */
56
+ pasteSplit?: TimePickerPasteSplit;
57
+ classes?: Classes<'root' | 'input' | 'section' | 'field'>;
58
+ }
59
+ type __VLS_Props = TimePickerProps;
60
+ type __VLS_ModelProps = {
61
+ modelValue?: string;
62
+ };
63
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
64
+ declare var __VLS_46: {}, __VLS_54: {}, __VLS_64: {}, __VLS_67: {}, __VLS_70: {};
65
+ type __VLS_Slots = {} & {
66
+ leftSection?: (props: typeof __VLS_46) => any;
67
+ } & {
68
+ rightSection?: (props: typeof __VLS_54) => any;
69
+ } & {
70
+ label?: (props: typeof __VLS_64) => any;
71
+ } & {
72
+ error?: (props: typeof __VLS_67) => any;
73
+ } & {
74
+ description?: (props: typeof __VLS_70) => any;
75
+ };
76
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
77
+ "update:modelValue": (value: string) => any;
78
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
79
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
80
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
81
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
82
+ declare const _default: typeof __VLS_export;
83
+ export default _default;
84
+ type __VLS_WithSlots<T, S> = T & {
85
+ new (): {
86
+ $slots: S;
87
+ };
88
+ };