@dialpad/dialtone-vue 3.120.0 → 3.120.2

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 (425) hide show
  1. package/dist/chunks/_plugin-vue_export-helper-caHeSgYY.js +11 -0
  2. package/dist/chunks/_plugin-vue_export-helper-caHeSgYY.js.map +1 -0
  3. package/dist/chunks/_plugin-vue_export-helper-fhnQq0tA.js +10 -0
  4. package/dist/chunks/_plugin-vue_export-helper-fhnQq0tA.js.map +1 -0
  5. package/dist/chunks/{dropdown-eWOvBvwq.js → dropdown-Hn-TeTvZ.js} +151 -104
  6. package/dist/chunks/{dropdown-UO3UJalk.js.map → dropdown-Hn-TeTvZ.js.map} +1 -1
  7. package/dist/chunks/dropdown-w8Do29L5.js +442 -0
  8. package/dist/chunks/{dropdown-eWOvBvwq.js.map → dropdown-w8Do29L5.js.map} +1 -1
  9. package/dist/chunks/dropdown_constants-2pGCXy7m.js +8 -0
  10. package/dist/chunks/dropdown_constants-2pGCXy7m.js.map +1 -0
  11. package/dist/chunks/dropdown_constants-w1MXGC3Z.js +9 -0
  12. package/dist/chunks/dropdown_constants-w1MXGC3Z.js.map +1 -0
  13. package/dist/chunks/{icon_constants-OpYAAKwF.js → icon_constants-Dy4MEUJL.js} +7 -6
  14. package/dist/chunks/{icon_constants-2S_OSQ1t.js.map → icon_constants-Dy4MEUJL.js.map} +1 -1
  15. package/dist/chunks/icon_constants-QYpmdE0R.js +16 -0
  16. package/dist/chunks/{icon_constants-OpYAAKwF.js.map → icon_constants-QYpmdE0R.js.map} +1 -1
  17. package/dist/chunks/index-4qgKeErp.js +446 -0
  18. package/dist/chunks/{index-b4iXYvId.js.map → index-4qgKeErp.js.map} +1 -1
  19. package/dist/chunks/index-b_MgDylR.js +447 -0
  20. package/dist/chunks/{index-6tYeqbgP.js.map → index-b_MgDylR.js.map} +1 -1
  21. package/dist/chunks/{input-4UQWegUk.js → input-NmYDD5bn.js} +83 -60
  22. package/dist/chunks/{input-0Uksk4DP.js.map → input-NmYDD5bn.js.map} +1 -1
  23. package/dist/chunks/input-ttnte8zB.js +295 -0
  24. package/dist/chunks/{input-4UQWegUk.js.map → input-ttnte8zB.js.map} +1 -1
  25. package/dist/chunks/input_group-M-D25pOJ.js +152 -0
  26. package/dist/chunks/{input_group-bBKaq3Wi.js.map → input_group-M-D25pOJ.js.map} +1 -1
  27. package/dist/chunks/{input_group-bBKaq3Wi.js → input_group-jWnq2DJT.js} +27 -24
  28. package/dist/chunks/{input_group-AS760Cp7.js.map → input_group-jWnq2DJT.js.map} +1 -1
  29. package/dist/chunks/keyboard_list_navigation-ScXhrxya.js +284 -0
  30. package/dist/chunks/{keyboard_list_navigation-N74Bpdq7.js.map → keyboard_list_navigation-ScXhrxya.js.map} +1 -1
  31. package/dist/chunks/keyboard_list_navigation-fJnl_Iox.js +283 -0
  32. package/dist/chunks/{keyboard_list_navigation-F0O8nht0.js.map → keyboard_list_navigation-fJnl_Iox.js.map} +1 -1
  33. package/dist/chunks/link_constants-Huj7D_hm.js +22 -0
  34. package/dist/chunks/{link_constants-Kn6kP4i1.js.map → link_constants-Huj7D_hm.js.map} +1 -1
  35. package/dist/chunks/link_constants-nWVlXQBs.js +23 -0
  36. package/dist/chunks/{link_constants-vIUB92L4.js.map → link_constants-nWVlXQBs.js.map} +1 -1
  37. package/dist/chunks/list_item_constants-EiqkqZvP.js +13 -0
  38. package/dist/chunks/{list_item_constants-Tsz5CO1m.js.map → list_item_constants-EiqkqZvP.js.map} +1 -1
  39. package/dist/chunks/list_item_constants-u1xcN9Dd.js +14 -0
  40. package/dist/chunks/{list_item_constants-LTUc74pD.js.map → list_item_constants-u1xcN9Dd.js.map} +1 -1
  41. package/dist/chunks/modal-VgxXAQFP.js +105 -0
  42. package/dist/chunks/{modal-qEzlo0Sj.js.map → modal-VgxXAQFP.js.map} +1 -1
  43. package/dist/chunks/modal-XOr4kiNZ.js +106 -0
  44. package/dist/chunks/{modal-VuMFkZFH.js.map → modal-XOr4kiNZ.js.map} +1 -1
  45. package/dist/chunks/notice_action-WTucGhvr.js +222 -0
  46. package/dist/chunks/{notice_action-tJfD5Qw1.js.map → notice_action-WTucGhvr.js.map} +1 -1
  47. package/dist/chunks/notice_action-p-ePanW_.js +223 -0
  48. package/dist/chunks/{notice_action-jO199emq.js.map → notice_action-p-ePanW_.js.map} +1 -1
  49. package/dist/chunks/notice_constants-7Qt2CQEY.js +7 -0
  50. package/dist/chunks/{notice_constants-mC6al2Dm.js.map → notice_constants-7Qt2CQEY.js.map} +1 -1
  51. package/dist/chunks/notice_constants-UXo9e3bS.js +6 -0
  52. package/dist/chunks/{notice_constants-c--hBFQw.js.map → notice_constants-UXo9e3bS.js.map} +1 -1
  53. package/dist/chunks/popover_constants-JwBF9h1Z.js +143 -0
  54. package/dist/chunks/{popover_constants-hOEhklvr.js.map → popover_constants-JwBF9h1Z.js.map} +1 -1
  55. package/dist/chunks/popover_constants-Qkpb0yh2.js +144 -0
  56. package/dist/chunks/{popover_constants-qjlEkroB.js.map → popover_constants-Qkpb0yh2.js.map} +1 -1
  57. package/dist/chunks/{sr_only_close_button-7O-Ev8uM.js → sr_only_close_button-3EdsV-dH.js} +28 -24
  58. package/dist/chunks/{sr_only_close_button-iD7s1Pbj.js.map → sr_only_close_button-3EdsV-dH.js.map} +1 -1
  59. package/dist/chunks/sr_only_close_button-xGrHFjwA.js +91 -0
  60. package/dist/chunks/{sr_only_close_button-7O-Ev8uM.js.map → sr_only_close_button-xGrHFjwA.js.map} +1 -1
  61. package/dist/chunks/stack_constants-HraCekPm.js +15 -0
  62. package/dist/chunks/{stack_constants-m9Ickqw0.js.map → stack_constants-HraCekPm.js.map} +1 -1
  63. package/dist/chunks/stack_constants-SMzMWnAQ.js +14 -0
  64. package/dist/chunks/{stack_constants-u7tNqGtc.js.map → stack_constants-SMzMWnAQ.js.map} +1 -1
  65. package/dist/chunks/tab-RTDgnD9-.js +391 -0
  66. package/dist/chunks/{tab-at7WWglk.js.map → tab-RTDgnD9-.js.map} +1 -1
  67. package/dist/chunks/tab-qc3f42Yp.js +390 -0
  68. package/dist/chunks/{tab-GQZFMq83.js.map → tab-qc3f42Yp.js.map} +1 -1
  69. package/dist/common/constants.cjs +60 -0
  70. package/dist/{lib → common}/constants.cjs.map +1 -1
  71. package/dist/{lib → common}/constants.js +25 -18
  72. package/dist/{lib → common}/constants.js.map +1 -1
  73. package/dist/common/dates.cjs +72 -0
  74. package/dist/{lib → common}/dates.cjs.map +1 -1
  75. package/dist/common/dates.js +72 -0
  76. package/dist/{lib → common}/dates.js.map +1 -1
  77. package/dist/common/emoji.cjs +163 -0
  78. package/dist/common/emoji.cjs.map +1 -0
  79. package/dist/common/emoji.js +168 -0
  80. package/dist/common/emoji.js.map +1 -0
  81. package/dist/common/mixins.cjs +17 -0
  82. package/dist/{lib → common}/mixins.cjs.map +1 -1
  83. package/dist/common/mixins.js +17 -0
  84. package/dist/common/utils.cjs +243 -0
  85. package/dist/{lib → common}/utils.cjs.map +1 -1
  86. package/dist/common/utils.js +243 -0
  87. package/dist/{lib → common}/utils.js.map +1 -1
  88. package/dist/common/validators.cjs +23 -0
  89. package/dist/{lib → common}/validators.cjs.map +1 -1
  90. package/dist/common/validators.js +23 -0
  91. package/dist/{lib → common}/validators.js.map +1 -1
  92. package/dist/dialtone-vue.cjs +373 -1
  93. package/dist/dialtone-vue.cjs.map +1 -1
  94. package/dist/dialtone-vue.js +328 -327
  95. package/dist/dialtone-vue.js.map +1 -1
  96. package/dist/lib/attachment-carousel.cjs +345 -1
  97. package/dist/lib/attachment-carousel.cjs.map +1 -1
  98. package/dist/lib/attachment-carousel.js +126 -108
  99. package/dist/lib/attachment-carousel.js.map +1 -1
  100. package/dist/lib/avatar.cjs +447 -1
  101. package/dist/lib/avatar.cjs.map +1 -1
  102. package/dist/lib/avatar.js +135 -101
  103. package/dist/lib/avatar.js.map +1 -1
  104. package/dist/lib/badge.cjs +206 -1
  105. package/dist/lib/badge.cjs.map +1 -1
  106. package/dist/lib/badge.js +64 -48
  107. package/dist/lib/badge.js.map +1 -1
  108. package/dist/lib/banner.cjs +242 -2
  109. package/dist/lib/banner.cjs.map +1 -1
  110. package/dist/lib/banner.js +81 -71
  111. package/dist/lib/banner.js.map +1 -1
  112. package/dist/lib/breadcrumbs.cjs +150 -1
  113. package/dist/lib/breadcrumbs.cjs.map +1 -1
  114. package/dist/lib/breadcrumbs.js +60 -52
  115. package/dist/lib/breadcrumbs.js.map +1 -1
  116. package/dist/lib/button-group.cjs +41 -1
  117. package/dist/lib/button-group.cjs.map +1 -1
  118. package/dist/lib/button-group.js +15 -14
  119. package/dist/lib/button-group.js.map +1 -1
  120. package/dist/lib/button.cjs +356 -1
  121. package/dist/lib/button.cjs.map +1 -1
  122. package/dist/lib/button.js +108 -88
  123. package/dist/lib/button.js.map +1 -1
  124. package/dist/lib/callbar-button-with-popover.cjs +322 -1
  125. package/dist/lib/callbar-button-with-popover.cjs.map +1 -1
  126. package/dist/lib/callbar-button-with-popover.js +101 -83
  127. package/dist/lib/callbar-button-with-popover.js.map +1 -1
  128. package/dist/lib/callbar-button.cjs +200 -1
  129. package/dist/lib/callbar-button.cjs.map +1 -1
  130. package/dist/lib/callbar-button.js +52 -45
  131. package/dist/lib/callbar-button.js.map +1 -1
  132. package/dist/lib/callbox.cjs +217 -1
  133. package/dist/lib/callbox.cjs.map +1 -1
  134. package/dist/lib/callbox.js +80 -67
  135. package/dist/lib/callbox.js.map +1 -1
  136. package/dist/lib/card.cjs +91 -1
  137. package/dist/lib/card.cjs.map +1 -1
  138. package/dist/lib/card.js +27 -27
  139. package/dist/lib/card.js.map +1 -1
  140. package/dist/lib/checkbox-group.cjs +115 -1
  141. package/dist/lib/checkbox-group.cjs.map +1 -1
  142. package/dist/lib/checkbox-group.js +34 -23
  143. package/dist/lib/checkbox-group.js.map +1 -1
  144. package/dist/lib/checkbox.cjs +156 -1
  145. package/dist/lib/checkbox.cjs.map +1 -1
  146. package/dist/lib/checkbox.js +72 -60
  147. package/dist/lib/checkbox.js.map +1 -1
  148. package/dist/lib/chip.cjs +235 -1
  149. package/dist/lib/chip.cjs.map +1 -1
  150. package/dist/lib/chip.js +84 -67
  151. package/dist/lib/chip.js.map +1 -1
  152. package/dist/lib/codeblock.cjs +23 -2
  153. package/dist/lib/codeblock.cjs.map +1 -1
  154. package/dist/lib/codeblock.js +13 -13
  155. package/dist/lib/codeblock.js.map +1 -1
  156. package/dist/lib/collapsible.cjs +398 -1
  157. package/dist/lib/collapsible.cjs.map +1 -1
  158. package/dist/lib/collapsible.js +123 -100
  159. package/dist/lib/collapsible.js.map +1 -1
  160. package/dist/lib/combobox-multi-select.cjs +589 -1
  161. package/dist/lib/combobox-multi-select.cjs.map +1 -1
  162. package/dist/lib/combobox-multi-select.js +270 -177
  163. package/dist/lib/combobox-multi-select.js.map +1 -1
  164. package/dist/lib/combobox-with-popover.cjs +452 -1
  165. package/dist/lib/combobox-with-popover.cjs.map +1 -1
  166. package/dist/lib/combobox-with-popover.js +172 -127
  167. package/dist/lib/combobox-with-popover.js.map +1 -1
  168. package/dist/lib/combobox.cjs +18 -1
  169. package/dist/lib/combobox.cjs.map +1 -1
  170. package/dist/lib/combobox.js +9 -9
  171. package/dist/lib/contact-info.cjs +205 -1
  172. package/dist/lib/contact-info.cjs.map +1 -1
  173. package/dist/lib/contact-info.js +69 -60
  174. package/dist/lib/contact-info.js.map +1 -1
  175. package/dist/lib/contact-row.cjs +246 -1
  176. package/dist/lib/contact-row.cjs.map +1 -1
  177. package/dist/lib/contact-row.js +67 -63
  178. package/dist/lib/contact-row.js.map +1 -1
  179. package/dist/lib/datepicker.cjs +854 -1
  180. package/dist/lib/datepicker.cjs.map +1 -1
  181. package/dist/lib/datepicker.js +585 -441
  182. package/dist/lib/datepicker.js.map +1 -1
  183. package/dist/lib/description-list.cjs +116 -1
  184. package/dist/lib/description-list.cjs.map +1 -1
  185. package/dist/lib/description-list.js +56 -24
  186. package/dist/lib/description-list.js.map +1 -1
  187. package/dist/lib/dropdown.cjs +36 -1
  188. package/dist/lib/dropdown.cjs.map +1 -1
  189. package/dist/lib/dropdown.js +22 -21
  190. package/dist/lib/dropdown.js.map +1 -1
  191. package/dist/lib/editor.cjs +711 -1
  192. package/dist/lib/editor.cjs.map +1 -1
  193. package/dist/lib/editor.js +271 -235
  194. package/dist/lib/editor.js.map +1 -1
  195. package/dist/lib/emoji-picker.cjs +1277 -1
  196. package/dist/lib/emoji-picker.cjs.map +1 -1
  197. package/dist/lib/emoji-picker.js +859 -569
  198. package/dist/lib/emoji-picker.js.map +1 -1
  199. package/dist/lib/emoji-row.cjs +128 -1
  200. package/dist/lib/emoji-row.cjs.map +1 -1
  201. package/dist/lib/emoji-row.js +89 -75
  202. package/dist/lib/emoji-row.js.map +1 -1
  203. package/dist/lib/emoji-text-wrapper.cjs +102 -1
  204. package/dist/lib/emoji-text-wrapper.cjs.map +1 -1
  205. package/dist/lib/emoji-text-wrapper.js +42 -31
  206. package/dist/lib/emoji-text-wrapper.js.map +1 -1
  207. package/dist/lib/emoji.cjs +158 -1
  208. package/dist/lib/emoji.cjs.map +1 -1
  209. package/dist/lib/emoji.js +153 -6
  210. package/dist/lib/emoji.js.map +1 -1
  211. package/dist/lib/feed-item-row.cjs +296 -1
  212. package/dist/lib/feed-item-row.cjs.map +1 -1
  213. package/dist/lib/feed-item-row.js +119 -100
  214. package/dist/lib/feed-item-row.js.map +1 -1
  215. package/dist/lib/feed-pill.cjs +173 -1
  216. package/dist/lib/feed-pill.cjs.map +1 -1
  217. package/dist/lib/feed-pill.js +70 -57
  218. package/dist/lib/feed-pill.js.map +1 -1
  219. package/dist/lib/general-row.cjs +518 -1
  220. package/dist/lib/general-row.cjs.map +1 -1
  221. package/dist/lib/general-row.js +186 -148
  222. package/dist/lib/general-row.js.map +1 -1
  223. package/dist/lib/group-row.cjs +116 -1
  224. package/dist/lib/group-row.cjs.map +1 -1
  225. package/dist/lib/group-row.js +37 -35
  226. package/dist/lib/group-row.js.map +1 -1
  227. package/dist/lib/grouped-chip.cjs +96 -1
  228. package/dist/lib/grouped-chip.cjs.map +1 -1
  229. package/dist/lib/grouped-chip.js +51 -46
  230. package/dist/lib/grouped-chip.js.map +1 -1
  231. package/dist/lib/hovercard.cjs +223 -1
  232. package/dist/lib/hovercard.cjs.map +1 -1
  233. package/dist/lib/hovercard.js +115 -80
  234. package/dist/lib/hovercard.js.map +1 -1
  235. package/dist/lib/icon.cjs +58 -1
  236. package/dist/lib/icon.cjs.map +1 -1
  237. package/dist/lib/icon.js +20 -20
  238. package/dist/lib/icon.js.map +1 -1
  239. package/dist/lib/image-viewer.cjs +243 -1
  240. package/dist/lib/image-viewer.cjs.map +1 -1
  241. package/dist/lib/image-viewer.js +104 -80
  242. package/dist/lib/image-viewer.js.map +1 -1
  243. package/dist/lib/input-group.cjs +91 -1
  244. package/dist/lib/input-group.cjs.map +1 -1
  245. package/dist/lib/input-group.js +41 -39
  246. package/dist/lib/input-group.js.map +1 -1
  247. package/dist/lib/input.cjs +578 -1
  248. package/dist/lib/input.cjs.map +1 -1
  249. package/dist/lib/input.js +185 -137
  250. package/dist/lib/input.js.map +1 -1
  251. package/dist/lib/item-layout.cjs +91 -1
  252. package/dist/lib/item-layout.cjs.map +1 -1
  253. package/dist/lib/item-layout.js +45 -39
  254. package/dist/lib/item-layout.js.map +1 -1
  255. package/dist/lib/ivr-node.cjs +263 -1
  256. package/dist/lib/ivr-node.cjs.map +1 -1
  257. package/dist/lib/ivr-node.js +130 -112
  258. package/dist/lib/ivr-node.js.map +1 -1
  259. package/dist/lib/keyboard-shortcut.cjs +119 -1
  260. package/dist/lib/keyboard-shortcut.cjs.map +1 -1
  261. package/dist/lib/keyboard-shortcut.js +58 -48
  262. package/dist/lib/keyboard-shortcut.js.map +1 -1
  263. package/dist/lib/lazy-show.cjs +82 -1
  264. package/dist/lib/lazy-show.cjs.map +1 -1
  265. package/dist/lib/lazy-show.js +21 -19
  266. package/dist/lib/lazy-show.js.map +1 -1
  267. package/dist/lib/link.cjs +43 -1
  268. package/dist/lib/link.cjs.map +1 -1
  269. package/dist/lib/link.js +20 -19
  270. package/dist/lib/link.js.map +1 -1
  271. package/dist/lib/list-item-group.cjs +67 -1
  272. package/dist/lib/list-item-group.cjs.map +1 -1
  273. package/dist/lib/list-item-group.js +24 -22
  274. package/dist/lib/list-item-group.js.map +1 -1
  275. package/dist/lib/list-item.cjs +216 -1
  276. package/dist/lib/list-item.cjs.map +1 -1
  277. package/dist/lib/list-item.js +71 -60
  278. package/dist/lib/list-item.js.map +1 -1
  279. package/dist/lib/message-input.cjs +708 -1
  280. package/dist/lib/message-input.cjs.map +1 -1
  281. package/dist/lib/message-input.js +232 -206
  282. package/dist/lib/message-input.js.map +1 -1
  283. package/dist/lib/modal.cjs +444 -2
  284. package/dist/lib/modal.cjs.map +1 -1
  285. package/dist/lib/modal.js +153 -120
  286. package/dist/lib/modal.js.map +1 -1
  287. package/dist/lib/notice.cjs +197 -1
  288. package/dist/lib/notice.cjs.map +1 -1
  289. package/dist/lib/notice.js +66 -63
  290. package/dist/lib/notice.js.map +1 -1
  291. package/dist/lib/pagination.cjs +205 -1
  292. package/dist/lib/pagination.cjs.map +1 -1
  293. package/dist/lib/pagination.js +96 -81
  294. package/dist/lib/pagination.js.map +1 -1
  295. package/dist/lib/popover.cjs +1080 -1
  296. package/dist/lib/popover.cjs.map +1 -1
  297. package/dist/lib/popover.js +447 -267
  298. package/dist/lib/popover.js.map +1 -1
  299. package/dist/lib/presence.cjs +70 -1
  300. package/dist/lib/presence.cjs.map +1 -1
  301. package/dist/lib/presence.js +33 -27
  302. package/dist/lib/presence.js.map +1 -1
  303. package/dist/lib/radio-group.cjs +88 -1
  304. package/dist/lib/radio-group.cjs.map +1 -1
  305. package/dist/lib/radio-group.js +18 -18
  306. package/dist/lib/radio-group.js.map +1 -1
  307. package/dist/lib/radio.cjs +162 -1
  308. package/dist/lib/radio.cjs.map +1 -1
  309. package/dist/lib/radio.js +66 -57
  310. package/dist/lib/radio.js.map +1 -1
  311. package/dist/lib/rich-text-editor.cjs +1137 -1
  312. package/dist/lib/rich-text-editor.cjs.map +1 -1
  313. package/dist/lib/rich-text-editor.js +567 -386
  314. package/dist/lib/rich-text-editor.js.map +1 -1
  315. package/dist/lib/root-layout.cjs +158 -1
  316. package/dist/lib/root-layout.cjs.map +1 -1
  317. package/dist/lib/root-layout.js +33 -31
  318. package/dist/lib/root-layout.js.map +1 -1
  319. package/dist/lib/scroller.cjs +1090 -1
  320. package/dist/lib/scroller.cjs.map +1 -1
  321. package/dist/lib/scroller.js +668 -345
  322. package/dist/lib/scroller.js.map +1 -1
  323. package/dist/lib/select-menu.cjs +312 -1
  324. package/dist/lib/select-menu.cjs.map +1 -1
  325. package/dist/lib/select-menu.js +124 -79
  326. package/dist/lib/select-menu.js.map +1 -1
  327. package/dist/lib/settings-menu-button.cjs +77 -1
  328. package/dist/lib/settings-menu-button.cjs.map +1 -1
  329. package/dist/lib/settings-menu-button.js +31 -30
  330. package/dist/lib/settings-menu-button.js.map +1 -1
  331. package/dist/lib/skeleton.cjs +635 -1
  332. package/dist/lib/skeleton.cjs.map +1 -1
  333. package/dist/lib/skeleton.js +189 -152
  334. package/dist/lib/skeleton.js.map +1 -1
  335. package/dist/lib/stack.cjs +123 -1
  336. package/dist/lib/stack.cjs.map +1 -1
  337. package/dist/lib/stack.js +61 -53
  338. package/dist/lib/stack.js.map +1 -1
  339. package/dist/lib/tabs.cjs +102 -1
  340. package/dist/lib/tabs.cjs.map +1 -1
  341. package/dist/lib/tabs.js +47 -41
  342. package/dist/lib/tabs.js.map +1 -1
  343. package/dist/lib/time-pill.cjs +41 -1
  344. package/dist/lib/time-pill.cjs.map +1 -1
  345. package/dist/lib/time-pill.js +18 -14
  346. package/dist/lib/time-pill.js.map +1 -1
  347. package/dist/lib/toast.cjs +281 -1
  348. package/dist/lib/toast.cjs.map +1 -1
  349. package/dist/lib/toast.js +96 -74
  350. package/dist/lib/toast.js.map +1 -1
  351. package/dist/lib/toggle.cjs +192 -1
  352. package/dist/lib/toggle.cjs.map +1 -1
  353. package/dist/lib/toggle.js +60 -49
  354. package/dist/lib/toggle.js.map +1 -1
  355. package/dist/lib/tooltip-directive.cjs +84 -1
  356. package/dist/lib/tooltip-directive.cjs.map +1 -1
  357. package/dist/lib/tooltip-directive.js +56 -42
  358. package/dist/lib/tooltip-directive.js.map +1 -1
  359. package/dist/lib/tooltip.cjs +460 -1
  360. package/dist/lib/tooltip.cjs.map +1 -1
  361. package/dist/lib/tooltip.js +162 -103
  362. package/dist/lib/tooltip.js.map +1 -1
  363. package/dist/lib/top-banner-info.cjs +71 -1
  364. package/dist/lib/top-banner-info.cjs.map +1 -1
  365. package/dist/lib/top-banner-info.js +27 -22
  366. package/dist/lib/top-banner-info.js.map +1 -1
  367. package/dist/lib/unread-pill.cjs +73 -1
  368. package/dist/lib/unread-pill.cjs.map +1 -1
  369. package/dist/lib/unread-pill.js +28 -25
  370. package/dist/lib/unread-pill.js.map +1 -1
  371. package/dist/lib/validation-messages.cjs +89 -1
  372. package/dist/lib/validation-messages.cjs.map +1 -1
  373. package/dist/lib/validation-messages.js +41 -36
  374. package/dist/lib/validation-messages.js.map +1 -1
  375. package/dist/style.css +1257 -1
  376. package/dist/types/components/rich_text_editor/extensions/emoji/EmojiComponent.vue.d.ts +2 -2
  377. package/dist/types/components/rich_text_editor/extensions/mentions/MentionComponent.vue.d.ts +2 -2
  378. package/package.json +30 -29
  379. package/dist/chunks/_plugin-vue_export-helper-6_y-gaV6.js +0 -2
  380. package/dist/chunks/_plugin-vue_export-helper-6_y-gaV6.js.map +0 -1
  381. package/dist/chunks/_plugin-vue_export-helper-hUChTQA_.js +0 -10
  382. package/dist/chunks/_plugin-vue_export-helper-hUChTQA_.js.map +0 -1
  383. package/dist/chunks/dropdown-UO3UJalk.js +0 -2
  384. package/dist/chunks/dropdown_constants-EUcDxBrX.js +0 -9
  385. package/dist/chunks/dropdown_constants-EUcDxBrX.js.map +0 -1
  386. package/dist/chunks/dropdown_constants-KHFvVI2L.js +0 -2
  387. package/dist/chunks/dropdown_constants-KHFvVI2L.js.map +0 -1
  388. package/dist/chunks/icon_constants-2S_OSQ1t.js +0 -2
  389. package/dist/chunks/index-6tYeqbgP.js +0 -3
  390. package/dist/chunks/index-IBtQ5jRJ.js +0 -2
  391. package/dist/chunks/index-IBtQ5jRJ.js.map +0 -1
  392. package/dist/chunks/index-b4iXYvId.js +0 -399
  393. package/dist/chunks/index-mRmwpCBG.js +0 -256
  394. package/dist/chunks/index-mRmwpCBG.js.map +0 -1
  395. package/dist/chunks/input-0Uksk4DP.js +0 -2
  396. package/dist/chunks/input_group-AS760Cp7.js +0 -2
  397. package/dist/chunks/keyboard_list_navigation-F0O8nht0.js +0 -197
  398. package/dist/chunks/keyboard_list_navigation-N74Bpdq7.js +0 -2
  399. package/dist/chunks/link_constants-Kn6kP4i1.js +0 -2
  400. package/dist/chunks/link_constants-vIUB92L4.js +0 -16
  401. package/dist/chunks/list_item_constants-LTUc74pD.js +0 -13
  402. package/dist/chunks/list_item_constants-Tsz5CO1m.js +0 -2
  403. package/dist/chunks/modal-VuMFkZFH.js +0 -82
  404. package/dist/chunks/modal-qEzlo0Sj.js +0 -2
  405. package/dist/chunks/notice_action-jO199emq.js +0 -2
  406. package/dist/chunks/notice_action-tJfD5Qw1.js +0 -209
  407. package/dist/chunks/notice_constants-c--hBFQw.js +0 -6
  408. package/dist/chunks/notice_constants-mC6al2Dm.js +0 -2
  409. package/dist/chunks/popover_constants-hOEhklvr.js +0 -2
  410. package/dist/chunks/popover_constants-qjlEkroB.js +0 -114
  411. package/dist/chunks/sr_only_close_button-iD7s1Pbj.js +0 -3
  412. package/dist/chunks/stack_constants-m9Ickqw0.js +0 -2
  413. package/dist/chunks/stack_constants-u7tNqGtc.js +0 -13
  414. package/dist/chunks/tab-GQZFMq83.js +0 -367
  415. package/dist/chunks/tab-at7WWglk.js +0 -2
  416. package/dist/lib/constants.cjs +0 -2
  417. package/dist/lib/dates.cjs +0 -2
  418. package/dist/lib/dates.js +0 -57
  419. package/dist/lib/mixins.cjs +0 -2
  420. package/dist/lib/mixins.js +0 -17
  421. package/dist/lib/utils.cjs +0 -2
  422. package/dist/lib/utils.js +0 -171
  423. package/dist/lib/validators.cjs +0 -2
  424. package/dist/lib/validators.js +0 -12
  425. /package/dist/{lib → common}/mixins.js.map +0 -0
@@ -1,2 +1,1091 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),fe=require("../chunks/_plugin-vue_export-helper-6_y-gaV6.js"),ie={__name:"core_scroller",props:{items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:e=>["vertical","horizontal"].includes(e)},itemSize:{type:Number,default:null},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},buffer:{type:Number,default:200},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["user-position"],setup(e,{expose:s,emit:n}){const i=e,y=n,m=t.reactive(new Map),z=t.reactive(new Map),h=t.ref([]),S=t.ref(null),g=t.ref(!1),p=t.ref(null),B=t.ref("top");let I=0,F=!1,A=0,R=null,U=null,j=0,se=0;const N=t.computed(()=>{if(i.itemSize===null){const o={"-1":{accumulator:0}},a=i.items,l=i.sizeField,D=i.minItemSize;let v=1e4,w=0,u;for(let k=0,P=a.length;k<P;k++)u=a[k][l]||D,u<v&&(v=u),w+=u,o[k]={accumulator:w,size:u};return U=v,o}return[]}),le=t.computed(()=>i.items.length&&typeof i.items[0]!="object"),re=t.computed(()=>{const o={};for(let a=0,l=i.items.length;a<l;a++)o[i.items[a][i.keyField]]=a;return o});t.watch(N,()=>{V(!1)},{deep:!0}),t.onMounted(()=>{t.nextTick(()=>{V(!0),g.value=!0})});const E=(o,a,l,D,v)=>{const w=t.markRaw({id:se++,index:a,used:!0,key:D,type:v}),u=t.shallowReactive({item:l,position:0,nr:w});return o.value.push(u),u},W=(o,a=!1)=>{const l=z,D=o.nr.type;let v=l.get(D);v||(v=[],l.set(D,v)),v.push(o),a||(o.nr.used=!1,o.position=-9999)},oe=()=>{const o=i.direction==="vertical";let a;return o?a={start:p.value.scrollTop,end:p.value.scrollTop+p.value.clientHeight}:a={start:p.value.scrollLeft,end:p.value.scrollLeft+p.value.clientWidth},a},ne=()=>{throw setTimeout(()=>{console.error("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",p),console.error("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},ae=()=>{h.value.sort((o,a)=>o.nr.index-a.nr.index)},V=(o,a=!1)=>{var Y,X,G,J,Q,Z;const l=i.itemSize,D=U,v=le.value?null:i.keyField,w=i.items,u=w.length,k=N.value,P=m,L=z,M=h,me=re;let $,f,H;if(!u)$=f=H=0;else{const c=oe();if(a){let d=c.start-A.value;if(d<0&&(d=-d),l===null&&d<D.value||d<l)return{continuous:!0}}A=c.start;const _=i.buffer;if(c.start-=_,c.end+=_,l===null){let d,O=0,ee=u-1,b=~~(u/2),te;do te=b,d=(Y=k[b])==null?void 0:Y.accumulator,d<c.start?O=b:b<u-1&&((X=k[b+1])==null?void 0:X.accumulator)>c.start&&(ee=b),b=~~((O+ee)/2);while(b!==te);for(b<0&&(b=0),$=b,H=(G=k[u-1])==null?void 0:G.accumulator,f=b;f<u&&((J=k[f])==null?void 0:J.accumulator)<c.end;f++);f===-1?f=w.length-1:(f++,f>u&&(f=u))}else{$=~~(c.start/l);const d=$%1;$-=d,f=Math.ceil(c.end/l),$<0&&($=0),f>u&&(f=u),H=Math.ceil(u/1)*l}}f-$>1e3&&ne(),j=H;let r;const C=$<=I&&f>=$;if(C)for(let c=0,_=M.value.length;c<_;c++)r=M.value[c],r!=null&&r.nr.used&&(o&&(r.nr.index=me[r.item[v]]),(r.nr.index==null||r.nr.index<$||r.nr.index>=f)&&W(r));const K=C?null:new Map;let T,x,q;for(let c=$;c<f;c++){T=w[c];const _=v?T==null?void 0:T[v]:T;if(_==null)throw new Error(`Key is ${_} on item (keyField is '${v}')`);if(r=P.get(_),!l&&!((Q=k[c])!=null&&Q.size)){r&&W(r);continue}x=T.type;let d=L.get(x);if(!r)C?d&&d.length?r=d.pop():r=E(M,c,T,_,x):(q=K.get(x)||0,(!d||q>=d.length)&&(r=E(M,c,T,_,x),W(r,!0),d=L.get(x)),r=d[q],K.set(x,q+1)),P.delete(r.nr.key),r.nr.used=!0,r.nr.index=c,r.nr.key=_,r.nr.type=x,P.set(_,r);else if(!r.nr.used&&(r.nr.used=!0,d)){const O=d.indexOf(r);O!==-1&&d.splice(O,1)}r.item=T,l===null?(r.position=(Z=k[c-1])==null?void 0:Z.accumulator,r.offset=0):(r.position=Math.floor(c)*l,r.offset=c%1*l)}return I=f,clearTimeout(R),R=setTimeout(ae,300),{continuous:C}},ce=o=>{const a=i.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"},l=p.value,D=a.scroll;l[D]=o},de=o=>{var l;let a;i.itemSize===null?a=o>0?(l=N.value[o-1])==null?void 0:l.accumulator:0:a=Math.floor(o)*i.itemSize,ce(a)},ue=()=>{const o=p.value;B.value!=="middle"&&(B.value="middle",y("user-position","middle")),o.scrollTop===0&&(B.value="top",y("user-position","top")),o.scrollTop+o.clientHeight===o.scrollHeight&&(B.value="bottom",y("user-position","bottom")),F||(F=!0,requestAnimationFrame(()=>{F=!1,V(!1,!0)}))};return s({scrollToItem:de,_updateVisibleItems:V}),(o,a)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"scroller",ref:p,class:t.normalizeClass(["vue-recycle-scroller",{ready:g.value,[`direction-${e.direction}`]:!0}]),onScrollPassive:ue},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.listTag),{ref:"wrapper",style:t.normalizeStyle({[e.direction==="vertical"?"minHeight":"minWidth"]:`${t.unref(j)}px`}),class:t.normalizeClass(["vue-recycle-scroller__item-wrapper",e.listClass])},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,l=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.itemTag),t.mergeProps({key:l.nr.id,style:g.value?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${l.position}px) translate${e.direction==="vertical"?"X":"Y"}(${l.offset}px)`,width:void 0,height:void 0}:null,class:["vue-recycle-scroller__item-view",[e.itemClass,{hover:!e.skipHover&&S.value===l.nr.key}]]},t.toHandlers(e.skipHover?{}:{mouseenter:()=>{S.value=l.nr.key},mouseleave:()=>{S.value=null}})),{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default",{item:l.item,index:l.nr.index,active:l.nr.used})]),_:2},1040,["style","class"]))),128))]),_:3},8,["style","class"]))],34))}},he={name:"DtScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},tag:{type:String,default:"div"}},computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.vscrollData.keyField in this.item)return this.item[this.vscrollData.keyField];throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id(e,s){if(this.$el.$_vs_id=this.id,this.size||this.onDataUpdate(),this.$_sizeObserved){const n=this.vscrollData.sizes[s],i=this.vscrollData.sizes[e];n!=null&&n!==i&&this.applySize(n)}},finalActive(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver))for(const e in this.sizeDependencies)this.$watch(()=>this.sizeDependencies[e],this.onDataUpdate)},mounted(){this.finalActive&&(this.updateSize(),this.observeSize())},beforeUnmount(){this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch("item",()=>{this.onDataUpdate()},{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate({force:e}){!this.finalActive&&e&&(this.$_pendingVScrollUpdate=this.id),(this.$_forceNextVScrollUpdate===this.id||e||!this.size)&&this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(e){this.$nextTick(()=>{if(this.id===e){const s=this.$el.offsetWidth,n=this.$el.offsetHeight;this.applyWidthHeight(s,n)}this.$_pendingSizeUpdate=null})},applyWidthHeight(e,s){const n=~~(this.vscrollParent.direction==="vertical"?s:e);n&&this.size!==n&&this.applySize(n)},applySize(e){this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.vscrollData.sizes[this.id]=e},observeSize(){this.vscrollResizeObserver&&(this.$_sizeObserved||(this.vscrollResizeObserver.observe(this.$el),this.$el.$_vs_id=this.id,this.$el.$_vs_onResize=this.onResize,this.$_sizeObserved=!0))},unobserveSize(){this.vscrollResizeObserver&&this.$_sizeObserved&&(this.vscrollResizeObserver.unobserve(this.$el),this.$el.$_vs_onResize=void 0,this.$_sizeObserved=!1)},onResize(e,s,n){this.id===e&&this.applyWidthHeight(s,n)}},render(){return t.h(this.tag,this.$slots.default())}},pe={name:"DynamicScroller",components:{CoreScroller:ie,DtScrollerItem:he},provide(){return typeof ResizeObserver<"u"&&(this.$_resizeObserver=new ResizeObserver(e=>{requestAnimationFrame(()=>{if(Array.isArray(e)){for(const s of e)if(s.target&&s.target.$_vs_onResize){let n,i;if(s.borderBoxSize){const y=s.borderBoxSize[0];n=y.inlineSize,i=y.blockSize}else n=s.contentRect.width,i=s.contentRect.height;s.target.$_vs_onResize(s.target.$_vs_id,n,i)}}})})),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{items:{type:Array,required:!0},dynamic:{type:Boolean,default:!1},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:e=>["vertical","horizontal"].includes(e)},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},minItemSize:{type:[Number,String]}},data(){return{vscrollData:{active:!0,sizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray(){return this.items.length&&typeof this.items[0]!="object"},itemsWithSize(){const e=[],{items:s,keyField:n,simpleArray:i}=this,y=this.vscrollData.sizes,m=s.length;for(let z=0;z<m;z++){const h=s[z],S=i?z:h[n];let g=y[S];typeof g>"u"&&!this.$_undefinedMap[S]&&(g=0),e.push({item:h,[n]:S,size:g})}return e}},watch:{simpleArray:{handler(e){this.vscrollData.simpleArray=e},immediate:!0},itemsWithSize(e,s){const n=this.$el.scrollTop;let i=0,y=0;const m=Math.min(e.length,s.length);for(let h=0;h<m&&!(i>=n);h++)i+=s[h].size||this.minItemSize,y+=e[h].size||this.minItemSize;const z=y-i;z!==0&&(this.$el.scrollTop+=z)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={}},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},methods:{dynamicScrollerUpdateItems(){const e=this.$refs.scroller;e&&e._updateVisibleItems(!0)},dynamicScrollerUpdateItemsFromBottom(){const e=this.$refs.scroller;e&&e._updateVisibleItems(!1,!0)},scrollToItem(e){const s=this.$refs.scroller;s&&s.scrollToItem(e)},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;const e=this.$el;this.$nextTick(()=>{e.scrollTop=e.scrollHeight+5e3;const s=()=>{e.scrollTop=e.scrollHeight+5e3,requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight+5e3,this.$_undefinedSizes===0?this.$_scrollingToBottom=!1:requestAnimationFrame(s)})};requestAnimationFrame(s)})}}};function ve(e,s,n,i,y,m){const z=t.resolveComponent("dt-scroller-item"),h=t.resolveComponent("core-scroller");return t.openBlock(),t.createBlock(h,t.mergeProps({ref:"scroller",items:m.itemsWithSize,"min-item-size":n.minItemSize,direction:n.direction,"key-field":n.keyField,"list-tag":n.listTag,"item-tag":n.itemTag},e.$attrs),{default:t.withCtx(({item:S,index:g,active:p})=>[t.createVNode(z,{item:S,active:p,"size-dependencies":[S.message],"data-index":g},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",t.normalizeProps(t.guardReactiveProps({item:S.item,index:g,active:p,itemWithSize:S})))]),_:2},1032,["item","active","size-dependencies","data-index"])]),_:3},16,["items","min-item-size","direction","key-field","list-tag","item-tag"])}const ye=fe._(pe,[["render",ve]]),ze={__name:"DtScroller",props:{direction:{type:String,default:"vertical",validator:e=>["vertical","horizontal"].includes(e)},dynamic:{type:Boolean,default:!1},itemSize:{type:Number,default:null},itemTag:{type:String,default:"div"},items:{type:Array,required:!0},keyField:{type:String,default:"id"},listTag:{type:String,default:"div"},minItemSize:{type:[Number,String],default:null},scrollerHeight:{type:[String,Number],default:"100%"},scrollerWidth:{type:[String,Number],default:"100%"}},emits:["user-position"],setup(e,{expose:s,emit:n}){const i=e,y=n;t.provide("emit",y);const m=t.ref(null),z=t.computed(()=>({width:typeof i.scrollerWidth=="number"?`${i.scrollerWidth}px`:i.scrollerWidth,height:typeof i.scrollerHeight=="number"?`${i.scrollerHeight}px`:i.scrollerHeight}));t.watch(i,()=>{B()},{deep:!0,immediate:!0});function h(){m.value&&m.value.scrollToBottom()}function S(I){m.value&&m.value.scrollToItem(I)}function g(){m.value&&(i.dynamic?m.value.dynamicScrollerUpdateItems():m.value._updateVisibleItems(!0))}function p(){m.value&&(i.dynamic?m.value.dynamicScrollerUpdateItemsFromBottom():m.value._updateVisibleItems(!1,!0))}function B(){i.dynamic&&!i.minItemSize&&console.error("scroller error: 'minItemSize' is required on 'dynamic' mode."),!i.dynamic&&!i.itemSize&&console.error("scroller error: 'itemSize' is required.")}return s({scrollToBottom:h,scrollToItem:S,updateItems:g,updateItemsFromBottom:p}),(I,F)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.dynamic?ye:ie),{ref_key:"scroller",ref:m,"data-qa":"dt-scroller",items:e.items,"item-size":e.itemSize,"min-item-size":e.minItemSize,direction:e.direction,"key-field":e.keyField,"list-tag":e.listTag,"item-tag":e.itemTag,style:t.normalizeStyle(z.value),tabindex:"0",onUserPosition:F[0]||(F[0]=A=>I.$emit("user-position",A))},{default:t.withCtx(({item:A,index:R,active:U})=>[t.renderSlot(I.$slots,"default",t.normalizeProps(t.guardReactiveProps({item:A,index:R,active:U})))]),_:3},40,["items","item-size","min-item-size","direction","key-field","list-tag","item-tag","style"]))}};exports.DtScroller=ze;
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const vue = require("vue");
4
+ const _pluginVue_exportHelper = require("../chunks/_plugin-vue_export-helper-fhnQq0tA.js");
5
+ const _sfc_main$3 = {
6
+ __name: "core_scroller",
7
+ props: {
8
+ /**
9
+ * List of items you want to display in the scroller.
10
+ */
11
+ items: {
12
+ type: Array,
13
+ required: true
14
+ },
15
+ /**
16
+ *
17
+ * Field used to identify items and optimize managing rendered views
18
+ */
19
+ keyField: {
20
+ type: String,
21
+ default: "id"
22
+ },
23
+ /**
24
+ * Direction of the scroller. Can be either `vertical` or `horizontal`.
25
+ */
26
+ direction: {
27
+ type: String,
28
+ default: "vertical",
29
+ validator: (value) => ["vertical", "horizontal"].includes(value)
30
+ },
31
+ /**
32
+ * Size of the items in the list.
33
+ * If it is set to null (the default value), it will use variable size mode.
34
+ */
35
+ itemSize: {
36
+ type: Number,
37
+ default: null
38
+ },
39
+ /**
40
+ * Minimum size used if the height (or width in horizontal mode) of an item is unknown.
41
+ */
42
+ minItemSize: {
43
+ type: [Number, String],
44
+ default: null
45
+ },
46
+ /**
47
+ * Field used to get the item's size in variable size mode.
48
+ */
49
+ sizeField: {
50
+ type: String,
51
+ default: "size"
52
+ },
53
+ /**
54
+ * Amount of pixel to add to edges of the scrolling visible area to start rendering items further away.
55
+ */
56
+ buffer: {
57
+ type: Number,
58
+ default: 200
59
+ },
60
+ /**
61
+ * If true, the hover state will be skipped.
62
+ * This can be useful if you want to use the hover state for other purposes.
63
+ */
64
+ skipHover: {
65
+ type: Boolean,
66
+ default: false
67
+ },
68
+ /**
69
+ * The element to render as the list's wrapper.
70
+ */
71
+ listTag: {
72
+ type: String,
73
+ default: "div"
74
+ },
75
+ /**
76
+ * The element to render as the list item.
77
+ */
78
+ itemTag: {
79
+ type: String,
80
+ default: "div"
81
+ },
82
+ /**
83
+ * The custom classes added to the item list wrapper.
84
+ */
85
+ listClass: {
86
+ type: [String, Object, Array],
87
+ default: ""
88
+ },
89
+ /**
90
+ * The custom classes added to each item.
91
+ */
92
+ itemClass: {
93
+ type: [String, Object, Array],
94
+ default: ""
95
+ }
96
+ },
97
+ emits: ["user-position"],
98
+ setup(__props, { expose: __expose, emit: __emit }) {
99
+ const props = __props;
100
+ const emit = __emit;
101
+ const views = vue.reactive(/* @__PURE__ */ new Map());
102
+ const unusedViews = vue.reactive(/* @__PURE__ */ new Map());
103
+ const pool = vue.ref([]);
104
+ const hoverKey = vue.ref(null);
105
+ const ready = vue.ref(false);
106
+ const scroller = vue.ref(null);
107
+ const userPosition = vue.ref("top");
108
+ let endIndex = 0;
109
+ let scrollDirty = false;
110
+ let lastUpdateScrollPosition = 0;
111
+ let sortTimer = null;
112
+ let computedMinItemSize = null;
113
+ let totalSize = 0;
114
+ let uid = 0;
115
+ const sizes = vue.computed(() => {
116
+ if (props.itemSize === null) {
117
+ const sizes2 = {
118
+ "-1": { accumulator: 0 }
119
+ };
120
+ const items = props.items;
121
+ const field = props.sizeField;
122
+ const minItemSize = props.minItemSize;
123
+ let computedMinSize = 1e4;
124
+ let accumulator = 0;
125
+ let current;
126
+ for (let i = 0, l = items.length; i < l; i++) {
127
+ current = items[i][field] || minItemSize;
128
+ if (current < computedMinSize) {
129
+ computedMinSize = current;
130
+ }
131
+ accumulator += current;
132
+ sizes2[i] = { accumulator, size: current };
133
+ }
134
+ computedMinItemSize = computedMinSize;
135
+ return sizes2;
136
+ }
137
+ return [];
138
+ });
139
+ const simpleArray = vue.computed(() => {
140
+ return props.items.length && typeof props.items[0] !== "object";
141
+ });
142
+ const itemIndexByKey = vue.computed(() => {
143
+ const result = {};
144
+ for (let i = 0, l = props.items.length; i < l; i++) {
145
+ result[props.items[i][props.keyField]] = i;
146
+ }
147
+ return result;
148
+ });
149
+ vue.watch(sizes, () => {
150
+ _updateVisibleItems(false);
151
+ }, { deep: true });
152
+ vue.onMounted(() => {
153
+ vue.nextTick(() => {
154
+ _updateVisibleItems(true);
155
+ ready.value = true;
156
+ });
157
+ });
158
+ const _addView = (pool2, index, item, key, type) => {
159
+ const nr = vue.markRaw({
160
+ id: uid++,
161
+ index,
162
+ used: true,
163
+ key,
164
+ type
165
+ });
166
+ const view = vue.shallowReactive({
167
+ item,
168
+ position: 0,
169
+ nr
170
+ });
171
+ pool2.value.push(view);
172
+ return view;
173
+ };
174
+ const _unuseView = (view, fake = false) => {
175
+ const _unusedViews = unusedViews;
176
+ const type = view.nr.type;
177
+ let unusedPool = _unusedViews.get(type);
178
+ if (!unusedPool) {
179
+ unusedPool = [];
180
+ _unusedViews.set(type, unusedPool);
181
+ }
182
+ unusedPool.push(view);
183
+ if (!fake) {
184
+ view.nr.used = false;
185
+ view.position = -9999;
186
+ }
187
+ };
188
+ const _getScroll = () => {
189
+ const isVertical = props.direction === "vertical";
190
+ let scrollState;
191
+ if (isVertical) {
192
+ scrollState = {
193
+ start: scroller.value.scrollTop,
194
+ end: scroller.value.scrollTop + scroller.value.clientHeight
195
+ };
196
+ } else {
197
+ scrollState = {
198
+ start: scroller.value.scrollLeft,
199
+ end: scroller.value.scrollLeft + scroller.value.clientWidth
200
+ };
201
+ }
202
+ return scrollState;
203
+ };
204
+ const _itemsLimitError = () => {
205
+ setTimeout(() => {
206
+ console.error("It seems the scroller element isn't scrolling, so it tries to render all the items at once.", "Scroller:", scroller);
207
+ console.error("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.");
208
+ });
209
+ throw new Error("Rendered items limit reached");
210
+ };
211
+ const _sortViews = () => {
212
+ pool.value.sort((viewA, viewB) => viewA.nr.index - viewB.nr.index);
213
+ };
214
+ const _updateVisibleItems = (checkItem, checkPositionDiff = false) => {
215
+ var _a, _b, _c, _d, _e, _f;
216
+ const itemSize = props.itemSize;
217
+ const minItemSize = computedMinItemSize;
218
+ const keyField = simpleArray.value ? null : props.keyField;
219
+ const items = props.items;
220
+ const count = items.length;
221
+ const _sizes = sizes.value;
222
+ const _views = views;
223
+ const _unusedViews = unusedViews;
224
+ const _pool = pool;
225
+ const _itemIndexByKey = itemIndexByKey;
226
+ let _startIndex, _endIndex;
227
+ let _totalSize;
228
+ if (!count) {
229
+ _startIndex = _endIndex = _totalSize = 0;
230
+ } else {
231
+ const scroll = _getScroll();
232
+ if (checkPositionDiff) {
233
+ let positionDiff = scroll.start - lastUpdateScrollPosition.value;
234
+ if (positionDiff < 0)
235
+ positionDiff = -positionDiff;
236
+ if (itemSize === null && positionDiff < minItemSize.value || positionDiff < itemSize) {
237
+ return {
238
+ continuous: true
239
+ };
240
+ }
241
+ }
242
+ lastUpdateScrollPosition = scroll.start;
243
+ const _buffer = props.buffer;
244
+ scroll.start -= _buffer;
245
+ scroll.end += _buffer;
246
+ if (itemSize === null) {
247
+ let h;
248
+ let a = 0;
249
+ let b = count - 1;
250
+ let i = ~~(count / 2);
251
+ let oldI;
252
+ do {
253
+ oldI = i;
254
+ h = (_a = _sizes[i]) == null ? void 0 : _a.accumulator;
255
+ if (h < scroll.start) {
256
+ a = i;
257
+ } else if (i < count - 1 && ((_b = _sizes[i + 1]) == null ? void 0 : _b.accumulator) > scroll.start) {
258
+ b = i;
259
+ }
260
+ i = ~~((a + b) / 2);
261
+ } while (i !== oldI);
262
+ i < 0 && (i = 0);
263
+ _startIndex = i;
264
+ _totalSize = (_c = _sizes[count - 1]) == null ? void 0 : _c.accumulator;
265
+ for (_endIndex = i; _endIndex < count && ((_d = _sizes[_endIndex]) == null ? void 0 : _d.accumulator) < scroll.end; _endIndex++)
266
+ ;
267
+ if (_endIndex === -1) {
268
+ _endIndex = items.length - 1;
269
+ } else {
270
+ _endIndex++;
271
+ _endIndex > count && (_endIndex = count);
272
+ }
273
+ } else {
274
+ _startIndex = ~~(scroll.start / itemSize);
275
+ const remainer = _startIndex % 1;
276
+ _startIndex -= remainer;
277
+ _endIndex = Math.ceil(scroll.end / itemSize);
278
+ _startIndex < 0 && (_startIndex = 0);
279
+ _endIndex > count && (_endIndex = count);
280
+ _totalSize = Math.ceil(count / 1) * itemSize;
281
+ }
282
+ }
283
+ if (_endIndex - _startIndex > 1e3) {
284
+ _itemsLimitError();
285
+ }
286
+ totalSize = _totalSize;
287
+ let view;
288
+ const continuous = _startIndex <= endIndex && _endIndex >= _startIndex;
289
+ if (continuous) {
290
+ for (let i = 0, l = _pool.value.length; i < l; i++) {
291
+ view = _pool.value[i];
292
+ if (view == null ? void 0 : view.nr.used) {
293
+ if (checkItem) {
294
+ view.nr.index = _itemIndexByKey[view.item[keyField]];
295
+ }
296
+ if (view.nr.index == null || view.nr.index < _startIndex || view.nr.index >= _endIndex) {
297
+ _unuseView(view);
298
+ }
299
+ }
300
+ }
301
+ }
302
+ const unusedIndex = continuous ? null : /* @__PURE__ */ new Map();
303
+ let item, type;
304
+ let v;
305
+ for (let i = _startIndex; i < _endIndex; i++) {
306
+ item = items[i];
307
+ const key = keyField ? item == null ? void 0 : item[keyField] : item;
308
+ if (key == null) {
309
+ throw new Error(`Key is ${key} on item (keyField is '${keyField}')`);
310
+ }
311
+ view = _views.get(key);
312
+ if (!itemSize && !((_e = _sizes[i]) == null ? void 0 : _e.size)) {
313
+ if (view)
314
+ _unuseView(view);
315
+ continue;
316
+ }
317
+ type = item.type;
318
+ let unusedPool = _unusedViews.get(type);
319
+ if (!view) {
320
+ if (continuous) {
321
+ if (unusedPool && unusedPool.length) {
322
+ view = unusedPool.pop();
323
+ } else {
324
+ view = _addView(_pool, i, item, key, type);
325
+ }
326
+ } else {
327
+ v = unusedIndex.get(type) || 0;
328
+ if (!unusedPool || v >= unusedPool.length) {
329
+ view = _addView(_pool, i, item, key, type);
330
+ _unuseView(view, true);
331
+ unusedPool = _unusedViews.get(type);
332
+ }
333
+ view = unusedPool[v];
334
+ unusedIndex.set(type, v + 1);
335
+ }
336
+ _views.delete(view.nr.key);
337
+ view.nr.used = true;
338
+ view.nr.index = i;
339
+ view.nr.key = key;
340
+ view.nr.type = type;
341
+ _views.set(key, view);
342
+ } else {
343
+ if (!view.nr.used) {
344
+ view.nr.used = true;
345
+ if (unusedPool) {
346
+ const index = unusedPool.indexOf(view);
347
+ if (index !== -1)
348
+ unusedPool.splice(index, 1);
349
+ }
350
+ }
351
+ }
352
+ view.item = item;
353
+ if (itemSize === null) {
354
+ view.position = (_f = _sizes[i - 1]) == null ? void 0 : _f.accumulator;
355
+ view.offset = 0;
356
+ } else {
357
+ view.position = Math.floor(i) * itemSize;
358
+ view.offset = i % 1 * itemSize;
359
+ }
360
+ }
361
+ endIndex = _endIndex;
362
+ clearTimeout(sortTimer);
363
+ sortTimer = setTimeout(_sortViews, 300);
364
+ return {
365
+ continuous
366
+ };
367
+ };
368
+ const _scrollToPosition = (position) => {
369
+ const direction = props.direction === "vertical" ? { scroll: "scrollTop", start: "top" } : { scroll: "scrollLeft", start: "left" };
370
+ const viewport = scroller.value;
371
+ const scrollDirection = direction.scroll;
372
+ viewport[scrollDirection] = position;
373
+ };
374
+ const scrollToItem = (index) => {
375
+ var _a;
376
+ let scroll;
377
+ if (props.itemSize === null) {
378
+ scroll = index > 0 ? (_a = sizes.value[index - 1]) == null ? void 0 : _a.accumulator : 0;
379
+ } else {
380
+ scroll = Math.floor(index) * props.itemSize;
381
+ }
382
+ _scrollToPosition(scroll);
383
+ };
384
+ const handleScroll = () => {
385
+ const container = scroller.value;
386
+ if (userPosition.value !== "middle") {
387
+ userPosition.value = "middle";
388
+ emit("user-position", "middle");
389
+ }
390
+ if (container.scrollTop === 0) {
391
+ userPosition.value = "top";
392
+ emit("user-position", "top");
393
+ }
394
+ if (container.scrollTop + container.clientHeight === container.scrollHeight) {
395
+ userPosition.value = "bottom";
396
+ emit("user-position", "bottom");
397
+ }
398
+ if (!scrollDirty) {
399
+ scrollDirty = true;
400
+ const requestUpdate = () => requestAnimationFrame(() => {
401
+ scrollDirty = false;
402
+ _updateVisibleItems(false, true);
403
+ });
404
+ requestUpdate();
405
+ }
406
+ };
407
+ __expose({
408
+ scrollToItem,
409
+ _updateVisibleItems
410
+ });
411
+ return (_ctx, _cache) => {
412
+ return vue.openBlock(), vue.createElementBlock("div", {
413
+ ref_key: "scroller",
414
+ ref: scroller,
415
+ class: vue.normalizeClass(["vue-recycle-scroller", {
416
+ ready: ready.value,
417
+ [`direction-${__props.direction}`]: true
418
+ }]),
419
+ onScrollPassive: handleScroll
420
+ }, [
421
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.listTag), {
422
+ ref: "wrapper",
423
+ style: vue.normalizeStyle({ [__props.direction === "vertical" ? "minHeight" : "minWidth"]: `${vue.unref(totalSize)}px` }),
424
+ class: vue.normalizeClass(["vue-recycle-scroller__item-wrapper", __props.listClass])
425
+ }, {
426
+ default: vue.withCtx(() => [
427
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(pool.value, (view) => {
428
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.itemTag), vue.mergeProps({
429
+ key: view.nr.id,
430
+ style: ready.value ? {
431
+ transform: `translate${__props.direction === "vertical" ? "Y" : "X"}(${view.position}px) translate${__props.direction === "vertical" ? "X" : "Y"}(${view.offset}px)`,
432
+ width: void 0,
433
+ height: void 0
434
+ } : null,
435
+ class: ["vue-recycle-scroller__item-view", [
436
+ __props.itemClass,
437
+ {
438
+ hover: !__props.skipHover && hoverKey.value === view.nr.key
439
+ }
440
+ ]]
441
+ }, vue.toHandlers(__props.skipHover ? {} : {
442
+ mouseenter: () => {
443
+ hoverKey.value = view.nr.key;
444
+ },
445
+ mouseleave: () => {
446
+ hoverKey.value = null;
447
+ }
448
+ })), {
449
+ default: vue.withCtx(() => [
450
+ vue.renderSlot(_ctx.$slots, "default", {
451
+ item: view.item,
452
+ index: view.nr.index,
453
+ active: view.nr.used
454
+ })
455
+ ]),
456
+ _: 2
457
+ }, 1040, ["style", "class"]);
458
+ }), 128))
459
+ ]),
460
+ _: 3
461
+ }, 8, ["style", "class"]))
462
+ ], 34);
463
+ };
464
+ }
465
+ };
466
+ const _sfc_main$2 = {
467
+ name: "DtScrollerItem",
468
+ inject: [
469
+ "vscrollData",
470
+ "vscrollParent",
471
+ "vscrollResizeObserver"
472
+ ],
473
+ props: {
474
+ // eslint-disable-next-line vue/require-prop-types
475
+ item: {
476
+ required: true
477
+ },
478
+ watchData: {
479
+ type: Boolean,
480
+ default: false
481
+ },
482
+ /**
483
+ * Indicates if the view is actively used to display an item.
484
+ */
485
+ active: {
486
+ type: Boolean,
487
+ required: true
488
+ },
489
+ index: {
490
+ type: Number,
491
+ default: void 0
492
+ },
493
+ sizeDependencies: {
494
+ type: [Array, Object],
495
+ default: null
496
+ },
497
+ tag: {
498
+ type: String,
499
+ default: "div"
500
+ }
501
+ },
502
+ computed: {
503
+ id() {
504
+ if (this.vscrollData.simpleArray)
505
+ return this.index;
506
+ if (this.vscrollData.keyField in this.item)
507
+ return this.item[this.vscrollData.keyField];
508
+ throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`);
509
+ },
510
+ size() {
511
+ return this.vscrollData.sizes[this.id] || 0;
512
+ },
513
+ finalActive() {
514
+ return this.active && this.vscrollData.active;
515
+ }
516
+ },
517
+ watch: {
518
+ watchData: "updateWatchData",
519
+ id(value, oldValue) {
520
+ this.$el.$_vs_id = this.id;
521
+ if (!this.size) {
522
+ this.onDataUpdate();
523
+ }
524
+ if (this.$_sizeObserved) {
525
+ const oldSize = this.vscrollData.sizes[oldValue];
526
+ const size = this.vscrollData.sizes[value];
527
+ if (oldSize != null && oldSize !== size) {
528
+ this.applySize(oldSize);
529
+ }
530
+ }
531
+ },
532
+ finalActive(value) {
533
+ if (!this.size) {
534
+ if (value) {
535
+ if (!this.vscrollParent.$_undefinedMap[this.id]) {
536
+ this.vscrollParent.$_undefinedSizes++;
537
+ this.vscrollParent.$_undefinedMap[this.id] = true;
538
+ }
539
+ } else {
540
+ if (this.vscrollParent.$_undefinedMap[this.id]) {
541
+ this.vscrollParent.$_undefinedSizes--;
542
+ this.vscrollParent.$_undefinedMap[this.id] = false;
543
+ }
544
+ }
545
+ }
546
+ if (this.vscrollResizeObserver) {
547
+ if (value) {
548
+ this.observeSize();
549
+ } else {
550
+ this.unobserveSize();
551
+ }
552
+ } else if (value && this.$_pendingVScrollUpdate === this.id) {
553
+ this.updateSize();
554
+ }
555
+ }
556
+ },
557
+ created() {
558
+ if (this.$isServer)
559
+ return;
560
+ this.$_forceNextVScrollUpdate = null;
561
+ this.updateWatchData();
562
+ if (!this.vscrollResizeObserver) {
563
+ for (const k in this.sizeDependencies) {
564
+ this.$watch(() => this.sizeDependencies[k], this.onDataUpdate);
565
+ }
566
+ }
567
+ },
568
+ mounted() {
569
+ if (this.finalActive) {
570
+ this.updateSize();
571
+ this.observeSize();
572
+ }
573
+ },
574
+ beforeUnmount() {
575
+ this.unobserveSize();
576
+ },
577
+ methods: {
578
+ updateSize() {
579
+ if (this.finalActive) {
580
+ if (this.$_pendingSizeUpdate !== this.id) {
581
+ this.$_pendingSizeUpdate = this.id;
582
+ this.$_forceNextVScrollUpdate = null;
583
+ this.$_pendingVScrollUpdate = null;
584
+ this.computeSize(this.id);
585
+ }
586
+ } else {
587
+ this.$_forceNextVScrollUpdate = this.id;
588
+ }
589
+ },
590
+ updateWatchData() {
591
+ if (this.watchData && !this.vscrollResizeObserver) {
592
+ this.$_watchData = this.$watch("item", () => {
593
+ this.onDataUpdate();
594
+ }, {
595
+ deep: true
596
+ });
597
+ } else if (this.$_watchData) {
598
+ this.$_watchData();
599
+ this.$_watchData = null;
600
+ }
601
+ },
602
+ onVscrollUpdate({ force }) {
603
+ if (!this.finalActive && force) {
604
+ this.$_pendingVScrollUpdate = this.id;
605
+ }
606
+ if (this.$_forceNextVScrollUpdate === this.id || force || !this.size) {
607
+ this.updateSize();
608
+ }
609
+ },
610
+ onDataUpdate() {
611
+ this.updateSize();
612
+ },
613
+ computeSize(id) {
614
+ this.$nextTick(() => {
615
+ if (this.id === id) {
616
+ const width = this.$el.offsetWidth;
617
+ const height = this.$el.offsetHeight;
618
+ this.applyWidthHeight(width, height);
619
+ }
620
+ this.$_pendingSizeUpdate = null;
621
+ });
622
+ },
623
+ applyWidthHeight(width, height) {
624
+ const size = ~~(this.vscrollParent.direction === "vertical" ? height : width);
625
+ if (size && this.size !== size) {
626
+ this.applySize(size);
627
+ }
628
+ },
629
+ applySize(size) {
630
+ if (this.vscrollParent.$_undefinedMap[this.id]) {
631
+ this.vscrollParent.$_undefinedSizes--;
632
+ this.vscrollParent.$_undefinedMap[this.id] = void 0;
633
+ }
634
+ this.vscrollData.sizes[this.id] = size;
635
+ },
636
+ observeSize() {
637
+ if (!this.vscrollResizeObserver)
638
+ return;
639
+ if (this.$_sizeObserved)
640
+ return;
641
+ this.vscrollResizeObserver.observe(this.$el);
642
+ this.$el.$_vs_id = this.id;
643
+ this.$el.$_vs_onResize = this.onResize;
644
+ this.$_sizeObserved = true;
645
+ },
646
+ unobserveSize() {
647
+ if (!this.vscrollResizeObserver)
648
+ return;
649
+ if (!this.$_sizeObserved)
650
+ return;
651
+ this.vscrollResizeObserver.unobserve(this.$el);
652
+ this.$el.$_vs_onResize = void 0;
653
+ this.$_sizeObserved = false;
654
+ },
655
+ onResize(id, width, height) {
656
+ if (this.id === id) {
657
+ this.applyWidthHeight(width, height);
658
+ }
659
+ }
660
+ },
661
+ render() {
662
+ return vue.h(this.tag, this.$slots.default());
663
+ }
664
+ };
665
+ const _sfc_main$1 = {
666
+ name: "DynamicScroller",
667
+ components: {
668
+ CoreScroller: _sfc_main$3,
669
+ DtScrollerItem: _sfc_main$2
670
+ },
671
+ provide() {
672
+ if (typeof ResizeObserver !== "undefined") {
673
+ this.$_resizeObserver = new ResizeObserver((entries) => {
674
+ requestAnimationFrame(() => {
675
+ if (!Array.isArray(entries)) {
676
+ return;
677
+ }
678
+ for (const entry of entries) {
679
+ if (entry.target && entry.target.$_vs_onResize) {
680
+ let width, height;
681
+ if (entry.borderBoxSize) {
682
+ const resizeObserverSize = entry.borderBoxSize[0];
683
+ width = resizeObserverSize.inlineSize;
684
+ height = resizeObserverSize.blockSize;
685
+ } else {
686
+ width = entry.contentRect.width;
687
+ height = entry.contentRect.height;
688
+ }
689
+ entry.target.$_vs_onResize(entry.target.$_vs_id, width, height);
690
+ }
691
+ }
692
+ });
693
+ });
694
+ }
695
+ return {
696
+ vscrollData: this.vscrollData,
697
+ vscrollParent: this,
698
+ vscrollResizeObserver: this.$_resizeObserver
699
+ };
700
+ },
701
+ inheritAttrs: false,
702
+ props: {
703
+ /*
704
+ * The items to render.
705
+ * If the items are simple arrays, the index will be used as the key.
706
+ * If the items are objects, the keyField will be used as the key.
707
+ */
708
+ items: {
709
+ type: Array,
710
+ required: true
711
+ },
712
+ /*
713
+ * Indicates if the items are dynamic.
714
+ * If true, the items will be wrapped in a DtScrollerItem component.
715
+ * This is required for dynamic items to be able to react to changes in their size.
716
+ */
717
+ dynamic: {
718
+ type: Boolean,
719
+ default: false
720
+ },
721
+ /*
722
+ * The key field to use for the items.
723
+ * Only used if the items are objects.
724
+ */
725
+ keyField: {
726
+ type: String,
727
+ default: "id"
728
+ },
729
+ /*
730
+ * The direction of the scroller.
731
+ * Can be either 'vertical' or 'horizontal'.
732
+ */
733
+ direction: {
734
+ type: String,
735
+ default: "vertical",
736
+ validator: (value) => ["vertical", "horizontal"].includes(value)
737
+ },
738
+ /*
739
+ * The tag to use for the list.
740
+ */
741
+ listTag: {
742
+ type: String,
743
+ default: "div"
744
+ },
745
+ /*
746
+ * The tag to use for the items.
747
+ */
748
+ itemTag: {
749
+ type: String,
750
+ default: "div"
751
+ },
752
+ /*
753
+ * Display height (or width in horizontal mode) of the items in pixels
754
+ * used to calculate the scroll size and position.
755
+ * Is required for the initial render of items in DYNAMIC size mode.
756
+ */
757
+ minItemSize: {
758
+ type: [Number, String]
759
+ }
760
+ },
761
+ data() {
762
+ return {
763
+ vscrollData: {
764
+ active: true,
765
+ sizes: {},
766
+ keyField: this.keyField,
767
+ simpleArray: false
768
+ }
769
+ };
770
+ },
771
+ computed: {
772
+ simpleArray() {
773
+ return this.items.length && typeof this.items[0] !== "object";
774
+ },
775
+ itemsWithSize() {
776
+ const result = [];
777
+ const { items, keyField, simpleArray } = this;
778
+ const sizes = this.vscrollData.sizes;
779
+ const l = items.length;
780
+ for (let i = 0; i < l; i++) {
781
+ const item = items[i];
782
+ const id = simpleArray ? i : item[keyField];
783
+ let size = sizes[id];
784
+ if (typeof size === "undefined" && !this.$_undefinedMap[id]) {
785
+ size = 0;
786
+ }
787
+ result.push({
788
+ item,
789
+ [keyField]: id,
790
+ size
791
+ });
792
+ }
793
+ return result;
794
+ }
795
+ },
796
+ watch: {
797
+ simpleArray: {
798
+ handler(value) {
799
+ this.vscrollData.simpleArray = value;
800
+ },
801
+ immediate: true
802
+ },
803
+ itemsWithSize(next, prev) {
804
+ const scrollTop = this.$el.scrollTop;
805
+ let prevActiveTop = 0;
806
+ let activeTop = 0;
807
+ const length = Math.min(next.length, prev.length);
808
+ for (let i = 0; i < length; i++) {
809
+ if (prevActiveTop >= scrollTop) {
810
+ break;
811
+ }
812
+ prevActiveTop += prev[i].size || this.minItemSize;
813
+ activeTop += next[i].size || this.minItemSize;
814
+ }
815
+ const offset = activeTop - prevActiveTop;
816
+ if (offset === 0) {
817
+ return;
818
+ }
819
+ this.$el.scrollTop += offset;
820
+ }
821
+ },
822
+ beforeCreate() {
823
+ this.$_updates = [];
824
+ this.$_undefinedSizes = 0;
825
+ this.$_undefinedMap = {};
826
+ },
827
+ activated() {
828
+ this.vscrollData.active = true;
829
+ },
830
+ deactivated() {
831
+ this.vscrollData.active = false;
832
+ },
833
+ methods: {
834
+ dynamicScrollerUpdateItems() {
835
+ const scroller = this.$refs.scroller;
836
+ if (scroller)
837
+ scroller._updateVisibleItems(true);
838
+ },
839
+ dynamicScrollerUpdateItemsFromBottom() {
840
+ const scroller = this.$refs.scroller;
841
+ if (scroller)
842
+ scroller._updateVisibleItems(false, true);
843
+ },
844
+ scrollToItem(index) {
845
+ const scroller = this.$refs.scroller;
846
+ if (scroller)
847
+ scroller.scrollToItem(index);
848
+ },
849
+ scrollToBottom() {
850
+ if (this.$_scrollingToBottom)
851
+ return;
852
+ this.$_scrollingToBottom = true;
853
+ const el = this.$el;
854
+ this.$nextTick(() => {
855
+ el.scrollTop = el.scrollHeight + 5e3;
856
+ const cb = () => {
857
+ el.scrollTop = el.scrollHeight + 5e3;
858
+ requestAnimationFrame(() => {
859
+ el.scrollTop = el.scrollHeight + 5e3;
860
+ if (this.$_undefinedSizes === 0) {
861
+ this.$_scrollingToBottom = false;
862
+ } else {
863
+ requestAnimationFrame(cb);
864
+ }
865
+ });
866
+ };
867
+ requestAnimationFrame(cb);
868
+ });
869
+ }
870
+ }
871
+ };
872
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
873
+ const _component_dt_scroller_item = vue.resolveComponent("dt-scroller-item");
874
+ const _component_core_scroller = vue.resolveComponent("core-scroller");
875
+ return vue.openBlock(), vue.createBlock(_component_core_scroller, vue.mergeProps({
876
+ ref: "scroller",
877
+ items: $options.itemsWithSize,
878
+ "min-item-size": $props.minItemSize,
879
+ direction: $props.direction,
880
+ "key-field": $props.keyField,
881
+ "list-tag": $props.listTag,
882
+ "item-tag": $props.itemTag
883
+ }, _ctx.$attrs), {
884
+ default: vue.withCtx(({ item: itemWithSize, index, active }) => [
885
+ vue.createVNode(_component_dt_scroller_item, {
886
+ item: itemWithSize,
887
+ active,
888
+ "size-dependencies": [
889
+ itemWithSize.message
890
+ ],
891
+ "data-index": index
892
+ }, {
893
+ default: vue.withCtx(() => [
894
+ vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps({
895
+ item: itemWithSize.item,
896
+ index,
897
+ active,
898
+ itemWithSize
899
+ })))
900
+ ]),
901
+ _: 2
902
+ }, 1032, ["item", "active", "size-dependencies", "data-index"])
903
+ ]),
904
+ _: 3
905
+ }, 16, ["items", "min-item-size", "direction", "key-field", "list-tag", "item-tag"]);
906
+ }
907
+ const DynamicScroller = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["render", _sfc_render]]);
908
+ const _sfc_main = {
909
+ __name: "DtScroller",
910
+ props: {
911
+ /**
912
+ * The direction of the scroller.
913
+ * @values vertical, horizontal
914
+ */
915
+ direction: {
916
+ type: String,
917
+ default: "vertical",
918
+ validator: (value) => ["vertical", "horizontal"].includes(value)
919
+ },
920
+ /**
921
+ * Indicates if the items need to react to changes in their size.
922
+ * If disabled the itemSize prop is required and you will get improved performance.
923
+ * If enabled the minItemSize prop is required and you
924
+ * will have reduced performance but the ability to reactively size list items
925
+ * @values true, false
926
+ */
927
+ dynamic: {
928
+ type: Boolean,
929
+ default: false
930
+ },
931
+ /**
932
+ * Display height (or width in horizontal mode) of the items in pixels
933
+ * used to calculate the scroll size and position.
934
+ * Required if DYNAMIC is false
935
+ */
936
+ itemSize: {
937
+ type: Number,
938
+ default: null
939
+ },
940
+ /**
941
+ * The tag to use for the items.
942
+ */
943
+ itemTag: {
944
+ type: String,
945
+ default: "div"
946
+ },
947
+ /**
948
+ * The items to render.
949
+ * If the items are simple arrays, the index will be used as the key.
950
+ * If the items are objects, the keyField will be used as the key.
951
+ * @example items: [ 'item1', 'item2', 'item3' ]
952
+ * @example items: [ { id: 1, name: 'item1' }, { id: 2, name: 'item2' }, { id: 3, name: 'item3' } ]
953
+ */
954
+ items: {
955
+ type: Array,
956
+ required: true
957
+ },
958
+ /**
959
+ * The key field to use for the items.
960
+ * If the items are objects, the scroller needs to be able to identify them.
961
+ * By default it will look for an id field on the items.
962
+ * This can be configured with this prop if you are using another field name.
963
+ */
964
+ keyField: {
965
+ type: String,
966
+ default: "id"
967
+ },
968
+ /**
969
+ * The tag to use for the list.
970
+ */
971
+ listTag: {
972
+ type: String,
973
+ default: "div"
974
+ },
975
+ /**
976
+ * Minimum size used if the height (or width in horizontal mode) of a item is unknown.
977
+ * Is required for the initial render of items in DYNAMIC size mode.
978
+ */
979
+ minItemSize: {
980
+ type: [Number, String],
981
+ default: null
982
+ },
983
+ /**
984
+ * The height of the scroller.
985
+ * Can be a number (in pixels) or a string (in CSS units).
986
+ */
987
+ scrollerHeight: {
988
+ type: [String, Number],
989
+ default: "100%"
990
+ },
991
+ /**
992
+ * The width of the scroller.
993
+ * Can be a number (in pixels) or a string (in CSS units).
994
+ */
995
+ scrollerWidth: {
996
+ type: [String, Number],
997
+ default: "100%"
998
+ }
999
+ },
1000
+ emits: [
1001
+ /**
1002
+ * Describe when the scroller changes from start/middle/end
1003
+ * @param {string} position The position of the scroller.
1004
+ * @values start, middle, end
1005
+ */
1006
+ "user-position"
1007
+ ],
1008
+ setup(__props, { expose: __expose, emit: __emit }) {
1009
+ const props = __props;
1010
+ const emits = __emit;
1011
+ vue.provide("emit", emits);
1012
+ const scroller = vue.ref(null);
1013
+ const computedStyle = vue.computed(() => {
1014
+ return {
1015
+ width: typeof props.scrollerWidth === "number" ? `${props.scrollerWidth}px` : props.scrollerWidth,
1016
+ height: typeof props.scrollerHeight === "number" ? `${props.scrollerHeight}px` : props.scrollerHeight
1017
+ };
1018
+ });
1019
+ vue.watch(props, () => {
1020
+ validateProps();
1021
+ }, { deep: true, immediate: true });
1022
+ function scrollToBottom() {
1023
+ if (scroller.value)
1024
+ scroller.value.scrollToBottom();
1025
+ }
1026
+ function scrollToItem(index) {
1027
+ if (scroller.value)
1028
+ scroller.value.scrollToItem(index);
1029
+ }
1030
+ function updateItems() {
1031
+ if (!scroller.value)
1032
+ return;
1033
+ if (props.dynamic) {
1034
+ scroller.value.dynamicScrollerUpdateItems();
1035
+ } else {
1036
+ scroller.value._updateVisibleItems(true);
1037
+ }
1038
+ }
1039
+ function updateItemsFromBottom() {
1040
+ if (!scroller.value)
1041
+ return;
1042
+ if (props.dynamic) {
1043
+ scroller.value.dynamicScrollerUpdateItemsFromBottom();
1044
+ } else {
1045
+ scroller.value._updateVisibleItems(false, true);
1046
+ }
1047
+ }
1048
+ function validateProps() {
1049
+ if (props.dynamic && !props.minItemSize) {
1050
+ console.error("scroller error: 'minItemSize' is required on 'dynamic' mode.");
1051
+ }
1052
+ if (!props.dynamic && !props.itemSize) {
1053
+ console.error("scroller error: 'itemSize' is required.");
1054
+ }
1055
+ }
1056
+ __expose({
1057
+ scrollToBottom,
1058
+ scrollToItem,
1059
+ updateItems,
1060
+ updateItemsFromBottom
1061
+ });
1062
+ return (_ctx, _cache) => {
1063
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.dynamic ? DynamicScroller : _sfc_main$3), {
1064
+ ref_key: "scroller",
1065
+ ref: scroller,
1066
+ "data-qa": "dt-scroller",
1067
+ items: __props.items,
1068
+ "item-size": __props.itemSize,
1069
+ "min-item-size": __props.minItemSize,
1070
+ direction: __props.direction,
1071
+ "key-field": __props.keyField,
1072
+ "list-tag": __props.listTag,
1073
+ "item-tag": __props.itemTag,
1074
+ style: vue.normalizeStyle(computedStyle.value),
1075
+ tabindex: "0",
1076
+ onUserPosition: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("user-position", $event))
1077
+ }, {
1078
+ default: vue.withCtx(({ item, index, active }) => [
1079
+ vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps({
1080
+ item,
1081
+ index,
1082
+ active
1083
+ })))
1084
+ ]),
1085
+ _: 3
1086
+ }, 40, ["items", "item-size", "min-item-size", "direction", "key-field", "list-tag", "item-tag", "style"]);
1087
+ };
1088
+ }
1089
+ };
1090
+ exports.DtScroller = _sfc_main;
2
1091
  //# sourceMappingURL=scroller.cjs.map