primevue 3.45.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 (395) hide show
  1. package/autocomplete/BaseAutoComplete.vue +1 -1
  2. package/autocomplete/autocomplete.cjs.js +1 -1
  3. package/autocomplete/autocomplete.cjs.min.js +1 -1
  4. package/autocomplete/autocomplete.esm.js +1 -1
  5. package/autocomplete/autocomplete.esm.min.js +1 -1
  6. package/autocomplete/autocomplete.js +1 -1
  7. package/autocomplete/autocomplete.min.js +1 -1
  8. package/calendar/BaseCalendar.vue +1 -1
  9. package/calendar/calendar.cjs.js +1 -1
  10. package/calendar/calendar.cjs.min.js +1 -1
  11. package/calendar/calendar.esm.js +1 -1
  12. package/calendar/calendar.esm.min.js +1 -1
  13. package/calendar/calendar.js +1 -1
  14. package/calendar/calendar.min.js +1 -1
  15. package/card/Card.d.ts +4 -0
  16. package/card/Card.vue +7 -5
  17. package/card/card.cjs.js +6 -3
  18. package/card/card.cjs.min.js +1 -1
  19. package/card/card.esm.js +6 -3
  20. package/card/card.esm.min.js +1 -1
  21. package/card/card.js +6 -3
  22. package/card/card.min.js +1 -1
  23. package/card/style/cardstyle.cjs.js +1 -0
  24. package/card/style/cardstyle.cjs.min.js +1 -1
  25. package/card/style/cardstyle.esm.js +1 -0
  26. package/card/style/cardstyle.esm.min.js +1 -1
  27. package/card/style/cardstyle.js +1 -0
  28. package/card/style/cardstyle.min.js +1 -1
  29. package/cascadeselect/BaseCascadeSelect.vue +1 -1
  30. package/cascadeselect/CascadeSelect.d.ts +41 -0
  31. package/cascadeselect/CascadeSelectSub.vue +18 -5
  32. package/cascadeselect/cascadeselect.cjs.js +19 -6
  33. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  34. package/cascadeselect/cascadeselect.esm.js +19 -6
  35. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  36. package/cascadeselect/cascadeselect.js +19 -6
  37. package/cascadeselect/cascadeselect.min.js +1 -1
  38. package/colorpicker/BaseColorPicker.vue +1 -1
  39. package/colorpicker/ColorPicker.d.ts +1 -1
  40. package/colorpicker/colorpicker.cjs.js +1 -1
  41. package/colorpicker/colorpicker.cjs.min.js +1 -1
  42. package/colorpicker/colorpicker.esm.js +1 -1
  43. package/colorpicker/colorpicker.esm.min.js +1 -1
  44. package/colorpicker/colorpicker.js +1 -1
  45. package/colorpicker/colorpicker.min.js +1 -1
  46. package/column/Column.d.ts +4 -0
  47. package/confirmdialog/ConfirmDialog.vue +1 -1
  48. package/confirmdialog/confirmdialog.cjs.js +1 -1
  49. package/confirmdialog/confirmdialog.cjs.min.js +1 -1
  50. package/confirmdialog/confirmdialog.esm.js +1 -1
  51. package/confirmdialog/confirmdialog.esm.min.js +1 -1
  52. package/confirmdialog/confirmdialog.js +1 -1
  53. package/confirmdialog/confirmdialog.min.js +1 -1
  54. package/confirmdialog/style/confirmdialogstyle.cjs.js +3 -6
  55. package/confirmdialog/style/confirmdialogstyle.cjs.min.js +1 -1
  56. package/confirmdialog/style/confirmdialogstyle.esm.js +3 -6
  57. package/confirmdialog/style/confirmdialogstyle.esm.min.js +1 -1
  58. package/confirmdialog/style/confirmdialogstyle.js +3 -6
  59. package/confirmdialog/style/confirmdialogstyle.min.js +1 -1
  60. package/confirmpopup/ConfirmPopup.vue +1 -1
  61. package/confirmpopup/confirmpopup.cjs.js +1 -1
  62. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  63. package/confirmpopup/confirmpopup.esm.js +1 -1
  64. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  65. package/confirmpopup/confirmpopup.js +1 -1
  66. package/confirmpopup/confirmpopup.min.js +1 -1
  67. package/confirmpopup/style/confirmpopupstyle.cjs.js +5 -8
  68. package/confirmpopup/style/confirmpopupstyle.cjs.min.js +1 -1
  69. package/confirmpopup/style/confirmpopupstyle.esm.js +5 -8
  70. package/confirmpopup/style/confirmpopupstyle.esm.min.js +1 -1
  71. package/confirmpopup/style/confirmpopupstyle.js +5 -8
  72. package/confirmpopup/style/confirmpopupstyle.min.js +1 -1
  73. package/contextmenu/BaseContextMenu.vue +1 -1
  74. package/contextmenu/ContextMenuSub.vue +6 -1
  75. package/contextmenu/contextmenu.cjs.js +11 -5
  76. package/contextmenu/contextmenu.cjs.min.js +1 -1
  77. package/contextmenu/contextmenu.esm.js +11 -5
  78. package/contextmenu/contextmenu.esm.min.js +1 -1
  79. package/contextmenu/contextmenu.js +11 -5
  80. package/contextmenu/contextmenu.min.js +1 -1
  81. package/core/core.js +82 -78
  82. package/core/core.min.js +38 -38
  83. package/datatable/BodyRow.vue +11 -7
  84. package/datatable/HeaderCell.vue +1 -0
  85. package/datatable/datatable.cjs.js +11 -7
  86. package/datatable/datatable.cjs.min.js +1 -1
  87. package/datatable/datatable.esm.js +11 -7
  88. package/datatable/datatable.esm.min.js +1 -1
  89. package/datatable/datatable.js +11 -7
  90. package/datatable/datatable.min.js +1 -1
  91. package/datatable/style/datatablestyle.cjs.js +1 -1
  92. package/datatable/style/datatablestyle.cjs.min.js +1 -1
  93. package/datatable/style/datatablestyle.esm.js +1 -1
  94. package/datatable/style/datatablestyle.esm.min.js +1 -1
  95. package/datatable/style/datatablestyle.js +1 -1
  96. package/datatable/style/datatablestyle.min.js +1 -1
  97. package/dialog/BaseDialog.vue +1 -1
  98. package/dialog/dialog.cjs.js +1 -1
  99. package/dialog/dialog.cjs.min.js +1 -1
  100. package/dialog/dialog.esm.js +1 -1
  101. package/dialog/dialog.esm.min.js +1 -1
  102. package/dialog/dialog.js +1 -1
  103. package/dialog/dialog.min.js +1 -1
  104. package/dropdown/BaseDropdown.vue +1 -1
  105. package/dropdown/dropdown.cjs.js +1 -1
  106. package/dropdown/dropdown.cjs.min.js +1 -1
  107. package/dropdown/dropdown.esm.js +1 -1
  108. package/dropdown/dropdown.esm.min.js +1 -1
  109. package/dropdown/dropdown.js +1 -1
  110. package/dropdown/dropdown.min.js +1 -1
  111. package/icons/arrowdown/index.cjs.js +2 -2
  112. package/icons/arrowdown/index.cjs.min.js +1 -1
  113. package/icons/arrowdown/index.esm.js +2 -2
  114. package/icons/arrowdown/index.esm.min.js +1 -1
  115. package/icons/arrowdown/index.js +2 -2
  116. package/icons/arrowdown/index.min.js +1 -1
  117. package/icons/arrowdown/index.vue +1 -1
  118. package/icons/arrowup/index.cjs.js +2 -2
  119. package/icons/arrowup/index.cjs.min.js +1 -1
  120. package/icons/arrowup/index.esm.js +2 -2
  121. package/icons/arrowup/index.esm.min.js +1 -1
  122. package/icons/arrowup/index.js +2 -2
  123. package/icons/arrowup/index.min.js +1 -1
  124. package/icons/arrowup/index.vue +1 -1
  125. package/icons/ban/index.cjs.js +2 -2
  126. package/icons/ban/index.cjs.min.js +1 -1
  127. package/icons/ban/index.esm.js +2 -2
  128. package/icons/ban/index.esm.min.js +1 -1
  129. package/icons/ban/index.js +2 -2
  130. package/icons/ban/index.min.js +1 -1
  131. package/icons/ban/index.vue +1 -1
  132. package/icons/exclamationtriangle/index.cjs.js +2 -2
  133. package/icons/exclamationtriangle/index.cjs.min.js +1 -1
  134. package/icons/exclamationtriangle/index.esm.js +2 -2
  135. package/icons/exclamationtriangle/index.esm.min.js +1 -1
  136. package/icons/exclamationtriangle/index.js +2 -2
  137. package/icons/exclamationtriangle/index.min.js +1 -1
  138. package/icons/exclamationtriangle/index.vue +1 -1
  139. package/icons/eyeslash/index.cjs.js +2 -2
  140. package/icons/eyeslash/index.cjs.min.js +1 -1
  141. package/icons/eyeslash/index.esm.js +2 -2
  142. package/icons/eyeslash/index.esm.min.js +1 -1
  143. package/icons/eyeslash/index.js +2 -2
  144. package/icons/eyeslash/index.min.js +1 -1
  145. package/icons/eyeslash/index.vue +1 -1
  146. package/icons/filter/index.cjs.js +2 -2
  147. package/icons/filter/index.cjs.min.js +1 -1
  148. package/icons/filter/index.esm.js +2 -2
  149. package/icons/filter/index.esm.min.js +1 -1
  150. package/icons/filter/index.js +2 -2
  151. package/icons/filter/index.min.js +1 -1
  152. package/icons/filter/index.vue +1 -1
  153. package/icons/filterslash/index.cjs.js +2 -2
  154. package/icons/filterslash/index.cjs.min.js +1 -1
  155. package/icons/filterslash/index.esm.js +2 -2
  156. package/icons/filterslash/index.esm.min.js +1 -1
  157. package/icons/filterslash/index.js +2 -2
  158. package/icons/filterslash/index.min.js +1 -1
  159. package/icons/filterslash/index.vue +1 -1
  160. package/icons/infocircle/index.cjs.js +2 -2
  161. package/icons/infocircle/index.cjs.min.js +1 -1
  162. package/icons/infocircle/index.esm.js +2 -2
  163. package/icons/infocircle/index.esm.min.js +1 -1
  164. package/icons/infocircle/index.js +2 -2
  165. package/icons/infocircle/index.min.js +1 -1
  166. package/icons/infocircle/index.vue +1 -1
  167. package/icons/pencil/index.cjs.js +2 -2
  168. package/icons/pencil/index.cjs.min.js +1 -1
  169. package/icons/pencil/index.esm.js +2 -2
  170. package/icons/pencil/index.esm.min.js +1 -1
  171. package/icons/pencil/index.js +2 -2
  172. package/icons/pencil/index.min.js +1 -1
  173. package/icons/pencil/index.vue +1 -1
  174. package/icons/plus/index.cjs.js +2 -2
  175. package/icons/plus/index.cjs.min.js +1 -1
  176. package/icons/plus/index.esm.js +2 -2
  177. package/icons/plus/index.esm.min.js +1 -1
  178. package/icons/plus/index.js +2 -2
  179. package/icons/plus/index.min.js +1 -1
  180. package/icons/plus/index.vue +1 -1
  181. package/icons/refresh/index.cjs.js +2 -2
  182. package/icons/refresh/index.cjs.min.js +1 -1
  183. package/icons/refresh/index.esm.js +2 -2
  184. package/icons/refresh/index.esm.min.js +1 -1
  185. package/icons/refresh/index.js +2 -2
  186. package/icons/refresh/index.min.js +1 -1
  187. package/icons/refresh/index.vue +1 -1
  188. package/icons/search/index.cjs.js +2 -2
  189. package/icons/search/index.cjs.min.js +1 -1
  190. package/icons/search/index.esm.js +2 -2
  191. package/icons/search/index.esm.min.js +1 -1
  192. package/icons/search/index.js +2 -2
  193. package/icons/search/index.min.js +1 -1
  194. package/icons/search/index.vue +1 -1
  195. package/icons/searchminus/index.cjs.js +2 -2
  196. package/icons/searchminus/index.cjs.min.js +1 -1
  197. package/icons/searchminus/index.esm.js +2 -2
  198. package/icons/searchminus/index.esm.min.js +1 -1
  199. package/icons/searchminus/index.js +2 -2
  200. package/icons/searchminus/index.min.js +1 -1
  201. package/icons/searchminus/index.vue +1 -1
  202. package/icons/searchplus/index.cjs.js +2 -2
  203. package/icons/searchplus/index.cjs.min.js +1 -1
  204. package/icons/searchplus/index.esm.js +2 -2
  205. package/icons/searchplus/index.esm.min.js +1 -1
  206. package/icons/searchplus/index.js +2 -2
  207. package/icons/searchplus/index.min.js +1 -1
  208. package/icons/searchplus/index.vue +1 -1
  209. package/icons/sortalt/index.cjs.js +2 -2
  210. package/icons/sortalt/index.cjs.min.js +1 -1
  211. package/icons/sortalt/index.esm.js +2 -2
  212. package/icons/sortalt/index.esm.min.js +1 -1
  213. package/icons/sortalt/index.js +2 -2
  214. package/icons/sortalt/index.min.js +1 -1
  215. package/icons/sortalt/index.vue +1 -1
  216. package/icons/sortamountdown/index.cjs.js +2 -2
  217. package/icons/sortamountdown/index.cjs.min.js +1 -1
  218. package/icons/sortamountdown/index.esm.js +2 -2
  219. package/icons/sortamountdown/index.esm.min.js +1 -1
  220. package/icons/sortamountdown/index.js +2 -2
  221. package/icons/sortamountdown/index.min.js +1 -1
  222. package/icons/sortamountdown/index.vue +1 -1
  223. package/icons/sortamountupalt/index.cjs.js +2 -2
  224. package/icons/sortamountupalt/index.cjs.min.js +1 -1
  225. package/icons/sortamountupalt/index.esm.js +2 -2
  226. package/icons/sortamountupalt/index.esm.min.js +1 -1
  227. package/icons/sortamountupalt/index.js +2 -2
  228. package/icons/sortamountupalt/index.min.js +1 -1
  229. package/icons/sortamountupalt/index.vue +1 -1
  230. package/icons/spinner/index.cjs.js +2 -2
  231. package/icons/spinner/index.cjs.min.js +1 -1
  232. package/icons/spinner/index.esm.js +2 -2
  233. package/icons/spinner/index.esm.min.js +1 -1
  234. package/icons/spinner/index.js +2 -2
  235. package/icons/spinner/index.min.js +1 -1
  236. package/icons/spinner/index.vue +1 -1
  237. package/icons/star/index.cjs.js +2 -2
  238. package/icons/star/index.cjs.min.js +1 -1
  239. package/icons/star/index.esm.js +2 -2
  240. package/icons/star/index.esm.min.js +1 -1
  241. package/icons/star/index.js +2 -2
  242. package/icons/star/index.min.js +1 -1
  243. package/icons/star/index.vue +1 -1
  244. package/icons/starfill/index.cjs.js +2 -2
  245. package/icons/starfill/index.cjs.min.js +1 -1
  246. package/icons/starfill/index.esm.js +2 -2
  247. package/icons/starfill/index.esm.min.js +1 -1
  248. package/icons/starfill/index.js +2 -2
  249. package/icons/starfill/index.min.js +1 -1
  250. package/icons/starfill/index.vue +1 -1
  251. package/icons/thlarge/index.cjs.js +2 -2
  252. package/icons/thlarge/index.cjs.min.js +1 -1
  253. package/icons/thlarge/index.esm.js +2 -2
  254. package/icons/thlarge/index.esm.min.js +1 -1
  255. package/icons/thlarge/index.js +2 -2
  256. package/icons/thlarge/index.min.js +1 -1
  257. package/icons/thlarge/index.vue +1 -1
  258. package/icons/timescircle/index.cjs.js +2 -2
  259. package/icons/timescircle/index.cjs.min.js +1 -1
  260. package/icons/timescircle/index.esm.js +2 -2
  261. package/icons/timescircle/index.esm.min.js +1 -1
  262. package/icons/timescircle/index.js +2 -2
  263. package/icons/timescircle/index.min.js +1 -1
  264. package/icons/timescircle/index.vue +1 -1
  265. package/icons/trash/index.cjs.js +2 -2
  266. package/icons/trash/index.cjs.min.js +1 -1
  267. package/icons/trash/index.esm.js +2 -2
  268. package/icons/trash/index.esm.min.js +1 -1
  269. package/icons/trash/index.js +2 -2
  270. package/icons/trash/index.min.js +1 -1
  271. package/icons/trash/index.vue +1 -1
  272. package/icons/undo/index.cjs.js +2 -2
  273. package/icons/undo/index.cjs.min.js +1 -1
  274. package/icons/undo/index.esm.js +2 -2
  275. package/icons/undo/index.esm.min.js +1 -1
  276. package/icons/undo/index.js +2 -2
  277. package/icons/undo/index.min.js +1 -1
  278. package/icons/undo/index.vue +1 -1
  279. package/icons/upload/index.cjs.js +2 -2
  280. package/icons/upload/index.cjs.min.js +1 -1
  281. package/icons/upload/index.esm.js +2 -2
  282. package/icons/upload/index.esm.min.js +1 -1
  283. package/icons/upload/index.js +2 -2
  284. package/icons/upload/index.min.js +1 -1
  285. package/icons/upload/index.vue +1 -1
  286. package/icons/windowmaximize/index.cjs.js +2 -2
  287. package/icons/windowmaximize/index.cjs.min.js +1 -1
  288. package/icons/windowmaximize/index.esm.js +2 -2
  289. package/icons/windowmaximize/index.esm.min.js +1 -1
  290. package/icons/windowmaximize/index.js +2 -2
  291. package/icons/windowmaximize/index.min.js +1 -1
  292. package/icons/windowmaximize/index.vue +1 -1
  293. package/icons/windowminimize/index.cjs.js +2 -2
  294. package/icons/windowminimize/index.cjs.min.js +1 -1
  295. package/icons/windowminimize/index.esm.js +2 -2
  296. package/icons/windowminimize/index.esm.min.js +1 -1
  297. package/icons/windowminimize/index.js +2 -2
  298. package/icons/windowminimize/index.min.js +1 -1
  299. package/icons/windowminimize/index.vue +1 -1
  300. package/inputnumber/InputNumber.vue +4 -0
  301. package/inputnumber/inputnumber.cjs.js +3 -0
  302. package/inputnumber/inputnumber.cjs.min.js +1 -1
  303. package/inputnumber/inputnumber.esm.js +3 -0
  304. package/inputnumber/inputnumber.esm.min.js +1 -1
  305. package/inputnumber/inputnumber.js +3 -0
  306. package/inputnumber/inputnumber.min.js +1 -1
  307. package/menu/BaseMenu.vue +1 -1
  308. package/menu/menu.cjs.js +1 -1
  309. package/menu/menu.cjs.min.js +1 -1
  310. package/menu/menu.esm.js +1 -1
  311. package/menu/menu.esm.min.js +1 -1
  312. package/menu/menu.js +1 -1
  313. package/menu/menu.min.js +1 -1
  314. package/menubar/Menubar.vue +2 -1
  315. package/menubar/MenubarSub.vue +5 -1
  316. package/menubar/menubar.cjs.js +10 -4
  317. package/menubar/menubar.cjs.min.js +1 -1
  318. package/menubar/menubar.esm.js +10 -4
  319. package/menubar/menubar.esm.min.js +1 -1
  320. package/menubar/menubar.js +10 -4
  321. package/menubar/menubar.min.js +1 -1
  322. package/multiselect/BaseMultiSelect.vue +1 -1
  323. package/multiselect/multiselect.cjs.js +1 -1
  324. package/multiselect/multiselect.cjs.min.js +1 -1
  325. package/multiselect/multiselect.esm.js +1 -1
  326. package/multiselect/multiselect.esm.min.js +1 -1
  327. package/multiselect/multiselect.js +1 -1
  328. package/multiselect/multiselect.min.js +1 -1
  329. package/overlaypanel/BaseOverlayPanel.vue +1 -1
  330. package/overlaypanel/overlaypanel.cjs.js +1 -1
  331. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  332. package/overlaypanel/overlaypanel.esm.js +1 -1
  333. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  334. package/overlaypanel/overlaypanel.js +1 -1
  335. package/overlaypanel/overlaypanel.min.js +1 -1
  336. package/package.json +1 -1
  337. package/password/BasePassword.vue +1 -1
  338. package/password/password.cjs.js +1 -1
  339. package/password/password.cjs.min.js +1 -1
  340. package/password/password.esm.js +1 -1
  341. package/password/password.esm.min.js +1 -1
  342. package/password/password.js +1 -1
  343. package/password/password.min.js +1 -1
  344. package/portal/Portal.vue +1 -1
  345. package/portal/portal.cjs.js +1 -1
  346. package/portal/portal.cjs.min.js +1 -1
  347. package/portal/portal.esm.js +1 -1
  348. package/portal/portal.esm.min.js +1 -1
  349. package/portal/portal.js +1 -1
  350. package/portal/portal.min.js +1 -1
  351. package/sidebar/Sidebar.vue +16 -1
  352. package/sidebar/sidebar.cjs.js +17 -5
  353. package/sidebar/sidebar.cjs.min.js +1 -1
  354. package/sidebar/sidebar.esm.js +17 -5
  355. package/sidebar/sidebar.esm.min.js +1 -1
  356. package/sidebar/sidebar.js +17 -5
  357. package/sidebar/sidebar.min.js +1 -1
  358. package/splitbutton/BaseSplitButton.vue +1 -1
  359. package/splitbutton/splitbutton.cjs.js +1 -1
  360. package/splitbutton/splitbutton.cjs.min.js +1 -1
  361. package/splitbutton/splitbutton.esm.js +1 -1
  362. package/splitbutton/splitbutton.esm.min.js +1 -1
  363. package/splitbutton/splitbutton.js +1 -1
  364. package/splitbutton/splitbutton.min.js +1 -1
  365. package/steps/Steps.vue +2 -1
  366. package/steps/steps.cjs.js +3 -2
  367. package/steps/steps.cjs.min.js +1 -1
  368. package/steps/steps.esm.js +3 -2
  369. package/steps/steps.esm.min.js +1 -1
  370. package/steps/steps.js +3 -2
  371. package/steps/steps.min.js +1 -1
  372. package/tieredmenu/BaseTieredMenu.vue +1 -1
  373. package/tieredmenu/TieredMenu.d.ts +4 -0
  374. package/tieredmenu/TieredMenuSub.vue +5 -1
  375. package/tieredmenu/tieredmenu.cjs.js +10 -4
  376. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  377. package/tieredmenu/tieredmenu.esm.js +10 -4
  378. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  379. package/tieredmenu/tieredmenu.js +10 -4
  380. package/tieredmenu/tieredmenu.min.js +1 -1
  381. package/tooltip/style/tooltipstyle.cjs.js +1 -1
  382. package/tooltip/style/tooltipstyle.cjs.min.js +1 -1
  383. package/tooltip/style/tooltipstyle.esm.js +1 -1
  384. package/tooltip/style/tooltipstyle.esm.min.js +1 -1
  385. package/tooltip/style/tooltipstyle.js +1 -1
  386. package/tooltip/style/tooltipstyle.min.js +1 -1
  387. package/treeselect/BaseTreeSelect.vue +1 -1
  388. package/treeselect/TreeSelect.vue +0 -4
  389. package/treeselect/treeselect.cjs.js +1 -5
  390. package/treeselect/treeselect.cjs.min.js +1 -1
  391. package/treeselect/treeselect.esm.js +1 -5
  392. package/treeselect/treeselect.esm.min.js +1 -1
  393. package/treeselect/treeselect.js +1 -5
  394. package/treeselect/treeselect.min.js +1 -1
  395. package/web-types.json +1 -1
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.cascadeselect=function(e,t,i,n,o,s,r,l,a,c){"use strict";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":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=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"];return 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)},I}(primevue.icons.angleright,primevue.icons.chevrondown,primevue.icons.spinner,primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.cascadeselect.style,primevue.ripple,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.cascadeselect=function(e,t,i,n,o,s,r,l,a,c){"use strict";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"];return 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)},I}(primevue.icons.angleright,primevue.icons.chevrondown,primevue.icons.spinner,primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.cascadeselect.style,primevue.ripple,Vue);
@@ -39,7 +39,7 @@ export default {
39
39
  default: 0
40
40
  },
41
41
  appendTo: {
42
- type: String,
42
+ type: [String, Object],
43
43
  default: 'body'
44
44
  },
45
45
  panelClass: null
@@ -211,7 +211,7 @@ export interface ColorPickerEmits {
211
211
  */
212
212
  'update:modelValue'(value: any): void;
213
213
  /**
214
- * Callback to invoke when a chip is added.
214
+ * Callback to invoke when a color is selected.
215
215
  * @param {ColorPickerChangeEvent} event - Custom add event.
216
216
  */
217
217
  change(event: ColorPickerChangeEvent): void;
@@ -51,7 +51,7 @@ var script$1 = {
51
51
  "default": 0
52
52
  },
53
53
  appendTo: {
54
- type: String,
54
+ type: [String, Object],
55
55
  "default": 'body'
56
56
  },
57
57
  panelClass: null
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/overlayeventbus"),t=require("primevue/portal"),n=require("primevue/utils"),i=require("primevue/basecomponent"),o=require("primevue/colorpicker/style"),r=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),a=s(t),u={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:s(i).default,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:String,default:"body"},panelClass:null},style:s(o).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.ZIndexUtils.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(),this.$emit("change",{event:e,value:this.modelValue})},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput(),this.$emit("change",{event:e,value:this.modelValue})},updateModel:function(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},validateRGB:function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},validateHEX:function(e){var t=6-e.length;if(t>0){for(var n=[],i=0;i<t;i++)n.push("0");n.push(e),e=n.join("")}return e},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.ZIndexUtils.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?n.DomHandler.relativePosition(this.picker,this.$refs.input):n.DomHandler.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&n.DomHandler.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},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 n.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!n.DomHandler.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},components:{Portal:a.default}},c=["tabindex","disabled"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),u.render=function(e,t,n,i,o,s){var l=r.resolveComponent("Portal");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:"container",class:e.cx("root")},e.ptm("root")),[e.inline?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return s.onInputClick&&s.onInputClick.apply(s,arguments)}),onKeydown:t[1]||(t[1]=function(){return s.onInputKeydown&&s.onInputKeydown.apply(s,arguments)})},e.ptm("input")),null,16,c)),r.createVNode(l,{appendTo:e.appendTo,disabled:e.inline},{default:r.withCtx((function(){return[r.createVNode(r.Transition,r.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:r.withCtx((function(){return[e.inline||o.overlayVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:s.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)})},e.ptm("panel")),[r.createElementVNode("div",r.mergeProps({class:e.cx("panel")},e.ptm("content")),[r.createElementVNode("div",r.mergeProps({ref:s.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return s.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return s.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return s.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return s.onDragEnd()})},e.ptm("selector")),[r.createElementVNode("div",r.mergeProps({class:e.cx("color")},e.ptm("color")),[r.createElementVNode("div",r.mergeProps({ref:s.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),r.createElementVNode("div",r.mergeProps({ref:s.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return s.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return s.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return s.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return s.onDragEnd()})},e.ptm("hue")),[r.createElementVNode("div",r.mergeProps({ref:s.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):r.createCommentVNode("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)},module.exports=u;
1
+ "use strict";var e=require("primevue/overlayeventbus"),t=require("primevue/portal"),n=require("primevue/utils"),i=require("primevue/basecomponent"),o=require("primevue/colorpicker/style"),r=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),a=s(t),u={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:s(i).default,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:[String,Object],default:"body"},panelClass:null},style:s(o).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.ZIndexUtils.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(),this.$emit("change",{event:e,value:this.modelValue})},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput(),this.$emit("change",{event:e,value:this.modelValue})},updateModel:function(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},validateRGB:function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},validateHEX:function(e){var t=6-e.length;if(t>0){for(var n=[],i=0;i<t;i++)n.push("0");n.push(e),e=n.join("")}return e},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.ZIndexUtils.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?n.DomHandler.relativePosition(this.picker,this.$refs.input):n.DomHandler.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&n.DomHandler.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},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 n.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!n.DomHandler.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},components:{Portal:a.default}},c=["tabindex","disabled"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),u.render=function(e,t,n,i,o,s){var l=r.resolveComponent("Portal");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:"container",class:e.cx("root")},e.ptm("root")),[e.inline?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return s.onInputClick&&s.onInputClick.apply(s,arguments)}),onKeydown:t[1]||(t[1]=function(){return s.onInputKeydown&&s.onInputKeydown.apply(s,arguments)})},e.ptm("input")),null,16,c)),r.createVNode(l,{appendTo:e.appendTo,disabled:e.inline},{default:r.withCtx((function(){return[r.createVNode(r.Transition,r.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:r.withCtx((function(){return[e.inline||o.overlayVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:s.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)})},e.ptm("panel")),[r.createElementVNode("div",r.mergeProps({class:e.cx("panel")},e.ptm("content")),[r.createElementVNode("div",r.mergeProps({ref:s.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return s.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return s.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return s.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return s.onDragEnd()})},e.ptm("selector")),[r.createElementVNode("div",r.mergeProps({class:e.cx("color")},e.ptm("color")),[r.createElementVNode("div",r.mergeProps({ref:s.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),r.createElementVNode("div",r.mergeProps({ref:s.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return s.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return s.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return s.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return s.onDragEnd()})},e.ptm("hue")),[r.createElementVNode("div",r.mergeProps({ref:s.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):r.createCommentVNode("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)},module.exports=u;
@@ -42,7 +42,7 @@ var script$1 = {
42
42
  "default": 0
43
43
  },
44
44
  appendTo: {
45
- type: String,
45
+ type: [String, Object],
46
46
  "default": 'body'
47
47
  },
48
48
  panelClass: null
@@ -1 +1 @@
1
- import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ZIndexUtils as n,DomHandler as i,ConnectedOverlayScrollHandler as o}from"primevue/utils";import r from"primevue/basecomponent";import s from"primevue/colorpicker/style";import{resolveComponent as l,openBlock as a,createElementBlock as u,mergeProps as c,createCommentVNode as h,createVNode as d,withCtx as p,Transition as f,createElementVNode as m}from"vue";var b={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:r,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:String,default:"body"},panelClass:null},style:s,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(),this.$emit("change",{event:e,value:this.modelValue})},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput(),this.$emit("change",{event:e,value:this.modelValue})},updateModel:function(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},validateRGB:function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},validateHEX:function(e){var t=6-e.length;if(t>0){for(var n=[],i=0;i<t;i++)n.push("0");n.push(e),e=n.join("")}return e},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.clear(e)},alignOverlay:function(){"self"===this.appendTo?i.relativePosition(this.picker,this.$refs.input):i.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&i.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&i.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&i.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},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 o(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!i.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(t){e.emit("overlay-click",{originalEvent:t,target:this.$el})}},components:{Portal:t}},g=["tabindex","disabled"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),b.render=function(e,t,n,i,o,r){var s=l("Portal");return a(),u("div",c({ref:"container",class:e.cx("root")},e.ptm("root")),[e.inline?h("",!0):(a(),u("input",c({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return r.onInputClick&&r.onInputClick.apply(r,arguments)}),onKeydown:t[1]||(t[1]=function(){return r.onInputKeydown&&r.onInputKeydown.apply(r,arguments)})},e.ptm("input")),null,16,g)),d(s,{appendTo:e.appendTo,disabled:e.inline},{default:p((function(){return[d(f,c({name:"p-connected-overlay",onEnter:r.onOverlayEnter,onLeave:r.onOverlayLeave,onAfterLeave:r.onOverlayAfterLeave},e.ptm("transition")),{default:p((function(){return[e.inline||o.overlayVisible?(a(),u("div",c({key:0,ref:r.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return r.onOverlayClick&&r.onOverlayClick.apply(r,arguments)})},e.ptm("panel")),[m("div",c({class:e.cx("panel")},e.ptm("content")),[m("div",c({ref:r.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return r.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return r.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return r.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return r.onDragEnd()})},e.ptm("selector")),[m("div",c({class:e.cx("color")},e.ptm("color")),[m("div",c({ref:r.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),m("div",c({ref:r.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return r.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return r.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return r.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return r.onDragEnd()})},e.ptm("hue")),[m("div",c({ref:r.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):h("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)};export{b as default};
1
+ import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ZIndexUtils as n,DomHandler as i,ConnectedOverlayScrollHandler as o}from"primevue/utils";import r from"primevue/basecomponent";import s from"primevue/colorpicker/style";import{resolveComponent as l,openBlock as a,createElementBlock as u,mergeProps as c,createCommentVNode as h,createVNode as d,withCtx as p,Transition as f,createElementVNode as m}from"vue";var b={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:r,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:[String,Object],default:"body"},panelClass:null},style:s,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(),this.$emit("change",{event:e,value:this.modelValue})},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput(),this.$emit("change",{event:e,value:this.modelValue})},updateModel:function(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},validateRGB:function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},validateHEX:function(e){var t=6-e.length;if(t>0){for(var n=[],i=0;i<t;i++)n.push("0");n.push(e),e=n.join("")}return e},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.clear(e)},alignOverlay:function(){"self"===this.appendTo?i.relativePosition(this.picker,this.$refs.input):i.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&i.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&i.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&i.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},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 o(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!i.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(t){e.emit("overlay-click",{originalEvent:t,target:this.$el})}},components:{Portal:t}},g=["tabindex","disabled"];!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),b.render=function(e,t,n,i,o,r){var s=l("Portal");return a(),u("div",c({ref:"container",class:e.cx("root")},e.ptm("root")),[e.inline?h("",!0):(a(),u("input",c({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return r.onInputClick&&r.onInputClick.apply(r,arguments)}),onKeydown:t[1]||(t[1]=function(){return r.onInputKeydown&&r.onInputKeydown.apply(r,arguments)})},e.ptm("input")),null,16,g)),d(s,{appendTo:e.appendTo,disabled:e.inline},{default:p((function(){return[d(f,c({name:"p-connected-overlay",onEnter:r.onOverlayEnter,onLeave:r.onOverlayLeave,onAfterLeave:r.onOverlayAfterLeave},e.ptm("transition")),{default:p((function(){return[e.inline||o.overlayVisible?(a(),u("div",c({key:0,ref:r.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return r.onOverlayClick&&r.onOverlayClick.apply(r,arguments)})},e.ptm("panel")),[m("div",c({class:e.cx("panel")},e.ptm("content")),[m("div",c({ref:r.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return r.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return r.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return r.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return r.onDragEnd()})},e.ptm("selector")),[m("div",c({class:e.cx("color")},e.ptm("color")),[m("div",c({ref:r.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),m("div",c({ref:r.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return r.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return r.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return r.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return r.onDragEnd()})},e.ptm("hue")),[m("div",c({ref:r.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):h("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)};export{b as default};
@@ -46,7 +46,7 @@ this.primevue.colorpicker = (function (OverlayEventBus, Portal, utils, BaseCompo
46
46
  "default": 0
47
47
  },
48
48
  appendTo: {
49
- type: String,
49
+ type: [String, Object],
50
50
  "default": 'body'
51
51
  },
52
52
  panelClass: null
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.colorpicker=function(e,t,n,i,o,r){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),a=s(t),u={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:s(i).default,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:String,default:"body"},panelClass:null},style:s(o).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.ZIndexUtils.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(),this.$emit("change",{event:e,value:this.modelValue})},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput(),this.$emit("change",{event:e,value:this.modelValue})},updateModel:function(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},validateRGB:function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},validateHEX:function(e){var t=6-e.length;if(t>0){for(var n=[],i=0;i<t;i++)n.push("0");n.push(e),e=n.join("")}return e},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.ZIndexUtils.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?n.DomHandler.relativePosition(this.picker,this.$refs.input):n.DomHandler.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&n.DomHandler.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},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 n.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!n.DomHandler.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},components:{Portal:a.default}},c=["tabindex","disabled"];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),u.render=function(e,t,n,i,o,s){var l=r.resolveComponent("Portal");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:"container",class:e.cx("root")},e.ptm("root")),[e.inline?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return s.onInputClick&&s.onInputClick.apply(s,arguments)}),onKeydown:t[1]||(t[1]=function(){return s.onInputKeydown&&s.onInputKeydown.apply(s,arguments)})},e.ptm("input")),null,16,c)),r.createVNode(l,{appendTo:e.appendTo,disabled:e.inline},{default:r.withCtx((function(){return[r.createVNode(r.Transition,r.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:r.withCtx((function(){return[e.inline||o.overlayVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:s.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)})},e.ptm("panel")),[r.createElementVNode("div",r.mergeProps({class:e.cx("panel")},e.ptm("content")),[r.createElementVNode("div",r.mergeProps({ref:s.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return s.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return s.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return s.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return s.onDragEnd()})},e.ptm("selector")),[r.createElementVNode("div",r.mergeProps({class:e.cx("color")},e.ptm("color")),[r.createElementVNode("div",r.mergeProps({ref:s.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),r.createElementVNode("div",r.mergeProps({ref:s.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return s.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return s.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return s.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return s.onDragEnd()})},e.ptm("hue")),[r.createElementVNode("div",r.mergeProps({ref:s.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):r.createCommentVNode("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)},u}(primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.colorpicker.style,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.colorpicker=function(e,t,n,i,o,r){"use strict";function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),a=s(t),u={name:"ColorPicker",extends:{name:"BaseColorPicker",extends:s(i).default,props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Boolean,default:!1},format:{type:String,default:"hex"},disabled:{type:Boolean,default:!1},tabindex:{type:String,default:null},autoZIndex:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},appendTo:{type:[String,Object],default:"body"},panelClass:null},style:s(o).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","show","hide"],data:function(){return{overlayVisible:!1}},hsbValue:null,outsideClickListener:null,documentMouseMoveListener:null,documentMouseUpListener:null,scrollHandler:null,resizeListener:null,hueDragging:null,colorDragging:null,selfUpdate:null,picker:null,colorSelector:null,colorHandle:null,hueView:null,hueHandle:null,watch:{modelValue:{immediate:!0,handler:function(e){this.hsbValue=this.toHSB(e),this.selfUpdate?this.selfUpdate=!1:this.updateUI()}}},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindDragListeners(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.picker&&this.autoZIndex&&n.ZIndexUtils.clear(this.picker),this.clearRefs()},mounted:function(){this.updateUI()},methods:{pickColor:function(e){var t=this.colorSelector.getBoundingClientRect(),n=t.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),i=t.left+document.body.scrollLeft,o=Math.floor(100*Math.max(0,Math.min(150,(e.pageX||e.changedTouches[0].pageX)-i))/150),r=Math.floor(100*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-n)))/150);this.hsbValue=this.validateHSB({h:this.hsbValue.h,s:o,b:r}),this.selfUpdate=!0,this.updateColorHandle(),this.updateInput(),this.updateModel(),this.$emit("change",{event:e,value:this.modelValue})},pickHue:function(e){var t=this.hueView.getBoundingClientRect().top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0);this.hsbValue=this.validateHSB({h:Math.floor(360*(150-Math.max(0,Math.min(150,(e.pageY||e.changedTouches[0].pageY)-t)))/150),s:100,b:100}),this.selfUpdate=!0,this.updateColorSelector(),this.updateHue(),this.updateModel(),this.updateInput(),this.$emit("change",{event:e,value:this.modelValue})},updateModel:function(){switch(this.format){case"hex":this.$emit("update:modelValue",this.HSBtoHEX(this.hsbValue));break;case"rgb":this.$emit("update:modelValue",this.HSBtoRGB(this.hsbValue));break;case"hsb":this.$emit("update:modelValue",this.hsbValue)}},updateColorSelector:function(){if(this.colorSelector){var e=this.validateHSB({h:this.hsbValue.h,s:100,b:100});this.colorSelector.style.backgroundColor="#"+this.HSBtoHEX(e)}},updateColorHandle:function(){this.colorHandle&&(this.colorHandle.style.left=Math.floor(150*this.hsbValue.s/100)+"px",this.colorHandle.style.top=Math.floor(150*(100-this.hsbValue.b)/100)+"px")},updateHue:function(){this.hueHandle&&(this.hueHandle.style.top=Math.floor(150-150*this.hsbValue.h/360)+"px")},updateInput:function(){this.$refs.input&&(this.$refs.input.style.backgroundColor="#"+this.HSBtoHEX(this.hsbValue))},updateUI:function(){this.updateHue(),this.updateColorHandle(),this.updateInput(),this.updateColorSelector()},validateHSB:function(e){return{h:Math.min(360,Math.max(0,e.h)),s:Math.min(100,Math.max(0,e.s)),b:Math.min(100,Math.max(0,e.b))}},validateRGB:function(e){return{r:Math.min(255,Math.max(0,e.r)),g:Math.min(255,Math.max(0,e.g)),b:Math.min(255,Math.max(0,e.b))}},validateHEX:function(e){var t=6-e.length;if(t>0){for(var n=[],i=0;i<t;i++)n.push("0");n.push(e),e=n.join("")}return e},HEXtoRGB:function(e){var t=parseInt(e.indexOf("#")>-1?e.substring(1):e,16);return{r:t>>16,g:(65280&t)>>8,b:255&t}},HEXtoHSB:function(e){return this.RGBtoHSB(this.HEXtoRGB(e))},RGBtoHSB:function(e){var t={h:0,s:0,b:0},n=Math.min(e.r,e.g,e.b),i=Math.max(e.r,e.g,e.b),o=i-n;return t.b=i,t.s=0!==i?255*o/i:0,t.h=0!==t.s?e.r===i?(e.g-e.b)/o:e.g===i?2+(e.b-e.r)/o:4+(e.r-e.g)/o:-1,t.h*=60,t.h<0&&(t.h+=360),t.s*=100/255,t.b*=100/255,t},HSBtoRGB:function(e){var t={r:null,g:null,b:null},n=Math.round(e.h),i=Math.round(255*e.s/100),o=Math.round(255*e.b/100);if(0===i)t={r:o,g:o,b:o};else{var r=o,s=(255-i)*o/255,l=n%60*(r-s)/60;360===n&&(n=0),n<60?(t.r=r,t.b=s,t.g=s+l):n<120?(t.g=r,t.b=s,t.r=r-l):n<180?(t.g=r,t.r=s,t.b=s+l):n<240?(t.b=r,t.r=s,t.g=r-l):n<300?(t.b=r,t.g=s,t.r=s+l):n<360?(t.r=r,t.g=s,t.b=r-l):(t.r=0,t.g=0,t.b=0)}return{r:Math.round(t.r),g:Math.round(t.g),b:Math.round(t.b)}},RGBtoHEX:function(e){var t=[e.r.toString(16),e.g.toString(16),e.b.toString(16)];for(var n in t)1===t[n].length&&(t[n]="0"+t[n]);return t.join("")},HSBtoHEX:function(e){return this.RGBtoHEX(this.HSBtoRGB(e))},toHSB:function(e){var t;if(e)switch(this.format){case"hex":t=this.HEXtoHSB(e);break;case"rgb":t=this.RGBtoHSB(e);break;case"hsb":t=e}else t=this.HEXtoHSB(this.defaultColor);return t},onOverlayEnter:function(e){this.updateUI(),this.alignOverlay(),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.autoZIndex&&n.ZIndexUtils.set("overlay",e,this.baseZIndex,this.$primevue.config.zIndex.overlay),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.clearRefs(),this.$emit("hide")},onOverlayAfterLeave:function(e){this.autoZIndex&&n.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?n.DomHandler.relativePosition(this.picker,this.$refs.input):n.DomHandler.absolutePosition(this.picker,this.$refs.input)},onInputClick:function(){this.disabled||(this.overlayVisible=!this.overlayVisible)},onInputKeydown:function(e){switch(e.code){case"Space":this.overlayVisible=!this.overlayVisible,e.preventDefault();break;case"Escape":case"Tab":this.overlayVisible=!1}},onColorMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onColorDragStart(e))},onColorDragStart:function(e){this.disabled||(this.colorDragging=!0,this.pickColor(e),this.$el.setAttribute("p-colorpicker-dragging","true"),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"),e.preventDefault())},onDrag:function(e){this.colorDragging&&(this.pickColor(e),e.preventDefault()),this.hueDragging&&(this.pickHue(e),e.preventDefault())},onDragEnd:function(){this.colorDragging=!1,this.hueDragging=!1,this.$el.setAttribute("p-colorpicker-dragging","false"),!this.isUnstyled&&n.DomHandler.removeClass(this.$el,"p-colorpicker-dragging"),this.unbindDragListeners()},onHueMousedown:function(e){this.disabled||(this.bindDragListeners(),this.onHueDragStart(e))},onHueDragStart:function(e){this.disabled||(this.hueDragging=!0,this.pickHue(e),!this.isUnstyled&&n.DomHandler.addClass(this.$el,"p-colorpicker-dragging"))},isInputClicked:function(e){return this.$refs.input&&this.$refs.input.isSameNode(e.target)},bindDragListeners:function(){this.bindDocumentMouseMoveListener(),this.bindDocumentMouseUpListener()},unbindDragListeners:function(){this.unbindDocumentMouseMoveListener(),this.unbindDocumentMouseUpListener()},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.picker&&!e.picker.contains(t.target)&&!e.isInputClicked(t)&&(e.overlayVisible=!1)},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 n.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&(e.overlayVisible=!1)}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!n.DomHandler.isTouchDevice()&&(e.overlayVisible=!1)},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},bindDocumentMouseMoveListener:function(){this.documentMouseMoveListener||(this.documentMouseMoveListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.documentMouseMoveListener))},unbindDocumentMouseMoveListener:function(){this.documentMouseMoveListener&&(document.removeEventListener("mousemove",this.documentMouseMoveListener),this.documentMouseMoveListener=null)},bindDocumentMouseUpListener:function(){this.documentMouseUpListener||(this.documentMouseUpListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.documentMouseUpListener))},unbindDocumentMouseUpListener:function(){this.documentMouseUpListener&&(document.removeEventListener("mouseup",this.documentMouseUpListener),this.documentMouseUpListener=null)},pickerRef:function(e){this.picker=e},colorSelectorRef:function(e){this.colorSelector=e},colorHandleRef:function(e){this.colorHandle=e},hueViewRef:function(e){this.hueView=e},hueHandleRef:function(e){this.hueHandle=e},clearRefs:function(){this.picker=null,this.colorSelector=null,this.colorHandle=null,this.hueView=null,this.hueHandle=null},onOverlayClick:function(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})}},components:{Portal:a.default}},c=["tabindex","disabled"];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-colorpicker {\n display: inline-block;\n}\n.p-colorpicker-dragging {\n cursor: pointer;\n}\n.p-colorpicker-overlay {\n position: relative;\n}\n.p-colorpicker-panel {\n position: relative;\n width: 193px;\n height: 166px;\n}\n.p-colorpicker-overlay-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-colorpicker-preview {\n cursor: pointer;\n}\n.p-colorpicker-panel .p-colorpicker-content {\n position: relative;\n}\n.p-colorpicker-panel .p-colorpicker-color-selector {\n width: 150px;\n height: 150px;\n top: 8px;\n left: 8px;\n position: absolute;\n}\n.p-colorpicker-panel .p-colorpicker-color {\n width: 150px;\n height: 150px;\n}\n.p-colorpicker-panel .p-colorpicker-color-handle {\n position: absolute;\n top: 0px;\n left: 150px;\n border-radius: 100%;\n width: 10px;\n height: 10px;\n border-width: 1px;\n border-style: solid;\n margin: -5px 0 0 -5px;\n cursor: pointer;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue {\n width: 17px;\n height: 150px;\n top: 8px;\n left: 167px;\n position: absolute;\n opacity: 0.85;\n}\n.p-colorpicker-panel .p-colorpicker-hue-handle {\n position: absolute;\n top: 150px;\n left: 0px;\n width: 21px;\n margin-left: -2px;\n margin-top: -5px;\n height: 10px;\n border-width: 2px;\n border-style: solid;\n opacity: 0.85;\n cursor: pointer;\n}\n"),u.render=function(e,t,n,i,o,s){var l=r.resolveComponent("Portal");return r.openBlock(),r.createElementBlock("div",r.mergeProps({ref:"container",class:e.cx("root")},e.ptm("root")),[e.inline?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("input",r.mergeProps({key:0,ref:"input",type:"text",class:e.cx("input"),readonly:"readonly",tabindex:e.tabindex,disabled:e.disabled,onClick:t[0]||(t[0]=function(){return s.onInputClick&&s.onInputClick.apply(s,arguments)}),onKeydown:t[1]||(t[1]=function(){return s.onInputKeydown&&s.onInputKeydown.apply(s,arguments)})},e.ptm("input")),null,16,c)),r.createVNode(l,{appendTo:e.appendTo,disabled:e.inline},{default:r.withCtx((function(){return[r.createVNode(r.Transition,r.mergeProps({name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},e.ptm("transition")),{default:r.withCtx((function(){return[e.inline||o.overlayVisible?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,ref:s.pickerRef,class:[e.cx("panel"),e.panelClass],onClick:t[10]||(t[10]=function(){return s.onOverlayClick&&s.onOverlayClick.apply(s,arguments)})},e.ptm("panel")),[r.createElementVNode("div",r.mergeProps({class:e.cx("panel")},e.ptm("content")),[r.createElementVNode("div",r.mergeProps({ref:s.colorSelectorRef,class:e.cx("selector"),onMousedown:t[2]||(t[2]=function(e){return s.onColorMousedown(e)}),onTouchstart:t[3]||(t[3]=function(e){return s.onColorDragStart(e)}),onTouchmove:t[4]||(t[4]=function(e){return s.onDrag(e)}),onTouchend:t[5]||(t[5]=function(e){return s.onDragEnd()})},e.ptm("selector")),[r.createElementVNode("div",r.mergeProps({class:e.cx("color")},e.ptm("color")),[r.createElementVNode("div",r.mergeProps({ref:s.colorHandleRef,class:e.cx("colorHandle")},e.ptm("colorHandle")),null,16)],16)],16),r.createElementVNode("div",r.mergeProps({ref:s.hueViewRef,class:e.cx("hue"),onMousedown:t[6]||(t[6]=function(e){return s.onHueMousedown(e)}),onTouchstart:t[7]||(t[7]=function(e){return s.onHueDragStart(e)}),onTouchmove:t[8]||(t[8]=function(e){return s.onDrag(e)}),onTouchend:t[9]||(t[9]=function(e){return s.onDragEnd()})},e.ptm("hue")),[r.createElementVNode("div",r.mergeProps({ref:s.hueHandleRef,class:e.cx("hueHandle")},e.ptm("hueHandle")),null,16)],16)],16)],16)):r.createCommentVNode("",!0)]})),_:1},16,["onEnter","onLeave","onAfterLeave"])]})),_:1},8,["appendTo","disabled"])],16)},u}(primevue.overlayeventbus,primevue.portal,primevue.utils,primevue.basecomponent,primevue.colorpicker.style,Vue);
@@ -148,6 +148,10 @@ export interface ColumnPassThroughOptions {
148
148
  * Used to pass attributes to the sort's DOM element.
149
149
  */
150
150
  sort?: ColumnPassThroughOptionType;
151
+ /**
152
+ * Used to pass attributes to the sort icon's DOM element.
153
+ */
154
+ sortIcon?: ColumnPassThroughOptionType;
151
155
  /**
152
156
  * Used to pass attributes to the sort badge's DOM element.
153
157
  */
@@ -21,7 +21,7 @@
21
21
  <template v-if="!$slots.message">
22
22
  <slot name="icon">
23
23
  <component v-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" />
24
- <span v-else-if="confirmation.icon" :class="cx('icon')" v-bind="ptm('icon')" />
24
+ <span v-else-if="confirmation.icon" :class="[confirmation.icon, cx('icon')]" v-bind="ptm('icon')" />
25
25
  </slot>
26
26
  <span :class="cx('message')" v-bind="ptm('message')">{{ message }}</span>
27
27
  </template>
@@ -173,7 +173,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
173
173
  "class": vue.normalizeClass(_ctx.cx('icon'))
174
174
  }, null, 8, ["class"])) : $data.confirmation.icon ? (vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
175
175
  key: 1,
176
- "class": _ctx.cx('icon')
176
+ "class": [$data.confirmation.icon, _ctx.cx('icon')]
177
177
  }, _ctx.ptm('icon')), null, 16)) : vue.createCommentVNode("", true)];
178
178
  }), vue.createElementVNode("span", vue.mergeProps({
179
179
  "class": _ctx.cx('message')
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/button"),t=require("primevue/confirmationeventbus"),n=require("primevue/dialog"),o=require("primevue/basecomponent"),c=require("primevue/confirmdialog/style"),i=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(e),s=r(t),l=r(n),u={name:"ConfirmDialog",extends:{name:"BaseConfirmDialog",extends:r(o).default,props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},style:r(c).default,provide:function(){return{$parentInstance:this}}},confirmListener:null,closeListener:null,data:function(){return{visible:!1,confirmation:null}},mounted:function(){var e=this;this.confirmListener=function(t){t&&t.group===e.group&&(e.confirmation=t,e.confirmation.onShow&&e.confirmation.onShow(),e.visible=!0)},this.closeListener=function(){e.visible=!1,e.confirmation=null},s.default.on("confirm",this.confirmListener),s.default.on("close",this.closeListener)},beforeUnmount:function(){s.default.off("confirm",this.confirmListener),s.default.off("close",this.closeListener)},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},getCXOptions:function(e,t){return{contenxt:{icon:e,iconClass:t.class}}}},computed:{header:function(){return this.confirmation?this.confirmation.header:null},message:function(){return this.confirmation?this.confirmation.message:null},blockScroll:function(){return!this.confirmation||this.confirmation.blockScroll},position:function(){return this.confirmation?this.confirmation.position:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null},autoFocusAccept:function(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject:function(){return"reject"===this.confirmation.defaultFocus},closeOnEscape:function(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:l.default,CDButton:a.default}};u.render=function(e,t,n,o,c,r){var a=i.resolveComponent("CDButton"),s=i.resolveComponent("CDialog");return i.openBlock(),i.createBlock(s,{visible:c.visible,"onUpdate:visible":[t[2]||(t[2]=function(e){return c.visible=e}),r.onHide],role:"alertdialog",class:i.normalizeClass(e.cx("root")),modal:!0,header:r.header,blockScroll:r.blockScroll,position:r.position,breakpoints:e.breakpoints,closeOnEscape:r.closeOnEscape,draggable:e.draggable,pt:e.pt,unstyled:e.unstyled},i.createSlots({default:i.withCtx((function(){return[e.$slots.container?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[e.$slots.message?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.renderSlot(e.$slots,"icon",{},(function(){return[e.$slots.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.$slots.icon),{key:0,class:i.normalizeClass(e.cx("icon"))},null,8,["class"])):c.confirmation.icon?(i.openBlock(),i.createElementBlock("span",i.mergeProps({key:1,class:e.cx("icon")},e.ptm("icon")),null,16)):i.createCommentVNode("",!0)]})),i.createElementVNode("span",i.mergeProps({class:e.cx("message")},e.ptm("message")),i.toDisplayString(r.message),17)],64))],64))]})),_:2},[e.$slots.container?{name:"container",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"container",{message:c.confirmation,onClose:t.onClose,onAccept:r.accept,onReject:r.reject,closeCallback:t.onclose,acceptCallback:r.accept,rejectCallback:r.reject})]})),key:"0"}:void 0,e.$slots.container?void 0:{name:"footer",fn:i.withCtx((function(){return[i.createVNode(a,{label:r.rejectLabel,class:i.normalizeClass([e.cx("rejectButton"),c.confirmation.rejectClass]),onClick:t[0]||(t[0]=function(e){return r.reject()}),autofocus:r.autoFocusReject,unstyled:e.unstyled,pt:e.ptm("rejectButton"),"data-pc-name":"rejectbutton"},i.createSlots({_:2},[r.rejectIcon||e.$slots.rejecticon?{name:"icon",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"rejecticon",{},(function(){return[i.createElementVNode("span",i.mergeProps({class:[r.rejectIcon,t.class]},e.ptm("rejectButton").icon,{"data-pc-name":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"]),i.createVNode(a,{label:r.acceptLabel,class:i.normalizeClass([e.cx("acceptButton"),c.confirmation.acceptClass]),onClick:t[1]||(t[1]=function(e){return r.accept()}),autofocus:r.autoFocusAccept,unstyled:e.unstyled,pt:e.ptm("acceptButton"),"data-pc-name":"acceptbutton"},i.createSlots({_:2},[r.acceptIcon||e.$slots.accepticon?{name:"icon",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"accepticon",{},(function(){return[i.createElementVNode("span",i.mergeProps({class:[r.acceptIcon,t.class]},e.ptm("acceptButton").icon,{"data-pc-name":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"])]})),key:"1"}]),1032,["visible","class","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible","pt","unstyled"])},module.exports=u;
1
+ "use strict";var e=require("primevue/button"),t=require("primevue/confirmationeventbus"),n=require("primevue/dialog"),o=require("primevue/basecomponent"),c=require("primevue/confirmdialog/style"),i=require("vue");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=r(e),s=r(t),l=r(n),u={name:"ConfirmDialog",extends:{name:"BaseConfirmDialog",extends:r(o).default,props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},style:r(c).default,provide:function(){return{$parentInstance:this}}},confirmListener:null,closeListener:null,data:function(){return{visible:!1,confirmation:null}},mounted:function(){var e=this;this.confirmListener=function(t){t&&t.group===e.group&&(e.confirmation=t,e.confirmation.onShow&&e.confirmation.onShow(),e.visible=!0)},this.closeListener=function(){e.visible=!1,e.confirmation=null},s.default.on("confirm",this.confirmListener),s.default.on("close",this.closeListener)},beforeUnmount:function(){s.default.off("confirm",this.confirmListener),s.default.off("close",this.closeListener)},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},getCXOptions:function(e,t){return{contenxt:{icon:e,iconClass:t.class}}}},computed:{header:function(){return this.confirmation?this.confirmation.header:null},message:function(){return this.confirmation?this.confirmation.message:null},blockScroll:function(){return!this.confirmation||this.confirmation.blockScroll},position:function(){return this.confirmation?this.confirmation.position:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null},autoFocusAccept:function(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject:function(){return"reject"===this.confirmation.defaultFocus},closeOnEscape:function(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:l.default,CDButton:a.default}};u.render=function(e,t,n,o,c,r){var a=i.resolveComponent("CDButton"),s=i.resolveComponent("CDialog");return i.openBlock(),i.createBlock(s,{visible:c.visible,"onUpdate:visible":[t[2]||(t[2]=function(e){return c.visible=e}),r.onHide],role:"alertdialog",class:i.normalizeClass(e.cx("root")),modal:!0,header:r.header,blockScroll:r.blockScroll,position:r.position,breakpoints:e.breakpoints,closeOnEscape:r.closeOnEscape,draggable:e.draggable,pt:e.pt,unstyled:e.unstyled},i.createSlots({default:i.withCtx((function(){return[e.$slots.container?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[e.$slots.message?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.renderSlot(e.$slots,"icon",{},(function(){return[e.$slots.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.$slots.icon),{key:0,class:i.normalizeClass(e.cx("icon"))},null,8,["class"])):c.confirmation.icon?(i.openBlock(),i.createElementBlock("span",i.mergeProps({key:1,class:[c.confirmation.icon,e.cx("icon")]},e.ptm("icon")),null,16)):i.createCommentVNode("",!0)]})),i.createElementVNode("span",i.mergeProps({class:e.cx("message")},e.ptm("message")),i.toDisplayString(r.message),17)],64))],64))]})),_:2},[e.$slots.container?{name:"container",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"container",{message:c.confirmation,onClose:t.onClose,onAccept:r.accept,onReject:r.reject,closeCallback:t.onclose,acceptCallback:r.accept,rejectCallback:r.reject})]})),key:"0"}:void 0,e.$slots.container?void 0:{name:"footer",fn:i.withCtx((function(){return[i.createVNode(a,{label:r.rejectLabel,class:i.normalizeClass([e.cx("rejectButton"),c.confirmation.rejectClass]),onClick:t[0]||(t[0]=function(e){return r.reject()}),autofocus:r.autoFocusReject,unstyled:e.unstyled,pt:e.ptm("rejectButton"),"data-pc-name":"rejectbutton"},i.createSlots({_:2},[r.rejectIcon||e.$slots.rejecticon?{name:"icon",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"rejecticon",{},(function(){return[i.createElementVNode("span",i.mergeProps({class:[r.rejectIcon,t.class]},e.ptm("rejectButton").icon,{"data-pc-name":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"]),i.createVNode(a,{label:r.acceptLabel,class:i.normalizeClass([e.cx("acceptButton"),c.confirmation.acceptClass]),onClick:t[1]||(t[1]=function(e){return r.accept()}),autofocus:r.autoFocusAccept,unstyled:e.unstyled,pt:e.ptm("acceptButton"),"data-pc-name":"acceptbutton"},i.createSlots({_:2},[r.acceptIcon||e.$slots.accepticon?{name:"icon",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"accepticon",{},(function(){return[i.createElementVNode("span",i.mergeProps({class:[r.acceptIcon,t.class]},e.ptm("acceptButton").icon,{"data-pc-name":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"])]})),key:"1"}]),1032,["visible","class","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible","pt","unstyled"])},module.exports=u;
@@ -163,7 +163,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
163
163
  "class": normalizeClass(_ctx.cx('icon'))
164
164
  }, null, 8, ["class"])) : $data.confirmation.icon ? (openBlock(), createElementBlock("span", mergeProps({
165
165
  key: 1,
166
- "class": _ctx.cx('icon')
166
+ "class": [$data.confirmation.icon, _ctx.cx('icon')]
167
167
  }, _ctx.ptm('icon')), null, 16)) : createCommentVNode("", true)];
168
168
  }), createElementVNode("span", mergeProps({
169
169
  "class": _ctx.cx('message')
@@ -1 +1 @@
1
- import n from"primevue/button";import t from"primevue/confirmationeventbus";import o from"primevue/dialog";import e from"primevue/basecomponent";import c from"primevue/confirmdialog/style";import{resolveComponent as i,openBlock as s,createBlock as a,normalizeClass as r,createSlots as l,withCtx as u,createElementBlock as f,Fragment as m,renderSlot as p,resolveDynamicComponent as d,mergeProps as h,createCommentVNode as b,createElementVNode as g,toDisplayString as v,createVNode as j}from"vue";var k={name:"ConfirmDialog",extends:{name:"BaseConfirmDialog",extends:e,props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},style:c,provide:function(){return{$parentInstance:this}}},confirmListener:null,closeListener:null,data:function(){return{visible:!1,confirmation:null}},mounted:function(){var n=this;this.confirmListener=function(t){t&&t.group===n.group&&(n.confirmation=t,n.confirmation.onShow&&n.confirmation.onShow(),n.visible=!0)},this.closeListener=function(){n.visible=!1,n.confirmation=null},t.on("confirm",this.confirmListener),t.on("close",this.closeListener)},beforeUnmount:function(){t.off("confirm",this.confirmListener),t.off("close",this.closeListener)},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},getCXOptions:function(n,t){return{contenxt:{icon:n,iconClass:t.class}}}},computed:{header:function(){return this.confirmation?this.confirmation.header:null},message:function(){return this.confirmation?this.confirmation.message:null},blockScroll:function(){return!this.confirmation||this.confirmation.blockScroll},position:function(){return this.confirmation?this.confirmation.position:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null},autoFocusAccept:function(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject:function(){return"reject"===this.confirmation.defaultFocus},closeOnEscape:function(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:o,CDButton:n}};k.render=function(n,t,o,e,c,k){var y=i("CDButton"),C=i("CDialog");return s(),a(C,{visible:c.visible,"onUpdate:visible":[t[2]||(t[2]=function(n){return c.visible=n}),k.onHide],role:"alertdialog",class:r(n.cx("root")),modal:!0,header:k.header,blockScroll:k.blockScroll,position:k.position,breakpoints:n.breakpoints,closeOnEscape:k.closeOnEscape,draggable:n.draggable,pt:n.pt,unstyled:n.unstyled},l({default:u((function(){return[n.$slots.container?b("",!0):(s(),f(m,{key:0},[n.$slots.message?(s(),a(d(n.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(s(),f(m,{key:0},[p(n.$slots,"icon",{},(function(){return[n.$slots.icon?(s(),a(d(n.$slots.icon),{key:0,class:r(n.cx("icon"))},null,8,["class"])):c.confirmation.icon?(s(),f("span",h({key:1,class:n.cx("icon")},n.ptm("icon")),null,16)):b("",!0)]})),g("span",h({class:n.cx("message")},n.ptm("message")),v(k.message),17)],64))],64))]})),_:2},[n.$slots.container?{name:"container",fn:u((function(t){return[p(n.$slots,"container",{message:c.confirmation,onClose:t.onClose,onAccept:k.accept,onReject:k.reject,closeCallback:t.onclose,acceptCallback:k.accept,rejectCallback:k.reject})]})),key:"0"}:void 0,n.$slots.container?void 0:{name:"footer",fn:u((function(){return[j(y,{label:k.rejectLabel,class:r([n.cx("rejectButton"),c.confirmation.rejectClass]),onClick:t[0]||(t[0]=function(n){return k.reject()}),autofocus:k.autoFocusReject,unstyled:n.unstyled,pt:n.ptm("rejectButton"),"data-pc-name":"rejectbutton"},l({_:2},[k.rejectIcon||n.$slots.rejecticon?{name:"icon",fn:u((function(t){return[p(n.$slots,"rejecticon",{},(function(){return[g("span",h({class:[k.rejectIcon,t.class]},n.ptm("rejectButton").icon,{"data-pc-name":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"]),j(y,{label:k.acceptLabel,class:r([n.cx("acceptButton"),c.confirmation.acceptClass]),onClick:t[1]||(t[1]=function(n){return k.accept()}),autofocus:k.autoFocusAccept,unstyled:n.unstyled,pt:n.ptm("acceptButton"),"data-pc-name":"acceptbutton"},l({_:2},[k.acceptIcon||n.$slots.accepticon?{name:"icon",fn:u((function(t){return[p(n.$slots,"accepticon",{},(function(){return[g("span",h({class:[k.acceptIcon,t.class]},n.ptm("acceptButton").icon,{"data-pc-name":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"])]})),key:"1"}]),1032,["visible","class","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible","pt","unstyled"])};export{k as default};
1
+ import n from"primevue/button";import t from"primevue/confirmationeventbus";import o from"primevue/dialog";import e from"primevue/basecomponent";import c from"primevue/confirmdialog/style";import{resolveComponent as i,openBlock as s,createBlock as a,normalizeClass as r,createSlots as l,withCtx as u,createElementBlock as f,Fragment as m,renderSlot as p,resolveDynamicComponent as d,mergeProps as h,createCommentVNode as b,createElementVNode as g,toDisplayString as v,createVNode as j}from"vue";var k={name:"ConfirmDialog",extends:{name:"BaseConfirmDialog",extends:e,props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},style:c,provide:function(){return{$parentInstance:this}}},confirmListener:null,closeListener:null,data:function(){return{visible:!1,confirmation:null}},mounted:function(){var n=this;this.confirmListener=function(t){t&&t.group===n.group&&(n.confirmation=t,n.confirmation.onShow&&n.confirmation.onShow(),n.visible=!0)},this.closeListener=function(){n.visible=!1,n.confirmation=null},t.on("confirm",this.confirmListener),t.on("close",this.closeListener)},beforeUnmount:function(){t.off("confirm",this.confirmListener),t.off("close",this.closeListener)},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},getCXOptions:function(n,t){return{contenxt:{icon:n,iconClass:t.class}}}},computed:{header:function(){return this.confirmation?this.confirmation.header:null},message:function(){return this.confirmation?this.confirmation.message:null},blockScroll:function(){return!this.confirmation||this.confirmation.blockScroll},position:function(){return this.confirmation?this.confirmation.position:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null},autoFocusAccept:function(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject:function(){return"reject"===this.confirmation.defaultFocus},closeOnEscape:function(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:o,CDButton:n}};k.render=function(n,t,o,e,c,k){var y=i("CDButton"),C=i("CDialog");return s(),a(C,{visible:c.visible,"onUpdate:visible":[t[2]||(t[2]=function(n){return c.visible=n}),k.onHide],role:"alertdialog",class:r(n.cx("root")),modal:!0,header:k.header,blockScroll:k.blockScroll,position:k.position,breakpoints:n.breakpoints,closeOnEscape:k.closeOnEscape,draggable:n.draggable,pt:n.pt,unstyled:n.unstyled},l({default:u((function(){return[n.$slots.container?b("",!0):(s(),f(m,{key:0},[n.$slots.message?(s(),a(d(n.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(s(),f(m,{key:0},[p(n.$slots,"icon",{},(function(){return[n.$slots.icon?(s(),a(d(n.$slots.icon),{key:0,class:r(n.cx("icon"))},null,8,["class"])):c.confirmation.icon?(s(),f("span",h({key:1,class:[c.confirmation.icon,n.cx("icon")]},n.ptm("icon")),null,16)):b("",!0)]})),g("span",h({class:n.cx("message")},n.ptm("message")),v(k.message),17)],64))],64))]})),_:2},[n.$slots.container?{name:"container",fn:u((function(t){return[p(n.$slots,"container",{message:c.confirmation,onClose:t.onClose,onAccept:k.accept,onReject:k.reject,closeCallback:t.onclose,acceptCallback:k.accept,rejectCallback:k.reject})]})),key:"0"}:void 0,n.$slots.container?void 0:{name:"footer",fn:u((function(){return[j(y,{label:k.rejectLabel,class:r([n.cx("rejectButton"),c.confirmation.rejectClass]),onClick:t[0]||(t[0]=function(n){return k.reject()}),autofocus:k.autoFocusReject,unstyled:n.unstyled,pt:n.ptm("rejectButton"),"data-pc-name":"rejectbutton"},l({_:2},[k.rejectIcon||n.$slots.rejecticon?{name:"icon",fn:u((function(t){return[p(n.$slots,"rejecticon",{},(function(){return[g("span",h({class:[k.rejectIcon,t.class]},n.ptm("rejectButton").icon,{"data-pc-name":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"]),j(y,{label:k.acceptLabel,class:r([n.cx("acceptButton"),c.confirmation.acceptClass]),onClick:t[1]||(t[1]=function(n){return k.accept()}),autofocus:k.autoFocusAccept,unstyled:n.unstyled,pt:n.ptm("acceptButton"),"data-pc-name":"acceptbutton"},l({_:2},[k.acceptIcon||n.$slots.accepticon?{name:"icon",fn:u((function(t){return[p(n.$slots,"accepticon",{},(function(){return[g("span",h({class:[k.acceptIcon,t.class]},n.ptm("acceptButton").icon,{"data-pc-name":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"])]})),key:"1"}]),1032,["visible","class","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible","pt","unstyled"])};export{k as default};
@@ -168,7 +168,7 @@ this.primevue.confirmdialog = (function (Button, ConfirmationEventBus, Dialog, B
168
168
  "class": vue.normalizeClass(_ctx.cx('icon'))
169
169
  }, null, 8, ["class"])) : $data.confirmation.icon ? (vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
170
170
  key: 1,
171
- "class": _ctx.cx('icon')
171
+ "class": [$data.confirmation.icon, _ctx.cx('icon')]
172
172
  }, _ctx.ptm('icon')), null, 16)) : vue.createCommentVNode("", true)];
173
173
  }), vue.createElementVNode("span", vue.mergeProps({
174
174
  "class": _ctx.cx('message')
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.confirmdialog=function(e,t,n,o,c,i){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(e),r=a(t),l=a(n),u={name:"ConfirmDialog",extends:{name:"BaseConfirmDialog",extends:a(o).default,props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},style:a(c).default,provide:function(){return{$parentInstance:this}}},confirmListener:null,closeListener:null,data:function(){return{visible:!1,confirmation:null}},mounted:function(){var e=this;this.confirmListener=function(t){t&&t.group===e.group&&(e.confirmation=t,e.confirmation.onShow&&e.confirmation.onShow(),e.visible=!0)},this.closeListener=function(){e.visible=!1,e.confirmation=null},r.default.on("confirm",this.confirmListener),r.default.on("close",this.closeListener)},beforeUnmount:function(){r.default.off("confirm",this.confirmListener),r.default.off("close",this.closeListener)},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},getCXOptions:function(e,t){return{contenxt:{icon:e,iconClass:t.class}}}},computed:{header:function(){return this.confirmation?this.confirmation.header:null},message:function(){return this.confirmation?this.confirmation.message:null},blockScroll:function(){return!this.confirmation||this.confirmation.blockScroll},position:function(){return this.confirmation?this.confirmation.position:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null},autoFocusAccept:function(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject:function(){return"reject"===this.confirmation.defaultFocus},closeOnEscape:function(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:l.default,CDButton:s.default}};return u.render=function(e,t,n,o,c,a){var s=i.resolveComponent("CDButton"),r=i.resolveComponent("CDialog");return i.openBlock(),i.createBlock(r,{visible:c.visible,"onUpdate:visible":[t[2]||(t[2]=function(e){return c.visible=e}),a.onHide],role:"alertdialog",class:i.normalizeClass(e.cx("root")),modal:!0,header:a.header,blockScroll:a.blockScroll,position:a.position,breakpoints:e.breakpoints,closeOnEscape:a.closeOnEscape,draggable:e.draggable,pt:e.pt,unstyled:e.unstyled},i.createSlots({default:i.withCtx((function(){return[e.$slots.container?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[e.$slots.message?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.renderSlot(e.$slots,"icon",{},(function(){return[e.$slots.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.$slots.icon),{key:0,class:i.normalizeClass(e.cx("icon"))},null,8,["class"])):c.confirmation.icon?(i.openBlock(),i.createElementBlock("span",i.mergeProps({key:1,class:e.cx("icon")},e.ptm("icon")),null,16)):i.createCommentVNode("",!0)]})),i.createElementVNode("span",i.mergeProps({class:e.cx("message")},e.ptm("message")),i.toDisplayString(a.message),17)],64))],64))]})),_:2},[e.$slots.container?{name:"container",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"container",{message:c.confirmation,onClose:t.onClose,onAccept:a.accept,onReject:a.reject,closeCallback:t.onclose,acceptCallback:a.accept,rejectCallback:a.reject})]})),key:"0"}:void 0,e.$slots.container?void 0:{name:"footer",fn:i.withCtx((function(){return[i.createVNode(s,{label:a.rejectLabel,class:i.normalizeClass([e.cx("rejectButton"),c.confirmation.rejectClass]),onClick:t[0]||(t[0]=function(e){return a.reject()}),autofocus:a.autoFocusReject,unstyled:e.unstyled,pt:e.ptm("rejectButton"),"data-pc-name":"rejectbutton"},i.createSlots({_:2},[a.rejectIcon||e.$slots.rejecticon?{name:"icon",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"rejecticon",{},(function(){return[i.createElementVNode("span",i.mergeProps({class:[a.rejectIcon,t.class]},e.ptm("rejectButton").icon,{"data-pc-name":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"]),i.createVNode(s,{label:a.acceptLabel,class:i.normalizeClass([e.cx("acceptButton"),c.confirmation.acceptClass]),onClick:t[1]||(t[1]=function(e){return a.accept()}),autofocus:a.autoFocusAccept,unstyled:e.unstyled,pt:e.ptm("acceptButton"),"data-pc-name":"acceptbutton"},i.createSlots({_:2},[a.acceptIcon||e.$slots.accepticon?{name:"icon",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"accepticon",{},(function(){return[i.createElementVNode("span",i.mergeProps({class:[a.acceptIcon,t.class]},e.ptm("acceptButton").icon,{"data-pc-name":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"])]})),key:"1"}]),1032,["visible","class","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible","pt","unstyled"])},u}(primevue.button,primevue.confirmationeventbus,primevue.dialog,primevue.basecomponent,primevue.confirmdialog.style,Vue);
1
+ this.primevue=this.primevue||{},this.primevue.confirmdialog=function(e,t,n,o,c,i){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=a(e),r=a(t),l=a(n),u={name:"ConfirmDialog",extends:{name:"BaseConfirmDialog",extends:a(o).default,props:{group:String,breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0}},style:a(c).default,provide:function(){return{$parentInstance:this}}},confirmListener:null,closeListener:null,data:function(){return{visible:!1,confirmation:null}},mounted:function(){var e=this;this.confirmListener=function(t){t&&t.group===e.group&&(e.confirmation=t,e.confirmation.onShow&&e.confirmation.onShow(),e.visible=!0)},this.closeListener=function(){e.visible=!1,e.confirmation=null},r.default.on("confirm",this.confirmListener),r.default.on("close",this.closeListener)},beforeUnmount:function(){r.default.off("confirm",this.confirmListener),r.default.off("close",this.closeListener)},methods:{accept:function(){this.confirmation.accept&&this.confirmation.accept(),this.visible=!1},reject:function(){this.confirmation.reject&&this.confirmation.reject(),this.visible=!1},onHide:function(){this.confirmation.onHide&&this.confirmation.onHide(),this.visible=!1},getCXOptions:function(e,t){return{contenxt:{icon:e,iconClass:t.class}}}},computed:{header:function(){return this.confirmation?this.confirmation.header:null},message:function(){return this.confirmation?this.confirmation.message:null},blockScroll:function(){return!this.confirmation||this.confirmation.blockScroll},position:function(){return this.confirmation?this.confirmation.position:null},acceptLabel:function(){return this.confirmation?this.confirmation.acceptLabel||this.$primevue.config.locale.accept:null},rejectLabel:function(){return this.confirmation?this.confirmation.rejectLabel||this.$primevue.config.locale.reject:null},acceptIcon:function(){return this.confirmation?this.confirmation.acceptIcon:null},rejectIcon:function(){return this.confirmation?this.confirmation.rejectIcon:null},autoFocusAccept:function(){return void 0===this.confirmation.defaultFocus||"accept"===this.confirmation.defaultFocus},autoFocusReject:function(){return"reject"===this.confirmation.defaultFocus},closeOnEscape:function(){return!this.confirmation||this.confirmation.closeOnEscape}},components:{CDialog:l.default,CDButton:s.default}};return u.render=function(e,t,n,o,c,a){var s=i.resolveComponent("CDButton"),r=i.resolveComponent("CDialog");return i.openBlock(),i.createBlock(r,{visible:c.visible,"onUpdate:visible":[t[2]||(t[2]=function(e){return c.visible=e}),a.onHide],role:"alertdialog",class:i.normalizeClass(e.cx("root")),modal:!0,header:a.header,blockScroll:a.blockScroll,position:a.position,breakpoints:e.breakpoints,closeOnEscape:a.closeOnEscape,draggable:e.draggable,pt:e.pt,unstyled:e.unstyled},i.createSlots({default:i.withCtx((function(){return[e.$slots.container?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[e.$slots.message?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.$slots.message),{key:1,message:c.confirmation},null,8,["message"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.renderSlot(e.$slots,"icon",{},(function(){return[e.$slots.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(e.$slots.icon),{key:0,class:i.normalizeClass(e.cx("icon"))},null,8,["class"])):c.confirmation.icon?(i.openBlock(),i.createElementBlock("span",i.mergeProps({key:1,class:[c.confirmation.icon,e.cx("icon")]},e.ptm("icon")),null,16)):i.createCommentVNode("",!0)]})),i.createElementVNode("span",i.mergeProps({class:e.cx("message")},e.ptm("message")),i.toDisplayString(a.message),17)],64))],64))]})),_:2},[e.$slots.container?{name:"container",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"container",{message:c.confirmation,onClose:t.onClose,onAccept:a.accept,onReject:a.reject,closeCallback:t.onclose,acceptCallback:a.accept,rejectCallback:a.reject})]})),key:"0"}:void 0,e.$slots.container?void 0:{name:"footer",fn:i.withCtx((function(){return[i.createVNode(s,{label:a.rejectLabel,class:i.normalizeClass([e.cx("rejectButton"),c.confirmation.rejectClass]),onClick:t[0]||(t[0]=function(e){return a.reject()}),autofocus:a.autoFocusReject,unstyled:e.unstyled,pt:e.ptm("rejectButton"),"data-pc-name":"rejectbutton"},i.createSlots({_:2},[a.rejectIcon||e.$slots.rejecticon?{name:"icon",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"rejecticon",{},(function(){return[i.createElementVNode("span",i.mergeProps({class:[a.rejectIcon,t.class]},e.ptm("rejectButton").icon,{"data-pc-name":"rejectbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"]),i.createVNode(s,{label:a.acceptLabel,class:i.normalizeClass([e.cx("acceptButton"),c.confirmation.acceptClass]),onClick:t[1]||(t[1]=function(e){return a.accept()}),autofocus:a.autoFocusAccept,unstyled:e.unstyled,pt:e.ptm("acceptButton"),"data-pc-name":"acceptbutton"},i.createSlots({_:2},[a.acceptIcon||e.$slots.accepticon?{name:"icon",fn:i.withCtx((function(t){return[i.renderSlot(e.$slots,"accepticon",{},(function(){return[i.createElementVNode("span",i.mergeProps({class:[a.acceptIcon,t.class]},e.ptm("acceptButton").icon,{"data-pc-name":"acceptbuttonicon"}),null,16)]}))]})),key:"0"}:void 0]),1032,["label","class","autofocus","unstyled","pt"])]})),key:"1"}]),1032,["visible","class","header","blockScroll","position","breakpoints","closeOnEscape","draggable","onUpdate:visible","pt","unstyled"])},u}(primevue.button,primevue.confirmationeventbus,primevue.dialog,primevue.basecomponent,primevue.confirmdialog.style,Vue);
@@ -8,13 +8,10 @@ var BaseStyle__default = /*#__PURE__*/_interopDefaultLegacy(BaseStyle);
8
8
 
9
9
  var classes = {
10
10
  root: 'p-confirm-dialog',
11
- icon: function icon(_ref) {
12
- var instance = _ref.instance;
13
- return ['p-confirm-dialog-icon', instance.confirmation ? instance.confirmation.icon : null];
14
- },
11
+ icon: 'p-confirm-dialog-icon',
15
12
  message: 'p-confirm-dialog-message',
16
- rejectButton: function rejectButton(_ref2) {
17
- var instance = _ref2.instance;
13
+ rejectButton: function rejectButton(_ref) {
14
+ var instance = _ref.instance;
18
15
  return ['p-confirm-dialog-reject', instance.confirmation && !instance.confirmation.rejectClass ? 'p-button-text' : null];
19
16
  },
20
17
  acceptButton: 'p-confirm-dialog-accept'
@@ -1 +1 @@
1
- "use strict";function n(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var e=n(require("primevue/base/style")).default.extend({name:"confirmdialog",classes:{root:"p-confirm-dialog",icon:function(n){var e=n.instance;return["p-confirm-dialog-icon",e.confirmation?e.confirmation.icon:null]},message:"p-confirm-dialog-message",rejectButton:function(n){var e=n.instance;return["p-confirm-dialog-reject",e.confirmation&&!e.confirmation.rejectClass?"p-button-text":null]},acceptButton:"p-confirm-dialog-accept"}});module.exports=e;
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=e(require("primevue/base/style")).default.extend({name:"confirmdialog",classes:{root:"p-confirm-dialog",icon:"p-confirm-dialog-icon",message:"p-confirm-dialog-message",rejectButton:function(e){var t=e.instance;return["p-confirm-dialog-reject",t.confirmation&&!t.confirmation.rejectClass?"p-button-text":null]},acceptButton:"p-confirm-dialog-accept"}});module.exports=t;