primevue 3.44.0 → 3.46.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 (752) hide show
  1. package/accordion/Accordion.vue +1 -0
  2. package/accordion/accordion.cjs.js +1 -0
  3. package/accordion/accordion.cjs.min.js +1 -1
  4. package/accordion/accordion.esm.js +1 -0
  5. package/accordion/accordion.esm.min.js +1 -1
  6. package/accordion/accordion.js +1 -0
  7. package/accordion/accordion.min.js +1 -1
  8. package/autocomplete/BaseAutoComplete.vue +1 -1
  9. package/autocomplete/autocomplete.cjs.js +1 -1
  10. package/autocomplete/autocomplete.cjs.min.js +1 -1
  11. package/autocomplete/autocomplete.esm.js +1 -1
  12. package/autocomplete/autocomplete.esm.min.js +1 -1
  13. package/autocomplete/autocomplete.js +1 -1
  14. package/autocomplete/autocomplete.min.js +1 -1
  15. package/basecomponent/BaseComponent.vue +1 -1
  16. package/basecomponent/basecomponent.cjs.js +2 -2
  17. package/basecomponent/basecomponent.cjs.min.js +1 -1
  18. package/basecomponent/basecomponent.esm.js +2 -2
  19. package/basecomponent/basecomponent.esm.min.js +1 -1
  20. package/basecomponent/basecomponent.js +2 -2
  21. package/basecomponent/basecomponent.min.js +1 -1
  22. package/basecomponent/style/basecomponentstyle.cjs.js +1 -1
  23. package/basecomponent/style/basecomponentstyle.cjs.min.js +1 -1
  24. package/basecomponent/style/basecomponentstyle.esm.js +1 -1
  25. package/basecomponent/style/basecomponentstyle.esm.min.js +1 -1
  26. package/basecomponent/style/basecomponentstyle.js +1 -1
  27. package/basecomponent/style/basecomponentstyle.min.js +1 -1
  28. package/baseicon/BaseIcon.vue +8 -14
  29. package/baseicon/baseicon.cjs.js +10 -15
  30. package/baseicon/baseicon.cjs.min.js +1 -1
  31. package/baseicon/baseicon.esm.js +10 -15
  32. package/baseicon/baseicon.esm.min.js +1 -1
  33. package/baseicon/baseicon.js +10 -15
  34. package/baseicon/baseicon.min.js +1 -1
  35. package/calendar/BaseCalendar.vue +1 -1
  36. package/calendar/Calendar.vue +5 -2
  37. package/calendar/calendar.cjs.js +6 -3
  38. package/calendar/calendar.cjs.min.js +1 -1
  39. package/calendar/calendar.esm.js +6 -3
  40. package/calendar/calendar.esm.min.js +1 -1
  41. package/calendar/calendar.js +6 -3
  42. package/calendar/calendar.min.js +1 -1
  43. package/card/Card.d.ts +4 -0
  44. package/card/Card.vue +7 -5
  45. package/card/card.cjs.js +6 -3
  46. package/card/card.cjs.min.js +1 -1
  47. package/card/card.esm.js +6 -3
  48. package/card/card.esm.min.js +1 -1
  49. package/card/card.js +6 -3
  50. package/card/card.min.js +1 -1
  51. package/card/style/cardstyle.cjs.js +1 -0
  52. package/card/style/cardstyle.cjs.min.js +1 -1
  53. package/card/style/cardstyle.esm.js +1 -0
  54. package/card/style/cardstyle.esm.min.js +1 -1
  55. package/card/style/cardstyle.js +1 -0
  56. package/card/style/cardstyle.min.js +1 -1
  57. package/cascadeselect/BaseCascadeSelect.vue +1 -1
  58. package/cascadeselect/CascadeSelect.d.ts +41 -0
  59. package/cascadeselect/CascadeSelect.vue +1 -0
  60. package/cascadeselect/CascadeSelectSub.vue +18 -5
  61. package/cascadeselect/cascadeselect.cjs.js +20 -6
  62. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  63. package/cascadeselect/cascadeselect.esm.js +20 -6
  64. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  65. package/cascadeselect/cascadeselect.js +20 -6
  66. package/cascadeselect/cascadeselect.min.js +1 -1
  67. package/cascadeselect/style/cascadeselectstyle.cjs.js +1 -1
  68. package/cascadeselect/style/cascadeselectstyle.cjs.min.js +1 -1
  69. package/cascadeselect/style/cascadeselectstyle.esm.js +1 -1
  70. package/cascadeselect/style/cascadeselectstyle.esm.min.js +1 -1
  71. package/cascadeselect/style/cascadeselectstyle.js +1 -1
  72. package/cascadeselect/style/cascadeselectstyle.min.js +1 -1
  73. package/chips/Chips.vue +1 -0
  74. package/chips/chips.cjs.js +1 -0
  75. package/chips/chips.cjs.min.js +1 -1
  76. package/chips/chips.esm.js +1 -0
  77. package/chips/chips.esm.min.js +1 -1
  78. package/chips/chips.js +1 -0
  79. package/chips/chips.min.js +1 -1
  80. package/colorpicker/BaseColorPicker.vue +1 -1
  81. package/colorpicker/ColorPicker.d.ts +1 -1
  82. package/colorpicker/colorpicker.cjs.js +1 -1
  83. package/colorpicker/colorpicker.cjs.min.js +1 -1
  84. package/colorpicker/colorpicker.esm.js +1 -1
  85. package/colorpicker/colorpicker.esm.min.js +1 -1
  86. package/colorpicker/colorpicker.js +1 -1
  87. package/colorpicker/colorpicker.min.js +1 -1
  88. package/column/Column.d.ts +4 -0
  89. package/column/Column.vue +7 -0
  90. package/column/column.cjs.js +9 -0
  91. package/column/column.cjs.min.js +1 -1
  92. package/column/column.esm.js +9 -0
  93. package/column/column.esm.min.js +1 -1
  94. package/column/column.js +9 -0
  95. package/column/column.min.js +1 -1
  96. package/columngroup/ColumnGroup.vue +7 -0
  97. package/columngroup/columngroup.cjs.js +9 -0
  98. package/columngroup/columngroup.cjs.min.js +1 -1
  99. package/columngroup/columngroup.esm.js +9 -0
  100. package/columngroup/columngroup.esm.min.js +1 -1
  101. package/columngroup/columngroup.js +9 -0
  102. package/columngroup/columngroup.min.js +1 -1
  103. package/confirmdialog/ConfirmDialog.d.ts +1 -1
  104. package/confirmdialog/ConfirmDialog.vue +1 -1
  105. package/confirmdialog/confirmdialog.cjs.js +1 -1
  106. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  107. package/confirmdialog/confirmdialog.esm.js +1 -1
  108. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  109. package/confirmdialog/confirmdialog.js +1 -1
  110. package/confirmdialog/confirmdialog.min.js +1 -1
  111. package/confirmdialog/style/confirmdialogstyle.cjs.js +3 -6
  112. package/confirmdialog/style/confirmdialogstyle.cjs.min.js +1 -1
  113. package/confirmdialog/style/confirmdialogstyle.esm.js +3 -6
  114. package/confirmdialog/style/confirmdialogstyle.esm.min.js +1 -1
  115. package/confirmdialog/style/confirmdialogstyle.js +3 -6
  116. package/confirmdialog/style/confirmdialogstyle.min.js +1 -1
  117. package/confirmpopup/ConfirmPopup.vue +3 -3
  118. package/confirmpopup/confirmpopup.cjs.js +3 -3
  119. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  120. package/confirmpopup/confirmpopup.esm.js +3 -3
  121. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  122. package/confirmpopup/confirmpopup.js +3 -3
  123. package/confirmpopup/confirmpopup.min.js +1 -1
  124. package/confirmpopup/style/confirmpopupstyle.cjs.js +5 -8
  125. package/confirmpopup/style/confirmpopupstyle.cjs.min.js +1 -1
  126. package/confirmpopup/style/confirmpopupstyle.esm.js +5 -8
  127. package/confirmpopup/style/confirmpopupstyle.esm.min.js +1 -1
  128. package/confirmpopup/style/confirmpopupstyle.js +5 -8
  129. package/confirmpopup/style/confirmpopupstyle.min.js +1 -1
  130. package/contextmenu/BaseContextMenu.vue +1 -1
  131. package/contextmenu/ContextMenu.vue +1 -0
  132. package/contextmenu/ContextMenuSub.vue +6 -1
  133. package/contextmenu/contextmenu.cjs.js +12 -5
  134. package/contextmenu/contextmenu.cjs.min.js +1 -1
  135. package/contextmenu/contextmenu.esm.js +12 -5
  136. package/contextmenu/contextmenu.esm.min.js +1 -1
  137. package/contextmenu/contextmenu.js +12 -5
  138. package/contextmenu/contextmenu.min.js +1 -1
  139. package/core/core.js +357 -209
  140. package/core/core.min.js +53 -53
  141. package/datatable/BaseDataTable.vue +2 -2
  142. package/datatable/BodyRow.vue +582 -0
  143. package/datatable/ColumnFilter.vue +1 -0
  144. package/datatable/DataTable.d.ts +1 -1
  145. package/datatable/DataTable.vue +111 -132
  146. package/datatable/HeaderCell.vue +10 -7
  147. package/datatable/TableBody.vue +74 -414
  148. package/datatable/TableFooter.vue +19 -26
  149. package/datatable/TableHeader.vue +19 -26
  150. package/datatable/datatable.cjs.js +895 -634
  151. package/datatable/datatable.cjs.min.js +1 -1
  152. package/datatable/datatable.esm.js +896 -635
  153. package/datatable/datatable.esm.min.js +1 -1
  154. package/datatable/datatable.js +895 -634
  155. package/datatable/datatable.min.js +1 -1
  156. package/datatable/style/datatablestyle.cjs.js +5 -4
  157. package/datatable/style/datatablestyle.cjs.min.js +1 -1
  158. package/datatable/style/datatablestyle.esm.js +5 -4
  159. package/datatable/style/datatablestyle.esm.min.js +1 -1
  160. package/datatable/style/datatablestyle.js +5 -4
  161. package/datatable/style/datatablestyle.min.js +1 -1
  162. package/dialog/BaseDialog.vue +1 -1
  163. package/dialog/dialog.cjs.js +1 -1
  164. package/dialog/dialog.cjs.min.js +1 -1
  165. package/dialog/dialog.esm.js +1 -1
  166. package/dialog/dialog.esm.min.js +1 -1
  167. package/dialog/dialog.js +1 -1
  168. package/dialog/dialog.min.js +1 -1
  169. package/dialog/style/dialogstyle.cjs.js +1 -1
  170. package/dialog/style/dialogstyle.cjs.min.js +1 -1
  171. package/dialog/style/dialogstyle.esm.js +1 -1
  172. package/dialog/style/dialogstyle.esm.min.js +1 -1
  173. package/dialog/style/dialogstyle.js +1 -1
  174. package/dialog/style/dialogstyle.min.js +1 -1
  175. package/dock/DockSub.vue +1 -0
  176. package/dock/dock.cjs.js +1 -0
  177. package/dock/dock.cjs.min.js +1 -1
  178. package/dock/dock.esm.js +1 -0
  179. package/dock/dock.esm.min.js +1 -1
  180. package/dock/dock.js +1 -0
  181. package/dock/dock.min.js +1 -1
  182. package/dropdown/BaseDropdown.vue +1 -1
  183. package/dropdown/Dropdown.vue +26 -0
  184. package/dropdown/dropdown.cjs.js +50 -26
  185. package/dropdown/dropdown.cjs.min.js +1 -1
  186. package/dropdown/dropdown.esm.js +50 -26
  187. package/dropdown/dropdown.esm.min.js +1 -1
  188. package/dropdown/dropdown.js +50 -26
  189. package/dropdown/dropdown.min.js +1 -1
  190. package/fieldset/Fieldset.vue +1 -1
  191. package/fieldset/fieldset.cjs.js +1 -1
  192. package/fieldset/fieldset.cjs.min.js +1 -1
  193. package/fieldset/fieldset.esm.js +1 -1
  194. package/fieldset/fieldset.esm.min.js +1 -1
  195. package/fieldset/fieldset.js +1 -1
  196. package/fieldset/fieldset.min.js +1 -1
  197. package/galleria/GalleriaItem.vue +1 -0
  198. package/galleria/GalleriaThumbnails.vue +1 -1
  199. package/galleria/galleria.cjs.js +2 -1
  200. package/galleria/galleria.cjs.min.js +1 -1
  201. package/galleria/galleria.esm.js +2 -1
  202. package/galleria/galleria.esm.min.js +1 -1
  203. package/galleria/galleria.js +2 -1
  204. package/galleria/galleria.min.js +1 -1
  205. package/icons/arrowdown/index.cjs.js +2 -2
  206. package/icons/arrowdown/index.cjs.min.js +1 -1
  207. package/icons/arrowdown/index.esm.js +2 -2
  208. package/icons/arrowdown/index.esm.min.js +1 -1
  209. package/icons/arrowdown/index.js +2 -2
  210. package/icons/arrowdown/index.min.js +1 -1
  211. package/icons/arrowdown/index.vue +1 -1
  212. package/icons/arrowup/index.cjs.js +2 -2
  213. package/icons/arrowup/index.cjs.min.js +1 -1
  214. package/icons/arrowup/index.esm.js +2 -2
  215. package/icons/arrowup/index.esm.min.js +1 -1
  216. package/icons/arrowup/index.js +2 -2
  217. package/icons/arrowup/index.min.js +1 -1
  218. package/icons/arrowup/index.vue +1 -1
  219. package/icons/ban/index.cjs.js +2 -2
  220. package/icons/ban/index.cjs.min.js +1 -1
  221. package/icons/ban/index.esm.js +2 -2
  222. package/icons/ban/index.esm.min.js +1 -1
  223. package/icons/ban/index.js +2 -2
  224. package/icons/ban/index.min.js +1 -1
  225. package/icons/ban/index.vue +1 -1
  226. package/icons/exclamationtriangle/index.cjs.js +2 -2
  227. package/icons/exclamationtriangle/index.cjs.min.js +1 -1
  228. package/icons/exclamationtriangle/index.esm.js +2 -2
  229. package/icons/exclamationtriangle/index.esm.min.js +1 -1
  230. package/icons/exclamationtriangle/index.js +2 -2
  231. package/icons/exclamationtriangle/index.min.js +1 -1
  232. package/icons/exclamationtriangle/index.vue +1 -1
  233. package/icons/eyeslash/index.cjs.js +2 -2
  234. package/icons/eyeslash/index.cjs.min.js +1 -1
  235. package/icons/eyeslash/index.esm.js +2 -2
  236. package/icons/eyeslash/index.esm.min.js +1 -1
  237. package/icons/eyeslash/index.js +2 -2
  238. package/icons/eyeslash/index.min.js +1 -1
  239. package/icons/eyeslash/index.vue +1 -1
  240. package/icons/filter/index.cjs.js +2 -2
  241. package/icons/filter/index.cjs.min.js +1 -1
  242. package/icons/filter/index.esm.js +2 -2
  243. package/icons/filter/index.esm.min.js +1 -1
  244. package/icons/filter/index.js +2 -2
  245. package/icons/filter/index.min.js +1 -1
  246. package/icons/filter/index.vue +1 -1
  247. package/icons/filterslash/index.cjs.js +2 -2
  248. package/icons/filterslash/index.cjs.min.js +1 -1
  249. package/icons/filterslash/index.esm.js +2 -2
  250. package/icons/filterslash/index.esm.min.js +1 -1
  251. package/icons/filterslash/index.js +2 -2
  252. package/icons/filterslash/index.min.js +1 -1
  253. package/icons/filterslash/index.vue +1 -1
  254. package/icons/infocircle/index.cjs.js +2 -2
  255. package/icons/infocircle/index.cjs.min.js +1 -1
  256. package/icons/infocircle/index.esm.js +2 -2
  257. package/icons/infocircle/index.esm.min.js +1 -1
  258. package/icons/infocircle/index.js +2 -2
  259. package/icons/infocircle/index.min.js +1 -1
  260. package/icons/infocircle/index.vue +1 -1
  261. package/icons/pencil/index.cjs.js +2 -2
  262. package/icons/pencil/index.cjs.min.js +1 -1
  263. package/icons/pencil/index.esm.js +2 -2
  264. package/icons/pencil/index.esm.min.js +1 -1
  265. package/icons/pencil/index.js +2 -2
  266. package/icons/pencil/index.min.js +1 -1
  267. package/icons/pencil/index.vue +1 -1
  268. package/icons/plus/index.cjs.js +2 -2
  269. package/icons/plus/index.cjs.min.js +1 -1
  270. package/icons/plus/index.esm.js +2 -2
  271. package/icons/plus/index.esm.min.js +1 -1
  272. package/icons/plus/index.js +2 -2
  273. package/icons/plus/index.min.js +1 -1
  274. package/icons/plus/index.vue +1 -1
  275. package/icons/refresh/index.cjs.js +2 -2
  276. package/icons/refresh/index.cjs.min.js +1 -1
  277. package/icons/refresh/index.esm.js +2 -2
  278. package/icons/refresh/index.esm.min.js +1 -1
  279. package/icons/refresh/index.js +2 -2
  280. package/icons/refresh/index.min.js +1 -1
  281. package/icons/refresh/index.vue +1 -1
  282. package/icons/search/index.cjs.js +2 -2
  283. package/icons/search/index.cjs.min.js +1 -1
  284. package/icons/search/index.esm.js +2 -2
  285. package/icons/search/index.esm.min.js +1 -1
  286. package/icons/search/index.js +2 -2
  287. package/icons/search/index.min.js +1 -1
  288. package/icons/search/index.vue +1 -1
  289. package/icons/searchminus/index.cjs.js +2 -2
  290. package/icons/searchminus/index.cjs.min.js +1 -1
  291. package/icons/searchminus/index.esm.js +2 -2
  292. package/icons/searchminus/index.esm.min.js +1 -1
  293. package/icons/searchminus/index.js +2 -2
  294. package/icons/searchminus/index.min.js +1 -1
  295. package/icons/searchminus/index.vue +1 -1
  296. package/icons/searchplus/index.cjs.js +2 -2
  297. package/icons/searchplus/index.cjs.min.js +1 -1
  298. package/icons/searchplus/index.esm.js +2 -2
  299. package/icons/searchplus/index.esm.min.js +1 -1
  300. package/icons/searchplus/index.js +2 -2
  301. package/icons/searchplus/index.min.js +1 -1
  302. package/icons/searchplus/index.vue +1 -1
  303. package/icons/sortalt/index.cjs.js +2 -2
  304. package/icons/sortalt/index.cjs.min.js +1 -1
  305. package/icons/sortalt/index.esm.js +2 -2
  306. package/icons/sortalt/index.esm.min.js +1 -1
  307. package/icons/sortalt/index.js +2 -2
  308. package/icons/sortalt/index.min.js +1 -1
  309. package/icons/sortalt/index.vue +1 -1
  310. package/icons/sortamountdown/index.cjs.js +12 -9
  311. package/icons/sortamountdown/index.cjs.min.js +1 -1
  312. package/icons/sortamountdown/index.esm.js +13 -10
  313. package/icons/sortamountdown/index.esm.min.js +1 -1
  314. package/icons/sortamountdown/index.js +12 -9
  315. package/icons/sortamountdown/index.min.js +1 -1
  316. package/icons/sortamountdown/index.vue +2 -22
  317. package/icons/sortamountupalt/index.cjs.js +12 -9
  318. package/icons/sortamountupalt/index.cjs.min.js +1 -1
  319. package/icons/sortamountupalt/index.esm.js +13 -10
  320. package/icons/sortamountupalt/index.esm.min.js +1 -1
  321. package/icons/sortamountupalt/index.js +12 -9
  322. package/icons/sortamountupalt/index.min.js +1 -1
  323. package/icons/sortamountupalt/index.vue +2 -22
  324. package/icons/spinner/index.cjs.js +2 -2
  325. package/icons/spinner/index.cjs.min.js +1 -1
  326. package/icons/spinner/index.esm.js +2 -2
  327. package/icons/spinner/index.esm.min.js +1 -1
  328. package/icons/spinner/index.js +2 -2
  329. package/icons/spinner/index.min.js +1 -1
  330. package/icons/spinner/index.vue +1 -1
  331. package/icons/star/index.cjs.js +2 -2
  332. package/icons/star/index.cjs.min.js +1 -1
  333. package/icons/star/index.esm.js +2 -2
  334. package/icons/star/index.esm.min.js +1 -1
  335. package/icons/star/index.js +2 -2
  336. package/icons/star/index.min.js +1 -1
  337. package/icons/star/index.vue +1 -1
  338. package/icons/starfill/index.cjs.js +2 -2
  339. package/icons/starfill/index.cjs.min.js +1 -1
  340. package/icons/starfill/index.esm.js +2 -2
  341. package/icons/starfill/index.esm.min.js +1 -1
  342. package/icons/starfill/index.js +2 -2
  343. package/icons/starfill/index.min.js +1 -1
  344. package/icons/starfill/index.vue +1 -1
  345. package/icons/thlarge/index.cjs.js +2 -2
  346. package/icons/thlarge/index.cjs.min.js +1 -1
  347. package/icons/thlarge/index.esm.js +2 -2
  348. package/icons/thlarge/index.esm.min.js +1 -1
  349. package/icons/thlarge/index.js +2 -2
  350. package/icons/thlarge/index.min.js +1 -1
  351. package/icons/thlarge/index.vue +1 -1
  352. package/icons/timescircle/index.cjs.js +2 -2
  353. package/icons/timescircle/index.cjs.min.js +1 -1
  354. package/icons/timescircle/index.esm.js +2 -2
  355. package/icons/timescircle/index.esm.min.js +1 -1
  356. package/icons/timescircle/index.js +2 -2
  357. package/icons/timescircle/index.min.js +1 -1
  358. package/icons/timescircle/index.vue +1 -1
  359. package/icons/trash/index.cjs.js +2 -2
  360. package/icons/trash/index.cjs.min.js +1 -1
  361. package/icons/trash/index.esm.js +2 -2
  362. package/icons/trash/index.esm.min.js +1 -1
  363. package/icons/trash/index.js +2 -2
  364. package/icons/trash/index.min.js +1 -1
  365. package/icons/trash/index.vue +1 -1
  366. package/icons/undo/index.cjs.js +2 -2
  367. package/icons/undo/index.cjs.min.js +1 -1
  368. package/icons/undo/index.esm.js +2 -2
  369. package/icons/undo/index.esm.min.js +1 -1
  370. package/icons/undo/index.js +2 -2
  371. package/icons/undo/index.min.js +1 -1
  372. package/icons/undo/index.vue +1 -1
  373. package/icons/upload/index.cjs.js +2 -2
  374. package/icons/upload/index.cjs.min.js +1 -1
  375. package/icons/upload/index.esm.js +2 -2
  376. package/icons/upload/index.esm.min.js +1 -1
  377. package/icons/upload/index.js +2 -2
  378. package/icons/upload/index.min.js +1 -1
  379. package/icons/upload/index.vue +1 -1
  380. package/icons/windowmaximize/index.cjs.js +2 -2
  381. package/icons/windowmaximize/index.cjs.min.js +1 -1
  382. package/icons/windowmaximize/index.esm.js +2 -2
  383. package/icons/windowmaximize/index.esm.min.js +1 -1
  384. package/icons/windowmaximize/index.js +2 -2
  385. package/icons/windowmaximize/index.min.js +1 -1
  386. package/icons/windowmaximize/index.vue +1 -1
  387. package/icons/windowminimize/index.cjs.js +2 -2
  388. package/icons/windowminimize/index.cjs.min.js +1 -1
  389. package/icons/windowminimize/index.esm.js +2 -2
  390. package/icons/windowminimize/index.esm.min.js +1 -1
  391. package/icons/windowminimize/index.js +2 -2
  392. package/icons/windowminimize/index.min.js +1 -1
  393. package/icons/windowminimize/index.vue +1 -1
  394. package/image/Image.vue +2 -6
  395. package/image/image.cjs.js +2 -5
  396. package/image/image.cjs.min.js +1 -1
  397. package/image/image.esm.js +2 -5
  398. package/image/image.esm.min.js +1 -1
  399. package/image/image.js +2 -5
  400. package/image/image.min.js +1 -1
  401. package/image/style/imagestyle.cjs.js +1 -1
  402. package/image/style/imagestyle.cjs.min.js +1 -1
  403. package/image/style/imagestyle.esm.js +1 -1
  404. package/image/style/imagestyle.esm.min.js +1 -1
  405. package/image/style/imagestyle.js +1 -1
  406. package/image/style/imagestyle.min.js +1 -1
  407. package/inputnumber/BaseInputNumber.vue +7 -0
  408. package/inputnumber/InputNumber.d.ts +7 -0
  409. package/inputnumber/InputNumber.vue +8 -3
  410. package/inputnumber/inputnumber.cjs.js +16 -3
  411. package/inputnumber/inputnumber.cjs.min.js +1 -1
  412. package/inputnumber/inputnumber.esm.js +16 -3
  413. package/inputnumber/inputnumber.esm.min.js +1 -1
  414. package/inputnumber/inputnumber.js +16 -3
  415. package/inputnumber/inputnumber.min.js +1 -1
  416. package/knob/Knob.vue +1 -1
  417. package/knob/knob.cjs.js +1 -1
  418. package/knob/knob.cjs.min.js +1 -1
  419. package/knob/knob.esm.js +1 -1
  420. package/knob/knob.esm.min.js +1 -1
  421. package/knob/knob.js +1 -1
  422. package/knob/knob.min.js +1 -1
  423. package/listbox/BaseListbox.vue +1 -1
  424. package/listbox/Listbox.d.ts +1 -1
  425. package/listbox/Listbox.vue +2 -0
  426. package/listbox/listbox.cjs.js +3 -1
  427. package/listbox/listbox.cjs.min.js +1 -1
  428. package/listbox/listbox.esm.js +3 -1
  429. package/listbox/listbox.esm.min.js +1 -1
  430. package/listbox/listbox.js +3 -1
  431. package/listbox/listbox.min.js +1 -1
  432. package/megamenu/MegaMenu.vue +2 -1
  433. package/megamenu/megamenu.cjs.js +2 -1
  434. package/megamenu/megamenu.cjs.min.js +1 -1
  435. package/megamenu/megamenu.esm.js +2 -1
  436. package/megamenu/megamenu.esm.min.js +1 -1
  437. package/megamenu/megamenu.js +2 -1
  438. package/megamenu/megamenu.min.js +1 -1
  439. package/menu/BaseMenu.vue +1 -1
  440. package/menu/Menu.vue +1 -0
  441. package/menu/menu.cjs.js +2 -1
  442. package/menu/menu.cjs.min.js +1 -1
  443. package/menu/menu.esm.js +2 -1
  444. package/menu/menu.esm.min.js +1 -1
  445. package/menu/menu.js +2 -1
  446. package/menu/menu.min.js +1 -1
  447. package/menubar/Menubar.vue +4 -2
  448. package/menubar/MenubarSub.vue +5 -1
  449. package/menubar/menubar.cjs.js +12 -5
  450. package/menubar/menubar.cjs.min.js +1 -1
  451. package/menubar/menubar.esm.js +12 -5
  452. package/menubar/menubar.esm.min.js +1 -1
  453. package/menubar/menubar.js +12 -5
  454. package/menubar/menubar.min.js +1 -1
  455. package/menuitem/MenuItem.d.ts +0 -6
  456. package/message/style/messagestyle.cjs.js +1 -1
  457. package/message/style/messagestyle.cjs.min.js +1 -1
  458. package/message/style/messagestyle.esm.js +1 -1
  459. package/message/style/messagestyle.esm.min.js +1 -1
  460. package/message/style/messagestyle.js +1 -1
  461. package/message/style/messagestyle.min.js +1 -1
  462. package/multiselect/BaseMultiSelect.vue +1 -1
  463. package/multiselect/MultiSelect.vue +2 -0
  464. package/multiselect/multiselect.cjs.js +3 -1
  465. package/multiselect/multiselect.cjs.min.js +1 -1
  466. package/multiselect/multiselect.esm.js +3 -1
  467. package/multiselect/multiselect.esm.min.js +1 -1
  468. package/multiselect/multiselect.js +3 -1
  469. package/multiselect/multiselect.min.js +1 -1
  470. package/orderlist/BaseOrderList.vue +1 -1
  471. package/orderlist/OrderList.d.ts +1 -1
  472. package/orderlist/OrderList.vue +1 -0
  473. package/orderlist/orderlist.cjs.js +2 -1
  474. package/orderlist/orderlist.cjs.min.js +1 -1
  475. package/orderlist/orderlist.esm.js +2 -1
  476. package/orderlist/orderlist.esm.min.js +1 -1
  477. package/orderlist/orderlist.js +2 -1
  478. package/orderlist/orderlist.min.js +1 -1
  479. package/organizationchart/OrganizationChartNode.vue +1 -1
  480. package/organizationchart/organizationchart.cjs.js +1 -1
  481. package/organizationchart/organizationchart.cjs.min.js +1 -1
  482. package/organizationchart/organizationchart.esm.js +1 -1
  483. package/organizationchart/organizationchart.esm.min.js +1 -1
  484. package/organizationchart/organizationchart.js +1 -1
  485. package/organizationchart/organizationchart.min.js +1 -1
  486. package/overlaypanel/BaseOverlayPanel.vue +1 -1
  487. package/overlaypanel/overlaypanel.cjs.js +1 -1
  488. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  489. package/overlaypanel/overlaypanel.esm.js +1 -1
  490. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  491. package/overlaypanel/overlaypanel.js +1 -1
  492. package/overlaypanel/overlaypanel.min.js +1 -1
  493. package/package.json +1 -1
  494. package/paginator/Paginator.vue +4 -4
  495. package/paginator/paginator.cjs.js +2 -2
  496. package/paginator/paginator.cjs.min.js +1 -1
  497. package/paginator/paginator.esm.js +2 -2
  498. package/paginator/paginator.esm.min.js +1 -1
  499. package/paginator/paginator.js +2 -2
  500. package/paginator/paginator.min.js +1 -1
  501. package/panel/Panel.vue +1 -1
  502. package/panel/panel.cjs.js +1 -1
  503. package/panel/panel.cjs.min.js +1 -1
  504. package/panel/panel.esm.js +1 -1
  505. package/panel/panel.esm.min.js +1 -1
  506. package/panel/panel.js +1 -1
  507. package/panel/panel.min.js +1 -1
  508. package/panelmenu/PanelMenu.vue +1 -0
  509. package/panelmenu/PanelMenuList.vue +1 -0
  510. package/panelmenu/panelmenu.cjs.js +2 -0
  511. package/panelmenu/panelmenu.cjs.min.js +1 -1
  512. package/panelmenu/panelmenu.esm.js +2 -0
  513. package/panelmenu/panelmenu.esm.min.js +1 -1
  514. package/panelmenu/panelmenu.js +2 -0
  515. package/panelmenu/panelmenu.min.js +1 -1
  516. package/password/BasePassword.vue +1 -1
  517. package/password/password.cjs.js +1 -1
  518. package/password/password.cjs.min.js +1 -1
  519. package/password/password.esm.js +1 -1
  520. package/password/password.esm.min.js +1 -1
  521. package/password/password.js +1 -1
  522. package/password/password.min.js +1 -1
  523. package/picklist/BasePickList.vue +1 -1
  524. package/picklist/PickList.d.ts +1 -1
  525. package/picklist/PickList.vue +2 -1
  526. package/picklist/picklist.cjs.js +3 -2
  527. package/picklist/picklist.cjs.min.js +1 -1
  528. package/picklist/picklist.esm.js +3 -2
  529. package/picklist/picklist.esm.min.js +1 -1
  530. package/picklist/picklist.js +3 -2
  531. package/picklist/picklist.min.js +1 -1
  532. package/picklist/style/pickliststyle.cjs.js +1 -1
  533. package/picklist/style/pickliststyle.cjs.min.js +1 -1
  534. package/picklist/style/pickliststyle.esm.js +1 -1
  535. package/picklist/style/pickliststyle.esm.min.js +1 -1
  536. package/picklist/style/pickliststyle.js +1 -1
  537. package/picklist/style/pickliststyle.min.js +1 -1
  538. package/portal/Portal.vue +1 -1
  539. package/portal/portal.cjs.js +1 -1
  540. package/portal/portal.cjs.min.js +1 -1
  541. package/portal/portal.esm.js +1 -1
  542. package/portal/portal.esm.min.js +1 -1
  543. package/portal/portal.js +1 -1
  544. package/portal/portal.min.js +1 -1
  545. package/resources/themes/arya-blue/theme.css +4 -4
  546. package/resources/themes/arya-green/theme.css +4 -4
  547. package/resources/themes/arya-orange/theme.css +4 -4
  548. package/resources/themes/arya-purple/theme.css +4 -4
  549. package/resources/themes/bootstrap4-dark-blue/theme.css +4 -4
  550. package/resources/themes/bootstrap4-dark-purple/theme.css +4 -4
  551. package/resources/themes/bootstrap4-light-blue/theme.css +4 -4
  552. package/resources/themes/bootstrap4-light-purple/theme.css +4 -4
  553. package/resources/themes/fluent-light/theme.css +4 -4
  554. package/resources/themes/lara-dark-amber/theme.css +4 -4
  555. package/resources/themes/lara-dark-blue/theme.css +4 -4
  556. package/resources/themes/lara-dark-cyan/theme.css +4 -4
  557. package/resources/themes/lara-dark-green/theme.css +4 -4
  558. package/resources/themes/lara-dark-indigo/theme.css +4 -4
  559. package/resources/themes/lara-dark-pink/theme.css +4 -4
  560. package/resources/themes/lara-dark-purple/theme.css +4 -4
  561. package/resources/themes/lara-dark-teal/theme.css +4 -4
  562. package/resources/themes/lara-light-amber/theme.css +4 -4
  563. package/resources/themes/lara-light-blue/theme.css +4 -4
  564. package/resources/themes/lara-light-cyan/theme.css +4 -4
  565. package/resources/themes/lara-light-green/theme.css +4 -4
  566. package/resources/themes/lara-light-indigo/theme.css +4 -4
  567. package/resources/themes/lara-light-pink/theme.css +4 -4
  568. package/resources/themes/lara-light-purple/theme.css +4 -4
  569. package/resources/themes/lara-light-teal/theme.css +44 -44
  570. package/resources/themes/luna-amber/theme.css +4 -4
  571. package/resources/themes/luna-blue/theme.css +4 -4
  572. package/resources/themes/luna-green/theme.css +4 -4
  573. package/resources/themes/luna-pink/theme.css +4 -4
  574. package/resources/themes/md-dark-deeppurple/theme.css +4 -4
  575. package/resources/themes/md-dark-indigo/theme.css +4 -4
  576. package/resources/themes/md-light-deeppurple/theme.css +4 -4
  577. package/resources/themes/md-light-indigo/theme.css +4 -4
  578. package/resources/themes/mdc-dark-deeppurple/theme.css +4 -4
  579. package/resources/themes/mdc-dark-indigo/theme.css +4 -4
  580. package/resources/themes/mdc-light-deeppurple/theme.css +4 -4
  581. package/resources/themes/mdc-light-indigo/theme.css +4 -4
  582. package/resources/themes/mira/theme.css +4 -4
  583. package/resources/themes/nano/theme.css +4 -4
  584. package/resources/themes/nova/theme.css +4 -4
  585. package/resources/themes/nova-accent/theme.css +4 -4
  586. package/resources/themes/nova-alt/theme.css +4 -4
  587. package/resources/themes/nova-vue/theme.css +4 -4
  588. package/resources/themes/rhea/theme.css +4 -4
  589. package/resources/themes/saga-blue/theme.css +4 -4
  590. package/resources/themes/saga-green/theme.css +4 -4
  591. package/resources/themes/saga-orange/theme.css +4 -4
  592. package/resources/themes/saga-purple/theme.css +4 -4
  593. package/resources/themes/soho-dark/theme.css +4 -4
  594. package/resources/themes/soho-light/theme.css +4 -4
  595. package/resources/themes/tailwind-light/theme.css +4 -4
  596. package/resources/themes/vela-blue/theme.css +4 -4
  597. package/resources/themes/vela-green/theme.css +4 -4
  598. package/resources/themes/vela-orange/theme.css +4 -4
  599. package/resources/themes/vela-purple/theme.css +4 -4
  600. package/resources/themes/viva-dark/theme.css +4 -4
  601. package/resources/themes/viva-light/theme.css +4 -4
  602. package/ripple/style/ripplestyle.cjs.js +1 -1
  603. package/ripple/style/ripplestyle.cjs.min.js +1 -1
  604. package/ripple/style/ripplestyle.esm.js +1 -1
  605. package/ripple/style/ripplestyle.esm.min.js +1 -1
  606. package/ripple/style/ripplestyle.js +1 -1
  607. package/ripple/style/ripplestyle.min.js +1 -1
  608. package/row/Row.vue +7 -0
  609. package/row/row.cjs.js +9 -0
  610. package/row/row.cjs.min.js +1 -1
  611. package/row/row.esm.js +9 -0
  612. package/row/row.esm.min.js +1 -1
  613. package/row/row.js +9 -0
  614. package/row/row.min.js +1 -1
  615. package/sidebar/Sidebar.vue +16 -1
  616. package/sidebar/sidebar.cjs.js +17 -5
  617. package/sidebar/sidebar.cjs.min.js +1 -1
  618. package/sidebar/sidebar.esm.js +17 -5
  619. package/sidebar/sidebar.esm.min.js +1 -1
  620. package/sidebar/sidebar.js +17 -5
  621. package/sidebar/sidebar.min.js +1 -1
  622. package/slider/Slider.vue +26 -19
  623. package/slider/slider.cjs.js +19 -11
  624. package/slider/slider.cjs.min.js +1 -1
  625. package/slider/slider.esm.js +19 -11
  626. package/slider/slider.esm.min.js +1 -1
  627. package/slider/slider.js +19 -11
  628. package/slider/slider.min.js +1 -1
  629. package/speeddial/SpeedDial.vue +1 -0
  630. package/speeddial/speeddial.cjs.js +1 -0
  631. package/speeddial/speeddial.cjs.min.js +1 -1
  632. package/speeddial/speeddial.esm.js +1 -0
  633. package/speeddial/speeddial.esm.min.js +1 -1
  634. package/speeddial/speeddial.js +1 -0
  635. package/speeddial/speeddial.min.js +1 -1
  636. package/splitbutton/BaseSplitButton.vue +1 -1
  637. package/splitbutton/splitbutton.cjs.js +1 -1
  638. package/splitbutton/splitbutton.cjs.min.js +1 -1
  639. package/splitbutton/splitbutton.esm.js +1 -1
  640. package/splitbutton/splitbutton.esm.min.js +1 -1
  641. package/splitbutton/splitbutton.js +1 -1
  642. package/splitbutton/splitbutton.min.js +1 -1
  643. package/steps/Steps.vue +3 -1
  644. package/steps/steps.cjs.js +4 -2
  645. package/steps/steps.cjs.min.js +1 -1
  646. package/steps/steps.esm.js +4 -2
  647. package/steps/steps.esm.min.js +1 -1
  648. package/steps/steps.js +4 -2
  649. package/steps/steps.min.js +1 -1
  650. package/tabmenu/TabMenu.vue +1 -0
  651. package/tabmenu/tabmenu.cjs.js +1 -0
  652. package/tabmenu/tabmenu.cjs.min.js +1 -1
  653. package/tabmenu/tabmenu.esm.js +1 -0
  654. package/tabmenu/tabmenu.esm.min.js +1 -1
  655. package/tabmenu/tabmenu.js +1 -0
  656. package/tabmenu/tabmenu.min.js +1 -1
  657. package/tabview/TabView.vue +1 -0
  658. package/tabview/tabview.cjs.js +1 -0
  659. package/tabview/tabview.cjs.min.js +1 -1
  660. package/tabview/tabview.esm.js +1 -0
  661. package/tabview/tabview.esm.min.js +1 -1
  662. package/tabview/tabview.js +1 -0
  663. package/tabview/tabview.min.js +1 -1
  664. package/terminal/Terminal.vue +1 -1
  665. package/terminal/terminal.cjs.js +1 -1
  666. package/terminal/terminal.cjs.min.js +1 -1
  667. package/terminal/terminal.esm.js +1 -1
  668. package/terminal/terminal.esm.min.js +1 -1
  669. package/terminal/terminal.js +1 -1
  670. package/terminal/terminal.min.js +1 -1
  671. package/tieredmenu/BaseTieredMenu.vue +1 -1
  672. package/tieredmenu/TieredMenu.d.ts +4 -0
  673. package/tieredmenu/TieredMenu.vue +1 -0
  674. package/tieredmenu/TieredMenuSub.vue +5 -1
  675. package/tieredmenu/tieredmenu.cjs.js +11 -4
  676. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  677. package/tieredmenu/tieredmenu.esm.js +11 -4
  678. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  679. package/tieredmenu/tieredmenu.js +11 -4
  680. package/tieredmenu/tieredmenu.min.js +1 -1
  681. package/tooltip/style/tooltipstyle.cjs.js +1 -1
  682. package/tooltip/style/tooltipstyle.cjs.min.js +1 -1
  683. package/tooltip/style/tooltipstyle.esm.js +1 -1
  684. package/tooltip/style/tooltipstyle.esm.min.js +1 -1
  685. package/tooltip/style/tooltipstyle.js +1 -1
  686. package/tooltip/style/tooltipstyle.min.js +1 -1
  687. package/tree/BaseTree.vue +1 -1
  688. package/tree/Tree.d.ts +1 -1
  689. package/tree/Tree.vue +1 -1
  690. package/tree/TreeNode.vue +1 -0
  691. package/tree/tree.cjs.js +3 -2
  692. package/tree/tree.cjs.min.js +1 -1
  693. package/tree/tree.esm.js +3 -2
  694. package/tree/tree.esm.min.js +1 -1
  695. package/tree/tree.js +3 -2
  696. package/tree/tree.min.js +1 -1
  697. package/treeselect/BaseTreeSelect.vue +2 -2
  698. package/treeselect/TreeSelect.d.ts +1 -1
  699. package/treeselect/TreeSelect.vue +1 -4
  700. package/treeselect/treeselect.cjs.js +3 -6
  701. package/treeselect/treeselect.cjs.min.js +1 -1
  702. package/treeselect/treeselect.esm.js +3 -6
  703. package/treeselect/treeselect.esm.min.js +1 -1
  704. package/treeselect/treeselect.js +3 -6
  705. package/treeselect/treeselect.min.js +1 -1
  706. package/treetable/BaseTreeTable.vue +5 -1
  707. package/treetable/HeaderCell.vue +1 -1
  708. package/treetable/TreeTable.d.ts +6 -1
  709. package/treetable/TreeTable.vue +32 -24
  710. package/treetable/TreeTableRow.vue +32 -20
  711. package/treetable/style/treetablestyle.cjs.js +1 -1
  712. package/treetable/style/treetablestyle.cjs.min.js +1 -1
  713. package/treetable/style/treetablestyle.esm.js +1 -1
  714. package/treetable/style/treetablestyle.esm.min.js +1 -1
  715. package/treetable/style/treetablestyle.js +1 -1
  716. package/treetable/style/treetablestyle.min.js +1 -1
  717. package/treetable/treetable.cjs.js +70 -43
  718. package/treetable/treetable.cjs.min.js +1 -1
  719. package/treetable/treetable.esm.js +71 -44
  720. package/treetable/treetable.esm.min.js +1 -1
  721. package/treetable/treetable.js +70 -43
  722. package/treetable/treetable.min.js +1 -1
  723. package/tristatecheckbox/TriStateCheckbox.vue +1 -1
  724. package/tristatecheckbox/tristatecheckbox.cjs.js +1 -1
  725. package/tristatecheckbox/tristatecheckbox.cjs.min.js +1 -1
  726. package/tristatecheckbox/tristatecheckbox.esm.js +1 -1
  727. package/tristatecheckbox/tristatecheckbox.esm.min.js +1 -1
  728. package/tristatecheckbox/tristatecheckbox.js +1 -1
  729. package/tristatecheckbox/tristatecheckbox.min.js +1 -1
  730. package/utils/Utils.d.ts +9 -0
  731. package/utils/utils.cjs.js +142 -41
  732. package/utils/utils.cjs.min.js +1 -1
  733. package/utils/utils.esm.js +142 -42
  734. package/utils/utils.esm.min.js +1 -1
  735. package/utils/utils.js +142 -41
  736. package/utils/utils.min.js +1 -1
  737. package/vetur-attributes.json +4 -0
  738. package/vetur-tags.json +1 -0
  739. package/virtualscroller/VirtualScroller.vue +19 -15
  740. package/virtualscroller/style/virtualscrollerstyle.cjs.js +1 -1
  741. package/virtualscroller/style/virtualscrollerstyle.cjs.min.js +1 -1
  742. package/virtualscroller/style/virtualscrollerstyle.esm.js +1 -1
  743. package/virtualscroller/style/virtualscrollerstyle.esm.min.js +1 -1
  744. package/virtualscroller/style/virtualscrollerstyle.js +1 -1
  745. package/virtualscroller/style/virtualscrollerstyle.min.js +1 -1
  746. package/virtualscroller/virtualscroller.cjs.js +19 -15
  747. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  748. package/virtualscroller/virtualscroller.esm.js +19 -15
  749. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  750. package/virtualscroller/virtualscroller.js +19 -15
  751. package/virtualscroller/virtualscroller.min.js +1 -1
  752. package/web-types.json +11 -1
@@ -45,7 +45,7 @@ export default {
45
45
  default: null
46
46
  },
47
47
  appendTo: {
48
- type: String,
48
+ type: [String, Object],
49
49
  default: 'body'
50
50
  },
51
51
  loading: {
@@ -40,6 +40,10 @@ export interface CascadeSelectPassThroughMethodOptions {
40
40
  * Defines parent options.
41
41
  */
42
42
  parent: any;
43
+ /**
44
+ * Defines current options.
45
+ */
46
+ context: CascadeSelectContext;
43
47
  /**
44
48
  * Defines passthrough(pt) options in global config.
45
49
  */
@@ -194,6 +198,43 @@ export interface CascadeSelectState {
194
198
  overlayVisible: boolean;
195
199
  }
196
200
 
201
+ /**
202
+ * Defines current options in CascadeSelect component.
203
+ */
204
+ export interface CascadeSelectContext {
205
+ /**
206
+ * Current option.
207
+ */
208
+ item: any;
209
+ /**
210
+ * Index of the option.
211
+ */
212
+ index: number;
213
+ /**
214
+ * Level of the option.
215
+ */
216
+ level: number;
217
+ /**
218
+ * Current item group state of option as a boolean.
219
+ */
220
+ itemGroup: boolean;
221
+ /**
222
+ * Current active state of option as a boolean.
223
+ * @defaultValue false
224
+ */
225
+ active: boolean;
226
+ /**
227
+ * Current focused state of option as a boolean.
228
+ * @defaultValue false
229
+ */
230
+ focused: boolean;
231
+ /**
232
+ * Current disabled state of option as a boolean.
233
+ * @defaultValue false
234
+ */
235
+ disabled: boolean;
236
+ }
237
+
197
238
  /**
198
239
  * Defines valid properties in CascadeSelect component.
199
240
  */
@@ -243,6 +243,7 @@ export default {
243
243
  break;
244
244
 
245
245
  case 'Enter':
246
+ case 'NumpadEnter':
246
247
  this.onEnterKey(event);
247
248
  break;
248
249
 
@@ -11,19 +11,19 @@
11
11
  :aria-level="level + 1"
12
12
  :aria-setsize="options.length"
13
13
  :aria-posinset="index + 1"
14
- v-bind="ptm('item')"
14
+ v-bind="getPTOptions(processedOption, index, 'item')"
15
15
  :data-p-item-group="isOptionGroup(processedOption)"
16
16
  :data-p-highlight="isOptionActive(processedOption)"
17
17
  :data-p-focus="isOptionFocused(processedOption)"
18
18
  :data-p-disabled="isOptionDisabled(processedOption)"
19
19
  >
20
- <div v-ripple :class="cx('content')" @click="onOptionClick($event, processedOption)" v-bind="ptm('content')">
20
+ <div v-ripple :class="cx('content')" @click="onOptionClick($event, processedOption)" v-bind="getPTOptions(processedOption, index, 'content')">
21
21
  <component v-if="templates['option']" :is="templates['option']" :option="processedOption.option" />
22
- <span v-else :class="cx('text')" v-bind="ptm('text')">{{ getOptionLabelToRender(processedOption) }}</span>
22
+ <span v-else :class="cx('text')" v-bind="getPTOptions(processedOption, index, 'text')">{{ getOptionLabelToRender(processedOption) }}</span>
23
23
  <template v-if="isOptionGroup(processedOption)">
24
24
  <component v-if="templates['optiongroupicon']" :is="templates['optiongroupicon']" aria-hidden="true" />
25
- <span v-else-if="optionGroupIcon" :class="[cx('groupIcon'), optionGroupIcon]" aria-hidden="true" v-bind="ptm('groupIcon')" />
26
- <AngleRightIcon v-else :class="cx('groupIcon')" aria-hidden="true" v-bind="ptm('groupIcon')" />
25
+ <span v-else-if="optionGroupIcon" :class="[cx('groupIcon'), optionGroupIcon]" aria-hidden="true" v-bind="getPTOptions(processedOption, index, 'groupIcon')" />
26
+ <AngleRightIcon v-else :class="cx('groupIcon')" aria-hidden="true" v-bind="getPTOptions(processedOption, index, 'groupIcon')" />
27
27
  </template>
28
28
  </div>
29
29
  <CascadeSelectSub
@@ -109,6 +109,19 @@ export default {
109
109
  getOptionValue(processedOption) {
110
110
  return this.optionValue ? ObjectUtils.resolveFieldData(processedOption.option, this.optionValue) : processedOption.option;
111
111
  },
112
+ getPTOptions(processedOption, index, key) {
113
+ return this.ptm(key, {
114
+ context: {
115
+ item: processedOption,
116
+ index,
117
+ level: this.level,
118
+ itemGroup: this.isOptionGroup(processedOption),
119
+ active: this.isOptionActive(processedOption),
120
+ focused: this.isOptionFocused(processedOption),
121
+ disabled: this.isOptionDisabled(processedOption)
122
+ }
123
+ });
124
+ },
112
125
  isOptionDisabled(processedOption) {
113
126
  return this.optionDisabled ? ObjectUtils.resolveFieldData(processedOption.option, this.optionDisabled) : false;
114
127
  },
@@ -65,7 +65,7 @@ var script$2 = {
65
65
  "default": null
66
66
  },
67
67
  appendTo: {
68
- type: String,
68
+ type: [String, Object],
69
69
  "default": 'body'
70
70
  },
71
71
  loading: {
@@ -188,6 +188,19 @@ var script$1 = {
188
188
  getOptionValue: function getOptionValue(processedOption) {
189
189
  return this.optionValue ? utils.ObjectUtils.resolveFieldData(processedOption.option, this.optionValue) : processedOption.option;
190
190
  },
191
+ getPTOptions: function getPTOptions(processedOption, index, key) {
192
+ return this.ptm(key, {
193
+ context: {
194
+ item: processedOption,
195
+ index: index,
196
+ level: this.level,
197
+ itemGroup: this.isOptionGroup(processedOption),
198
+ active: this.isOptionActive(processedOption),
199
+ focused: this.isOptionFocused(processedOption),
200
+ disabled: this.isOptionDisabled(processedOption)
201
+ }
202
+ });
203
+ },
191
204
  isOptionDisabled: function isOptionDisabled(processedOption) {
192
205
  return this.optionDisabled ? utils.ObjectUtils.resolveFieldData(processedOption.option, this.optionDisabled) : false;
193
206
  },
@@ -259,7 +272,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
259
272
  "aria-level": $props.level + 1,
260
273
  "aria-setsize": $props.options.length,
261
274
  "aria-posinset": index + 1
262
- }, _ctx.ptm('item'), {
275
+ }, $options.getPTOptions(processedOption, index, 'item'), {
263
276
  "data-p-item-group": $options.isOptionGroup(processedOption),
264
277
  "data-p-highlight": $options.isOptionActive(processedOption),
265
278
  "data-p-focus": $options.isOptionFocused(processedOption),
@@ -269,13 +282,13 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
269
282
  onClick: function onClick($event) {
270
283
  return $options.onOptionClick($event, processedOption);
271
284
  }
272
- }, _ctx.ptm('content')), [$props.templates['option'] ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['option']), {
285
+ }, $options.getPTOptions(processedOption, index, 'content')), [$props.templates['option'] ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['option']), {
273
286
  key: 0,
274
287
  option: processedOption.option
275
288
  }, null, 8, ["option"])) : (vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
276
289
  key: 1,
277
290
  "class": _ctx.cx('text')
278
- }, _ctx.ptm('text')), vue.toDisplayString($options.getOptionLabelToRender(processedOption)), 17)), $options.isOptionGroup(processedOption) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
291
+ }, $options.getPTOptions(processedOption, index, 'text')), vue.toDisplayString($options.getOptionLabelToRender(processedOption)), 17)), $options.isOptionGroup(processedOption) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, {
279
292
  key: 2
280
293
  }, [$props.templates['optiongroupicon'] ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent($props.templates['optiongroupicon']), {
281
294
  key: 0,
@@ -284,11 +297,11 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
284
297
  key: 1,
285
298
  "class": [_ctx.cx('groupIcon'), $props.optionGroupIcon],
286
299
  "aria-hidden": "true"
287
- }, _ctx.ptm('groupIcon')), null, 16)) : (vue.openBlock(), vue.createBlock(_component_AngleRightIcon, vue.mergeProps({
300
+ }, $options.getPTOptions(processedOption, index, 'groupIcon')), null, 16)) : (vue.openBlock(), vue.createBlock(_component_AngleRightIcon, vue.mergeProps({
288
301
  key: 2,
289
302
  "class": _ctx.cx('groupIcon'),
290
303
  "aria-hidden": "true"
291
- }, _ctx.ptm('groupIcon')), null, 16, ["class"]))], 64)) : vue.createCommentVNode("", true)], 16, _hoisted_2)), [[_directive_ripple]]), $options.isOptionGroup(processedOption) && $options.isOptionActive(processedOption) ? (vue.openBlock(), vue.createBlock(_component_CascadeSelectSub, {
304
+ }, $options.getPTOptions(processedOption, index, 'groupIcon')), null, 16, ["class"]))], 64)) : vue.createCommentVNode("", true)], 16, _hoisted_2)), [[_directive_ripple]]), $options.isOptionGroup(processedOption) && $options.isOptionActive(processedOption) ? (vue.openBlock(), vue.createBlock(_component_CascadeSelectSub, {
292
305
  key: 0,
293
306
  role: "group",
294
307
  "class": vue.normalizeClass(_ctx.cx('sublist')),
@@ -473,6 +486,7 @@ var script = {
473
486
  this.onSpaceKey(event);
474
487
  break;
475
488
  case 'Enter':
489
+ case 'NumpadEnter':
476
490
  this.onEnterKey(event);
477
491
  break;
478
492
  case 'Escape':
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/icons/angleright"),t=require("primevue/icons/chevrondown"),i=require("primevue/icons/spinner"),n=require("primevue/overlayeventbus"),o=require("primevue/portal"),s=require("primevue/utils"),r=require("primevue/basecomponent"),l=require("primevue/cascadeselect/style"),a=require("primevue/ripple"),c=require("vue");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=p(e),d=p(t),h=p(i),f=p(n),O=p(o),v=p(r),y={name:"BaseCascadeSelect",extends:v.default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},optionGroupIcon:{type:String,default:void 0},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:p(l).default,provide:function(){return{$parentInstance:this}}},b={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:v.default,emits:["option-change"],container:null,props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:{type:[String,Array],default:null},activeOptionPath:Array,level:Number,templates:null,isParentMount:Boolean},data:function(){return{mounted:!1}},watch:{isParentMount:{handler:function(e){e&&s.DomHandler.nestedPosition(this.container,this.level)}}},mounted:function(){(this.isParentMount||0===this.level)&&s.DomHandler.nestedPosition(this.container,this.level),this.mounted=!0},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},containerRef:function(e){this.container=e}},directives:{ripple:p(a).default},components:{AngleRightIcon:u.default}},m=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],g=["onClick"];b.render=function(e,t,i,n,o,s){var r=c.resolveComponent("AngleRightIcon"),l=c.resolveComponent("CascadeSelectSub",!0),a=c.resolveDirective("ripple");return c.openBlock(),c.createElementBlock("ul",c.mergeProps({ref:s.containerRef,class:e.cx("list")},e.ptm(0===i.level?"list":"sublist")),[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.options,(function(t,n){return c.openBlock(),c.createElementBlock("li",c.mergeProps({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption:t}),role:"treeitem","aria-label":s.getOptionLabelToRender(t),"aria-selected":s.isOptionGroup(t)?void 0:s.isOptionSelected(t),"aria-expanded":s.isOptionGroup(t)?s.isOptionActive(t):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":n+1},e.ptm("item"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[c.withDirectives((c.openBlock(),c.createElementBlock("div",c.mergeProps({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},e.ptm("content")),[i.templates.option?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.option),{key:0,option:t.option},null,8,["option"])):(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:e.cx("text")},e.ptm("text")),c.toDisplayString(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[i.templates.optiongroupicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):i.optionGroupIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:[e.cx("groupIcon"),i.optionGroupIcon],"aria-hidden":"true"},e.ptm("groupIcon")),null,16)):(c.openBlock(),c.createBlock(r,c.mergeProps({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},e.ptm("groupIcon")),null,16,["class"]))],64)):c.createCommentVNode("",!0)],16,g)),[[a]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(c.openBlock(),c.createBlock(l,{key:0,role:"group",class:c.normalizeClass(e.cx("sublist")),selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:s.getOptionGroupChildren(t),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled,isParentMount:o.mounted},null,8,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled","isParentMount"])):c.createCommentVNode("",!0)],16,m)})),128))],16)};var I={name:"CascadeSelect",extends:y,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){return{id:this.$attrs.id,focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||s.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||s.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return s.ObjectUtils.isString(this.optionGroupChildren)?s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren):s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&s.ObjectUtils.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&s.DomHandler.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&s.DomHandler.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,i=e.processedOption,n=e.isFocus,o=e.isHide;if(!s.ObjectUtils.isEmpty(i)){var r=i.index,l=i.level,a=i.parentKey,c=s.ObjectUtils.isNotEmpty(i.children),p=this.activeOptionPath.filter((function(e){return e.parentKey!==a}));p.push(i),this.focusedOptionInfo={index:r,level:l,parentKey:a},this.activeOptionPath=p,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&s.DomHandler.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),s.DomHandler.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){f.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var i=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((function(e){return e.key===i.parentKey})),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,r=s.ObjectUtils.isEmpty(i.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),r||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return t.key===e.key}))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t});e.preventDefault()}},onHomeKey:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),s.DomHandler.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){s.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new s.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!s.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return s.ObjectUtils.isNotEmpty(e)&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return s.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===i&&this.processedOptions))return null;if(s.ObjectUtils.isEmpty(e))return[];for(var n=0;n<t.length;n++){var o=t[n];if(s.ObjectUtils.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var r=this.findOptionPathByValue(e,o.children,i+1);if(r)return r.unshift(o),r}},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionInfo.index?-1===(n=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionInfo.index&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.onOptionChange({originalEvent:e,processedOption:this.visibleOptions[t],isHide:!1}))},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=s.DomHandler.findSingle(this.list,'li[id="'.concat(t,'"]'));i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex(),this.onOptionChange({processedOption:this.visibleOptions[this.focusedOptionInfo.index],isHide:!1}),!this.overlayVisible&&(this.focusedOptionInfo={index:-1,level:0,parentKey:""}))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,r){var l=(""!==o?o+"_":"")+r,a={option:e,index:r,level:i,key:l,parent:n,parentKey:o};a.children=t.createProcessedOptions(t.getOptionGroupChildren(e,i),i+1,a,l),s.push(a)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return s.ObjectUtils.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),i=s.ObjectUtils.isNotEmpty(t)?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return s.ObjectUtils.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(s.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:b,Portal:O.default,ChevronDownIcon:d.default,SpinnerIcon:h.default,AngleRightIcon:u.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 L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function S(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?L(Object(i),!0).forEach((function(t){k(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function k(e,t,i){var n;return(t="symbol"==x(n=C(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function C(e,t){if("object"!=x(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var P=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];I.render=function(e,t,i,n,o,s){var r=c.resolveComponent("SpinnerIcon"),l=c.resolveComponent("CascadeSelectSub"),a=c.resolveComponent("Portal");return c.openBlock(),c.createElementBlock("div",c.mergeProps({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[c.createElementVNode("div",c.mergeProps({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[c.createElementVNode("input",c.mergeProps({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_tree","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},S(S({},e.inputProps),e.ptm("input"))),null,16,P)],16),c.createElementVNode("span",c.mergeProps({class:e.cx("label")},e.ptm("label")),[c.renderSlot(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[c.createTextVNode(c.toDisplayString(s.label),1)]}))],16),c.createElementVNode("div",c.mergeProps({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?c.renderSlot(e.$slots,"loadingicon",{key:0,class:c.normalizeClass(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(c.openBlock(),c.createBlock(r,c.mergeProps({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):c.renderSlot(e.$slots,"dropdownicon",{key:1,class:c.normalizeClass(e.cx("dropdownIcon"))},(function(){return[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(e.dropdownIcon?"span":"ChevronDownIcon"),c.mergeProps({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.searchResultMessageText),17),c.createVNode(a,{appendTo:e.appendTo},{default:c.withCtx((function(){return[c.createVNode(c.Transition,c.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:c.withCtx((function(){return[o.overlayVisible?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},S(S({},e.panelProps),e.ptm("panel"))),[c.createElementVNode("div",c.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[c.createVNode(l,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:o.focused?s.focusedOptionId:void 0,options:s.processedOptions,activeOptionPath:o.activeOptionPath,level:0,templates:e.$slots,optionLabel:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.selectedMessageText),17)],16)):c.createCommentVNode("",!0)]})),_:1},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)},module.exports=I;
1
+ "use strict";var e=require("primevue/icons/angleright"),t=require("primevue/icons/chevrondown"),i=require("primevue/icons/spinner"),n=require("primevue/overlayeventbus"),o=require("primevue/portal"),s=require("primevue/utils"),r=require("primevue/basecomponent"),l=require("primevue/cascadeselect/style"),a=require("primevue/ripple"),c=require("vue");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=p(e),d=p(t),h=p(i),f=p(n),O=p(o),v=p(r),y={name:"BaseCascadeSelect",extends:v.default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},appendTo:{type:[String,Object],default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},optionGroupIcon:{type:String,default:void 0},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:p(l).default,provide:function(){return{$parentInstance:this}}},b={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:v.default,emits:["option-change"],container:null,props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:{type:[String,Array],default:null},activeOptionPath:Array,level:Number,templates:null,isParentMount:Boolean},data:function(){return{mounted:!1}},watch:{isParentMount:{handler:function(e){e&&s.DomHandler.nestedPosition(this.container,this.level)}}},mounted:function(){(this.isParentMount||0===this.level)&&s.DomHandler.nestedPosition(this.container,this.level),this.mounted=!0},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e.option,this.optionValue):e.option},getPTOptions:function(e,t,i){return this.ptm(i,{context:{item:e,index:t,level:this.level,itemGroup:this.isOptionGroup(e),active:this.isOptionActive(e),focused:this.isOptionFocused(e),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},containerRef:function(e){this.container=e}},directives:{ripple:p(a).default},components:{AngleRightIcon:u.default}},m=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],g=["onClick"];b.render=function(e,t,i,n,o,s){var r=c.resolveComponent("AngleRightIcon"),l=c.resolveComponent("CascadeSelectSub",!0),a=c.resolveDirective("ripple");return c.openBlock(),c.createElementBlock("ul",c.mergeProps({ref:s.containerRef,class:e.cx("list")},e.ptm(0===i.level?"list":"sublist")),[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.options,(function(t,n){return c.openBlock(),c.createElementBlock("li",c.mergeProps({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption:t}),role:"treeitem","aria-label":s.getOptionLabelToRender(t),"aria-selected":s.isOptionGroup(t)?void 0:s.isOptionSelected(t),"aria-expanded":s.isOptionGroup(t)?s.isOptionActive(t):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":n+1},s.getPTOptions(t,n,"item"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[c.withDirectives((c.openBlock(),c.createElementBlock("div",c.mergeProps({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},s.getPTOptions(t,n,"content")),[i.templates.option?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.option),{key:0,option:t.option},null,8,["option"])):(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:e.cx("text")},s.getPTOptions(t,n,"text")),c.toDisplayString(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[i.templates.optiongroupicon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(i.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):i.optionGroupIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:1,class:[e.cx("groupIcon"),i.optionGroupIcon],"aria-hidden":"true"},s.getPTOptions(t,n,"groupIcon")),null,16)):(c.openBlock(),c.createBlock(r,c.mergeProps({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},s.getPTOptions(t,n,"groupIcon")),null,16,["class"]))],64)):c.createCommentVNode("",!0)],16,g)),[[a]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(c.openBlock(),c.createBlock(l,{key:0,role:"group",class:c.normalizeClass(e.cx("sublist")),selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:s.getOptionGroupChildren(t),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled,isParentMount:o.mounted},null,8,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled","isParentMount"])):c.createCommentVNode("",!0)],16,m)})),128))],16)};var I={name:"CascadeSelect",extends:y,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){return{id:this.$attrs.id,focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||s.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||s.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?s.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?s.ObjectUtils.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&s.ObjectUtils.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?s.ObjectUtils.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return s.ObjectUtils.isString(this.optionGroupChildren)?s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren):s.ObjectUtils.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return s.ObjectUtils.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&s.ObjectUtils.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&s.DomHandler.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&s.DomHandler.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&s.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,i=e.processedOption,n=e.isFocus,o=e.isHide;if(!s.ObjectUtils.isEmpty(i)){var r=i.index,l=i.level,a=i.parentKey,c=s.ObjectUtils.isNotEmpty(i.children),p=this.activeOptionPath.filter((function(e){return e.parentKey!==a}));p.push(i),this.focusedOptionInfo={index:r,level:l,parentKey:a},this.activeOptionPath=p,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&s.DomHandler.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),s.DomHandler.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){f.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var i=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((function(e){return e.key===i.parentKey})),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,r=s.ObjectUtils.isEmpty(i.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),r||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return t.key===e.key}))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t});e.preventDefault()}},onHomeKey:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){s.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),s.DomHandler.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){s.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?s.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.DomHandler.getOuterWidth(this.$el)+"px",s.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new s.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!s.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return s.ObjectUtils.isNotEmpty(e)&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return s.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?s.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===i&&this.processedOptions))return null;if(s.ObjectUtils.isEmpty(e))return[];for(var n=0;n<t.length;n++){var o=t[n];if(s.ObjectUtils.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var r=this.findOptionPathByValue(e,o.children,i+1);if(r)return r.unshift(o),r}},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionInfo.index?-1===(n=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionInfo.index&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.onOptionChange({originalEvent:e,processedOption:this.visibleOptions[t],isHide:!1}))},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=s.DomHandler.findSingle(this.list,'li[id="'.concat(t,'"]'));i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex(),this.onOptionChange({processedOption:this.visibleOptions[this.focusedOptionInfo.index],isHide:!1}),!this.overlayVisible&&(this.focusedOptionInfo={index:-1,level:0,parentKey:""}))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,r){var l=(""!==o?o+"_":"")+r,a={option:e,index:r,level:i,key:l,parent:n,parentKey:o};a.children=t.createProcessedOptions(t.getOptionGroupChildren(e,i),i+1,a,l),s.push(a)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return s.ObjectUtils.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),i=s.ObjectUtils.isNotEmpty(t)?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return s.ObjectUtils.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(s.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:b,Portal:O.default,ChevronDownIcon:d.default,SpinnerIcon:h.default,AngleRightIcon:u.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 L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function S(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?L(Object(i),!0).forEach((function(t){k(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function k(e,t,i){var n;return(t="symbol"==x(n=P(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function P(e,t){if("object"!=x(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var C=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];I.render=function(e,t,i,n,o,s){var r=c.resolveComponent("SpinnerIcon"),l=c.resolveComponent("CascadeSelectSub"),a=c.resolveComponent("Portal");return c.openBlock(),c.createElementBlock("div",c.mergeProps({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[c.createElementVNode("div",c.mergeProps({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[c.createElementVNode("input",c.mergeProps({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_tree","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},S(S({},e.inputProps),e.ptm("input"))),null,16,C)],16),c.createElementVNode("span",c.mergeProps({class:e.cx("label")},e.ptm("label")),[c.renderSlot(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[c.createTextVNode(c.toDisplayString(s.label),1)]}))],16),c.createElementVNode("div",c.mergeProps({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?c.renderSlot(e.$slots,"loadingicon",{key:0,class:c.normalizeClass(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(c.openBlock(),c.createElementBlock("span",c.mergeProps({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(c.openBlock(),c.createBlock(r,c.mergeProps({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):c.renderSlot(e.$slots,"dropdownicon",{key:1,class:c.normalizeClass(e.cx("dropdownIcon"))},(function(){return[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(e.dropdownIcon?"span":"ChevronDownIcon"),c.mergeProps({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.searchResultMessageText),17),c.createVNode(a,{appendTo:e.appendTo},{default:c.withCtx((function(){return[c.createVNode(c.Transition,c.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:c.withCtx((function(){return[o.overlayVisible?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},S(S({},e.panelProps),e.ptm("panel"))),[c.createElementVNode("div",c.mergeProps({class:e.cx("wrapper")},e.ptm("wrapper")),[c.createVNode(l,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:o.focused?s.focusedOptionId:void 0,options:s.processedOptions,activeOptionPath:o.activeOptionPath,level:0,templates:e.$slots,optionLabel:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])],16),c.createElementVNode("span",c.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),c.toDisplayString(s.selectedMessageText),17)],16)):c.createCommentVNode("",!0)]})),_:1},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)},module.exports=I;
@@ -52,7 +52,7 @@ var script$2 = {
52
52
  "default": null
53
53
  },
54
54
  appendTo: {
55
- type: String,
55
+ type: [String, Object],
56
56
  "default": 'body'
57
57
  },
58
58
  loading: {
@@ -175,6 +175,19 @@ var script$1 = {
175
175
  getOptionValue: function getOptionValue(processedOption) {
176
176
  return this.optionValue ? ObjectUtils.resolveFieldData(processedOption.option, this.optionValue) : processedOption.option;
177
177
  },
178
+ getPTOptions: function getPTOptions(processedOption, index, key) {
179
+ return this.ptm(key, {
180
+ context: {
181
+ item: processedOption,
182
+ index: index,
183
+ level: this.level,
184
+ itemGroup: this.isOptionGroup(processedOption),
185
+ active: this.isOptionActive(processedOption),
186
+ focused: this.isOptionFocused(processedOption),
187
+ disabled: this.isOptionDisabled(processedOption)
188
+ }
189
+ });
190
+ },
178
191
  isOptionDisabled: function isOptionDisabled(processedOption) {
179
192
  return this.optionDisabled ? ObjectUtils.resolveFieldData(processedOption.option, this.optionDisabled) : false;
180
193
  },
@@ -246,7 +259,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
246
259
  "aria-level": $props.level + 1,
247
260
  "aria-setsize": $props.options.length,
248
261
  "aria-posinset": index + 1
249
- }, _ctx.ptm('item'), {
262
+ }, $options.getPTOptions(processedOption, index, 'item'), {
250
263
  "data-p-item-group": $options.isOptionGroup(processedOption),
251
264
  "data-p-highlight": $options.isOptionActive(processedOption),
252
265
  "data-p-focus": $options.isOptionFocused(processedOption),
@@ -256,13 +269,13 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
256
269
  onClick: function onClick($event) {
257
270
  return $options.onOptionClick($event, processedOption);
258
271
  }
259
- }, _ctx.ptm('content')), [$props.templates['option'] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates['option']), {
272
+ }, $options.getPTOptions(processedOption, index, 'content')), [$props.templates['option'] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates['option']), {
260
273
  key: 0,
261
274
  option: processedOption.option
262
275
  }, null, 8, ["option"])) : (openBlock(), createElementBlock("span", mergeProps({
263
276
  key: 1,
264
277
  "class": _ctx.cx('text')
265
- }, _ctx.ptm('text')), toDisplayString($options.getOptionLabelToRender(processedOption)), 17)), $options.isOptionGroup(processedOption) ? (openBlock(), createElementBlock(Fragment, {
278
+ }, $options.getPTOptions(processedOption, index, 'text')), toDisplayString($options.getOptionLabelToRender(processedOption)), 17)), $options.isOptionGroup(processedOption) ? (openBlock(), createElementBlock(Fragment, {
266
279
  key: 2
267
280
  }, [$props.templates['optiongroupicon'] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates['optiongroupicon']), {
268
281
  key: 0,
@@ -271,11 +284,11 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
271
284
  key: 1,
272
285
  "class": [_ctx.cx('groupIcon'), $props.optionGroupIcon],
273
286
  "aria-hidden": "true"
274
- }, _ctx.ptm('groupIcon')), null, 16)) : (openBlock(), createBlock(_component_AngleRightIcon, mergeProps({
287
+ }, $options.getPTOptions(processedOption, index, 'groupIcon')), null, 16)) : (openBlock(), createBlock(_component_AngleRightIcon, mergeProps({
275
288
  key: 2,
276
289
  "class": _ctx.cx('groupIcon'),
277
290
  "aria-hidden": "true"
278
- }, _ctx.ptm('groupIcon')), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_2)), [[_directive_ripple]]), $options.isOptionGroup(processedOption) && $options.isOptionActive(processedOption) ? (openBlock(), createBlock(_component_CascadeSelectSub, {
291
+ }, $options.getPTOptions(processedOption, index, 'groupIcon')), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_2)), [[_directive_ripple]]), $options.isOptionGroup(processedOption) && $options.isOptionActive(processedOption) ? (openBlock(), createBlock(_component_CascadeSelectSub, {
279
292
  key: 0,
280
293
  role: "group",
281
294
  "class": normalizeClass(_ctx.cx('sublist')),
@@ -460,6 +473,7 @@ var script = {
460
473
  this.onSpaceKey(event);
461
474
  break;
462
475
  case 'Enter':
476
+ case 'NumpadEnter':
463
477
  this.onEnterKey(event);
464
478
  break;
465
479
  case 'Escape':
@@ -1 +1 @@
1
- import e from"primevue/icons/angleright";import t from"primevue/icons/chevrondown";import i from"primevue/icons/spinner";import n from"primevue/overlayeventbus";import o from"primevue/portal";import{DomHandler as s,ObjectUtils as r,UniqueComponentId as a,ZIndexUtils as l,ConnectedOverlayScrollHandler as p}from"primevue/utils";import c from"primevue/basecomponent";import u from"primevue/cascadeselect/style";import d from"primevue/ripple";import{resolveComponent as h,resolveDirective as f,openBlock as O,createElementBlock as v,mergeProps as y,Fragment as b,renderList as g,withDirectives as m,createBlock as I,resolveDynamicComponent as x,toDisplayString as L,createCommentVNode as S,normalizeClass as w,createElementVNode as C,renderSlot as P,createTextVNode as V,createVNode as k,withCtx as K,Transition as G}from"vue";var D={name:"BaseCascadeSelect",extends:c,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},optionGroupIcon:{type:String,default:void 0},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:u,provide:function(){return{$parentInstance:this}}},E={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:c,emits:["option-change"],container:null,props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:{type:[String,Array],default:null},activeOptionPath:Array,level:Number,templates:null,isParentMount:Boolean},data:function(){return{mounted:!1}},watch:{isParentMount:{handler:function(e){e&&s.nestedPosition(this.container,this.level)}}},mounted:function(){(this.isParentMount||0===this.level)&&s.nestedPosition(this.container,this.level),this.mounted=!0},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?r.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?r.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled:function(e){return!!this.optionDisabled&&r.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?r.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return r.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},containerRef:function(e){this.container=e}},directives:{ripple:d},components:{AngleRightIcon:e}},F=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],M=["onClick"];E.render=function(e,t,i,n,o,s){var r=h("AngleRightIcon"),a=h("CascadeSelectSub",!0),l=f("ripple");return O(),v("ul",y({ref:s.containerRef,class:e.cx("list")},e.ptm(0===i.level?"list":"sublist")),[(O(!0),v(b,null,g(i.options,(function(t,n){return O(),v("li",y({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption:t}),role:"treeitem","aria-label":s.getOptionLabelToRender(t),"aria-selected":s.isOptionGroup(t)?void 0:s.isOptionSelected(t),"aria-expanded":s.isOptionGroup(t)?s.isOptionActive(t):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":n+1},e.ptm("item"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[m((O(),v("div",y({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},e.ptm("content")),[i.templates.option?(O(),I(x(i.templates.option),{key:0,option:t.option},null,8,["option"])):(O(),v("span",y({key:1,class:e.cx("text")},e.ptm("text")),L(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(O(),v(b,{key:2},[i.templates.optiongroupicon?(O(),I(x(i.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):i.optionGroupIcon?(O(),v("span",y({key:1,class:[e.cx("groupIcon"),i.optionGroupIcon],"aria-hidden":"true"},e.ptm("groupIcon")),null,16)):(O(),I(r,y({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},e.ptm("groupIcon")),null,16,["class"]))],64)):S("",!0)],16,M)),[[l]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(O(),I(a,{key:0,role:"group",class:w(e.cx("sublist")),selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:s.getOptionGroupChildren(t),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled,isParentMount:o.mounted},null,8,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled","isParentMount"])):S("",!0)],16,F)})),128))],16)};var A={name:"CascadeSelect",extends:D,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){return{id:this.$attrs.id,focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||a()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||a(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(l.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?r.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?r.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&r.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?r.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return r.isString(this.optionGroupChildren)?r.resolveFieldData(e,this.optionGroupChildren):r.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return r.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&r.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&s.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&s.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&r.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,i=e.processedOption,n=e.isFocus,o=e.isHide;if(!r.isEmpty(i)){var a=i.index,l=i.level,p=i.parentKey,c=r.isNotEmpty(i.children),u=this.activeOptionPath.filter((function(e){return e.parentKey!==p}));u.push(i),this.focusedOptionInfo={index:a,level:l,parentKey:p},this.activeOptionPath=u,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&s.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),s.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){n.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var i=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((function(e){return e.key===i.parentKey})),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,s=r.isEmpty(i.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),s||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return t.key===e.key}))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t});e.preventDefault()}},onHomeKey:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){l.set("overlay",e,this.$primevue.config.zIndex.overlay),s.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){l.clear(e)},alignOverlay:function(){"self"===this.appendTo?s.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.getOuterWidth(this.$el)+"px",s.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new p(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!s.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return r.isNotEmpty(e)&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return r.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?r.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===i&&this.processedOptions))return null;if(r.isEmpty(e))return[];for(var n=0;n<t.length;n++){var o=t[n];if(r.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var s=this.findOptionPathByValue(e,o.children,i+1);if(s)return s.unshift(o),s}},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionInfo.index?-1===(n=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionInfo.index&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.onOptionChange({originalEvent:e,processedOption:this.visibleOptions[t],isHide:!1}))},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=s.findSingle(this.list,'li[id="'.concat(t,'"]'));i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex(),this.onOptionChange({processedOption:this.visibleOptions[this.focusedOptionInfo.index],isHide:!1}),!this.overlayVisible&&(this.focusedOptionInfo={index:-1,level:0,parentKey:""}))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,r){var a=(""!==o?o+"_":"")+r,l={option:e,index:r,level:i,key:a,parent:n,parentKey:o};l.children=t.createProcessedOptions(t.getOptionGroupChildren(e,i),i+1,l,a),s.push(l)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return r.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),i=r.isNotEmpty(t)?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return r.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(r.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:E,Portal:o,ChevronDownIcon:t,SpinnerIcon:i,AngleRightIcon:e}};function T(e){return T="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},T(e)}function $(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function R(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$(Object(i),!0).forEach((function(t){j(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function j(e,t,i){var n;return(t="symbol"==T(n=z(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function z(e,t){if("object"!=T(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var B=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];A.render=function(e,t,i,n,o,s){var r=h("SpinnerIcon"),a=h("CascadeSelectSub"),l=h("Portal");return O(),v("div",y({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[C("div",y({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[C("input",y({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_tree","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},R(R({},e.inputProps),e.ptm("input"))),null,16,B)],16),C("span",y({class:e.cx("label")},e.ptm("label")),[P(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[V(L(s.label),1)]}))],16),C("div",y({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?P(e.$slots,"loadingicon",{key:0,class:w(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(O(),v("span",y({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(O(),I(r,y({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):P(e.$slots,"dropdownicon",{key:1,class:w(e.cx("dropdownIcon"))},(function(){return[(O(),I(x(e.dropdownIcon?"span":"ChevronDownIcon"),y({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),C("span",y({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),L(s.searchResultMessageText),17),k(l,{appendTo:e.appendTo},{default:K((function(){return[k(G,y({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:K((function(){return[o.overlayVisible?(O(),v("div",y({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},R(R({},e.panelProps),e.ptm("panel"))),[C("div",y({class:e.cx("wrapper")},e.ptm("wrapper")),[k(a,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:o.focused?s.focusedOptionId:void 0,options:s.processedOptions,activeOptionPath:o.activeOptionPath,level:0,templates:e.$slots,optionLabel:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])],16),C("span",y({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),L(s.selectedMessageText),17)],16)):S("",!0)]})),_:1},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)};export{A as default};
1
+ import e from"primevue/icons/angleright";import t from"primevue/icons/chevrondown";import i from"primevue/icons/spinner";import n from"primevue/overlayeventbus";import o from"primevue/portal";import{DomHandler as s,ObjectUtils as r,UniqueComponentId as a,ZIndexUtils as l,ConnectedOverlayScrollHandler as p}from"primevue/utils";import c from"primevue/basecomponent";import u from"primevue/cascadeselect/style";import d from"primevue/ripple";import{resolveComponent as h,resolveDirective as f,openBlock as O,createElementBlock as v,mergeProps as y,Fragment as b,renderList as g,withDirectives as m,createBlock as I,resolveDynamicComponent as x,toDisplayString as L,createCommentVNode as S,normalizeClass as w,createElementVNode as P,renderSlot as C,createTextVNode as V,createVNode as k,withCtx as K,Transition as G}from"vue";var D={name:"BaseCascadeSelect",extends:c,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,placeholder:String,disabled:Boolean,dataKey:null,inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},appendTo:{type:[String,Object],default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},optionGroupIcon:{type:String,default:void 0},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},searchLocale:{type:String,default:void 0},searchMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptySearchMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabelledby:{type:String,default:null},ariaLabel:{type:String,default:null}},style:u,provide:function(){return{$parentInstance:this}}},E={name:"CascadeSelectSub",hostName:"CascadeSelect",extends:c,emits:["option-change"],container:null,props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:{type:[String,Array],default:null},activeOptionPath:Array,level:Number,templates:null,isParentMount:Boolean},data:function(){return{mounted:!1}},watch:{isParentMount:{handler:function(e){e&&s.nestedPosition(this.container,this.level)}}},mounted:function(){(this.isParentMount||0===this.level)&&s.nestedPosition(this.container,this.level),this.mounted=!0},methods:{getOptionId:function(e){return"".concat(this.selectId,"_").concat(e.key)},getOptionLabel:function(e){return this.optionLabel?r.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue:function(e){return this.optionValue?r.resolveFieldData(e.option,this.optionValue):e.option},getPTOptions:function(e,t,i){return this.ptm(i,{context:{item:e,index:t,level:this.level,itemGroup:this.isOptionGroup(e),active:this.isOptionActive(e),focused:this.isOptionFocused(e),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!!this.optionDisabled&&r.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?r.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:function(e){return e.children},isOptionGroup:function(e){return r.isNotEmpty(e.children)},isOptionSelected:function(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},isOptionFocused:function(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender:function(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick:function(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange:function(e){this.$emit("option-change",e)},containerRef:function(e){this.container=e}},directives:{ripple:d},components:{AngleRightIcon:e}},F=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset","data-p-item-group","data-p-highlight","data-p-focus","data-p-disabled"],M=["onClick"];E.render=function(e,t,i,n,o,s){var r=h("AngleRightIcon"),a=h("CascadeSelectSub",!0),l=f("ripple");return O(),v("ul",y({ref:s.containerRef,class:e.cx("list")},e.ptm(0===i.level?"list":"sublist")),[(O(!0),v(b,null,g(i.options,(function(t,n){return O(),v("li",y({key:s.getOptionLabelToRender(t),id:s.getOptionId(t),class:e.cx("item",{processedOption:t}),role:"treeitem","aria-label":s.getOptionLabelToRender(t),"aria-selected":s.isOptionGroup(t)?void 0:s.isOptionSelected(t),"aria-expanded":s.isOptionGroup(t)?s.isOptionActive(t):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":n+1},s.getPTOptions(t,n,"item"),{"data-p-item-group":s.isOptionGroup(t),"data-p-highlight":s.isOptionActive(t),"data-p-focus":s.isOptionFocused(t),"data-p-disabled":s.isOptionDisabled(t)}),[m((O(),v("div",y({class:e.cx("content"),onClick:function(e){return s.onOptionClick(e,t)}},s.getPTOptions(t,n,"content")),[i.templates.option?(O(),I(x(i.templates.option),{key:0,option:t.option},null,8,["option"])):(O(),v("span",y({key:1,class:e.cx("text")},s.getPTOptions(t,n,"text")),L(s.getOptionLabelToRender(t)),17)),s.isOptionGroup(t)?(O(),v(b,{key:2},[i.templates.optiongroupicon?(O(),I(x(i.templates.optiongroupicon),{key:0,"aria-hidden":"true"})):i.optionGroupIcon?(O(),v("span",y({key:1,class:[e.cx("groupIcon"),i.optionGroupIcon],"aria-hidden":"true"},s.getPTOptions(t,n,"groupIcon")),null,16)):(O(),I(r,y({key:2,class:e.cx("groupIcon"),"aria-hidden":"true"},s.getPTOptions(t,n,"groupIcon")),null,16,["class"]))],64)):S("",!0)],16,M)),[[l]]),s.isOptionGroup(t)&&s.isOptionActive(t)?(O(),I(a,{key:0,role:"group",class:w(e.cx("sublist")),selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:s.getOptionGroupChildren(t),activeOptionPath:i.activeOptionPath,level:i.level+1,templates:i.templates,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled,isParentMount:o.mounted},null,8,["class","selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled","isParentMount"])):S("",!0)],16,F)})),128))],16)};var T={name:"CascadeSelect",extends:D,emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:function(){return{id:this.$attrs.id,focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}},watch:{"$attrs.id":function(e){this.id=e||a()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||a(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(l.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel:function(e){return this.optionLabel?r.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?r.resolveFieldData(e,this.optionValue):e},isOptionDisabled:function(e){return!!this.optionDisabled&&r.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel:function(e){return this.optionGroupLabel?r.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren:function(e,t){return r.isString(this.optionGroupChildren)?r.resolveFieldData(e,this.optionGroupChildren):r.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup:function(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel:function(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:function(e){return r.isNotEmpty(e.children)},show:function(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&r.isNotEmpty(this.activeOptionPath)){var t=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?t.index:-1,level:t.level,parentKey:t.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&s.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.activeOptionPath=[],t.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&s.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){if(this.disabled||this.loading)e.preventDefault();else{var t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&r.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}}},onOptionChange:function(e){var t=e.originalEvent,i=e.processedOption,n=e.isFocus,o=e.isHide;if(!r.isEmpty(i)){var a=i.index,l=i.level,p=i.parentKey,c=r.isNotEmpty(i.children),u=this.activeOptionPath.filter((function(e){return e.parentKey!==p}));u.push(i),this.focusedOptionInfo={index:a,level:l,parentKey:p},this.activeOptionPath=u,c?this.onOptionGroupSelect(t,i):this.onOptionSelect(t,i,o),n&&s.focus(this.$refs.focusInput)}},onOptionSelect:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=this.getOptionValue(t.option);this.activeOptionPath.forEach((function(e){return e.selected=!0})),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect:function(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick:function(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),s.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick:function(e){n.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{var i=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,i),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){var t=this;if(this.overlayVisible){var i=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((function(e){return e.key===i.parentKey})),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,s=r.isEmpty(i.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((function(e){return e.parentKey!==t.focusedOptionInfo.parentKey}))),s||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey:function(e){if(this.overlayVisible){var t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t))this.activeOptionPath.some((function(e){return t.key===e.key}))?(this.focusedOptionInfo={index:-1,parentKey:t.key},this.searchValue="",this.onArrowDownKey(e)):this.onOptionChange({originalEvent:e,processedOption:t});e.preventDefault()}},onHomeKey:function(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey:function(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey:function(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index],i=this.isProccessedOptionGroup(t);this.onOptionChange({originalEvent:e,processedOption:t}),!i&&this.hide()}}else this.onArrowDownKey(e);e.preventDefault()},onSpaceKey:function(e){this.onEnterKey(e)},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){if(-1!==this.focusedOptionInfo.index){var t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter:function(e){l.set("overlay",e,this.$primevue.config.zIndex.overlay),s.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave:function(e){l.clear(e)},alignOverlay:function(){"self"===this.appendTo?s.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=s.getOuterWidth(this.$el)+"px",s.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.overlay&&!e.$el.contains(t.target)&&!e.overlay.contains(t.target)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new p(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!s.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched:function(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption:function(e){return r.isNotEmpty(e)&&!this.isOptionDisabled(e.option)},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){return this.activeOptionPath.some((function(t){return t.key===e.key}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return r.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?r.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findSelectedOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)}))},findFirstFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!(t=t||0===i&&this.processedOptions))return null;if(r.isEmpty(e))return[];for(var n=0;n<t.length;n++){var o=t[n];if(r.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];var s=this.findOptionPathByValue(e,o.children,i+1);if(s)return s.unshift(o),s}},searchOptions:function(e,t){var i=this;this.searchValue=(this.searchValue||"")+t;var n=-1,o=!1;return-1!==(n=-1!==this.focusedOptionInfo.index?-1===(n=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((function(e){return i.isOptionMatched(e)})):n+this.focusedOptionInfo.index:this.visibleOptions.findIndex((function(e){return i.isOptionMatched(e)})))&&(o=!0),-1===n&&-1===this.focusedOptionInfo.index&&(n=this.findFirstFocusedOptionIndex()),-1!==n&&this.changeFocusedOptionIndex(e,n),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){i.searchValue="",i.searchTimeout=null}),500),o},changeFocusedOptionIndex:function(e,t){this.focusedOptionInfo.index!==t&&(this.focusedOptionInfo.index=t,this.scrollInView(),this.selectOnFocus&&this.onOptionChange({originalEvent:e,processedOption:this.visibleOptions[t],isHide:!1}))},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=s.findSingle(this.list,'li[id="'.concat(t,'"]'));i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel:function(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionInfo.index=this.findFirstFocusedOptionIndex(),this.onOptionChange({processedOption:this.visibleOptions[this.focusedOptionInfo.index],isHide:!1}),!this.overlayVisible&&(this.focusedOptionInfo={index:-1,level:0,parentKey:""}))},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=[];return e&&e.forEach((function(e,r){var a=(""!==o?o+"_":"")+r,l={option:e,index:r,level:i,key:a,parent:n,parentKey:o};l.children=t.createProcessedOptions(t.getOptionGroupChildren(e,i),i+1,l,a),s.push(l)})),s},overlayRef:function(e){this.overlay=e}},computed:{hasSelectedOption:function(){return r.isNotEmpty(this.modelValue)},label:function(){var e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){var t=this.findOptionPathByValue(this.modelValue),i=r.isNotEmpty(t)?t[t.length-1]:null;return i?this.getOptionLabel(i.option):e}return e},processedOptions:function(){return this.createProcessedOptions(this.options||[])},visibleOptions:function(){var e=this,t=this.activeOptionPath.find((function(t){return t.key===e.focusedOptionInfo.parentKey}));return t?t.children:this.processedOptions},equalityKey:function(){return this.optionValue?null:this.dataKey},searchResultMessageText:function(){return r.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText:function(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText:function(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionInfo.index?"".concat(this.id).concat(r.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:"","_").concat(this.focusedOptionInfo.index):null}},components:{CascadeSelectSub:E,Portal:o,ChevronDownIcon:t,SpinnerIcon:i,AngleRightIcon:e}};function A(e){return A="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},A(e)}function $(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function R(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?$(Object(i),!0).forEach((function(t){j(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):$(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function j(e,t,i){var n;return(t="symbol"==A(n=z(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function z(e,t){if("object"!=A(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var B=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"];T.render=function(e,t,i,n,o,s){var r=h("SpinnerIcon"),a=h("CascadeSelectSub"),l=h("Portal");return O(),v("div",y({ref:"container",class:e.cx("root"),style:e.sx("root"),onClick:t[5]||(t[5]=function(e){return s.onContainerClick(e)})},e.ptm("root"),{"data-pc-name":"cascadeselect"}),[P("div",y({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[P("input",y({ref:"focusInput",id:e.inputId,type:"text",class:e.inputClass,style:e.inputStyle,readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_tree","aria-activedescendant":o.focused?s.focusedOptionId:void 0,onFocus:t[0]||(t[0]=function(){return s.onFocus&&s.onFocus.apply(s,arguments)}),onBlur:t[1]||(t[1]=function(){return s.onBlur&&s.onBlur.apply(s,arguments)}),onKeydown:t[2]||(t[2]=function(){return s.onKeyDown&&s.onKeyDown.apply(s,arguments)})},R(R({},e.inputProps),e.ptm("input"))),null,16,B)],16),P("span",y({class:e.cx("label")},e.ptm("label")),[C(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return[V(L(s.label),1)]}))],16),P("div",y({class:e.cx("dropdownButton"),role:"button",tabindex:"-1","aria-hidden":"true"},e.ptm("dropdownButton")),[e.loading?C(e.$slots,"loadingicon",{key:0,class:w(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(O(),v("span",y({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(O(),I(r,y({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):C(e.$slots,"dropdownicon",{key:1,class:w(e.cx("dropdownIcon"))},(function(){return[(O(),I(x(e.dropdownIcon?"span":"ChevronDownIcon"),y({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),P("span",y({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSearchResult"),{"data-p-hidden-accessible":!0}),L(s.searchResultMessageText),17),k(l,{appendTo:e.appendTo},{default:K((function(){return[k(G,y({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:K((function(){return[o.overlayVisible?(O(),v("div",y({key:0,ref:s.overlayRef,class:[e.cx("panel"),e.panelClass],style:e.panelStyle,onClick:t[3]||(t[3]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)}),onKeydown:t[4]||(t[4]=function(){return s.onOverlayKeyDown&&s.onOverlayKeyDown.apply(s,arguments)})},R(R({},e.panelProps),e.ptm("panel"))),[P("div",y({class:e.cx("wrapper")},e.ptm("wrapper")),[k(a,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:o.focused?s.focusedOptionId:void 0,options:s.processedOptions,activeOptionPath:o.activeOptionPath,level:0,templates:e.$slots,optionLabel:e.optionLabel,optionValue:e.optionValue,optionDisabled:e.optionDisabled,optionGroupIcon:e.optionGroupIcon,optionGroupLabel:e.optionGroupLabel,optionGroupChildren:e.optionGroupChildren,onOptionChange:s.onOptionChange,pt:e.pt,unstyled:e.unstyled},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange","pt","unstyled"])],16),P("span",y({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),L(s.selectedMessageText),17)],16)):S("",!0)]})),_:1},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo"])],16)};export{T as default};