primevue 3.32.2 → 3.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. package/accordion/Accordion.d.ts +21 -2
  2. package/accordion/accordion.cjs.js +3 -3
  3. package/accordion/accordion.esm.js +3 -3
  4. package/accordion/accordion.js +3 -3
  5. package/accordiontab/AccordionTab.d.ts +24 -2
  6. package/autocomplete/AutoComplete.d.ts +24 -2
  7. package/autocomplete/AutoComplete.vue +1 -1
  8. package/autocomplete/autocomplete.cjs.js +5 -5
  9. package/autocomplete/autocomplete.cjs.min.js +1 -1
  10. package/autocomplete/autocomplete.esm.js +5 -5
  11. package/autocomplete/autocomplete.esm.min.js +1 -1
  12. package/autocomplete/autocomplete.js +5 -5
  13. package/autocomplete/autocomplete.min.js +1 -1
  14. package/avatar/Avatar.d.ts +21 -2
  15. package/avatargroup/AvatarGroup.d.ts +8 -2
  16. package/badge/Badge.d.ts +18 -2
  17. package/badgedirective/BadgeDirective.d.ts +12 -2
  18. package/badgedirective/badgedirective.cjs.js +3 -3
  19. package/badgedirective/badgedirective.esm.js +3 -3
  20. package/badgedirective/badgedirective.js +3 -3
  21. package/basecomponent/BaseComponent.vue +20 -22
  22. package/basecomponent/basecomponent.cjs.js +41 -28
  23. package/basecomponent/basecomponent.cjs.min.js +1 -1
  24. package/basecomponent/basecomponent.esm.js +41 -28
  25. package/basecomponent/basecomponent.esm.min.js +1 -1
  26. package/basecomponent/basecomponent.js +41 -28
  27. package/basecomponent/basecomponent.min.js +1 -1
  28. package/basedirective/basedirective.cjs.js +42 -25
  29. package/basedirective/basedirective.cjs.min.js +1 -1
  30. package/basedirective/basedirective.esm.js +42 -25
  31. package/basedirective/basedirective.esm.min.js +1 -1
  32. package/basedirective/basedirective.js +42 -25
  33. package/basedirective/basedirective.min.js +1 -1
  34. package/blockui/BlockUI.d.ts +21 -2
  35. package/breadcrumb/Breadcrumb.d.ts +47 -2
  36. package/breadcrumb/Breadcrumb.vue +7 -2
  37. package/breadcrumb/BreadcrumbItem.vue +28 -3
  38. package/breadcrumb/breadcrumb.cjs.js +35 -8
  39. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  40. package/breadcrumb/breadcrumb.esm.js +36 -9
  41. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  42. package/breadcrumb/breadcrumb.js +35 -8
  43. package/breadcrumb/breadcrumb.min.js +1 -1
  44. package/button/Button.d.ts +24 -2
  45. package/button/button.cjs.js +1 -1
  46. package/button/button.esm.js +1 -1
  47. package/button/button.js +1 -1
  48. package/calendar/Calendar.d.ts +26 -4
  49. package/calendar/Calendar.vue +63 -29
  50. package/calendar/calendar.cjs.js +137 -51
  51. package/calendar/calendar.cjs.min.js +1 -1
  52. package/calendar/calendar.esm.js +137 -51
  53. package/calendar/calendar.esm.min.js +1 -1
  54. package/calendar/calendar.js +137 -51
  55. package/calendar/calendar.min.js +1 -1
  56. package/card/Card.d.ts +8 -2
  57. package/carousel/Carousel.d.ts +24 -2
  58. package/carousel/Carousel.vue +22 -2
  59. package/carousel/carousel.cjs.js +9 -5
  60. package/carousel/carousel.cjs.min.js +1 -1
  61. package/carousel/carousel.esm.js +9 -5
  62. package/carousel/carousel.esm.min.js +1 -1
  63. package/carousel/carousel.js +9 -5
  64. package/carousel/carousel.min.js +1 -1
  65. package/cascadeselect/CascadeSelect.d.ts +21 -2
  66. package/cascadeselect/cascadeselect.cjs.js +3 -3
  67. package/cascadeselect/cascadeselect.esm.js +3 -3
  68. package/cascadeselect/cascadeselect.js +3 -3
  69. package/chart/Chart.d.ts +18 -2
  70. package/chart/chart.cjs.js +3 -3
  71. package/chart/chart.esm.js +3 -3
  72. package/chart/chart.js +3 -3
  73. package/checkbox/Checkbox.d.ts +24 -2
  74. package/checkbox/checkbox.cjs.js +3 -3
  75. package/checkbox/checkbox.esm.js +3 -3
  76. package/checkbox/checkbox.js +3 -3
  77. package/chip/Chip.d.ts +21 -2
  78. package/chips/Chips.d.ts +21 -2
  79. package/chips/chips.cjs.js +3 -3
  80. package/chips/chips.esm.js +3 -3
  81. package/chips/chips.js +3 -3
  82. package/colorpicker/ColorPicker.d.ts +21 -2
  83. package/column/Column.d.ts +24 -2
  84. package/columngroup/ColumnGroup.d.ts +24 -2
  85. package/config/PrimeVue.d.ts +93 -92
  86. package/config/config.cjs.js +4 -3
  87. package/config/config.cjs.min.js +1 -1
  88. package/config/config.esm.js +4 -3
  89. package/config/config.esm.min.js +1 -1
  90. package/config/config.js +4 -3
  91. package/config/config.min.js +1 -1
  92. package/confirmdialog/ConfirmDialog.d.ts +21 -2
  93. package/confirmpopup/ConfirmPopup.d.ts +21 -2
  94. package/confirmpopup/confirmpopup.cjs.js +3 -3
  95. package/confirmpopup/confirmpopup.esm.js +3 -3
  96. package/confirmpopup/confirmpopup.js +3 -3
  97. package/contextmenu/ContextMenu.d.ts +54 -2
  98. package/contextmenu/ContextMenu.vue +13 -7
  99. package/contextmenu/ContextMenuSub.vue +34 -2
  100. package/contextmenu/contextmenu.cjs.js +41 -14
  101. package/contextmenu/contextmenu.cjs.min.js +1 -1
  102. package/contextmenu/contextmenu.esm.js +42 -15
  103. package/contextmenu/contextmenu.esm.min.js +1 -1
  104. package/contextmenu/contextmenu.js +41 -14
  105. package/contextmenu/contextmenu.min.js +1 -1
  106. package/core/core.js +256 -147
  107. package/core/core.min.js +12 -12
  108. package/datatable/BodyCell.vue +14 -4
  109. package/datatable/DataTable.d.ts +41 -3
  110. package/datatable/DataTable.vue +6 -3
  111. package/datatable/TableBody.vue +7 -8
  112. package/datatable/datatable.cjs.js +63 -57
  113. package/datatable/datatable.cjs.min.js +1 -1
  114. package/datatable/datatable.esm.js +63 -57
  115. package/datatable/datatable.esm.min.js +1 -1
  116. package/datatable/datatable.js +63 -57
  117. package/datatable/datatable.min.js +1 -1
  118. package/dataview/DataView.d.ts +21 -2
  119. package/dataviewlayoutoptions/DataViewLayoutOptions.d.ts +21 -2
  120. package/deferredcontent/DeferredContent.d.ts +21 -2
  121. package/dialog/Dialog.d.ts +21 -2
  122. package/dialog/Dialog.vue +2 -2
  123. package/dialog/dialog.cjs.js +7 -5
  124. package/dialog/dialog.cjs.min.js +1 -1
  125. package/dialog/dialog.esm.js +8 -6
  126. package/dialog/dialog.esm.min.js +1 -1
  127. package/dialog/dialog.js +7 -5
  128. package/dialog/dialog.min.js +1 -1
  129. package/divider/Divider.d.ts +18 -2
  130. package/dock/Dock.d.ts +46 -2
  131. package/dock/Dock.vue +5 -0
  132. package/dock/DockSub.vue +20 -1
  133. package/dock/dock.cjs.js +21 -2
  134. package/dock/dock.cjs.min.js +1 -1
  135. package/dock/dock.esm.js +22 -3
  136. package/dock/dock.esm.min.js +1 -1
  137. package/dock/dock.js +21 -2
  138. package/dock/dock.min.js +1 -1
  139. package/dropdown/Dropdown.d.ts +24 -2
  140. package/dropdown/dropdown.cjs.js +6 -6
  141. package/dropdown/dropdown.esm.js +6 -6
  142. package/dropdown/dropdown.js +6 -6
  143. package/editor/Editor.d.ts +22 -2
  144. package/editor/editor.cjs.js +3 -3
  145. package/editor/editor.esm.js +3 -3
  146. package/editor/editor.js +3 -3
  147. package/fieldset/Fieldset.d.ts +21 -2
  148. package/fieldset/fieldset.cjs.js +4 -4
  149. package/fieldset/fieldset.esm.js +4 -4
  150. package/fieldset/fieldset.js +4 -4
  151. package/fileupload/FileContent.vue +8 -6
  152. package/fileupload/FileUpload.d.ts +21 -2
  153. package/fileupload/FileUpload.vue +9 -7
  154. package/fileupload/fileupload.cjs.js +17 -13
  155. package/fileupload/fileupload.cjs.min.js +1 -1
  156. package/fileupload/fileupload.esm.js +17 -13
  157. package/fileupload/fileupload.esm.min.js +1 -1
  158. package/fileupload/fileupload.js +17 -13
  159. package/fileupload/fileupload.min.js +1 -1
  160. package/focustrap/FocusTrap.d.ts +8 -2
  161. package/galleria/Galleria.d.ts +24 -2
  162. package/galleria/galleria.cjs.js +9 -9
  163. package/galleria/galleria.esm.js +9 -9
  164. package/galleria/galleria.js +9 -9
  165. package/image/Image.d.ts +21 -2
  166. package/image/image.cjs.js +3 -3
  167. package/image/image.esm.js +3 -3
  168. package/image/image.js +3 -3
  169. package/inlinemessage/InlineMessage.d.ts +21 -2
  170. package/inplace/Inplace.d.ts +21 -2
  171. package/inplace/inplace.cjs.js +3 -3
  172. package/inplace/inplace.esm.js +3 -3
  173. package/inplace/inplace.js +3 -3
  174. package/inputmask/InputMask.d.ts +21 -2
  175. package/inputmask/InputMask.vue +3 -1
  176. package/inputmask/inputmask.cjs.js +2 -1
  177. package/inputmask/inputmask.cjs.min.js +1 -1
  178. package/inputmask/inputmask.esm.js +2 -1
  179. package/inputmask/inputmask.esm.min.js +1 -1
  180. package/inputmask/inputmask.js +2 -1
  181. package/inputmask/inputmask.min.js +1 -1
  182. package/inputnumber/InputNumber.d.ts +21 -2
  183. package/inputnumber/inputnumber.cjs.js +6 -6
  184. package/inputnumber/inputnumber.esm.js +6 -6
  185. package/inputnumber/inputnumber.js +6 -6
  186. package/inputswitch/InputSwitch.d.ts +21 -2
  187. package/inputswitch/inputswitch.cjs.js +3 -3
  188. package/inputswitch/inputswitch.esm.js +3 -3
  189. package/inputswitch/inputswitch.js +3 -3
  190. package/inputtext/InputText.d.ts +21 -2
  191. package/knob/Knob.d.ts +21 -2
  192. package/listbox/Listbox.d.ts +24 -2
  193. package/listbox/listbox.cjs.js +3 -3
  194. package/listbox/listbox.esm.js +3 -3
  195. package/listbox/listbox.js +3 -3
  196. package/megamenu/MegaMenu.d.ts +58 -2
  197. package/megamenu/MegaMenu.vue +6 -30
  198. package/megamenu/MegaMenuSub.vue +34 -3
  199. package/megamenu/megamenu.cjs.js +36 -39
  200. package/megamenu/megamenu.cjs.min.js +1 -1
  201. package/megamenu/megamenu.esm.js +37 -40
  202. package/megamenu/megamenu.esm.min.js +1 -1
  203. package/megamenu/megamenu.js +36 -39
  204. package/megamenu/megamenu.min.js +1 -1
  205. package/menu/Menu.d.ts +60 -2
  206. package/menu/Menu.vue +6 -1
  207. package/menu/Menuitem.vue +26 -1
  208. package/menu/menu.cjs.js +29 -7
  209. package/menu/menu.cjs.min.js +1 -1
  210. package/menu/menu.esm.js +30 -8
  211. package/menu/menu.esm.min.js +1 -1
  212. package/menu/menu.js +29 -7
  213. package/menu/menu.min.js +1 -1
  214. package/menubar/Menubar.d.ts +62 -2
  215. package/menubar/Menubar.vue +6 -0
  216. package/menubar/MenubarSub.vue +32 -1
  217. package/menubar/menubar.cjs.js +34 -6
  218. package/menubar/menubar.cjs.min.js +1 -1
  219. package/menubar/menubar.esm.js +35 -7
  220. package/menubar/menubar.esm.min.js +1 -1
  221. package/menubar/menubar.js +34 -6
  222. package/menubar/menubar.min.js +1 -1
  223. package/menuitem/MenuItem.d.ts +1 -0
  224. package/message/Message.d.ts +21 -2
  225. package/message/message.cjs.js +3 -3
  226. package/message/message.esm.js +3 -3
  227. package/message/message.js +3 -3
  228. package/multiselect/MultiSelect.d.ts +24 -2
  229. package/multiselect/multiselect.cjs.js +6 -6
  230. package/multiselect/multiselect.esm.js +6 -6
  231. package/multiselect/multiselect.js +6 -6
  232. package/orderlist/OrderList.d.ts +24 -2
  233. package/orderlist/OrderList.vue +7 -5
  234. package/orderlist/orderlist.cjs.js +10 -8
  235. package/orderlist/orderlist.cjs.min.js +1 -1
  236. package/orderlist/orderlist.esm.js +10 -8
  237. package/orderlist/orderlist.esm.min.js +1 -1
  238. package/orderlist/orderlist.js +10 -8
  239. package/orderlist/orderlist.min.js +1 -1
  240. package/organizationchart/OrganizationChart.d.ts +24 -2
  241. package/organizationchart/organizationchart.cjs.js +4 -4
  242. package/organizationchart/organizationchart.esm.js +4 -4
  243. package/organizationchart/organizationchart.js +4 -4
  244. package/overlaypanel/OverlayPanel.d.ts +21 -2
  245. package/overlaypanel/overlaypanel.cjs.js +3 -3
  246. package/overlaypanel/overlaypanel.esm.js +3 -3
  247. package/overlaypanel/overlaypanel.js +3 -3
  248. package/package.json +1 -1
  249. package/paginator/FirstPageLink.vue +1 -1
  250. package/paginator/JumpToPageDropdown.vue +1 -0
  251. package/paginator/LastPageLink.vue +1 -1
  252. package/paginator/NextPageLink.vue +1 -1
  253. package/paginator/Paginator.d.ts +24 -2
  254. package/paginator/PrevPageLink.vue +1 -1
  255. package/paginator/RowsPerPageDropdown.vue +1 -0
  256. package/paginator/paginator.cjs.js +19 -9
  257. package/paginator/paginator.cjs.min.js +1 -1
  258. package/paginator/paginator.esm.js +19 -9
  259. package/paginator/paginator.esm.min.js +1 -1
  260. package/paginator/paginator.js +19 -9
  261. package/paginator/paginator.min.js +1 -1
  262. package/panel/Panel.d.ts +21 -2
  263. package/panel/panel.cjs.js +3 -3
  264. package/panel/panel.esm.js +3 -3
  265. package/panel/panel.js +3 -3
  266. package/panelmenu/PanelMenu.d.ts +58 -2
  267. package/panelmenu/PanelMenu.vue +6 -0
  268. package/panelmenu/PanelMenuList.vue +1 -0
  269. package/panelmenu/PanelMenuSub.vue +33 -1
  270. package/panelmenu/panelmenu.cjs.js +41 -12
  271. package/panelmenu/panelmenu.cjs.min.js +1 -1
  272. package/panelmenu/panelmenu.esm.js +42 -13
  273. package/panelmenu/panelmenu.esm.min.js +1 -1
  274. package/panelmenu/panelmenu.js +41 -12
  275. package/panelmenu/panelmenu.min.js +1 -1
  276. package/passthrough/index.cjs.js +15 -9
  277. package/passthrough/index.cjs.min.js +1 -1
  278. package/passthrough/index.d.ts +4 -4
  279. package/passthrough/index.esm.js +15 -9
  280. package/passthrough/index.esm.min.js +1 -1
  281. package/passthrough/index.js +15 -9
  282. package/passthrough/index.min.js +1 -1
  283. package/passthrough/tailwind/index.cjs.js +3 -3
  284. package/passthrough/tailwind/index.cjs.min.js +1 -1
  285. package/passthrough/tailwind/index.esm.js +3 -3
  286. package/passthrough/tailwind/index.esm.min.js +1 -1
  287. package/passthrough/tailwind/index.js +3 -3
  288. package/passthrough/tailwind/index.min.js +1 -1
  289. package/password/Password.d.ts +21 -2
  290. package/password/password.cjs.js +3 -3
  291. package/password/password.esm.js +3 -3
  292. package/password/password.js +3 -3
  293. package/picklist/PickList.d.ts +24 -2
  294. package/picklist/PickList.vue +8 -5
  295. package/picklist/picklist.cjs.js +10 -8
  296. package/picklist/picklist.cjs.min.js +1 -1
  297. package/picklist/picklist.esm.js +10 -8
  298. package/picklist/picklist.esm.min.js +1 -1
  299. package/picklist/picklist.js +10 -8
  300. package/picklist/picklist.min.js +1 -1
  301. package/progressbar/ProgressBar.d.ts +18 -2
  302. package/progressspinner/ProgressSpinner.d.ts +18 -2
  303. package/radiobutton/RadioButton.d.ts +21 -2
  304. package/radiobutton/radiobutton.cjs.js +3 -3
  305. package/radiobutton/radiobutton.esm.js +3 -3
  306. package/radiobutton/radiobutton.js +3 -3
  307. package/rating/Rating.d.ts +24 -2
  308. package/ripple/Ripple.d.ts +8 -2
  309. package/row/Row.d.ts +16 -0
  310. package/scrollpanel/ScrollPanel.d.ts +21 -2
  311. package/scrolltop/ScrollTop.d.ts +21 -2
  312. package/selectbutton/SelectButton.d.ts +24 -2
  313. package/sidebar/Sidebar.d.ts +21 -2
  314. package/sidebar/sidebar.cjs.js +3 -3
  315. package/sidebar/sidebar.esm.js +3 -3
  316. package/sidebar/sidebar.js +3 -3
  317. package/skeleton/Skeleton.d.ts +18 -2
  318. package/slider/Slider.d.ts +18 -2
  319. package/speeddial/SpeedDial.d.ts +24 -2
  320. package/speeddial/speeddial.cjs.js +4 -4
  321. package/speeddial/speeddial.esm.js +4 -4
  322. package/speeddial/speeddial.js +4 -4
  323. package/splitbutton/SplitButton.d.ts +35 -2
  324. package/splitbutton/SplitButton.vue +6 -2
  325. package/splitbutton/splitbutton.cjs.js +17 -9
  326. package/splitbutton/splitbutton.cjs.min.js +1 -1
  327. package/splitbutton/splitbutton.esm.js +18 -10
  328. package/splitbutton/splitbutton.esm.min.js +1 -1
  329. package/splitbutton/splitbutton.js +17 -9
  330. package/splitbutton/splitbutton.min.js +1 -1
  331. package/splitter/Splitter.d.ts +24 -2
  332. package/splitterpanel/SplitterPanel.d.ts +21 -2
  333. package/steps/Steps.d.ts +51 -2
  334. package/steps/Steps.vue +31 -1
  335. package/steps/steps.cjs.js +31 -3
  336. package/steps/steps.cjs.min.js +1 -1
  337. package/steps/steps.esm.js +31 -3
  338. package/steps/steps.esm.min.js +1 -1
  339. package/steps/steps.js +32 -4
  340. package/steps/steps.min.js +1 -1
  341. package/styleclass/StyleClass.d.ts +8 -2
  342. package/tabmenu/TabMenu.d.ts +50 -2
  343. package/tabmenu/TabMenu.vue +27 -1
  344. package/tabmenu/tabmenu.cjs.js +26 -3
  345. package/tabmenu/tabmenu.cjs.min.js +1 -1
  346. package/tabmenu/tabmenu.esm.js +26 -3
  347. package/tabmenu/tabmenu.esm.min.js +1 -1
  348. package/tabmenu/tabmenu.js +27 -4
  349. package/tabmenu/tabmenu.min.js +1 -1
  350. package/tabpanel/TabPanel.d.ts +24 -2
  351. package/tabview/TabView.d.ts +8 -2
  352. package/tabview/tabview.cjs.js +3 -3
  353. package/tabview/tabview.esm.js +3 -3
  354. package/tabview/tabview.js +3 -3
  355. package/tag/Tag.d.ts +18 -2
  356. package/terminal/Terminal.d.ts +21 -2
  357. package/textarea/Textarea.d.ts +21 -2
  358. package/tieredmenu/TieredMenu.d.ts +58 -2
  359. package/tieredmenu/TieredMenu.vue +6 -0
  360. package/tieredmenu/TieredMenuSub.vue +33 -1
  361. package/tieredmenu/tieredmenu.cjs.js +35 -7
  362. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  363. package/tieredmenu/tieredmenu.esm.js +36 -8
  364. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  365. package/tieredmenu/tieredmenu.js +35 -7
  366. package/tieredmenu/tieredmenu.min.js +1 -1
  367. package/timeline/Timeline.d.ts +21 -2
  368. package/toast/Toast.d.ts +21 -2
  369. package/toast/toast.cjs.js +7 -7
  370. package/toast/toast.esm.js +7 -7
  371. package/toast/toast.js +7 -7
  372. package/togglebutton/ToggleButton.d.ts +24 -2
  373. package/togglebutton/ToggleButton.vue +4 -4
  374. package/togglebutton/togglebutton.cjs.js +7 -7
  375. package/togglebutton/togglebutton.cjs.min.js +1 -1
  376. package/togglebutton/togglebutton.esm.js +7 -7
  377. package/togglebutton/togglebutton.esm.min.js +1 -1
  378. package/togglebutton/togglebutton.js +7 -7
  379. package/togglebutton/togglebutton.min.js +1 -1
  380. package/toolbar/Toolbar.d.ts +18 -2
  381. package/tooltip/Tooltip.d.ts +12 -2
  382. package/tooltip/tooltip.cjs.js +2 -2
  383. package/tooltip/tooltip.esm.js +2 -2
  384. package/tooltip/tooltip.js +2 -2
  385. package/tree/Tree.d.ts +24 -2
  386. package/tree/Tree.vue +1 -1
  387. package/tree/tree.cjs.js +7 -7
  388. package/tree/tree.cjs.min.js +1 -1
  389. package/tree/tree.esm.js +7 -7
  390. package/tree/tree.esm.min.js +1 -1
  391. package/tree/tree.js +7 -7
  392. package/tree/tree.min.js +1 -1
  393. package/treeselect/TreeSelect.d.ts +21 -2
  394. package/treeselect/treeselect.cjs.js +6 -6
  395. package/treeselect/treeselect.esm.js +6 -6
  396. package/treeselect/treeselect.js +6 -6
  397. package/treetable/BodyCell.vue +1 -1
  398. package/treetable/TreeTable.d.ts +24 -2
  399. package/treetable/TreeTableRow.vue +1 -1
  400. package/treetable/treetable.cjs.js +22 -20
  401. package/treetable/treetable.cjs.min.js +1 -1
  402. package/treetable/treetable.esm.js +22 -20
  403. package/treetable/treetable.esm.min.js +1 -1
  404. package/treetable/treetable.js +22 -20
  405. package/treetable/treetable.min.js +1 -1
  406. package/tristatecheckbox/TriStateCheckbox.d.ts +24 -2
  407. package/tristatecheckbox/tristatecheckbox.cjs.js +3 -3
  408. package/tristatecheckbox/tristatecheckbox.esm.js +3 -3
  409. package/tristatecheckbox/tristatecheckbox.js +3 -3
  410. package/ts-helpers.d.ts +2 -2
  411. package/utils/utils.cjs.js +30 -20
  412. package/utils/utils.cjs.min.js +1 -1
  413. package/utils/utils.esm.js +30 -20
  414. package/utils/utils.esm.min.js +1 -1
  415. package/utils/utils.js +30 -20
  416. package/utils/utils.min.js +1 -1
  417. package/vetur-attributes.json +1 -1
  418. package/virtualscroller/BaseVirtualScroller.vue +3 -3
  419. package/virtualscroller/VirtualScroller.d.ts +21 -2
  420. package/virtualscroller/virtualscroller.cjs.js +6 -6
  421. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  422. package/virtualscroller/virtualscroller.esm.js +6 -6
  423. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  424. package/virtualscroller/virtualscroller.js +6 -6
  425. package/virtualscroller/virtualscroller.min.js +1 -1
  426. package/web-types.json +13 -3
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.dialog=function(e,t,n,o,i,a,l,r,s,d){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=c(e),p=c(t),u=c(n),f=c(o),g=c(i),h=c(a),b=c(s),v=d.useStyle("\n.p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n}\n\n.p-dialog {\n max-height: 90%;\n transform: scale(1);\n}\n\n.p-dialog-content {\n overflow-y: auto;\n}\n\n.p-dialog-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n}\n\n.p-dialog-footer {\n flex-shrink: 0;\n}\n\n.p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n}\n\n.p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n/* Fluid */\n.p-fluid .p-dialog-footer .p-button {\n width: auto;\n}\n\n/* Animation */\n/* Center */\n.p-dialog-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-dialog-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-dialog-enter-from,\n.p-dialog-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n\n/* Top, Bottom, Left, Right, Top* and Bottom* */\n.p-dialog-top .p-dialog,\n.p-dialog-bottom .p-dialog,\n.p-dialog-left .p-dialog,\n.p-dialog-right .p-dialog,\n.p-dialog-topleft .p-dialog,\n.p-dialog-topright .p-dialog,\n.p-dialog-bottomleft .p-dialog,\n.p-dialog-bottomright .p-dialog {\n margin: 0.75rem;\n transform: translate3d(0px, 0px, 0px);\n}\n.p-dialog-top .p-dialog-enter-active,\n.p-dialog-top .p-dialog-leave-active,\n.p-dialog-bottom .p-dialog-enter-active,\n.p-dialog-bottom .p-dialog-leave-active,\n.p-dialog-left .p-dialog-enter-active,\n.p-dialog-left .p-dialog-leave-active,\n.p-dialog-right .p-dialog-enter-active,\n.p-dialog-right .p-dialog-leave-active,\n.p-dialog-topleft .p-dialog-enter-active,\n.p-dialog-topleft .p-dialog-leave-active,\n.p-dialog-topright .p-dialog-enter-active,\n.p-dialog-topright .p-dialog-leave-active,\n.p-dialog-bottomleft .p-dialog-enter-active,\n.p-dialog-bottomleft .p-dialog-leave-active,\n.p-dialog-bottomright .p-dialog-enter-active,\n.p-dialog-bottomright .p-dialog-leave-active {\n transition: all 0.3s ease-out;\n}\n.p-dialog-top .p-dialog-enter-from,\n.p-dialog-top .p-dialog-leave-to {\n transform: translate3d(0px, -100%, 0px);\n}\n.p-dialog-bottom .p-dialog-enter-from,\n.p-dialog-bottom .p-dialog-leave-to {\n transform: translate3d(0px, 100%, 0px);\n}\n.p-dialog-left .p-dialog-enter-from,\n.p-dialog-left .p-dialog-leave-to,\n.p-dialog-topleft .p-dialog-enter-from,\n.p-dialog-topleft .p-dialog-leave-to,\n.p-dialog-bottomleft .p-dialog-enter-from,\n.p-dialog-bottomleft .p-dialog-leave-to {\n transform: translate3d(-100%, 0px, 0px);\n}\n.p-dialog-right .p-dialog-enter-from,\n.p-dialog-right .p-dialog-leave-to,\n.p-dialog-topright .p-dialog-enter-from,\n.p-dialog-topright .p-dialog-leave-to,\n.p-dialog-bottomright .p-dialog-enter-from,\n.p-dialog-bottomright .p-dialog-leave-to {\n transform: translate3d(100%, 0px, 0px);\n}\n\n/* Maximize */\n.p-dialog-maximized {\n -webkit-transition: none;\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n top: 0px !important;\n left: 0px !important;\n max-height: 100%;\n height: 100%;\n}\n.p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n}\n\n.p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n}\n",{name:"dialog",manual:!0}),y={name:"Dialog",extends:{name:"BaseDialog",extends:b.default,props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:void 0},maximizeIcon:{type:String,default:void 0},minimizeIcon:{type:String,default:void 0},closeButtonProps:{type:null,default:null},_instance:null},css:{classes:{mask:function(e){var t=e.props,n=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find((function(e){return e===t.position}));return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":t.modal},n?"p-dialog-".concat(n):""]},root:function(e){var t=e.props,n=e.instance;return["p-dialog p-component",{"p-dialog-rtl":t.rtl,"p-dialog-maximized":t.maximizable&&n.maximized,"p-input-filled":"filled"===n.$primevue.config.inputStyle,"p-ripple-disabled":!1===n.$primevue.config.ripple}]},header:"p-dialog-header",headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",maximizableIcon:"p-dialog-header-maximize-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",closeButtonIcon:"p-dialog-header-close-icon",content:"p-dialog-content",footer:"p-dialog-footer"},inlineStyles:{mask:function(e){var t=e.position;return{position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t||"topleft"===t||"bottomleft"===t?"flex-start":"right"===t||"topright"===t||"bottomright"===t?"flex-end":"center",alignItems:"top"===t||"topleft"===t||"topright"===t?"flex-start":"bottom"===t||"bottomleft"===t||"bottomright"===t?"flex-end":"center",pointerEvents:e.modal?"auto":"none"}},root:{display:"flex",flexDirection:"column",pointerEvents:"auto"}},loadStyle:v.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],provide:function(){var e=this;return{dialogRef:r.computed((function(){return e._instance}))}},data:function(){return{containerVisible:this.visible,maximized:!1,focusableMax:null,focusableClose:null}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&l.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},mounted:function(){this.breakpoints&&this.createStyle()},methods:{close:function(){this.$emit("update:visible",!1)},onBeforeEnter:function(e){e.setAttribute(this.attributeSelector,"")},onEnter:function(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&l.ZIndexUtils.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&l.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide"),this.focusableClose=null,this.focusableMax=null},onAfterLeave:function(){this.autoZIndex&&l.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissableMask&&this.modal&&this.mask===e.target&&this.close()},focus:function(){var e=function(e){return e&&e.querySelector("[autofocus]")},t=this.$slots.footer&&e(this.footerContainer);t||(t=this.$slots.header&&e(this.headerContainer))||(t=this.$slots.default&&e(this.content))||(this.maximizable?(this.focusableMax=!0,t=this.maximizableButton):(this.focusableClose=!0,t=this.closeButton)),t&&l.DomHandler.focus(t)},maximize:function(e){this.maximized?(this.maximized=!1,this.$emit("unmaximize",e)):(this.maximized=!0,this.$emit("maximize",e)),this.modal||(this.maximized?l.DomHandler.addClass(document.body,"p-overflow-hidden"):l.DomHandler.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings:function(){(this.modal||this.maximizable&&this.maximized)&&l.DomHandler.addClass(document.body,"p-overflow-hidden")},unbindDocumentState:function(){(this.modal||this.maximizable&&this.maximized)&&l.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeyDown:function(e){"Escape"===e.code&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener:function(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener:function(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},footerContainerRef:function(e){this.footerContainer=e},maximizableRef:function(e){this.maximizableButton=e},closeButtonRef:function(e){this.closeButton=e},createStyle:function(){if(!this.styleElement&&!this.isUnstyled){var e;this.styleElement=document.createElement("style"),this.styleElement.type="text/css",l.DomHandler.setAttribute(this.styleElement,"nonce",null===(e=this.$primevue)||void 0===e||null===(e=e.config)||void 0===e||null===(e=e.csp)||void 0===e?void 0:e.nonce),document.head.appendChild(this.styleElement);var t="";for(var n in this.breakpoints)t+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(this.attributeSelector,"] {\n width: ").concat(this.breakpoints[n]," !important;\n }\n }\n ");this.styleElement.innerHTML=t}},destroyStyle:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag:function(e){l.DomHandler.findSingle(e.target,'[data-pc-section="headeraction"]')||l.DomHandler.findSingle(e.target.parentElement,'[data-pc-section="headeraction"]')||this.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",!this.isUnstyled&&l.DomHandler.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners:function(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners:function(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener:function(){var e=this;this.documentDragListener=function(t){if(e.dragging){var n=l.DomHandler.getOuterWidth(e.container),o=l.DomHandler.getOuterHeight(e.container),i=t.pageX-e.lastPageX,a=t.pageY-e.lastPageY,r=e.container.getBoundingClientRect(),s=r.left+i,d=r.top+a,c=l.DomHandler.getViewport(),m=getComputedStyle(e.container),p=parseFloat(m.marginLeft),u=parseFloat(m.marginTop);e.container.style.position="fixed",e.keepInViewport?(s>=e.minX&&s+n<c.width&&(e.lastPageX=t.pageX,e.container.style.left=s-p+"px"),d>=e.minY&&d+o<c.height&&(e.lastPageY=t.pageY,e.container.style.top=d-u+"px")):(e.lastPageX=t.pageX,e.container.style.left=s-p+"px",e.lastPageY=t.pageY,e.container.style.top=d-u+"px")}},window.document.addEventListener("mousemove",this.documentDragListener)},unbindDocumentDragListener:function(){this.documentDragListener&&(window.document.removeEventListener("mousemove",this.documentDragListener),this.documentDragListener=null)},bindDocumentDragEndListener:function(){var e=this;this.documentDragEndListener=function(t){e.dragging&&(e.dragging=!1,!e.isUnstyled&&l.DomHandler.removeClass(document.body,"p-unselectable-text"),e.$emit("dragend",t))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener:function(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maximizeIconComponent:function(){return this.maximized?this.minimizeIcon?"span":"WindowMinimizeIcon":this.maximizeIcon?"span":"WindowMaximizeIcon"},ariaId:function(){return l.UniqueComponentId()},ariaLabelledById:function(){return null!=this.header||null!==this.$attrs["aria-labelledby"]?this.ariaId+"_header":null},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector:function(){return l.UniqueComponentId()},contentStyleClass:function(){return["p-dialog-content",this.contentClass]}},directives:{ripple:h.default,focustrap:m.default},components:{Portal:g.default,WindowMinimizeIcon:f.default,WindowMaximizeIcon:u.default,TimesIcon:p.default}};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k(e,t,n){return(t=B(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){var t=z(e,"string");return"symbol"===x(t)?t:String(t)}function z(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==x(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var L=["aria-labelledby","aria-modal"],C=["id"],E=["autofocus","tabindex"],I=["autofocus","aria-label"];return y.render=function(e,t,n,o,i,a){var l=r.resolveComponent("Portal"),s=r.resolveDirective("ripple"),d=r.resolveDirective("focustrap");return r.openBlock(),r.createBlock(l,{appendTo:e.appendTo},{default:r.withCtx((function(){return[i.containerVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:a.maskRef,class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position,modal:e.modal}),onClick:t[3]||(t[3]=function(){return a.onMaskClick&&a.onMaskClick.apply(a,arguments)})},e.ptm("mask")),[r.createVNode(r.Transition,r.mergeProps({name:"p-dialog",onBeforeEnter:a.onBeforeEnter,onEnter:a.onEnter,onBeforeLeave:a.onBeforeLeave,onLeave:a.onLeave,onAfterLeave:a.onAfterLeave,appear:""},e.ptm("transition")),{default:r.withCtx((function(){return[e.visible?r.withDirectives((r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:a.containerRef,class:e.cx("root"),style:e.sx("root"),role:"dialog","aria-labelledby":a.ariaLabelledById,"aria-modal":e.modal},w(w({},e.$attrs),e.ptm("root"))),[e.showHeader?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:a.headerContainerRef,class:e.cx("header"),onMousedown:t[2]||(t[2]=function(){return a.initDrag&&a.initDrag.apply(a,arguments)})},e.ptm("header")),[r.renderSlot(e.$slots,"header",{},(function(){return[e.header?(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,id:a.ariaLabelledById,class:e.cx("headerTitle")},e.ptm("headerTitle")),r.toDisplayString(e.header),17,C)):r.createCommentVNode("",!0)]})),r.createElementVNode("div",r.mergeProps({class:e.cx("headerIcons")},e.ptm("headerIcons")),[e.maximizable?r.withDirectives((r.openBlock(),r.createElementBlock("button",r.mergeProps({key:0,ref:a.maximizableRef,autofocus:i.focusableMax,class:e.cx("maximizableButton"),onClick:t[0]||(t[0]=function(){return a.maximize&&a.maximize.apply(a,arguments)}),type:"button",tabindex:e.maximizable?"0":"-1"},e.ptm("maximizableButton"),{"data-pc-group-section":"headericon"}),[r.renderSlot(e.$slots,"maximizeicon",{maximized:i.maximized,class:r.normalizeClass(e.cx("maximizableIcon"))},(function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(a.maximizeIconComponent),r.mergeProps({class:[e.cx("maximizableIcon"),i.maximized?e.minimizeIcon:e.maximizeIcon]},e.ptm("maximizableIcon")),null,16,["class"]))]}))],16,E)),[[s]]):r.createCommentVNode("",!0),e.closable?r.withDirectives((r.openBlock(),r.createElementBlock("button",r.mergeProps({key:1,ref:a.closeButtonRef,autofocus:i.focusableClose,class:e.cx("closeButton"),onClick:t[1]||(t[1]=function(){return a.close&&a.close.apply(a,arguments)}),"aria-label":a.closeAriaLabel,type:"button"},w(w({},e.closeButtonProps),e.ptm("closeButton")),{"data-pc-group-section":"headericon"}),[r.renderSlot(e.$slots,"closeicon",{class:r.normalizeClass(e.cx("closeButtonIcon"))},(function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),r.mergeProps({class:[e.cx("closeButtonIcon"),e.closeIcon]},e.ptm("closeButtonIcon")),null,16,["class"]))]}))],16,I)),[[s]]):r.createCommentVNode("",!0)],16)],16)):r.createCommentVNode("",!0),r.createElementVNode("div",r.mergeProps({ref:a.contentRef,class:[e.cx("content"),e.contentClass],style:e.contentStyle},w(w({},e.contentProps),e.ptm("content"))),[r.renderSlot(e.$slots,"default")],16),e.footer||e.$slots.footer?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:1,ref:a.footerContainerRef,class:e.cx("footer")},e.ptm("footer")),[r.renderSlot(e.$slots,"footer",{},(function(){return[r.createTextVNode(r.toDisplayString(e.footer),1)]}))],16)):r.createCommentVNode("",!0)],16,L)),[[d,{disabled:!e.modal}]]):r.createCommentVNode("",!0)]})),_:3},16,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):r.createCommentVNode("",!0)]})),_:3},8,["appendTo"])},y}(primevue.focustrap,primevue.icons.times,primevue.icons.windowmaximize,primevue.icons.windowminimize,primevue.portal,primevue.ripple,primevue.utils,Vue,primevue.basecomponent,primevue.usestyle);
1
+ this.primevue=this.primevue||{},this.primevue.dialog=function(e,t,n,o,i,a,l,r,s,d){"use strict";function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=c(e),p=c(t),u=c(n),f=c(o),g=c(i),h=c(a),b=c(s),v=d.useStyle("\n.p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n}\n\n.p-dialog {\n max-height: 90%;\n transform: scale(1);\n}\n\n.p-dialog-content {\n overflow-y: auto;\n}\n\n.p-dialog-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-shrink: 0;\n}\n\n.p-dialog-footer {\n flex-shrink: 0;\n}\n\n.p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n}\n\n.p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n}\n\n/* Fluid */\n.p-fluid .p-dialog-footer .p-button {\n width: auto;\n}\n\n/* Animation */\n/* Center */\n.p-dialog-enter-active {\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n}\n.p-dialog-leave-active {\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n}\n.p-dialog-enter-from,\n.p-dialog-leave-to {\n opacity: 0;\n transform: scale(0.7);\n}\n\n/* Top, Bottom, Left, Right, Top* and Bottom* */\n.p-dialog-top .p-dialog,\n.p-dialog-bottom .p-dialog,\n.p-dialog-left .p-dialog,\n.p-dialog-right .p-dialog,\n.p-dialog-topleft .p-dialog,\n.p-dialog-topright .p-dialog,\n.p-dialog-bottomleft .p-dialog,\n.p-dialog-bottomright .p-dialog {\n margin: 0.75rem;\n transform: translate3d(0px, 0px, 0px);\n}\n.p-dialog-top .p-dialog-enter-active,\n.p-dialog-top .p-dialog-leave-active,\n.p-dialog-bottom .p-dialog-enter-active,\n.p-dialog-bottom .p-dialog-leave-active,\n.p-dialog-left .p-dialog-enter-active,\n.p-dialog-left .p-dialog-leave-active,\n.p-dialog-right .p-dialog-enter-active,\n.p-dialog-right .p-dialog-leave-active,\n.p-dialog-topleft .p-dialog-enter-active,\n.p-dialog-topleft .p-dialog-leave-active,\n.p-dialog-topright .p-dialog-enter-active,\n.p-dialog-topright .p-dialog-leave-active,\n.p-dialog-bottomleft .p-dialog-enter-active,\n.p-dialog-bottomleft .p-dialog-leave-active,\n.p-dialog-bottomright .p-dialog-enter-active,\n.p-dialog-bottomright .p-dialog-leave-active {\n transition: all 0.3s ease-out;\n}\n.p-dialog-top .p-dialog-enter-from,\n.p-dialog-top .p-dialog-leave-to {\n transform: translate3d(0px, -100%, 0px);\n}\n.p-dialog-bottom .p-dialog-enter-from,\n.p-dialog-bottom .p-dialog-leave-to {\n transform: translate3d(0px, 100%, 0px);\n}\n.p-dialog-left .p-dialog-enter-from,\n.p-dialog-left .p-dialog-leave-to,\n.p-dialog-topleft .p-dialog-enter-from,\n.p-dialog-topleft .p-dialog-leave-to,\n.p-dialog-bottomleft .p-dialog-enter-from,\n.p-dialog-bottomleft .p-dialog-leave-to {\n transform: translate3d(-100%, 0px, 0px);\n}\n.p-dialog-right .p-dialog-enter-from,\n.p-dialog-right .p-dialog-leave-to,\n.p-dialog-topright .p-dialog-enter-from,\n.p-dialog-topright .p-dialog-leave-to,\n.p-dialog-bottomright .p-dialog-enter-from,\n.p-dialog-bottomright .p-dialog-leave-to {\n transform: translate3d(100%, 0px, 0px);\n}\n\n/* Maximize */\n.p-dialog-maximized {\n -webkit-transition: none;\n transition: none;\n transform: none;\n width: 100vw !important;\n height: 100vh !important;\n top: 0px !important;\n left: 0px !important;\n max-height: 100%;\n height: 100%;\n}\n.p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n}\n\n.p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n}\n",{name:"dialog",manual:!0}),y={name:"Dialog",extends:{name:"BaseDialog",extends:b.default,props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:void 0},maximizeIcon:{type:String,default:void 0},minimizeIcon:{type:String,default:void 0},closeButtonProps:{type:null,default:null},_instance:null},css:{classes:{mask:function(e){var t=e.props,n=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find((function(e){return e===t.position}));return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":t.modal},n?"p-dialog-".concat(n):""]},root:function(e){var t=e.props,n=e.instance;return["p-dialog p-component",{"p-dialog-rtl":t.rtl,"p-dialog-maximized":t.maximizable&&n.maximized,"p-input-filled":"filled"===n.$primevue.config.inputStyle,"p-ripple-disabled":!1===n.$primevue.config.ripple}]},header:"p-dialog-header",headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",maximizableIcon:"p-dialog-header-maximize-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",closeButtonIcon:"p-dialog-header-close-icon",content:"p-dialog-content",footer:"p-dialog-footer"},inlineStyles:{mask:function(e){var t=e.position;return{position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t||"topleft"===t||"bottomleft"===t?"flex-start":"right"===t||"topright"===t||"bottomright"===t?"flex-end":"center",alignItems:"top"===t||"topleft"===t||"topright"===t?"flex-start":"bottom"===t||"bottomleft"===t||"bottomright"===t?"flex-end":"center",pointerEvents:e.modal?"auto":"none"}},root:{display:"flex",flexDirection:"column",pointerEvents:"auto"}},loadStyle:v.load},provide:function(){return{$parentInstance:this}}},inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],provide:function(){var e=this;return{dialogRef:r.computed((function(){return e._instance}))}},data:function(){return{containerVisible:this.visible,maximized:!1,focusableMax:null,focusableClose:null}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated:function(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount:function(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&l.ZIndexUtils.clear(this.mask),this.container=null,this.mask=null},mounted:function(){this.breakpoints&&this.createStyle()},methods:{close:function(){this.$emit("update:visible",!1)},onBeforeEnter:function(e){e.setAttribute(this.attributeSelector,"")},onEnter:function(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&l.ZIndexUtils.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave:function(){this.modal&&!this.isUnstyled&&l.DomHandler.addClass(this.mask,"p-component-overlay-leave")},onLeave:function(){this.$emit("hide"),this.focusableClose=null,this.focusableMax=null},onAfterLeave:function(){this.autoZIndex&&l.ZIndexUtils.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick:function(e){this.dismissableMask&&this.modal&&this.mask===e.target&&this.close()},focus:function(){var e=function(e){return e&&e.querySelector("[autofocus]")},t=this.$slots.footer&&e(this.footerContainer);t||(t=this.$slots.header&&e(this.headerContainer))||(t=this.$slots.default&&e(this.content))||(this.maximizable?(this.focusableMax=!0,t=this.maximizableButton):(this.focusableClose=!0,t=this.closeButton)),t&&l.DomHandler.focus(t)},maximize:function(e){this.maximized?(this.maximized=!1,this.$emit("unmaximize",e)):(this.maximized=!0,this.$emit("maximize",e)),this.modal||(this.maximized?l.DomHandler.addClass(document.body,"p-overflow-hidden"):l.DomHandler.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings:function(){(this.modal||this.maximizable&&this.maximized)&&l.DomHandler.addClass(document.body,"p-overflow-hidden")},unbindDocumentState:function(){(this.modal||this.maximizable&&this.maximized)&&l.DomHandler.removeClass(document.body,"p-overflow-hidden")},onKeyDown:function(e){"Escape"===e.code&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener:function(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener:function(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},containerRef:function(e){this.container=e},maskRef:function(e){this.mask=e},contentRef:function(e){this.content=e},headerContainerRef:function(e){this.headerContainer=e},footerContainerRef:function(e){this.footerContainer=e},maximizableRef:function(e){this.maximizableButton=e},closeButtonRef:function(e){this.closeButton=e},createStyle:function(){if(!this.styleElement&&!this.isUnstyled){var e;this.styleElement=document.createElement("style"),this.styleElement.type="text/css",l.DomHandler.setAttribute(this.styleElement,"nonce",null===(e=this.$primevue)||void 0===e||null===(e=e.config)||void 0===e||null===(e=e.csp)||void 0===e?void 0:e.nonce),document.head.appendChild(this.styleElement);var t="";for(var n in this.breakpoints)t+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(this.attributeSelector,"] {\n width: ").concat(this.breakpoints[n]," !important;\n }\n }\n ");this.styleElement.innerHTML=t}},destroyStyle:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag:function(e){"headericons"!==e.target.closest("div").getAttribute("data-pc-section")&&this.draggable&&(this.dragging=!0,this.lastPageX=e.pageX,this.lastPageY=e.pageY,this.container.style.margin="0",!this.isUnstyled&&l.DomHandler.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners:function(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners:function(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener:function(){var e=this;this.documentDragListener=function(t){if(e.dragging){var n=l.DomHandler.getOuterWidth(e.container),o=l.DomHandler.getOuterHeight(e.container),i=t.pageX-e.lastPageX,a=t.pageY-e.lastPageY,r=e.container.getBoundingClientRect(),s=r.left+i,d=r.top+a,c=l.DomHandler.getViewport(),m=getComputedStyle(e.container),p=parseFloat(m.marginLeft),u=parseFloat(m.marginTop);e.container.style.position="fixed",e.keepInViewport?(s>=e.minX&&s+n<c.width&&(e.lastPageX=t.pageX,e.container.style.left=s-p+"px"),d>=e.minY&&d+o<c.height&&(e.lastPageY=t.pageY,e.container.style.top=d-u+"px")):(e.lastPageX=t.pageX,e.container.style.left=s-p+"px",e.lastPageY=t.pageY,e.container.style.top=d-u+"px")}},window.document.addEventListener("mousemove",this.documentDragListener)},unbindDocumentDragListener:function(){this.documentDragListener&&(window.document.removeEventListener("mousemove",this.documentDragListener),this.documentDragListener=null)},bindDocumentDragEndListener:function(){var e=this;this.documentDragEndListener=function(t){e.dragging&&(e.dragging=!1,!e.isUnstyled&&l.DomHandler.removeClass(document.body,"p-unselectable-text"),e.$emit("dragend",t))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener:function(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maximizeIconComponent:function(){return this.maximized?this.minimizeIcon?"span":"WindowMinimizeIcon":this.maximizeIcon?"span":"WindowMaximizeIcon"},ariaId:function(){return l.UniqueComponentId()},ariaLabelledById:function(){return null!=this.header||null!==this.$attrs["aria-labelledby"]?this.ariaId+"_header":null},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector:function(){return l.UniqueComponentId()},contentStyleClass:function(){return["p-dialog-content",this.contentClass]}},directives:{ripple:h.default,focustrap:m.default},components:{Portal:g.default,WindowMinimizeIcon:f.default,WindowMaximizeIcon:u.default,TimesIcon:p.default}};function x(e){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},x(e)}function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?D(Object(n),!0).forEach((function(t){k(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function k(e,t,n){return(t=B(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B(e){var t=z(e,"string");return"symbol"===x(t)?t:String(t)}function z(e,t){if("object"!==x(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==x(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var L=["aria-labelledby","aria-modal"],C=["id"],E=["autofocus","tabindex"],I=["autofocus","aria-label"];return y.render=function(e,t,n,o,i,a){var l=r.resolveComponent("Portal"),s=r.resolveDirective("ripple"),d=r.resolveDirective("focustrap");return r.openBlock(),r.createBlock(l,{appendTo:e.appendTo},{default:r.withCtx((function(){return[i.containerVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:a.maskRef,class:e.cx("mask"),style:e.sx("mask",!0,{position:e.position,modal:e.modal}),onClick:t[3]||(t[3]=function(){return a.onMaskClick&&a.onMaskClick.apply(a,arguments)})},e.ptm("mask")),[r.createVNode(r.Transition,r.mergeProps({name:"p-dialog",onBeforeEnter:a.onBeforeEnter,onEnter:a.onEnter,onBeforeLeave:a.onBeforeLeave,onLeave:a.onLeave,onAfterLeave:a.onAfterLeave,appear:""},e.ptm("transition")),{default:r.withCtx((function(){return[e.visible?r.withDirectives((r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:a.containerRef,class:e.cx("root"),style:e.sx("root"),role:"dialog","aria-labelledby":a.ariaLabelledById,"aria-modal":e.modal},w(w({},e.$attrs),e.ptm("root"))),[e.showHeader?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:a.headerContainerRef,class:e.cx("header"),onMousedown:t[2]||(t[2]=function(){return a.initDrag&&a.initDrag.apply(a,arguments)})},e.ptm("header")),[r.renderSlot(e.$slots,"header",{class:r.normalizeClass(e.cx("headerTitle"))},(function(){return[e.header?(r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,id:a.ariaLabelledById,class:e.cx("headerTitle")},e.ptm("headerTitle")),r.toDisplayString(e.header),17,C)):r.createCommentVNode("",!0)]})),r.createElementVNode("div",r.mergeProps({class:e.cx("headerIcons")},e.ptm("headerIcons")),[e.maximizable?r.withDirectives((r.openBlock(),r.createElementBlock("button",r.mergeProps({key:0,ref:a.maximizableRef,autofocus:i.focusableMax,class:e.cx("maximizableButton"),onClick:t[0]||(t[0]=function(){return a.maximize&&a.maximize.apply(a,arguments)}),type:"button",tabindex:e.maximizable?"0":"-1"},e.ptm("maximizableButton"),{"data-pc-group-section":"headericon"}),[r.renderSlot(e.$slots,"maximizeicon",{maximized:i.maximized,class:r.normalizeClass(e.cx("maximizableIcon"))},(function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(a.maximizeIconComponent),r.mergeProps({class:[e.cx("maximizableIcon"),i.maximized?e.minimizeIcon:e.maximizeIcon]},e.ptm("maximizableIcon")),null,16,["class"]))]}))],16,E)),[[s]]):r.createCommentVNode("",!0),e.closable?r.withDirectives((r.openBlock(),r.createElementBlock("button",r.mergeProps({key:1,ref:a.closeButtonRef,autofocus:i.focusableClose,class:e.cx("closeButton"),onClick:t[1]||(t[1]=function(){return a.close&&a.close.apply(a,arguments)}),"aria-label":a.closeAriaLabel,type:"button"},w(w({},e.closeButtonProps),e.ptm("closeButton")),{"data-pc-group-section":"headericon"}),[r.renderSlot(e.$slots,"closeicon",{class:r.normalizeClass(e.cx("closeButtonIcon"))},(function(){return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),r.mergeProps({class:[e.cx("closeButtonIcon"),e.closeIcon]},e.ptm("closeButtonIcon")),null,16,["class"]))]}))],16,I)),[[s]]):r.createCommentVNode("",!0)],16)],16)):r.createCommentVNode("",!0),r.createElementVNode("div",r.mergeProps({ref:a.contentRef,class:[e.cx("content"),e.contentClass],style:e.contentStyle},w(w({},e.contentProps),e.ptm("content"))),[r.renderSlot(e.$slots,"default")],16),e.footer||e.$slots.footer?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:1,ref:a.footerContainerRef,class:e.cx("footer")},e.ptm("footer")),[r.renderSlot(e.$slots,"footer",{},(function(){return[r.createTextVNode(r.toDisplayString(e.footer),1)]}))],16)):r.createCommentVNode("",!0)],16,L)),[[d,{disabled:!e.modal}]]):r.createCommentVNode("",!0)]})),_:3},16,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],16)):r.createCommentVNode("",!0)]})),_:3},8,["appendTo"])},y}(primevue.focustrap,primevue.icons.times,primevue.icons.windowmaximize,primevue.icons.windowminimize,primevue.portal,primevue.ripple,primevue.utils,Vue,primevue.basecomponent,primevue.usestyle);
@@ -9,7 +9,8 @@
9
9
  */
10
10
  import { VNode } from 'vue';
11
11
  import { ComponentHooks } from '../basecomponent';
12
- import { ClassComponent, GlobalComponentConstructor, PTOptions } from '../ts-helpers';
12
+ import { PassThroughOptions } from '../passthrough';
13
+ import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
13
14
 
14
15
  export declare type DividerPassThroughOptionType = DividerPassThroughAttributes | ((options: DividerPassThroughMethodOptions) => DividerPassThroughAttributes | string) | string | null | undefined;
15
16
 
@@ -17,8 +18,18 @@ export declare type DividerPassThroughOptionType = DividerPassThroughAttributes
17
18
  * Custom passthrough(pt) option method.
18
19
  */
19
20
  export interface DividerPassThroughMethodOptions {
21
+ /**
22
+ * Defines instance.
23
+ */
20
24
  instance: any;
25
+ /**
26
+ * Defines valid properties.
27
+ */
21
28
  props: DividerProps;
29
+ /**
30
+ * Defines passthrough(pt) options in global config.
31
+ */
32
+ global: object | undefined;
22
33
  }
23
34
 
24
35
  /**
@@ -70,7 +81,12 @@ export interface DividerProps {
70
81
  * Used to pass attributes to DOM elements inside the component.
71
82
  * @type {DividerPassThroughOptions}
72
83
  */
73
- pt?: PTOptions<DividerPassThroughOptions>;
84
+ pt?: PassThrough<DividerPassThroughOptions>;
85
+ /**
86
+ * Used to configure passthrough(pt) options of the component.
87
+ * @type {PassThroughOptions}
88
+ */
89
+ ptOptions?: PassThroughOptions;
74
90
  /**
75
91
  * When enabled, it removes component related styles in the core.
76
92
  * @defaultValue false
package/dock/Dock.d.ts CHANGED
@@ -10,7 +10,8 @@
10
10
  import { VNode } from 'vue';
11
11
  import { ComponentHooks } from '../basecomponent';
12
12
  import { MenuItem } from '../menuitem';
13
- import { ClassComponent, GlobalComponentConstructor, PTOptions } from '../ts-helpers';
13
+ import { PassThroughOptions } from '../passthrough';
14
+ import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
14
15
 
15
16
  export declare type DockPassThroughOptionType = DockPassThroughAttributes | ((options: DockPassThroughMethodOptions) => DockPassThroughAttributes | string) | string | null | undefined;
16
17
 
@@ -18,10 +19,26 @@ export declare type DockPassThroughOptionType = DockPassThroughAttributes | ((op
18
19
  * Custom passthrough(pt) option method.
19
20
  */
20
21
  export interface DockPassThroughMethodOptions {
22
+ /**
23
+ * Defines instance.
24
+ */
21
25
  instance: any;
26
+ /**
27
+ * Defines valid properties.
28
+ */
22
29
  props: DockProps;
30
+ /**
31
+ * Defines current inline state.
32
+ */
23
33
  state: DockState;
34
+ /**
35
+ * Defines current options.
36
+ */
24
37
  context: DockContext;
38
+ /**
39
+ * Defines passthrough(pt) options in global config.
40
+ */
41
+ global: object | undefined;
25
42
  }
26
43
 
27
44
  /**
@@ -134,6 +151,20 @@ export interface DockTooltipOptions {
134
151
  [key: string]: any;
135
152
  }
136
153
 
154
+ /**
155
+ * Defines valid router binding props in Dock component.
156
+ */
157
+ export interface DockRouterBindProps {
158
+ /**
159
+ * Action element binding
160
+ */
161
+ action: object;
162
+ /**
163
+ * Icon element binding
164
+ */
165
+ icon: object;
166
+ }
167
+
137
168
  /**
138
169
  * Defines valid properties in Dock component.
139
170
  */
@@ -185,7 +216,12 @@ export interface DockProps {
185
216
  * Used to pass attributes to DOM elements inside the component.
186
217
  * @type {DockPassThroughOptions}
187
218
  */
188
- pt?: PTOptions<DockPassThroughOptions>;
219
+ pt?: PassThrough<DockPassThroughOptions>;
220
+ /**
221
+ * Used to configure passthrough(pt) options of the component.
222
+ * @type {PassThroughOptions}
223
+ */
224
+ ptOptions?: PassThroughOptions;
189
225
  /**
190
226
  * When enabled, it removes component related styles in the core.
191
227
  * @defaultValue false
@@ -210,6 +246,14 @@ export interface DockSlots {
210
246
  * Index of the menuitem
211
247
  */
212
248
  index: number;
249
+ /**
250
+ * Label property of the menuitem
251
+ */
252
+ label: string | ((...args: any) => string) | undefined;
253
+ /**
254
+ * Binding properties of the menuitem
255
+ */
256
+ props: DockRouterBindProps;
213
257
  }): VNode[];
214
258
  /**
215
259
  * Custom icon content.
package/dock/Dock.vue CHANGED
@@ -23,6 +23,11 @@ import DockSub from './DockSub.vue';
23
23
  export default {
24
24
  name: 'Dock',
25
25
  extends: BaseDock,
26
+ beforeMount() {
27
+ if (!this.$slots.item) {
28
+ console.warn('In future versions, vue-router support will be removed. Item templating should be used.');
29
+ }
30
+ },
26
31
  computed: {
27
32
  containerClass() {
28
33
  return [this.class, this.cx('root')];
package/dock/DockSub.vue CHANGED
@@ -64,7 +64,7 @@
64
64
  <component v-else :is="templates['icon']" :item="processedItem" :class="cx('icon')"></component>
65
65
  </a>
66
66
  </template>
67
- <component v-else :is="templates['item']" :item="processedItem" :index="index"></component>
67
+ <component v-else :is="templates['item']" :item="processedItem" :index="index" :label="processedItem.label" :props="getMenuItemProps(processedItem, index)"></component>
68
68
  </div>
69
69
  </li>
70
70
  </template>
@@ -77,6 +77,7 @@ import BaseComponent from 'primevue/basecomponent';
77
77
  import Ripple from 'primevue/ripple';
78
78
  import Tooltip from 'primevue/tooltip';
79
79
  import { DomHandler, ObjectUtils, UniqueComponentId } from 'primevue/utils';
80
+ import { mergeProps } from 'vue';
80
81
 
81
82
  export default {
82
83
  name: 'DockSub',
@@ -275,6 +276,24 @@ export default {
275
276
  },
276
277
  disabled(item) {
277
278
  return typeof item.disabled === 'function' ? item.disabled() : item.disabled;
279
+ },
280
+ getMenuItemProps(item, index) {
281
+ return {
282
+ action: mergeProps(
283
+ {
284
+ tabindex: -1,
285
+ 'aria-hidden': true,
286
+ class: this.cx('action')
287
+ },
288
+ this.getPTOptions('action', item, index)
289
+ ),
290
+ icon: mergeProps(
291
+ {
292
+ class: [this.cx('icon'), item.icon]
293
+ },
294
+ this.getPTOptions('icon', item, index)
295
+ )
296
+ };
278
297
  }
279
298
  },
280
299
  computed: {
package/dock/dock.cjs.js CHANGED
@@ -296,6 +296,18 @@ var script$1 = {
296
296
  },
297
297
  disabled: function disabled(item) {
298
298
  return typeof item.disabled === 'function' ? item.disabled() : item.disabled;
299
+ },
300
+ getMenuItemProps: function getMenuItemProps(item, index) {
301
+ return {
302
+ action: vue.mergeProps({
303
+ tabindex: -1,
304
+ 'aria-hidden': true,
305
+ "class": this.cx('action')
306
+ }, this.getPTOptions('action', item, index)),
307
+ icon: vue.mergeProps({
308
+ "class": [this.cx('icon'), item.icon]
309
+ }, this.getPTOptions('icon', item, index))
310
+ };
299
311
  }
300
312
  },
301
313
  computed: {
@@ -421,8 +433,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
421
433
  }, $props.tooltipOptions]])], 64)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['item']), {
422
434
  key: 1,
423
435
  item: processedItem,
424
- index: index
425
- }, null, 8, ["item", "index"]))], 16)], 16, _hoisted_2);
436
+ index: index,
437
+ label: processedItem.label,
438
+ props: $options.getMenuItemProps(processedItem, index)
439
+ }, null, 8, ["item", "index", "label", "props"]))], 16)], 16, _hoisted_2);
426
440
  }), 128))], 16, _hoisted_1)], 16);
427
441
  }
428
442
 
@@ -431,6 +445,11 @@ script$1.render = render$1;
431
445
  var script = {
432
446
  name: 'Dock',
433
447
  "extends": script$2,
448
+ beforeMount: function beforeMount() {
449
+ if (!this.$slots.item) {
450
+ console.warn('In future versions, vue-router support will be removed. Item templating should be used.');
451
+ }
452
+ },
434
453
  computed: {
435
454
  containerClass: function containerClass() {
436
455
  return [this["class"], this.cx('root')];
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/basecomponent"),t=require("primevue/usestyle"),n=require("primevue/ripple"),o=require("primevue/tooltip"),i=require("primevue/utils"),r=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),l=a(n),s=a(o),d=t.useStyle("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),u={name:"BaseDock",extends:c.default,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(e){return["p-dock p-component","p-dock-".concat(e.props.position)]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(e){var t=e.instance,n=e.processedItem,o=e.index;return["p-dock-item",{"p-focus":t.isItemActive(e.id),"p-disabled":t.disabled(n),"p-dock-item-second-prev":t.currentIndex-2===o,"p-dock-item-prev":t.currentIndex-1===o,"p-dock-item-current":t.currentIndex===o,"p-dock-item-next":t.currentIndex+1===o,"p-dock-item-second-next":t.currentIndex+2===o}]},content:"p-menuitem-content",action:function(e){return["p-dock-link",{"router-link-active":e.isActive,"router-link-active-exact":e.props.exact&&e.isExactActive}]},icon:"p-dock-icon"},loadStyle:d.load},provide:function(){return{$parentInstance:this}}};function p(e){return k(e)||h(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var y={name:"DockSub",hostName:"Dock",extends:c.default,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(e){this.id=e||i.UniqueComponentId()}},mounted:function(){this.id=this.id||i.UniqueComponentId()},methods:{getItemId:function(e){return"".concat(this.id,"_").concat(e)},getItemProp:function(e,t){return e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0},getPTOptions:function(e,t,n){return this.ptm(e,{context:{index:n,item:t,active:this.isItemActive(this.getItemId(n))}})},isSameMenuItem:function(e){return e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(e){return e===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemActionClick:function(e,t){t&&t(e)},onItemClick:function(e,t){if(this.isSameMenuItem(e)){var n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus:function(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey:function(){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey:function(){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var e=i.DomHandler.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),t=e&&i.DomHandler.findSingle(e,'[data-pc-section="action"]');t?t.click():e&&e.click()},findNextOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=t[e>=t.length?t.length-1:e<0?0:e].getAttribute("id")},disabled:function(e){return"function"==typeof e.disabled?e.disabled():e.disabled}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:l.default,tooltip:s.default}},v=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],x=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],g=["href","target","onClick"],I=["href","target"];y.render=function(e,t,n,o,i,a){var c=r.resolveComponent("router-link"),l=r.resolveDirective("ripple"),s=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("container")},e.ptm("container")),[r.createElementVNode("ul",r.mergeProps({ref:"list",id:i.id,class:e.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":i.focused?a.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=function(){return a.onListFocus&&a.onListFocus.apply(a,arguments)}),onBlur:t[1]||(t[1]=function(){return a.onListBlur&&a.onListBlur.apply(a,arguments)}),onKeydown:t[2]||(t[2]=function(){return a.onListKeyDown&&a.onListKeyDown.apply(a,arguments)}),onMouseleave:t[3]||(t[3]=function(){return a.onListMouseLeave&&a.onListMouseLeave.apply(a,arguments)})},e.ptm("menu")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.model,(function(t,o){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:o,id:a.getItemId(o),class:e.cx("menuitem",{processedItem:t,index:o,id:a.getItemId(o)}),role:"menuitem","aria-label":t.label,"aria-disabled":a.disabled(t),onClick:function(e){return a.onItemClick(e,t)},onMouseenter:function(e){return a.onItemMouseEnter(o)}},a.getPTOptions("menuitem",t,o),{"data-p-focused":a.isItemActive(a.getItemId(o)),"data-p-disabled":a.disabled(t)||!1}),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},a.getPTOptions("content",t,o)),[n.templates.item?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.item),{key:1,item:t,index:o},null,8,["item","index"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.to&&!a.disabled(t)?(r.openBlock(),r.createBlock(c,{key:0,to:t.to,custom:""},{default:r.withCtx((function(i){var c=i.navigate,d=i.href,u=i.isActive,p=i.isExactActive;return[r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({href:d,class:e.cx("action",{isActive:u,isExactActive:p}),target:t.target,tabindex:"-1","aria-hidden":"true",onClick:function(e){return a.onItemActionClick(e,t,c)}},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,g)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({key:1,href:t.url,class:e.cx("action"),target:t.target,tabindex:"-1","aria-hidden":"true"},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,I)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,x)})),128))],16,v)],16)};var O={name:"Dock",extends:u,computed:{containerClass:function(){return[this.class,this.cx("root")]}},components:{DockSub:y}};O.render=function(e,t,n,o,i,a){var c=r.resolveComponent("DockSub");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:a.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"dock"}),[r.createVNode(c,{model:e.model,templates:e.$slots,exact:e.exact,tooltipOptions:e.tooltipOptions,position:e.position,menuId:e.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:e.tabindex,pt:e.pt,unstyled:e.unstyled},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt","unstyled"])],16)},module.exports=O;
1
+ "use strict";var e=require("primevue/basecomponent"),t=require("primevue/usestyle"),n=require("primevue/ripple"),o=require("primevue/tooltip"),i=require("primevue/utils"),r=require("vue");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),l=a(n),s=a(o),d=t.useStyle("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),u={name:"BaseDock",extends:c.default,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(e){return["p-dock p-component","p-dock-".concat(e.props.position)]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(e){var t=e.instance,n=e.processedItem,o=e.index;return["p-dock-item",{"p-focus":t.isItemActive(e.id),"p-disabled":t.disabled(n),"p-dock-item-second-prev":t.currentIndex-2===o,"p-dock-item-prev":t.currentIndex-1===o,"p-dock-item-current":t.currentIndex===o,"p-dock-item-next":t.currentIndex+1===o,"p-dock-item-second-next":t.currentIndex+2===o}]},content:"p-menuitem-content",action:function(e){return["p-dock-link",{"router-link-active":e.isActive,"router-link-active-exact":e.props.exact&&e.isExactActive}]},icon:"p-dock-icon"},loadStyle:d.load},provide:function(){return{$parentInstance:this}}};function p(e){return b(e)||h(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function b(e){if(Array.isArray(e))return k(e)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var g={name:"DockSub",hostName:"Dock",extends:c.default,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(e){this.id=e||i.UniqueComponentId()}},mounted:function(){this.id=this.id||i.UniqueComponentId()},methods:{getItemId:function(e){return"".concat(this.id,"_").concat(e)},getItemProp:function(e,t){return e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0},getPTOptions:function(e,t,n){return this.ptm(e,{context:{index:n,item:t,active:this.isItemActive(this.getItemId(n))}})},isSameMenuItem:function(e){return e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(e){return e===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemActionClick:function(e,t){t&&t(e)},onItemClick:function(e,t){if(this.isSameMenuItem(e)){var n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus:function(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey:function(){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey:function(){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var e=i.DomHandler.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),t=e&&i.DomHandler.findSingle(e,'[data-pc-section="action"]');t?t.click():e&&e.click()},findNextOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=t[e>=t.length?t.length-1:e<0?0:e].getAttribute("id")},disabled:function(e){return"function"==typeof e.disabled?e.disabled():e.disabled},getMenuItemProps:function(e,t){return{action:r.mergeProps({tabindex:-1,"aria-hidden":!0,class:this.cx("action")},this.getPTOptions("action",e,t)),icon:r.mergeProps({class:[this.cx("icon"),e.icon]},this.getPTOptions("icon",e,t))}}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:l.default,tooltip:s.default}},v=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],x=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],y=["href","target","onClick"],I=["href","target"];g.render=function(e,t,n,o,i,a){var c=r.resolveComponent("router-link"),l=r.resolveDirective("ripple"),s=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("container")},e.ptm("container")),[r.createElementVNode("ul",r.mergeProps({ref:"list",id:i.id,class:e.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":i.focused?a.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=function(){return a.onListFocus&&a.onListFocus.apply(a,arguments)}),onBlur:t[1]||(t[1]=function(){return a.onListBlur&&a.onListBlur.apply(a,arguments)}),onKeydown:t[2]||(t[2]=function(){return a.onListKeyDown&&a.onListKeyDown.apply(a,arguments)}),onMouseleave:t[3]||(t[3]=function(){return a.onListMouseLeave&&a.onListMouseLeave.apply(a,arguments)})},e.ptm("menu")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.model,(function(t,o){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:o,id:a.getItemId(o),class:e.cx("menuitem",{processedItem:t,index:o,id:a.getItemId(o)}),role:"menuitem","aria-label":t.label,"aria-disabled":a.disabled(t),onClick:function(e){return a.onItemClick(e,t)},onMouseenter:function(e){return a.onItemMouseEnter(o)}},a.getPTOptions("menuitem",t,o),{"data-p-focused":a.isItemActive(a.getItemId(o)),"data-p-disabled":a.disabled(t)||!1}),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},a.getPTOptions("content",t,o)),[n.templates.item?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.item),{key:1,item:t,index:o,label:t.label,props:a.getMenuItemProps(t,o)},null,8,["item","index","label","props"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.to&&!a.disabled(t)?(r.openBlock(),r.createBlock(c,{key:0,to:t.to,custom:""},{default:r.withCtx((function(i){var c=i.navigate,d=i.href,u=i.isActive,p=i.isExactActive;return[r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({href:d,class:e.cx("action",{isActive:u,isExactActive:p}),target:t.target,tabindex:"-1","aria-hidden":"true",onClick:function(e){return a.onItemActionClick(e,t,c)}},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,y)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({key:1,href:t.url,class:e.cx("action"),target:t.target,tabindex:"-1","aria-hidden":"true"},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,I)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,x)})),128))],16,v)],16)};var O={name:"Dock",extends:u,beforeMount:function(){this.$slots.item||console.warn("In future versions, vue-router support will be removed. Item templating should be used.")},computed:{containerClass:function(){return[this.class,this.cx("root")]}},components:{DockSub:g}};O.render=function(e,t,n,o,i,a){var c=r.resolveComponent("DockSub");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:a.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"dock"}),[r.createVNode(c,{model:e.model,templates:e.$slots,exact:e.exact,tooltipOptions:e.tooltipOptions,position:e.position,menuId:e.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:e.tabindex,pt:e.pt,unstyled:e.unstyled},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt","unstyled"])],16)},module.exports=O;
package/dock/dock.esm.js CHANGED
@@ -3,7 +3,7 @@ import { useStyle } from 'primevue/usestyle';
3
3
  import Ripple from 'primevue/ripple';
4
4
  import Tooltip from 'primevue/tooltip';
5
5
  import { UniqueComponentId, ObjectUtils, DomHandler } from 'primevue/utils';
6
- import { resolveComponent, resolveDirective, openBlock, createElementBlock, mergeProps, createElementVNode, Fragment, renderList, createBlock, withCtx, withDirectives, resolveDynamicComponent, normalizeClass, createVNode } from 'vue';
6
+ import { mergeProps, resolveComponent, resolveDirective, openBlock, createElementBlock, createElementVNode, Fragment, renderList, createBlock, withCtx, withDirectives, resolveDynamicComponent, normalizeClass, createVNode } from 'vue';
7
7
 
8
8
  var styles = "\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n";
9
9
  var classes = {
@@ -288,6 +288,18 @@ var script$1 = {
288
288
  },
289
289
  disabled: function disabled(item) {
290
290
  return typeof item.disabled === 'function' ? item.disabled() : item.disabled;
291
+ },
292
+ getMenuItemProps: function getMenuItemProps(item, index) {
293
+ return {
294
+ action: mergeProps({
295
+ tabindex: -1,
296
+ 'aria-hidden': true,
297
+ "class": this.cx('action')
298
+ }, this.getPTOptions('action', item, index)),
299
+ icon: mergeProps({
300
+ "class": [this.cx('icon'), item.icon]
301
+ }, this.getPTOptions('icon', item, index))
302
+ };
291
303
  }
292
304
  },
293
305
  computed: {
@@ -413,8 +425,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
413
425
  }, $props.tooltipOptions]])], 64)) : (openBlock(), createBlock(resolveDynamicComponent($props.templates['item']), {
414
426
  key: 1,
415
427
  item: processedItem,
416
- index: index
417
- }, null, 8, ["item", "index"]))], 16)], 16, _hoisted_2);
428
+ index: index,
429
+ label: processedItem.label,
430
+ props: $options.getMenuItemProps(processedItem, index)
431
+ }, null, 8, ["item", "index", "label", "props"]))], 16)], 16, _hoisted_2);
418
432
  }), 128))], 16, _hoisted_1)], 16);
419
433
  }
420
434
 
@@ -423,6 +437,11 @@ script$1.render = render$1;
423
437
  var script = {
424
438
  name: 'Dock',
425
439
  "extends": script$2,
440
+ beforeMount: function beforeMount() {
441
+ if (!this.$slots.item) {
442
+ console.warn('In future versions, vue-router support will be removed. Item templating should be used.');
443
+ }
444
+ },
426
445
  computed: {
427
446
  containerClass: function containerClass() {
428
447
  return [this["class"], this.cx('root')];
@@ -1 +1 @@
1
- import t from"primevue/basecomponent";import{useStyle as e}from"primevue/usestyle";import n from"primevue/ripple";import i from"primevue/tooltip";import{UniqueComponentId as o,ObjectUtils as r,DomHandler as a}from"primevue/utils";import{resolveComponent as s,resolveDirective as c,openBlock as l,createElementBlock as d,mergeProps as u,createElementVNode as p,Fragment as m,renderList as f,createBlock as h,withCtx as b,withDirectives as x,resolveDynamicComponent as y,normalizeClass as k,createVNode as g}from"vue";var v=e("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),I={name:"BaseDock",extends:t,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(t){return["p-dock p-component","p-dock-".concat(t.props.position)]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(t){var e=t.instance,n=t.processedItem,i=t.index;return["p-dock-item",{"p-focus":e.isItemActive(t.id),"p-disabled":e.disabled(n),"p-dock-item-second-prev":e.currentIndex-2===i,"p-dock-item-prev":e.currentIndex-1===i,"p-dock-item-current":e.currentIndex===i,"p-dock-item-next":e.currentIndex+1===i,"p-dock-item-second-next":e.currentIndex+2===i}]},content:"p-menuitem-content",action:function(t){return["p-dock-link",{"router-link-active":t.isActive,"router-link-active-exact":t.props.exact&&t.isExactActive}]},icon:"p-dock-icon"},loadStyle:v.load},provide:function(){return{$parentInstance:this}}};function O(t){return D(t)||S(t)||w(t)||A()}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return L(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}}function S(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function D(t){if(Array.isArray(t))return L(t)}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var K={name:"DockSub",hostName:"Dock",extends:t,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(t){this.id=t||o()}},mounted:function(){this.id=this.id||o()},methods:{getItemId:function(t){return"".concat(this.id,"_").concat(t)},getItemProp:function(t,e){return t&&t.item?r.getItemValue(t.item[e]):void 0},getPTOptions:function(t,e,n){return this.ptm(t,{context:{index:n,item:e,active:this.isItemActive(this.getItemId(n))}})},isSameMenuItem:function(t){return t.currentTarget&&(t.currentTarget.isSameNode(t.target)||t.currentTarget.isSameNode(t.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(t){return t===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(t){this.currentIndex=t},onItemActionClick:function(t,e){e&&e(t)},onItemClick:function(t,e){if(this.isSameMenuItem(t)){var n=this.getItemProp(e,"command");n&&n({originalEvent:t,item:e.item})}},onListFocus:function(t){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",t)},onListBlur:function(t){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",t)},onListKeyDown:function(t){switch(t.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),t.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),t.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),t.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),t.preventDefault();break;case"Home":this.onHomeKey(),t.preventDefault();break;case"End":this.onEndKey(),t.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(t),t.preventDefault()}},onArrowDownKey:function(){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t)},onArrowUpKey:function(){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var t=a.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),e=t&&a.findSingle(t,'[data-pc-section="action"]');e?e.click():t&&t.click()},findNextOptionIndex:function(t){var e=O(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(e){return e.id===t}));return e>-1?e+1:0},findPrevOptionIndex:function(t){var e=O(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(e){return e.id===t}));return e>-1?e-1:0},changeFocusedOptionIndex:function(t){var e=a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=e[t>=e.length?e.length-1:t<0?0:t].getAttribute("id")},disabled:function(t){return"function"==typeof t.disabled?t.disabled():t.disabled}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:n,tooltip:i}},P=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],C=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],E=["href","target","onClick"],M=["href","target"];K.render=function(t,e,n,i,o,r){var a=s("router-link"),g=c("ripple"),v=c("tooltip");return l(),d("div",u({class:t.cx("container")},t.ptm("container")),[p("ul",u({ref:"list",id:o.id,class:t.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,onFocus:e[0]||(e[0]=function(){return r.onListFocus&&r.onListFocus.apply(r,arguments)}),onBlur:e[1]||(e[1]=function(){return r.onListBlur&&r.onListBlur.apply(r,arguments)}),onKeydown:e[2]||(e[2]=function(){return r.onListKeyDown&&r.onListKeyDown.apply(r,arguments)}),onMouseleave:e[3]||(e[3]=function(){return r.onListMouseLeave&&r.onListMouseLeave.apply(r,arguments)})},t.ptm("menu")),[(l(!0),d(m,null,f(n.model,(function(e,i){return l(),d("li",u({key:i,id:r.getItemId(i),class:t.cx("menuitem",{processedItem:e,index:i,id:r.getItemId(i)}),role:"menuitem","aria-label":e.label,"aria-disabled":r.disabled(e),onClick:function(t){return r.onItemClick(t,e)},onMouseenter:function(t){return r.onItemMouseEnter(i)}},r.getPTOptions("menuitem",e,i),{"data-p-focused":r.isItemActive(r.getItemId(i)),"data-p-disabled":r.disabled(e)||!1}),[p("div",u({class:t.cx("content")},r.getPTOptions("content",e,i)),[n.templates.item?(l(),h(y(n.templates.item),{key:1,item:e,index:i},null,8,["item","index"])):(l(),d(m,{key:0},[e.to&&!r.disabled(e)?(l(),h(a,{key:0,to:e.to,custom:""},{default:b((function(o){var a=o.navigate,s=o.href,c=o.isActive,p=o.isExactActive;return[x((l(),d("a",u({href:s,class:t.cx("action",{isActive:c,isExactActive:p}),target:e.target,tabindex:"-1","aria-hidden":"true",onClick:function(t){return r.onItemActionClick(t,e,a)}},r.getPTOptions("action",e,i)),[n.templates.icon?(l(),h(y(n.templates.icon),{key:1,item:e,class:k(t.cx("icon"))},null,8,["item","class"])):x((l(),d("span",u({key:0,class:[t.cx("icon"),e.icon]},r.getPTOptions("icon",e,i)),null,16)),[[g]])],16,E)),[[v,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):x((l(),d("a",u({key:1,href:e.url,class:t.cx("action"),target:e.target,tabindex:"-1","aria-hidden":"true"},r.getPTOptions("action",e,i)),[n.templates.icon?(l(),h(y(n.templates.icon),{key:1,item:e,class:k(t.cx("icon"))},null,8,["item","class"])):x((l(),d("span",u({key:0,class:[t.cx("icon"),e.icon]},r.getPTOptions("icon",e,i)),null,16)),[[g]])],16,M)),[[v,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,C)})),128))],16,P)],16)};var T={name:"Dock",extends:I,computed:{containerClass:function(){return[this.class,this.cx("root")]}},components:{DockSub:K}};T.render=function(t,e,n,i,o,r){var a=s("DockSub");return l(),d("div",u({class:r.containerClass,style:t.style},t.ptm("root"),{"data-pc-name":"dock"}),[g(a,{model:t.model,templates:t.$slots,exact:t.exact,tooltipOptions:t.tooltipOptions,position:t.position,menuId:t.menuId,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,tabindex:t.tabindex,pt:t.pt,unstyled:t.unstyled},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt","unstyled"])],16)};export{T as default};
1
+ import t from"primevue/basecomponent";import{useStyle as e}from"primevue/usestyle";import n from"primevue/ripple";import i from"primevue/tooltip";import{UniqueComponentId as o,ObjectUtils as r,DomHandler as a}from"primevue/utils";import{mergeProps as s,resolveComponent as c,resolveDirective as l,openBlock as d,createElementBlock as u,createElementVNode as p,Fragment as m,renderList as f,createBlock as h,withCtx as b,withDirectives as x,resolveDynamicComponent as y,normalizeClass as g,createVNode as k}from"vue";var v=e("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),I={name:"BaseDock",extends:t,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(t){return["p-dock p-component","p-dock-".concat(t.props.position)]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(t){var e=t.instance,n=t.processedItem,i=t.index;return["p-dock-item",{"p-focus":e.isItemActive(t.id),"p-disabled":e.disabled(n),"p-dock-item-second-prev":e.currentIndex-2===i,"p-dock-item-prev":e.currentIndex-1===i,"p-dock-item-current":e.currentIndex===i,"p-dock-item-next":e.currentIndex+1===i,"p-dock-item-second-next":e.currentIndex+2===i}]},content:"p-menuitem-content",action:function(t){return["p-dock-link",{"router-link-active":t.isActive,"router-link-active-exact":t.props.exact&&t.isExactActive}]},icon:"p-dock-icon"},loadStyle:v.load},provide:function(){return{$parentInstance:this}}};function O(t){return D(t)||S(t)||w(t)||A()}function A(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(t,e){if(t){if("string"==typeof t)return L(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(t,e):void 0}}function S(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function D(t){if(Array.isArray(t))return L(t)}function L(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var K={name:"DockSub",hostName:"Dock",extends:t,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(t){this.id=t||o()}},mounted:function(){this.id=this.id||o()},methods:{getItemId:function(t){return"".concat(this.id,"_").concat(t)},getItemProp:function(t,e){return t&&t.item?r.getItemValue(t.item[e]):void 0},getPTOptions:function(t,e,n){return this.ptm(t,{context:{index:n,item:e,active:this.isItemActive(this.getItemId(n))}})},isSameMenuItem:function(t){return t.currentTarget&&(t.currentTarget.isSameNode(t.target)||t.currentTarget.isSameNode(t.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(t){return t===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(t){this.currentIndex=t},onItemActionClick:function(t,e){e&&e(t)},onItemClick:function(t,e){if(this.isSameMenuItem(t)){var n=this.getItemProp(e,"command");n&&n({originalEvent:t,item:e.item})}},onListFocus:function(t){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",t)},onListBlur:function(t){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",t)},onListKeyDown:function(t){switch(t.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),t.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),t.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),t.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),t.preventDefault();break;case"Home":this.onHomeKey(),t.preventDefault();break;case"End":this.onEndKey(),t.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(t),t.preventDefault()}},onArrowDownKey:function(){var t=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t)},onArrowUpKey:function(){var t=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(t)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var t=a.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),e=t&&a.findSingle(t,'[data-pc-section="action"]');e?e.click():t&&t.click()},findNextOptionIndex:function(t){var e=O(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(e){return e.id===t}));return e>-1?e+1:0},findPrevOptionIndex:function(t){var e=O(a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(e){return e.id===t}));return e>-1?e-1:0},changeFocusedOptionIndex:function(t){var e=a.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=e[t>=e.length?e.length-1:t<0?0:t].getAttribute("id")},disabled:function(t){return"function"==typeof t.disabled?t.disabled():t.disabled},getMenuItemProps:function(t,e){return{action:s({tabindex:-1,"aria-hidden":!0,class:this.cx("action")},this.getPTOptions("action",t,e)),icon:s({class:[this.cx("icon"),t.icon]},this.getPTOptions("icon",t,e))}}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:n,tooltip:i}},P=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],M=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],T=["href","target","onClick"],C=["href","target"];K.render=function(t,e,n,i,o,r){var a=c("router-link"),k=l("ripple"),v=l("tooltip");return d(),u("div",s({class:t.cx("container")},t.ptm("container")),[p("ul",s({ref:"list",id:o.id,class:t.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":o.focused?r.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,onFocus:e[0]||(e[0]=function(){return r.onListFocus&&r.onListFocus.apply(r,arguments)}),onBlur:e[1]||(e[1]=function(){return r.onListBlur&&r.onListBlur.apply(r,arguments)}),onKeydown:e[2]||(e[2]=function(){return r.onListKeyDown&&r.onListKeyDown.apply(r,arguments)}),onMouseleave:e[3]||(e[3]=function(){return r.onListMouseLeave&&r.onListMouseLeave.apply(r,arguments)})},t.ptm("menu")),[(d(!0),u(m,null,f(n.model,(function(e,i){return d(),u("li",s({key:i,id:r.getItemId(i),class:t.cx("menuitem",{processedItem:e,index:i,id:r.getItemId(i)}),role:"menuitem","aria-label":e.label,"aria-disabled":r.disabled(e),onClick:function(t){return r.onItemClick(t,e)},onMouseenter:function(t){return r.onItemMouseEnter(i)}},r.getPTOptions("menuitem",e,i),{"data-p-focused":r.isItemActive(r.getItemId(i)),"data-p-disabled":r.disabled(e)||!1}),[p("div",s({class:t.cx("content")},r.getPTOptions("content",e,i)),[n.templates.item?(d(),h(y(n.templates.item),{key:1,item:e,index:i,label:e.label,props:r.getMenuItemProps(e,i)},null,8,["item","index","label","props"])):(d(),u(m,{key:0},[e.to&&!r.disabled(e)?(d(),h(a,{key:0,to:e.to,custom:""},{default:b((function(o){var a=o.navigate,c=o.href,l=o.isActive,p=o.isExactActive;return[x((d(),u("a",s({href:c,class:t.cx("action",{isActive:l,isExactActive:p}),target:e.target,tabindex:"-1","aria-hidden":"true",onClick:function(t){return r.onItemActionClick(t,e,a)}},r.getPTOptions("action",e,i)),[n.templates.icon?(d(),h(y(n.templates.icon),{key:1,item:e,class:g(t.cx("icon"))},null,8,["item","class"])):x((d(),u("span",s({key:0,class:[t.cx("icon"),e.icon]},r.getPTOptions("icon",e,i)),null,16)),[[k]])],16,T)),[[v,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):x((d(),u("a",s({key:1,href:e.url,class:t.cx("action"),target:e.target,tabindex:"-1","aria-hidden":"true"},r.getPTOptions("action",e,i)),[n.templates.icon?(d(),h(y(n.templates.icon),{key:1,item:e,class:g(t.cx("icon"))},null,8,["item","class"])):x((d(),u("span",s({key:0,class:[t.cx("icon"),e.icon]},r.getPTOptions("icon",e,i)),null,16)),[[k]])],16,C)),[[v,{value:e.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,M)})),128))],16,P)],16)};var E={name:"Dock",extends:I,beforeMount:function(){this.$slots.item||console.warn("In future versions, vue-router support will be removed. Item templating should be used.")},computed:{containerClass:function(){return[this.class,this.cx("root")]}},components:{DockSub:K}};E.render=function(t,e,n,i,o,r){var a=c("DockSub");return d(),u("div",s({class:r.containerClass,style:t.style},t.ptm("root"),{"data-pc-name":"dock"}),[k(a,{model:t.model,templates:t.$slots,exact:t.exact,tooltipOptions:t.tooltipOptions,position:t.position,menuId:t.menuId,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,tabindex:t.tabindex,pt:t.pt,unstyled:t.unstyled},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt","unstyled"])],16)};export{E as default};
package/dock/dock.js CHANGED
@@ -291,6 +291,18 @@ this.primevue.dock = (function (BaseComponent, usestyle, Ripple, Tooltip, utils,
291
291
  },
292
292
  disabled: function disabled(item) {
293
293
  return typeof item.disabled === 'function' ? item.disabled() : item.disabled;
294
+ },
295
+ getMenuItemProps: function getMenuItemProps(item, index) {
296
+ return {
297
+ action: vue.mergeProps({
298
+ tabindex: -1,
299
+ 'aria-hidden': true,
300
+ "class": this.cx('action')
301
+ }, this.getPTOptions('action', item, index)),
302
+ icon: vue.mergeProps({
303
+ "class": [this.cx('icon'), item.icon]
304
+ }, this.getPTOptions('icon', item, index))
305
+ };
294
306
  }
295
307
  },
296
308
  computed: {
@@ -416,8 +428,10 @@ this.primevue.dock = (function (BaseComponent, usestyle, Ripple, Tooltip, utils,
416
428
  }, $props.tooltipOptions]])], 64)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['item']), {
417
429
  key: 1,
418
430
  item: processedItem,
419
- index: index
420
- }, null, 8, ["item", "index"]))], 16)], 16, _hoisted_2);
431
+ index: index,
432
+ label: processedItem.label,
433
+ props: $options.getMenuItemProps(processedItem, index)
434
+ }, null, 8, ["item", "index", "label", "props"]))], 16)], 16, _hoisted_2);
421
435
  }), 128))], 16, _hoisted_1)], 16);
422
436
  }
423
437
 
@@ -426,6 +440,11 @@ this.primevue.dock = (function (BaseComponent, usestyle, Ripple, Tooltip, utils,
426
440
  var script = {
427
441
  name: 'Dock',
428
442
  "extends": script$2,
443
+ beforeMount: function beforeMount() {
444
+ if (!this.$slots.item) {
445
+ console.warn('In future versions, vue-router support will be removed. Item templating should be used.');
446
+ }
447
+ },
429
448
  computed: {
430
449
  containerClass: function containerClass() {
431
450
  return [this["class"], this.cx('root')];
package/dock/dock.min.js CHANGED
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.dock=function(e,t,n,o,i,r){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),l=a(n),s=a(o),d=t.useStyle("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),u={name:"BaseDock",extends:c.default,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(e){return["p-dock p-component","p-dock-".concat(e.props.position)]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(e){var t=e.instance,n=e.processedItem,o=e.index;return["p-dock-item",{"p-focus":t.isItemActive(e.id),"p-disabled":t.disabled(n),"p-dock-item-second-prev":t.currentIndex-2===o,"p-dock-item-prev":t.currentIndex-1===o,"p-dock-item-current":t.currentIndex===o,"p-dock-item-next":t.currentIndex+1===o,"p-dock-item-second-next":t.currentIndex+2===o}]},content:"p-menuitem-content",action:function(e){return["p-dock-link",{"router-link-active":e.isActive,"router-link-active-exact":e.props.exact&&e.isExactActive}]},icon:"p-dock-icon"},loadStyle:d.load},provide:function(){return{$parentInstance:this}}};function p(e){return k(e)||h(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function k(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var v={name:"DockSub",hostName:"Dock",extends:c.default,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(e){this.id=e||i.UniqueComponentId()}},mounted:function(){this.id=this.id||i.UniqueComponentId()},methods:{getItemId:function(e){return"".concat(this.id,"_").concat(e)},getItemProp:function(e,t){return e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0},getPTOptions:function(e,t,n){return this.ptm(e,{context:{index:n,item:t,active:this.isItemActive(this.getItemId(n))}})},isSameMenuItem:function(e){return e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(e){return e===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemActionClick:function(e,t){t&&t(e)},onItemClick:function(e,t){if(this.isSameMenuItem(e)){var n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus:function(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey:function(){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey:function(){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var e=i.DomHandler.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),t=e&&i.DomHandler.findSingle(e,'[data-pc-section="action"]');t?t.click():e&&e.click()},findNextOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=t[e>=t.length?t.length-1:e<0?0:e].getAttribute("id")},disabled:function(e){return"function"==typeof e.disabled?e.disabled():e.disabled}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:l.default,tooltip:s.default}},y=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],g=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],x=["href","target","onClick"],I=["href","target"];v.render=function(e,t,n,o,i,a){var c=r.resolveComponent("router-link"),l=r.resolveDirective("ripple"),s=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("container")},e.ptm("container")),[r.createElementVNode("ul",r.mergeProps({ref:"list",id:i.id,class:e.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":i.focused?a.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=function(){return a.onListFocus&&a.onListFocus.apply(a,arguments)}),onBlur:t[1]||(t[1]=function(){return a.onListBlur&&a.onListBlur.apply(a,arguments)}),onKeydown:t[2]||(t[2]=function(){return a.onListKeyDown&&a.onListKeyDown.apply(a,arguments)}),onMouseleave:t[3]||(t[3]=function(){return a.onListMouseLeave&&a.onListMouseLeave.apply(a,arguments)})},e.ptm("menu")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.model,(function(t,o){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:o,id:a.getItemId(o),class:e.cx("menuitem",{processedItem:t,index:o,id:a.getItemId(o)}),role:"menuitem","aria-label":t.label,"aria-disabled":a.disabled(t),onClick:function(e){return a.onItemClick(e,t)},onMouseenter:function(e){return a.onItemMouseEnter(o)}},a.getPTOptions("menuitem",t,o),{"data-p-focused":a.isItemActive(a.getItemId(o)),"data-p-disabled":a.disabled(t)||!1}),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},a.getPTOptions("content",t,o)),[n.templates.item?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.item),{key:1,item:t,index:o},null,8,["item","index"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.to&&!a.disabled(t)?(r.openBlock(),r.createBlock(c,{key:0,to:t.to,custom:""},{default:r.withCtx((function(i){var c=i.navigate,d=i.href,u=i.isActive,p=i.isExactActive;return[r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({href:d,class:e.cx("action",{isActive:u,isExactActive:p}),target:t.target,tabindex:"-1","aria-hidden":"true",onClick:function(e){return a.onItemActionClick(e,t,c)}},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,x)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({key:1,href:t.url,class:e.cx("action"),target:t.target,tabindex:"-1","aria-hidden":"true"},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[l]])],16,I)),[[s,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,g)})),128))],16,y)],16)};var O={name:"Dock",extends:u,computed:{containerClass:function(){return[this.class,this.cx("root")]}},components:{DockSub:v}};return O.render=function(e,t,n,o,i,a){var c=r.resolveComponent("DockSub");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:a.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"dock"}),[r.createVNode(c,{model:e.model,templates:e.$slots,exact:e.exact,tooltipOptions:e.tooltipOptions,position:e.position,menuId:e.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:e.tabindex,pt:e.pt,unstyled:e.unstyled},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt","unstyled"])],16)},O}(primevue.basecomponent,primevue.usestyle,primevue.ripple,primevue.tooltip,primevue.utils,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.dock=function(e,t,n,o,i,r){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=a(e),s=a(n),l=a(o),d=t.useStyle("\n.p-dock {\n position: absolute;\n z-index: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n pointer-events: none;\n}\n\n.p-dock-list-container {\n display: flex;\n pointer-events: auto;\n}\n\n.p-dock-list {\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.p-dock-item {\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n will-change: transform;\n}\n\n.p-dock-link {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n position: relative;\n overflow: hidden;\n cursor: default;\n}\n\n.p-dock-item-second-prev,\n.p-dock-item-second-next {\n transform: scale(1.2);\n}\n\n.p-dock-item-prev,\n.p-dock-item-next {\n transform: scale(1.4);\n}\n\n.p-dock-item-current {\n transform: scale(1.6);\n z-index: 1;\n}\n\n/* Position */\n/* top */\n.p-dock-top {\n left: 0;\n top: 0;\n width: 100%;\n}\n\n.p-dock-top .p-dock-item {\n transform-origin: center top;\n}\n\n/* bottom */\n.p-dock-bottom {\n left: 0;\n bottom: 0;\n width: 100%;\n}\n\n.p-dock-bottom .p-dock-item {\n transform-origin: center bottom;\n}\n\n/* right */\n.p-dock-right {\n right: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-right .p-dock-item {\n transform-origin: center right;\n}\n\n.p-dock-right .p-dock-list {\n flex-direction: column;\n}\n\n/* left */\n.p-dock-left {\n left: 0;\n top: 0;\n height: 100%;\n}\n\n.p-dock-left .p-dock-item {\n transform-origin: center left;\n}\n\n.p-dock-left .p-dock-list {\n flex-direction: column;\n}\n",{name:"dock",manual:!0}),u={name:"BaseDock",extends:c.default,props:{position:{type:String,default:"bottom"},model:null,class:null,style:null,tooltipOptions:null,exact:{type:Boolean,default:!0},menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},css:{classes:{root:function(e){return["p-dock p-component","p-dock-".concat(e.props.position)]},container:"p-dock-list-container",menu:"p-dock-list",menuitem:function(e){var t=e.instance,n=e.processedItem,o=e.index;return["p-dock-item",{"p-focus":t.isItemActive(e.id),"p-disabled":t.disabled(n),"p-dock-item-second-prev":t.currentIndex-2===o,"p-dock-item-prev":t.currentIndex-1===o,"p-dock-item-current":t.currentIndex===o,"p-dock-item-next":t.currentIndex+1===o,"p-dock-item-second-next":t.currentIndex+2===o}]},content:"p-menuitem-content",action:function(e){return["p-dock-link",{"router-link-active":e.isActive,"router-link-active-exact":e.props.exact&&e.isExactActive}]},icon:"p-dock-icon"},loadStyle:d.load},provide:function(){return{$parentInstance:this}}};function p(e){return b(e)||h(e)||f(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function f(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function b(e){if(Array.isArray(e))return k(e)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var g={name:"DockSub",hostName:"Dock",extends:c.default,emits:["focus","blur"],props:{position:{type:String,default:"bottom"},model:{type:Array,default:null},templates:{type:null,default:null},exact:{type:Boolean,default:!0},tooltipOptions:null,menuId:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},data:function(){return{id:this.menuId,currentIndex:-3,focused:!1,focusedOptionIndex:-1}},watch:{menuId:function(e){this.id=e||i.UniqueComponentId()}},mounted:function(){this.id=this.id||i.UniqueComponentId()},methods:{getItemId:function(e){return"".concat(this.id,"_").concat(e)},getItemProp:function(e,t){return e&&e.item?i.ObjectUtils.getItemValue(e.item[t]):void 0},getPTOptions:function(e,t,n){return this.ptm(e,{context:{index:n,item:t,active:this.isItemActive(this.getItemId(n))}})},isSameMenuItem:function(e){return e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest('[data-pc-section="menuitem"]')))},isItemActive:function(e){return e===this.focusedOptionIndex},onListMouseLeave:function(){this.currentIndex=-3},onItemMouseEnter:function(e){this.currentIndex=e},onItemActionClick:function(e,t){t&&t(e)},onItemClick:function(e,t){if(this.isSameMenuItem(e)){var n=this.getItemProp(t,"command");n&&n({originalEvent:e,item:t.item})}},onListFocus:function(e){this.focused=!0,this.changeFocusedOptionIndex(0),this.$emit("focus",e)},onListBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.$emit("blur",e)},onListKeyDown:function(e){switch(e.code){case"ArrowDown":"left"!==this.position&&"right"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowUp":"left"!==this.position&&"right"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"ArrowRight":"top"!==this.position&&"bottom"!==this.position||this.onArrowDownKey(),e.preventDefault();break;case"ArrowLeft":"top"!==this.position&&"bottom"!==this.position||this.onArrowUpKey(),e.preventDefault();break;case"Home":this.onHomeKey(),e.preventDefault();break;case"End":this.onEndKey(),e.preventDefault();break;case"Enter":case"Space":this.onSpaceKey(e),e.preventDefault()}},onArrowDownKey:function(){var e=this.findNextOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onArrowUpKey:function(){var e=this.findPrevOptionIndex(this.focusedOptionIndex);this.changeFocusedOptionIndex(e)},onHomeKey:function(){this.changeFocusedOptionIndex(0)},onEndKey:function(){this.changeFocusedOptionIndex(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]').length-1)},onSpaceKey:function(){var e=i.DomHandler.findSingle(this.$refs.list,'li[id="'.concat("".concat(this.focusedOptionIndex),'"]')),t=e&&i.DomHandler.findSingle(e,'[data-pc-section="action"]');t?t.click():e&&e.click()},findNextOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t+1:0},findPrevOptionIndex:function(e){var t=p(i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]')).findIndex((function(t){return t.id===e}));return t>-1?t-1:0},changeFocusedOptionIndex:function(e){var t=i.DomHandler.find(this.$refs.list,'li[data-pc-section="menuitem"][data-p-disabled="false"]');this.focusedOptionIndex=t[e>=t.length?t.length-1:e<0?0:e].getAttribute("id")},disabled:function(e){return"function"==typeof e.disabled?e.disabled():e.disabled},getMenuItemProps:function(e,t){return{action:r.mergeProps({tabindex:-1,"aria-hidden":!0,class:this.cx("action")},this.getPTOptions("action",e,t)),icon:r.mergeProps({class:[this.cx("icon"),e.icon]},this.getPTOptions("icon",e,t))}}},computed:{focusedOptionId:function(){return-1!==this.focusedOptionIndex?this.focusedOptionIndex:null}},directives:{ripple:s.default,tooltip:l.default}},v=["id","aria-orientation","aria-activedescendant","tabindex","aria-label","aria-labelledby"],x=["id","aria-label","aria-disabled","onClick","onMouseenter","data-p-focused","data-p-disabled"],y=["href","target","onClick"],I=["href","target"];g.render=function(e,t,n,o,i,a){var c=r.resolveComponent("router-link"),s=r.resolveDirective("ripple"),l=r.resolveDirective("tooltip");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:e.cx("container")},e.ptm("container")),[r.createElementVNode("ul",r.mergeProps({ref:"list",id:i.id,class:e.cx("menu"),role:"menu","aria-orientation":"bottom"===n.position||"top"===n.position?"horizontal":"vertical","aria-activedescendant":i.focused?a.focusedOptionId:void 0,tabindex:n.tabindex,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,onFocus:t[0]||(t[0]=function(){return a.onListFocus&&a.onListFocus.apply(a,arguments)}),onBlur:t[1]||(t[1]=function(){return a.onListBlur&&a.onListBlur.apply(a,arguments)}),onKeydown:t[2]||(t[2]=function(){return a.onListKeyDown&&a.onListKeyDown.apply(a,arguments)}),onMouseleave:t[3]||(t[3]=function(){return a.onListMouseLeave&&a.onListMouseLeave.apply(a,arguments)})},e.ptm("menu")),[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.model,(function(t,o){return r.openBlock(),r.createElementBlock("li",r.mergeProps({key:o,id:a.getItemId(o),class:e.cx("menuitem",{processedItem:t,index:o,id:a.getItemId(o)}),role:"menuitem","aria-label":t.label,"aria-disabled":a.disabled(t),onClick:function(e){return a.onItemClick(e,t)},onMouseenter:function(e){return a.onItemMouseEnter(o)}},a.getPTOptions("menuitem",t,o),{"data-p-focused":a.isItemActive(a.getItemId(o)),"data-p-disabled":a.disabled(t)||!1}),[r.createElementVNode("div",r.mergeProps({class:e.cx("content")},a.getPTOptions("content",t,o)),[n.templates.item?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.item),{key:1,item:t,index:o,label:t.label,props:a.getMenuItemProps(t,o)},null,8,["item","index","label","props"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.to&&!a.disabled(t)?(r.openBlock(),r.createBlock(c,{key:0,to:t.to,custom:""},{default:r.withCtx((function(i){var c=i.navigate,d=i.href,u=i.isActive,p=i.isExactActive;return[r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({href:d,class:e.cx("action",{isActive:u,isExactActive:p}),target:t.target,tabindex:"-1","aria-hidden":"true",onClick:function(e){return a.onItemActionClick(e,t,c)}},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[s]])],16,y)),[[l,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])]})),_:2},1032,["to"])):r.withDirectives((r.openBlock(),r.createElementBlock("a",r.mergeProps({key:1,href:t.url,class:e.cx("action"),target:t.target,tabindex:"-1","aria-hidden":"true"},a.getPTOptions("action",t,o)),[n.templates.icon?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(n.templates.icon),{key:1,item:t,class:r.normalizeClass(e.cx("icon"))},null,8,["item","class"])):r.withDirectives((r.openBlock(),r.createElementBlock("span",r.mergeProps({key:0,class:[e.cx("icon"),t.icon]},a.getPTOptions("icon",t,o)),null,16)),[[s]])],16,I)),[[l,{value:t.label,disabled:!n.tooltipOptions},n.tooltipOptions]])],64))],16)],16,x)})),128))],16,v)],16)};var O={name:"Dock",extends:u,beforeMount:function(){this.$slots.item||console.warn("In future versions, vue-router support will be removed. Item templating should be used.")},computed:{containerClass:function(){return[this.class,this.cx("root")]}},components:{DockSub:g}};return O.render=function(e,t,n,o,i,a){var c=r.resolveComponent("DockSub");return r.openBlock(),r.createElementBlock("div",r.mergeProps({class:a.containerClass,style:e.style},e.ptm("root"),{"data-pc-name":"dock"}),[r.createVNode(c,{model:e.model,templates:e.$slots,exact:e.exact,tooltipOptions:e.tooltipOptions,position:e.position,menuId:e.menuId,"aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,tabindex:e.tabindex,pt:e.pt,unstyled:e.unstyled},null,8,["model","templates","exact","tooltipOptions","position","menuId","aria-label","aria-labelledby","tabindex","pt","unstyled"])],16)},O}(primevue.basecomponent,primevue.usestyle,primevue.ripple,primevue.tooltip,primevue.utils,Vue);