primevue 3.22.3 → 3.22.4

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 (194) hide show
  1. package/accordion/Accordion.vue +7 -3
  2. package/accordion/accordion.cjs.js +7 -3
  3. package/accordion/accordion.cjs.min.js +1 -1
  4. package/accordion/accordion.esm.js +8 -4
  5. package/accordion/accordion.esm.min.js +1 -1
  6. package/accordion/accordion.js +7 -3
  7. package/accordion/accordion.min.js +1 -1
  8. package/autocomplete/AutoComplete.vue +6 -3
  9. package/autocomplete/autocomplete.cjs.js +12 -9
  10. package/autocomplete/autocomplete.cjs.min.js +1 -1
  11. package/autocomplete/autocomplete.esm.js +13 -10
  12. package/autocomplete/autocomplete.esm.min.js +1 -1
  13. package/autocomplete/autocomplete.js +12 -9
  14. package/autocomplete/autocomplete.min.js +1 -1
  15. package/breadcrumb/Breadcrumb.vue +2 -2
  16. package/breadcrumb/breadcrumb.cjs.js +17 -10
  17. package/breadcrumb/breadcrumb.cjs.min.js +1 -1
  18. package/breadcrumb/breadcrumb.esm.js +17 -10
  19. package/breadcrumb/breadcrumb.esm.min.js +1 -1
  20. package/breadcrumb/breadcrumb.js +17 -10
  21. package/breadcrumb/breadcrumb.min.js +1 -1
  22. package/cascadeselect/CascadeSelect.vue +6 -3
  23. package/cascadeselect/cascadeselect.cjs.js +9 -6
  24. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  25. package/cascadeselect/cascadeselect.esm.js +10 -7
  26. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  27. package/cascadeselect/cascadeselect.js +9 -6
  28. package/cascadeselect/cascadeselect.min.js +1 -1
  29. package/contextmenu/ContextMenu.vue +6 -3
  30. package/contextmenu/contextmenu.cjs.js +8 -5
  31. package/contextmenu/contextmenu.cjs.min.js +1 -1
  32. package/contextmenu/contextmenu.esm.js +9 -6
  33. package/contextmenu/contextmenu.esm.min.js +1 -1
  34. package/contextmenu/contextmenu.js +8 -5
  35. package/contextmenu/contextmenu.min.js +1 -1
  36. package/core/core.js +45 -33
  37. package/core/core.min.js +4 -4
  38. package/datatable/BodyCell.vue +4 -2
  39. package/datatable/datatable.cjs.js +4 -2
  40. package/datatable/datatable.cjs.min.js +1 -1
  41. package/datatable/datatable.esm.js +4 -2
  42. package/datatable/datatable.esm.min.js +1 -1
  43. package/datatable/datatable.js +4 -2
  44. package/datatable/datatable.min.js +1 -1
  45. package/dock/DockSub.vue +9 -3
  46. package/dock/dock.cjs.js +10 -4
  47. package/dock/dock.cjs.min.js +1 -1
  48. package/dock/dock.esm.js +11 -5
  49. package/dock/dock.esm.min.js +1 -1
  50. package/dock/dock.js +10 -4
  51. package/dock/dock.min.js +1 -1
  52. package/dropdown/Dropdown.vue +6 -3
  53. package/dropdown/dropdown.cjs.js +13 -10
  54. package/dropdown/dropdown.cjs.min.js +1 -1
  55. package/dropdown/dropdown.esm.js +14 -11
  56. package/dropdown/dropdown.esm.min.js +1 -1
  57. package/dropdown/dropdown.js +13 -10
  58. package/dropdown/dropdown.min.js +1 -1
  59. package/listbox/Listbox.vue +6 -3
  60. package/listbox/listbox.cjs.js +11 -8
  61. package/listbox/listbox.cjs.min.js +1 -1
  62. package/listbox/listbox.esm.js +12 -9
  63. package/listbox/listbox.esm.min.js +1 -1
  64. package/listbox/listbox.js +11 -8
  65. package/listbox/listbox.min.js +1 -1
  66. package/megamenu/MegaMenu.vue +7 -3
  67. package/megamenu/megamenu.cjs.js +10 -6
  68. package/megamenu/megamenu.cjs.min.js +1 -1
  69. package/megamenu/megamenu.esm.js +11 -7
  70. package/megamenu/megamenu.esm.min.js +1 -1
  71. package/megamenu/megamenu.js +10 -6
  72. package/megamenu/megamenu.min.js +1 -1
  73. package/menu/Menu.vue +8 -3
  74. package/menu/menu.cjs.js +13 -8
  75. package/menu/menu.cjs.min.js +1 -1
  76. package/menu/menu.esm.js +14 -9
  77. package/menu/menu.esm.min.js +1 -1
  78. package/menu/menu.js +13 -8
  79. package/menu/menu.min.js +1 -1
  80. package/menubar/Menubar.vue +7 -3
  81. package/menubar/menubar.cjs.js +10 -6
  82. package/menubar/menubar.cjs.min.js +1 -1
  83. package/menubar/menubar.esm.js +11 -7
  84. package/menubar/menubar.esm.min.js +1 -1
  85. package/menubar/menubar.js +10 -6
  86. package/menubar/menubar.min.js +1 -1
  87. package/multiselect/MultiSelect.vue +6 -3
  88. package/multiselect/multiselect.cjs.js +11 -8
  89. package/multiselect/multiselect.cjs.min.js +1 -1
  90. package/multiselect/multiselect.esm.js +12 -9
  91. package/multiselect/multiselect.esm.min.js +1 -1
  92. package/multiselect/multiselect.js +11 -8
  93. package/multiselect/multiselect.min.js +1 -1
  94. package/orderlist/OrderList.vue +8 -3
  95. package/orderlist/orderlist.cjs.js +11 -6
  96. package/orderlist/orderlist.cjs.min.js +1 -1
  97. package/orderlist/orderlist.esm.js +12 -7
  98. package/orderlist/orderlist.esm.min.js +1 -1
  99. package/orderlist/orderlist.js +11 -6
  100. package/orderlist/orderlist.min.js +1 -1
  101. package/package.json +1 -1
  102. package/panelmenu/PanelMenu.vue +9 -6
  103. package/panelmenu/PanelMenuList.vue +1 -1
  104. package/panelmenu/panelmenu.cjs.js +11 -8
  105. package/panelmenu/panelmenu.cjs.min.js +1 -1
  106. package/panelmenu/panelmenu.esm.js +11 -8
  107. package/panelmenu/panelmenu.esm.min.js +1 -1
  108. package/panelmenu/panelmenu.js +11 -8
  109. package/panelmenu/panelmenu.min.js +1 -1
  110. package/picklist/PickList.vue +8 -2
  111. package/picklist/picklist.cjs.js +8 -2
  112. package/picklist/picklist.cjs.min.js +1 -1
  113. package/picklist/picklist.esm.js +9 -3
  114. package/picklist/picklist.esm.min.js +1 -1
  115. package/picklist/picklist.js +8 -2
  116. package/picklist/picklist.min.js +1 -1
  117. package/rating/Rating.vue +9 -3
  118. package/rating/rating.cjs.js +11 -5
  119. package/rating/rating.cjs.min.js +1 -1
  120. package/rating/rating.esm.js +12 -6
  121. package/rating/rating.esm.min.js +1 -1
  122. package/rating/rating.js +11 -5
  123. package/rating/rating.min.js +1 -1
  124. package/resources/themes/arya-blue/theme.css +7 -0
  125. package/resources/themes/arya-green/theme.css +7 -0
  126. package/resources/themes/arya-orange/theme.css +7 -0
  127. package/resources/themes/arya-purple/theme.css +7 -0
  128. package/resources/themes/bootstrap4-dark-blue/theme.css +7 -0
  129. package/resources/themes/bootstrap4-dark-purple/theme.css +7 -0
  130. package/resources/themes/bootstrap4-light-blue/theme.css +7 -0
  131. package/resources/themes/bootstrap4-light-purple/theme.css +7 -0
  132. package/resources/themes/fluent-light/theme.css +7 -0
  133. package/resources/themes/lara-dark-blue/theme.css +7 -0
  134. package/resources/themes/lara-dark-indigo/theme.css +7 -0
  135. package/resources/themes/lara-dark-purple/theme.css +7 -0
  136. package/resources/themes/lara-dark-teal/theme.css +7 -0
  137. package/resources/themes/lara-light-blue/theme.css +7 -0
  138. package/resources/themes/lara-light-indigo/theme.css +7 -0
  139. package/resources/themes/lara-light-purple/theme.css +7 -0
  140. package/resources/themes/lara-light-teal/theme.css +7 -0
  141. package/resources/themes/luna-amber/theme.css +7 -0
  142. package/resources/themes/luna-blue/theme.css +7 -0
  143. package/resources/themes/luna-green/theme.css +7 -0
  144. package/resources/themes/luna-pink/theme.css +7 -0
  145. package/resources/themes/md-dark-deeppurple/theme.css +10 -2
  146. package/resources/themes/md-dark-indigo/theme.css +10 -2
  147. package/resources/themes/md-light-deeppurple/theme.css +10 -2
  148. package/resources/themes/md-light-indigo/theme.css +10 -2
  149. package/resources/themes/mdc-dark-deeppurple/theme.css +10 -2
  150. package/resources/themes/mdc-dark-indigo/theme.css +10 -2
  151. package/resources/themes/mdc-light-deeppurple/theme.css +10 -2
  152. package/resources/themes/mdc-light-indigo/theme.css +10 -2
  153. package/resources/themes/nova/theme.css +7 -0
  154. package/resources/themes/nova-accent/theme.css +7 -0
  155. package/resources/themes/nova-alt/theme.css +7 -0
  156. package/resources/themes/nova-vue/theme.css +7 -0
  157. package/resources/themes/rhea/theme.css +7 -0
  158. package/resources/themes/saga-blue/theme.css +7 -0
  159. package/resources/themes/saga-green/theme.css +7 -0
  160. package/resources/themes/saga-orange/theme.css +7 -0
  161. package/resources/themes/saga-purple/theme.css +7 -0
  162. package/resources/themes/tailwind-light/theme.css +7 -0
  163. package/resources/themes/vela-blue/theme.css +7 -0
  164. package/resources/themes/vela-green/theme.css +7 -0
  165. package/resources/themes/vela-orange/theme.css +7 -0
  166. package/resources/themes/vela-purple/theme.css +7 -0
  167. package/speeddial/SpeedDial.vue +6 -3
  168. package/speeddial/speeddial.cjs.js +11 -8
  169. package/speeddial/speeddial.cjs.min.js +1 -1
  170. package/speeddial/speeddial.esm.js +12 -9
  171. package/speeddial/speeddial.esm.min.js +1 -1
  172. package/speeddial/speeddial.js +11 -8
  173. package/speeddial/speeddial.min.js +1 -1
  174. package/tabview/TabView.vue +6 -3
  175. package/tabview/tabview.cjs.js +6 -3
  176. package/tabview/tabview.cjs.min.js +1 -1
  177. package/tabview/tabview.esm.js +7 -4
  178. package/tabview/tabview.esm.min.js +1 -1
  179. package/tabview/tabview.js +6 -3
  180. package/tabview/tabview.min.js +1 -1
  181. package/tieredmenu/TieredMenu.vue +7 -3
  182. package/tieredmenu/tieredmenu.cjs.js +10 -6
  183. package/tieredmenu/tieredmenu.cjs.min.js +1 -1
  184. package/tieredmenu/tieredmenu.esm.js +11 -7
  185. package/tieredmenu/tieredmenu.esm.min.js +1 -1
  186. package/tieredmenu/tieredmenu.js +10 -6
  187. package/tieredmenu/tieredmenu.min.js +1 -1
  188. package/utils/utils.cjs.js +9 -9
  189. package/utils/utils.cjs.min.js +1 -1
  190. package/utils/utils.esm.js +9 -9
  191. package/utils/utils.esm.min.js +1 -1
  192. package/utils/utils.js +9 -9
  193. package/utils/utils.min.js +1 -1
  194. package/web-types.json +1 -1
@@ -1 +1 @@
1
- this.primevue=this.primevue||{},this.primevue.breadcrumb=function(e){"use strict";var t={name:"BreadcrumbItem",props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.item.command&&this.item.command({originalEvent:e,item:this.item}),this.item.to&&t&&t(e)},containerClass(){return["p-menuitem",{"p-disabled":this.disabled()},this.item.class]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label},isCurrentUrl(){const{to:e,url:t}=this.item;let n=this.$router?this.$router.currentRoute.path:"";return e===n||t===n?"page":void 0}},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}}};const n=["href","aria-current","onClick"],l={key:1,class:"p-menuitem-text"},i=["href","target","aria-current"],a={key:1,class:"p-menuitem-text"};t.render=function(t,r,o,c,s,m){const u=e.resolveComponent("router-link");return m.visible()?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass(m.containerClass())},[o.template?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.template),{key:1,item:o.item},null,8,["item"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.item.to?(e.openBlock(),e.createBlock(u,{key:0,to:o.item.to,custom:""},{default:e.withCtx((({navigate:t,href:i,isActive:a,isExactActive:r})=>[e.createElementVNode("a",{href:i,class:e.normalizeClass(m.linkClass({isActive:a,isExactActive:r})),"aria-current":m.isCurrentUrl(),onClick:e=>m.onClick(e,t)},[o.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(m.iconClass)},null,2)):e.createCommentVNode("",!0),o.item.label?(e.openBlock(),e.createElementBlock("span",l,e.toDisplayString(m.label()),1)):e.createCommentVNode("",!0)],10,n)])),_:1},8,["to"])):(e.openBlock(),e.createElementBlock("a",{key:1,href:o.item.url||"#",class:e.normalizeClass(m.linkClass()),target:o.item.target,"aria-current":m.isCurrentUrl(),onClick:r[0]||(r[0]=(...e)=>m.onClick&&m.onClick(...e))},[o.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(m.iconClass)},null,2)):e.createCommentVNode("",!0),o.item.label?(e.openBlock(),e.createElementBlock("span",a,e.toDisplayString(m.label()),1)):e.createCommentVNode("",!0)],10,i))],64))],2)):e.createCommentVNode("",!0)};var r={name:"Breadcrumb",props:{model:{type:Array,default:null},home:{type:null,default:null},exact:{type:Boolean,default:!0}},components:{BreadcrumbItem:t}};const o={class:"p-breadcrumb p-component"},c={class:"p-breadcrumb-list"},s=e.createElementVNode("li",{class:"p-menuitem-separator"},[e.createElementVNode("span",{class:"pi pi-chevron-right","aria-hidden":"true"})],-1);return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-breadcrumb {\n overflow-x: auto;\n}\n.p-breadcrumb .p-breadcrumb-list {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n.p-breadcrumb .p-menuitem-text {\n line-height: 1;\n}\n.p-breadcrumb .p-menuitem-link {\n text-decoration: none;\n display: flex;\n align-items: center;\n}\n.p-breadcrumb .p-menuitem-separator {\n display: flex;\n align-items: center;\n}\n.p-breadcrumb::-webkit-scrollbar {\n display: none;\n}\n"),r.render=function(t,n,l,i,a,r){const m=e.resolveComponent("BreadcrumbItem");return e.openBlock(),e.createElementBlock("nav",o,[e.createElementVNode("ol",c,[l.home?(e.openBlock(),e.createBlock(m,{key:0,item:l.home,class:"p-breadcrumb-home",exact:l.exact},null,8,["item","exact"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.model,(n=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.label},[s,e.createVNode(m,{item:n,template:t.$slots.item,exact:l.exact},null,8,["item","template","exact"])],64)))),128))])])},r}(Vue);
1
+ this.primevue=this.primevue||{},this.primevue.breadcrumb=function(e){"use strict";var t={name:"BreadcrumbItem",props:{item:null,template:null,exact:null},methods:{onClick(e,t){this.item.command&&this.item.command({originalEvent:e,item:this.item}),this.item.to&&t&&t(e)},containerClass(){return["p-menuitem",{"p-disabled":this.disabled()},this.item.class]},linkClass(e){return["p-menuitem-link",{"router-link-active":e&&e.isActive,"router-link-active-exact":this.exact&&e&&e.isExactActive}]},visible(){return"function"==typeof this.item.visible?this.item.visible():!1!==this.item.visible},disabled(){return"function"==typeof this.item.disabled?this.item.disabled():this.item.disabled},label(){return"function"==typeof this.item.label?this.item.label():this.item.label},isCurrentUrl(){const{to:e,url:t}=this.item;let n=this.$router?this.$router.currentRoute.path:"";return e===n||t===n?"page":void 0}},computed:{iconClass(){return["p-menuitem-icon",this.item.icon]}}};const n=["href","aria-current","onClick"],l={key:1,class:"p-menuitem-text"},i=["href","target","aria-current"],a={key:1,class:"p-menuitem-text"};t.render=function(t,r,o,c,m,s){const u=e.resolveComponent("router-link");return s.visible()?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass(s.containerClass())},[o.template?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.template),{key:1,item:o.item},null,8,["item"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[o.item.to?(e.openBlock(),e.createBlock(u,{key:0,to:o.item.to,custom:""},{default:e.withCtx((({navigate:t,href:i,isActive:a,isExactActive:r})=>[e.createElementVNode("a",{href:i,class:e.normalizeClass(s.linkClass({isActive:a,isExactActive:r})),"aria-current":s.isCurrentUrl(),onClick:e=>s.onClick(e,t)},[o.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.iconClass)},null,2)):e.createCommentVNode("",!0),o.item.label?(e.openBlock(),e.createElementBlock("span",l,e.toDisplayString(s.label()),1)):e.createCommentVNode("",!0)],10,n)])),_:1},8,["to"])):(e.openBlock(),e.createElementBlock("a",{key:1,href:o.item.url||"#",class:e.normalizeClass(s.linkClass()),target:o.item.target,"aria-current":s.isCurrentUrl(),onClick:r[0]||(r[0]=(...e)=>s.onClick&&s.onClick(...e))},[o.item.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(s.iconClass)},null,2)):e.createCommentVNode("",!0),o.item.label?(e.openBlock(),e.createElementBlock("span",a,e.toDisplayString(s.label()),1)):e.createCommentVNode("",!0)],10,i))],64))],2)):e.createCommentVNode("",!0)};var r={name:"Breadcrumb",props:{model:{type:Array,default:null},home:{type:null,default:null},exact:{type:Boolean,default:!0}},components:{BreadcrumbItem:t}};const o={class:"p-breadcrumb p-component"},c={class:"p-breadcrumb-list"},m={key:0,class:"p-menuitem-separator"},s=[e.createElementVNode("span",{class:"pi pi-chevron-right","aria-hidden":"true"},null,-1)];return function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var l=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&l.firstChild?l.insertBefore(i,l.firstChild):l.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}("\n.p-breadcrumb {\n overflow-x: auto;\n}\n.p-breadcrumb .p-breadcrumb-list {\n margin: 0;\n padding: 0;\n list-style-type: none;\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n}\n.p-breadcrumb .p-menuitem-text {\n line-height: 1;\n}\n.p-breadcrumb .p-menuitem-link {\n text-decoration: none;\n display: flex;\n align-items: center;\n}\n.p-breadcrumb .p-menuitem-separator {\n display: flex;\n align-items: center;\n}\n.p-breadcrumb::-webkit-scrollbar {\n display: none;\n}\n"),r.render=function(t,n,l,i,a,r){const u=e.resolveComponent("BreadcrumbItem");return e.openBlock(),e.createElementBlock("nav",o,[e.createElementVNode("ol",c,[l.home?(e.openBlock(),e.createBlock(u,{key:0,item:l.home,class:"p-breadcrumb-home",exact:l.exact},null,8,["item","exact"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.model,((n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:n.label},[l.home||0!==i?(e.openBlock(),e.createElementBlock("li",m,s)):e.createCommentVNode("",!0),e.createVNode(u,{item:n,template:t.$slots.item,exact:l.exact},null,8,["item","template","exact"])],64)))),128))])])},r}(Vue);
@@ -192,6 +192,7 @@ export default {
192
192
  focusOnHover: false,
193
193
  data() {
194
194
  return {
195
+ id: this.$attrs.id,
195
196
  focused: false,
196
197
  focusedOptionInfo: { index: -1, level: 0, parentKey: '' },
197
198
  activeOptionPath: [],
@@ -200,11 +201,16 @@ export default {
200
201
  };
201
202
  },
202
203
  watch: {
204
+ '$attrs.id': function (newValue) {
205
+ this.id = newValue || UniqueComponentId();
206
+ },
203
207
  options() {
204
208
  this.autoUpdateModel();
205
209
  }
206
210
  },
207
211
  mounted() {
212
+ this.id = this.id || UniqueComponentId();
213
+
208
214
  this.autoUpdateModel();
209
215
  },
210
216
  beforeUnmount() {
@@ -846,9 +852,6 @@ export default {
846
852
  selectedMessageText() {
847
853
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
848
854
  },
849
- id() {
850
- return this.$attrs.id || UniqueComponentId();
851
- },
852
855
  focusedOptionId() {
853
856
  return this.focusedOptionInfo.index !== -1 ? `${this.id}${ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey) ? '_' + this.focusedOptionInfo.parentKey : ''}_${this.focusedOptionInfo.index}` : null;
854
857
  }
@@ -291,6 +291,7 @@ var script = {
291
291
  focusOnHover: false,
292
292
  data() {
293
293
  return {
294
+ id: this.$attrs.id,
294
295
  focused: false,
295
296
  focusedOptionInfo: { index: -1, level: 0, parentKey: '' },
296
297
  activeOptionPath: [],
@@ -299,11 +300,16 @@ var script = {
299
300
  };
300
301
  },
301
302
  watch: {
303
+ '$attrs.id': function (newValue) {
304
+ this.id = newValue || utils.UniqueComponentId();
305
+ },
302
306
  options() {
303
307
  this.autoUpdateModel();
304
308
  }
305
309
  },
306
310
  mounted() {
311
+ this.id = this.id || utils.UniqueComponentId();
312
+
307
313
  this.autoUpdateModel();
308
314
  },
309
315
  beforeUnmount() {
@@ -942,9 +948,6 @@ var script = {
942
948
  selectedMessageText() {
943
949
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
944
950
  },
945
- id() {
946
- return this.$attrs.id || utils.UniqueComponentId();
947
- },
948
951
  focusedOptionId() {
949
952
  return this.focusedOptionInfo.index !== -1 ? `${this.id}${utils.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey) ? '_' + this.focusedOptionInfo.parentKey : ''}_${this.focusedOptionInfo.index}` : null;
950
953
  }
@@ -1000,7 +1003,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1000
1003
  "aria-labelledby": _ctx.ariaLabelledby,
1001
1004
  "aria-haspopup": "tree",
1002
1005
  "aria-expanded": $data.overlayVisible,
1003
- "aria-controls": $options.id + '_tree',
1006
+ "aria-controls": $data.id + '_tree',
1004
1007
  "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
1005
1008
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
1006
1009
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
@@ -1046,10 +1049,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1046
1049
  }, $props.panelProps), [
1047
1050
  vue.createElementVNode("div", _hoisted_5, [
1048
1051
  vue.createVNode(_component_CascadeSelectSub, {
1049
- id: $options.id + '_tree',
1052
+ id: $data.id + '_tree',
1050
1053
  role: "tree",
1051
1054
  "aria-orientation": "horizontal",
1052
- selectId: $options.id,
1055
+ selectId: $data.id,
1053
1056
  focusedOptionId: $data.focused ? $options.focusedOptionId : undefined,
1054
1057
  options: $options.processedOptions,
1055
1058
  activeOptionPath: $data.activeOptionPath,
@@ -1 +1 @@
1
- "use strict";var e=require("primevue/overlayeventbus"),t=require("primevue/portal"),i=require("primevue/utils"),n=require("primevue/ripple"),o=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),a=s(t),r={name:"CascadeSelectSub",emits:["option-change"],props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null},mounted(){i.ObjectUtils.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId(e){return`${this.selectId}_${e.key}`},getOptionLabel(e){return this.optionLabel?i.ObjectUtils.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue(e){return this.optionValue?i.ObjectUtils.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled(e){return!!this.optionDisabled&&i.ObjectUtils.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?i.ObjectUtils.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:e=>e.children,isOptionGroup:e=>i.ObjectUtils.isNotEmpty(e.children),isOptionSelected(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive(e){return this.activeOptionPath.some((t=>t.key===e.key))},isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange(e){this.$emit("option-change",e)},position(){const e=this.$el.parentElement,t=i.DomHandler.getOffset(e),n=i.DomHandler.getViewport(),o=this.$el.offsetParent?this.$el.offsetWidth:i.DomHandler.getHiddenElementOuterWidth(this.$el),s=i.DomHandler.getOuterWidth(e.children[0]);parseInt(t.left,10)+s+o>n.width-i.DomHandler.calculateScrollbarWidth()&&(this.$el.style.left="-100%")},getOptionClass(e){return["p-cascadeselect-item",{"p-cascadeselect-item-group":this.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":this.isOptionActive(e),"p-focus":this.isOptionFocused(e),"p-disabled":this.isOptionDisabled(e)}]}},directives:{ripple:s(n).default}};const p={class:"p-cascadeselect-panel p-cascadeselect-items"},c=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset"],d=["onClick"],h={key:1,class:"p-cascadeselect-item-text"};r.render=function(e,t,i,n,s,l){const a=o.resolveComponent("CascadeSelectSub",!0),r=o.resolveDirective("ripple");return o.openBlock(),o.createElementBlock("ul",p,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.options,((e,t)=>(o.openBlock(),o.createElementBlock("li",{key:l.getOptionLabelToRender(e),id:l.getOptionId(e),class:o.normalizeClass(l.getOptionClass(e)),role:"treeitem","aria-label":l.getOptionLabelToRender(e),"aria-selected":l.isOptionGroup(e)?void 0:l.isOptionSelected(e),"aria-expanded":l.isOptionGroup(e)?l.isOptionActive(e):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":t+1},[o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:"p-cascadeselect-item-content",onClick:t=>l.onOptionClick(t,e)},[i.templates.option?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.templates.option),{key:0,option:e.option},null,8,["option"])):(o.openBlock(),o.createElementBlock("span",h,o.toDisplayString(l.getOptionLabelToRender(e)),1)),l.isOptionGroup(e)?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass(["p-cascadeselect-group-icon",i.optionGroupIcon]),"aria-hidden":"true"},null,2)):o.createCommentVNode("",!0)],8,d)),[[r]]),l.isOptionGroup(e)&&l.isOptionActive(e)?(o.openBlock(),o.createBlock(a,{key:0,role:"group",class:"p-cascadeselect-sublist",selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:l.getOptionGroupChildren(e),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:l.onOptionChange},null,8,["selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange"])):o.createCommentVNode("",!0)],10,c)))),128))])};var u={name:"CascadeSelect",emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],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,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:"pi pi-chevron-down"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},optionGroupIcon:{type:String,default:"pi pi-angle-right"},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},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:()=>({focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(i.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel(e){return this.optionLabel?i.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?i.ObjectUtils.resolveFieldData(e,this.optionValue):e},isOptionDisabled(e){return!!this.optionDisabled&&i.ObjectUtils.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?i.ObjectUtils.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren(e,t){return i.ObjectUtils.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:e=>i.ObjectUtils.isNotEmpty(e.children),show(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&i.ObjectUtils.isNotEmpty(this.activeOptionPath)){const e=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?e.index:-1,level:e.level,parentKey:e.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&i.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.activeOptionPath=[],this.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&i.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled||this.loading)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&i.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}},onOptionChange(e){const{originalEvent:t,processedOption:n,isFocus:o,isHide:s}=e;if(i.ObjectUtils.isEmpty(n))return;const{index:l,level:a,parentKey:r,children:p}=n,c=i.ObjectUtils.isNotEmpty(p),d=this.activeOptionPath.filter((e=>e.parentKey!==r));d.push(n),this.focusedOptionInfo={index:l,level:a,parentKey:r},this.activeOptionPath=d,c?this.onOptionGroupSelect(t,n):this.onOptionSelect(t,n,s),o&&i.DomHandler.focus(this.$refs.focusInput)},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t.option);this.activeOptionPath.forEach((e=>e.selected=!0)),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),i.DomHandler.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{const t=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((e=>e.key===t.parentKey)),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,s=i.ObjectUtils.isEmpty(t.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((e=>e.parentKey!==this.focusedOptionInfo.parentKey))),s||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t)){this.activeOptionPath.some((e=>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(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){const 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(e){this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter(e){i.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave(e){i.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?i.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=i.DomHandler.getOuterWidth(this.$el)+"px",i.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!i.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.activeOptionPath.some((t=>t.key===e.key))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return i.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?i.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e)))},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue(e,t,n=0){if(!(t=t||0===n&&this.processedOptions))return null;if(i.ObjectUtils.isEmpty(e))return[];for(let o=0;o<t.length;o++){const s=t[o];if(i.ObjectUtils.equals(e,this.getOptionValue(s.option),this.equalityKey))return[s];const l=this.findOptionPathByValue(e,s.children,n+1);if(l)return l.unshift(s),l}},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionInfo.index?(i=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionInfo.index):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionInfo.index&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(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(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,n=i.DomHandler.findSingle(this.list,`li[id="${t}"]`);n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel(){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(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions(e,t=0,i={},n=""){const o=[];return e&&e.forEach(((e,s)=>{const l=(""!==n?n+"_":"")+s,a={option:e,index:s,level:t,key:l,parent:i,parentKey:n};a.children=this.createProcessedOptions(this.getOptionGroupChildren(e,t),t+1,a,l),o.push(a)})),o},overlayRef(e){this.overlay=e}},computed:{containerClass(){return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-cascadeselect-label p-inputtext",{"p-placeholder":this.label===this.placeholder,"p-cascadeselect-label-empty":!this.$slots.value&&("p-emptylabel"===this.label||0===this.label.length)}]},panelStyleClass(){return["p-cascadeselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-cascadeselect-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},hasSelectedOption(){return i.ObjectUtils.isNotEmpty(this.modelValue)},label(){const e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){const t=this.findOptionPathByValue(this.modelValue),n=i.ObjectUtils.isNotEmpty(t)?t[t.length-1]:null;return n?this.getOptionLabel(n.option):e}return e},processedOptions(){return this.createProcessedOptions(this.options||[])},visibleOptions(){const e=this.activeOptionPath.find((e=>e.key===this.focusedOptionInfo.parentKey));return e?e.children:this.processedOptions},equalityKey(){return this.optionValue?null:this.dataKey},searchResultMessageText(){return i.ObjectUtils.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},id(){return this.$attrs.id||i.UniqueComponentId()},focusedOptionId(){return-1!==this.focusedOptionInfo.index?`${this.id}${i.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:""}_${this.focusedOptionInfo.index}`:null}},components:{CascadeSelectSub:r,Portal:a.default}};const O={class:"p-hidden-accessible"},f=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],y={class:"p-cascadeselect-trigger",role:"button",tabindex:"-1","aria-hidden":"true"},v={role:"status","aria-live":"polite",class:"p-hidden-accessible"},b={class:"p-cascadeselect-items-wrapper"},m={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n.p-cascadeselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n.p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n.p-fluid .p-cascadeselect {\n display: flex;\n}\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n"),u.render=function(e,t,i,n,s,l){const a=o.resolveComponent("CascadeSelectSub"),r=o.resolveComponent("Portal");return o.openBlock(),o.createElementBlock("div",{ref:"container",class:o.normalizeClass(l.containerClass),onClick:t[5]||(t[5]=e=>l.onContainerClick(e))},[o.createElementVNode("div",O,[o.createElementVNode("input",o.mergeProps({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":s.overlayVisible,"aria-controls":l.id+"_tree","aria-activedescendant":s.focused?l.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>l.onFocus&&l.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onBlur&&l.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onKeyDown&&l.onKeyDown(...e))},i.inputProps),null,16,f)]),o.createElementVNode("span",{class:o.normalizeClass(l.labelClass)},[o.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[o.createTextVNode(o.toDisplayString(l.label),1)]))],2),o.createElementVNode("div",y,[o.renderSlot(e.$slots,"indicator",{},(()=>[o.createElementVNode("span",{class:o.normalizeClass(l.dropdownIconClass)},null,2)]))]),o.createElementVNode("span",v,o.toDisplayString(l.searchResultMessageText),1),o.createVNode(r,{appendTo:i.appendTo},{default:o.withCtx((()=>[o.createVNode(o.Transition,{name:"p-connected-overlay",onEnter:l.onOverlayEnter,onAfterEnter:l.onOverlayAfterEnter,onLeave:l.onOverlayLeave,onAfterLeave:l.onOverlayAfterLeave},{default:o.withCtx((()=>[s.overlayVisible?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:l.overlayRef,style:i.panelStyle,class:l.panelStyleClass,onClick:t[3]||(t[3]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e)),onKeydown:t[4]||(t[4]=(...e)=>l.onOverlayKeyDown&&l.onOverlayKeyDown(...e))},i.panelProps),[o.createElementVNode("div",b,[o.createVNode(a,{id:l.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:l.id,focusedOptionId:s.focused?l.focusedOptionId:void 0,options:l.processedOptions,activeOptionPath:s.activeOptionPath,level:0,templates:e.$slots,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:l.onOptionChange},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange"])]),o.createElementVNode("span",m,o.toDisplayString(l.selectedMessageText),1)],16)):o.createCommentVNode("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1},8,["appendTo"])],2)},module.exports=u;
1
+ "use strict";var e=require("primevue/overlayeventbus"),t=require("primevue/portal"),i=require("primevue/utils"),n=require("primevue/ripple"),o=require("vue");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(e),a=s(t),r={name:"CascadeSelectSub",emits:["option-change"],props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null},mounted(){i.ObjectUtils.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId(e){return`${this.selectId}_${e.key}`},getOptionLabel(e){return this.optionLabel?i.ObjectUtils.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue(e){return this.optionValue?i.ObjectUtils.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled(e){return!!this.optionDisabled&&i.ObjectUtils.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?i.ObjectUtils.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:e=>e.children,isOptionGroup:e=>i.ObjectUtils.isNotEmpty(e.children),isOptionSelected(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive(e){return this.activeOptionPath.some((t=>t.key===e.key))},isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange(e){this.$emit("option-change",e)},position(){const e=this.$el.parentElement,t=i.DomHandler.getOffset(e),n=i.DomHandler.getViewport(),o=this.$el.offsetParent?this.$el.offsetWidth:i.DomHandler.getHiddenElementOuterWidth(this.$el),s=i.DomHandler.getOuterWidth(e.children[0]);parseInt(t.left,10)+s+o>n.width-i.DomHandler.calculateScrollbarWidth()&&(this.$el.style.left="-100%")},getOptionClass(e){return["p-cascadeselect-item",{"p-cascadeselect-item-group":this.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":this.isOptionActive(e),"p-focus":this.isOptionFocused(e),"p-disabled":this.isOptionDisabled(e)}]}},directives:{ripple:s(n).default}};const p={class:"p-cascadeselect-panel p-cascadeselect-items"},c=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset"],d=["onClick"],h={key:1,class:"p-cascadeselect-item-text"};r.render=function(e,t,i,n,s,l){const a=o.resolveComponent("CascadeSelectSub",!0),r=o.resolveDirective("ripple");return o.openBlock(),o.createElementBlock("ul",p,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.options,((e,t)=>(o.openBlock(),o.createElementBlock("li",{key:l.getOptionLabelToRender(e),id:l.getOptionId(e),class:o.normalizeClass(l.getOptionClass(e)),role:"treeitem","aria-label":l.getOptionLabelToRender(e),"aria-selected":l.isOptionGroup(e)?void 0:l.isOptionSelected(e),"aria-expanded":l.isOptionGroup(e)?l.isOptionActive(e):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":t+1},[o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:"p-cascadeselect-item-content",onClick:t=>l.onOptionClick(t,e)},[i.templates.option?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.templates.option),{key:0,option:e.option},null,8,["option"])):(o.openBlock(),o.createElementBlock("span",h,o.toDisplayString(l.getOptionLabelToRender(e)),1)),l.isOptionGroup(e)?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass(["p-cascadeselect-group-icon",i.optionGroupIcon]),"aria-hidden":"true"},null,2)):o.createCommentVNode("",!0)],8,d)),[[r]]),l.isOptionGroup(e)&&l.isOptionActive(e)?(o.openBlock(),o.createBlock(a,{key:0,role:"group",class:"p-cascadeselect-sublist",selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:l.getOptionGroupChildren(e),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:l.onOptionChange},null,8,["selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange"])):o.createCommentVNode("",!0)],10,c)))),128))])};var u={name:"CascadeSelect",emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],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,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:"pi pi-chevron-down"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},optionGroupIcon:{type:String,default:"pi pi-angle-right"},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},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data(){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||i.UniqueComponentId()},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||i.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(i.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel(e){return this.optionLabel?i.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?i.ObjectUtils.resolveFieldData(e,this.optionValue):e},isOptionDisabled(e){return!!this.optionDisabled&&i.ObjectUtils.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?i.ObjectUtils.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren(e,t){return i.ObjectUtils.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:e=>i.ObjectUtils.isNotEmpty(e.children),show(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&i.ObjectUtils.isNotEmpty(this.activeOptionPath)){const e=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?e.index:-1,level:e.level,parentKey:e.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&i.DomHandler.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.activeOptionPath=[],this.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&i.DomHandler.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled||this.loading)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&i.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}},onOptionChange(e){const{originalEvent:t,processedOption:n,isFocus:o,isHide:s}=e;if(i.ObjectUtils.isEmpty(n))return;const{index:l,level:a,parentKey:r,children:p}=n,c=i.ObjectUtils.isNotEmpty(p),d=this.activeOptionPath.filter((e=>e.parentKey!==r));d.push(n),this.focusedOptionInfo={index:l,level:a,parentKey:r},this.activeOptionPath=d,c?this.onOptionGroupSelect(t,n):this.onOptionSelect(t,n,s),o&&i.DomHandler.focus(this.$refs.focusInput)},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t.option);this.activeOptionPath.forEach((e=>e.selected=!0)),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),i.DomHandler.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick(e){l.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{const t=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((e=>e.key===t.parentKey)),o=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,s=i.ObjectUtils.isEmpty(t.parent);o&&(this.activeOptionPath=this.activeOptionPath.filter((e=>e.parentKey!==this.focusedOptionInfo.parentKey))),s||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t)){this.activeOptionPath.some((e=>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(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){const 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(e){this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter(e){i.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave(e){i.ZIndexUtils.clear(e)},alignOverlay(){"self"===this.appendTo?i.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=i.DomHandler.getOuterWidth(this.$el)+"px",i.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new i.ConnectedOverlayScrollHandler(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!i.DomHandler.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.activeOptionPath.some((t=>t.key===e.key))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return i.ObjectUtils.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?i.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e)))},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue(e,t,n=0){if(!(t=t||0===n&&this.processedOptions))return null;if(i.ObjectUtils.isEmpty(e))return[];for(let o=0;o<t.length;o++){const s=t[o];if(i.ObjectUtils.equals(e,this.getOptionValue(s.option),this.equalityKey))return[s];const l=this.findOptionPathByValue(e,s.children,n+1);if(l)return l.unshift(s),l}},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionInfo.index?(i=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionInfo.index):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionInfo.index&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(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(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,n=i.DomHandler.findSingle(this.list,`li[id="${t}"]`);n&&n.scrollIntoView&&n.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel(){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(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions(e,t=0,i={},n=""){const o=[];return e&&e.forEach(((e,s)=>{const l=(""!==n?n+"_":"")+s,a={option:e,index:s,level:t,key:l,parent:i,parentKey:n};a.children=this.createProcessedOptions(this.getOptionGroupChildren(e,t),t+1,a,l),o.push(a)})),o},overlayRef(e){this.overlay=e}},computed:{containerClass(){return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-cascadeselect-label p-inputtext",{"p-placeholder":this.label===this.placeholder,"p-cascadeselect-label-empty":!this.$slots.value&&("p-emptylabel"===this.label||0===this.label.length)}]},panelStyleClass(){return["p-cascadeselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-cascadeselect-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},hasSelectedOption(){return i.ObjectUtils.isNotEmpty(this.modelValue)},label(){const e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){const t=this.findOptionPathByValue(this.modelValue),n=i.ObjectUtils.isNotEmpty(t)?t[t.length-1]:null;return n?this.getOptionLabel(n.option):e}return e},processedOptions(){return this.createProcessedOptions(this.options||[])},visibleOptions(){const e=this.activeOptionPath.find((e=>e.key===this.focusedOptionInfo.parentKey));return e?e.children:this.processedOptions},equalityKey(){return this.optionValue?null:this.dataKey},searchResultMessageText(){return i.ObjectUtils.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionInfo.index?`${this.id}${i.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:""}_${this.focusedOptionInfo.index}`:null}},components:{CascadeSelectSub:r,Portal:a.default}};const O={class:"p-hidden-accessible"},f=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],y={class:"p-cascadeselect-trigger",role:"button",tabindex:"-1","aria-hidden":"true"},v={role:"status","aria-live":"polite",class:"p-hidden-accessible"},b={class:"p-cascadeselect-items-wrapper"},m={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}("\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n.p-cascadeselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n.p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n.p-fluid .p-cascadeselect {\n display: flex;\n}\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n"),u.render=function(e,t,i,n,s,l){const a=o.resolveComponent("CascadeSelectSub"),r=o.resolveComponent("Portal");return o.openBlock(),o.createElementBlock("div",{ref:"container",class:o.normalizeClass(l.containerClass),onClick:t[5]||(t[5]=e=>l.onContainerClick(e))},[o.createElementVNode("div",O,[o.createElementVNode("input",o.mergeProps({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":s.overlayVisible,"aria-controls":s.id+"_tree","aria-activedescendant":s.focused?l.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>l.onFocus&&l.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>l.onBlur&&l.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>l.onKeyDown&&l.onKeyDown(...e))},i.inputProps),null,16,f)]),o.createElementVNode("span",{class:o.normalizeClass(l.labelClass)},[o.renderSlot(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[o.createTextVNode(o.toDisplayString(l.label),1)]))],2),o.createElementVNode("div",y,[o.renderSlot(e.$slots,"indicator",{},(()=>[o.createElementVNode("span",{class:o.normalizeClass(l.dropdownIconClass)},null,2)]))]),o.createElementVNode("span",v,o.toDisplayString(l.searchResultMessageText),1),o.createVNode(r,{appendTo:i.appendTo},{default:o.withCtx((()=>[o.createVNode(o.Transition,{name:"p-connected-overlay",onEnter:l.onOverlayEnter,onAfterEnter:l.onOverlayAfterEnter,onLeave:l.onOverlayLeave,onAfterLeave:l.onOverlayAfterLeave},{default:o.withCtx((()=>[s.overlayVisible?(o.openBlock(),o.createElementBlock("div",o.mergeProps({key:0,ref:l.overlayRef,style:i.panelStyle,class:l.panelStyleClass,onClick:t[3]||(t[3]=(...e)=>l.onOverlayClick&&l.onOverlayClick(...e)),onKeydown:t[4]||(t[4]=(...e)=>l.onOverlayKeyDown&&l.onOverlayKeyDown(...e))},i.panelProps),[o.createElementVNode("div",b,[o.createVNode(a,{id:s.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:s.id,focusedOptionId:s.focused?l.focusedOptionId:void 0,options:l.processedOptions,activeOptionPath:s.activeOptionPath,level:0,templates:e.$slots,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:l.onOptionChange},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange"])]),o.createElementVNode("span",m,o.toDisplayString(l.selectedMessageText),1)],16)):o.createCommentVNode("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1},8,["appendTo"])],2)},module.exports=u;
@@ -1,6 +1,6 @@
1
1
  import OverlayEventBus from 'primevue/overlayeventbus';
2
2
  import Portal from 'primevue/portal';
3
- import { ObjectUtils, DomHandler, ZIndexUtils, ConnectedOverlayScrollHandler, UniqueComponentId } from 'primevue/utils';
3
+ import { ObjectUtils, DomHandler, UniqueComponentId, ZIndexUtils, ConnectedOverlayScrollHandler } from 'primevue/utils';
4
4
  import Ripple from 'primevue/ripple';
5
5
  import { resolveComponent, resolveDirective, openBlock, createElementBlock, Fragment, renderList, normalizeClass, withDirectives, createBlock, resolveDynamicComponent, toDisplayString, createCommentVNode, createElementVNode, mergeProps, renderSlot, createTextVNode, createVNode, withCtx, Transition } from 'vue';
6
6
 
@@ -283,6 +283,7 @@ var script = {
283
283
  focusOnHover: false,
284
284
  data() {
285
285
  return {
286
+ id: this.$attrs.id,
286
287
  focused: false,
287
288
  focusedOptionInfo: { index: -1, level: 0, parentKey: '' },
288
289
  activeOptionPath: [],
@@ -291,11 +292,16 @@ var script = {
291
292
  };
292
293
  },
293
294
  watch: {
295
+ '$attrs.id': function (newValue) {
296
+ this.id = newValue || UniqueComponentId();
297
+ },
294
298
  options() {
295
299
  this.autoUpdateModel();
296
300
  }
297
301
  },
298
302
  mounted() {
303
+ this.id = this.id || UniqueComponentId();
304
+
299
305
  this.autoUpdateModel();
300
306
  },
301
307
  beforeUnmount() {
@@ -934,9 +940,6 @@ var script = {
934
940
  selectedMessageText() {
935
941
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
936
942
  },
937
- id() {
938
- return this.$attrs.id || UniqueComponentId();
939
- },
940
943
  focusedOptionId() {
941
944
  return this.focusedOptionInfo.index !== -1 ? `${this.id}${ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey) ? '_' + this.focusedOptionInfo.parentKey : ''}_${this.focusedOptionInfo.index}` : null;
942
945
  }
@@ -992,7 +995,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
992
995
  "aria-labelledby": _ctx.ariaLabelledby,
993
996
  "aria-haspopup": "tree",
994
997
  "aria-expanded": $data.overlayVisible,
995
- "aria-controls": $options.id + '_tree',
998
+ "aria-controls": $data.id + '_tree',
996
999
  "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
997
1000
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
998
1001
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
@@ -1038,10 +1041,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1038
1041
  }, $props.panelProps), [
1039
1042
  createElementVNode("div", _hoisted_5, [
1040
1043
  createVNode(_component_CascadeSelectSub, {
1041
- id: $options.id + '_tree',
1044
+ id: $data.id + '_tree',
1042
1045
  role: "tree",
1043
1046
  "aria-orientation": "horizontal",
1044
- selectId: $options.id,
1047
+ selectId: $data.id,
1045
1048
  focusedOptionId: $data.focused ? $options.focusedOptionId : undefined,
1046
1049
  options: $options.processedOptions,
1047
1050
  activeOptionPath: $data.activeOptionPath,
@@ -1 +1 @@
1
- import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ObjectUtils as i,DomHandler as n,ZIndexUtils as s,ConnectedOverlayScrollHandler as o,UniqueComponentId as l}from"primevue/utils";import a from"primevue/ripple";import{resolveComponent as r,resolveDirective as p,openBlock as d,createElementBlock as c,Fragment as h,renderList as u,normalizeClass as f,withDirectives as O,createBlock as y,resolveDynamicComponent as v,toDisplayString as b,createCommentVNode as g,createElementVNode as m,mergeProps as I,renderSlot as x,createTextVNode as L,createVNode as w,withCtx as S,Transition as C}from"vue";var V={name:"CascadeSelectSub",emits:["option-change"],props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null},mounted(){i.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId(e){return`${this.selectId}_${e.key}`},getOptionLabel(e){return this.optionLabel?i.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue(e){return this.optionValue?i.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled(e){return!!this.optionDisabled&&i.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?i.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:e=>e.children,isOptionGroup:e=>i.isNotEmpty(e.children),isOptionSelected(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive(e){return this.activeOptionPath.some((t=>t.key===e.key))},isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange(e){this.$emit("option-change",e)},position(){const e=this.$el.parentElement,t=n.getOffset(e),i=n.getViewport(),s=this.$el.offsetParent?this.$el.offsetWidth:n.getHiddenElementOuterWidth(this.$el),o=n.getOuterWidth(e.children[0]);parseInt(t.left,10)+o+s>i.width-n.calculateScrollbarWidth()&&(this.$el.style.left="-100%")},getOptionClass(e){return["p-cascadeselect-item",{"p-cascadeselect-item-group":this.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":this.isOptionActive(e),"p-focus":this.isOptionFocused(e),"p-disabled":this.isOptionDisabled(e)}]}},directives:{ripple:a}};const k={class:"p-cascadeselect-panel p-cascadeselect-items"},K=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset"],G=["onClick"],P={key:1,class:"p-cascadeselect-item-text"};V.render=function(e,t,i,n,s,o){const l=r("CascadeSelectSub",!0),a=p("ripple");return d(),c("ul",k,[(d(!0),c(h,null,u(i.options,((e,t)=>(d(),c("li",{key:o.getOptionLabelToRender(e),id:o.getOptionId(e),class:f(o.getOptionClass(e)),role:"treeitem","aria-label":o.getOptionLabelToRender(e),"aria-selected":o.isOptionGroup(e)?void 0:o.isOptionSelected(e),"aria-expanded":o.isOptionGroup(e)?o.isOptionActive(e):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":t+1},[O((d(),c("div",{class:"p-cascadeselect-item-content",onClick:t=>o.onOptionClick(t,e)},[i.templates.option?(d(),y(v(i.templates.option),{key:0,option:e.option},null,8,["option"])):(d(),c("span",P,b(o.getOptionLabelToRender(e)),1)),o.isOptionGroup(e)?(d(),c("span",{key:2,class:f(["p-cascadeselect-group-icon",i.optionGroupIcon]),"aria-hidden":"true"},null,2)):g("",!0)],8,G)),[[a]]),o.isOptionGroup(e)&&o.isOptionActive(e)?(d(),y(l,{key:0,role:"group",class:"p-cascadeselect-sublist",selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:o.getOptionGroupChildren(e),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:o.onOptionChange},null,8,["selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange"])):g("",!0)],10,K)))),128))])};var E={name:"CascadeSelect",emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],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,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:"pi pi-chevron-down"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},optionGroupIcon:{type:String,default:"pi pi-angle-right"},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},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data:()=>({focused:!1,focusedOptionInfo:{index:-1,level:0,parentKey:""},activeOptionPath:[],overlayVisible:!1,dirty:!1}),watch:{options(){this.autoUpdateModel()}},mounted(){this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(s.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel(e){return this.optionLabel?i.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?i.resolveFieldData(e,this.optionValue):e},isOptionDisabled(e){return!!this.optionDisabled&&i.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?i.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren(e,t){return i.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:e=>i.isNotEmpty(e.children),show(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&i.isNotEmpty(this.activeOptionPath)){const e=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?e.index:-1,level:e.level,parentKey:e.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&n.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.activeOptionPath=[],this.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&n.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled||this.loading)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&i.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}},onOptionChange(e){const{originalEvent:t,processedOption:s,isFocus:o,isHide:l}=e;if(i.isEmpty(s))return;const{index:a,level:r,parentKey:p,children:d}=s,c=i.isNotEmpty(d),h=this.activeOptionPath.filter((e=>e.parentKey!==p));h.push(s),this.focusedOptionInfo={index:a,level:r,parentKey:p},this.activeOptionPath=h,c?this.onOptionGroupSelect(t,s):this.onOptionSelect(t,s,l),o&&n.focus(this.$refs.focusInput)},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t.option);this.activeOptionPath.forEach((e=>e.selected=!0)),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),n.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick(t){e.emit("overlay-click",{originalEvent:t,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{const t=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((e=>e.key===t.parentKey)),s=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,o=i.isEmpty(t.parent);s&&(this.activeOptionPath=this.activeOptionPath.filter((e=>e.parentKey!==this.focusedOptionInfo.parentKey))),o||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t)){this.activeOptionPath.some((e=>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(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){const 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(e){this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter(e){s.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave(e){s.clear(e)},alignOverlay(){"self"===this.appendTo?n.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=n.getOuterWidth(this.$el)+"px",n.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new o(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!n.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.activeOptionPath.some((t=>t.key===e.key))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return i.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?i.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e)))},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue(e,t,n=0){if(!(t=t||0===n&&this.processedOptions))return null;if(i.isEmpty(e))return[];for(let s=0;s<t.length;s++){const o=t[s];if(i.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];const l=this.findOptionPathByValue(e,o.children,n+1);if(l)return l.unshift(o),l}},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionInfo.index?(i=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionInfo.index):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionInfo.index&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(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(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=n.findSingle(this.list,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel(){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(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions(e,t=0,i={},n=""){const s=[];return e&&e.forEach(((e,o)=>{const l=(""!==n?n+"_":"")+o,a={option:e,index:o,level:t,key:l,parent:i,parentKey:n};a.children=this.createProcessedOptions(this.getOptionGroupChildren(e,t),t+1,a,l),s.push(a)})),s},overlayRef(e){this.overlay=e}},computed:{containerClass(){return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-cascadeselect-label p-inputtext",{"p-placeholder":this.label===this.placeholder,"p-cascadeselect-label-empty":!this.$slots.value&&("p-emptylabel"===this.label||0===this.label.length)}]},panelStyleClass(){return["p-cascadeselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-cascadeselect-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},hasSelectedOption(){return i.isNotEmpty(this.modelValue)},label(){const e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){const t=this.findOptionPathByValue(this.modelValue),n=i.isNotEmpty(t)?t[t.length-1]:null;return n?this.getOptionLabel(n.option):e}return e},processedOptions(){return this.createProcessedOptions(this.options||[])},visibleOptions(){const e=this.activeOptionPath.find((e=>e.key===this.focusedOptionInfo.parentKey));return e?e.children:this.processedOptions},equalityKey(){return this.optionValue?null:this.dataKey},searchResultMessageText(){return i.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},id(){return this.$attrs.id||l()},focusedOptionId(){return-1!==this.focusedOptionInfo.index?`${this.id}${i.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:""}_${this.focusedOptionInfo.index}`:null}},components:{CascadeSelectSub:V,Portal:t}};const D={class:"p-hidden-accessible"},$=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],F={class:"p-cascadeselect-trigger",role:"button",tabindex:"-1","aria-hidden":"true"},M={role:"status","aria-live":"polite",class:"p-hidden-accessible"},T={class:"p-cascadeselect-items-wrapper"},A={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n.p-cascadeselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n.p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n.p-fluid .p-cascadeselect {\n display: flex;\n}\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n"),E.render=function(e,t,i,n,s,o){const l=r("CascadeSelectSub"),a=r("Portal");return d(),c("div",{ref:"container",class:f(o.containerClass),onClick:t[5]||(t[5]=e=>o.onContainerClick(e))},[m("div",D,[m("input",I({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":s.overlayVisible,"aria-controls":o.id+"_tree","aria-activedescendant":s.focused?o.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onKeyDown&&o.onKeyDown(...e))},i.inputProps),null,16,$)]),m("span",{class:f(o.labelClass)},[x(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[L(b(o.label),1)]))],2),m("div",F,[x(e.$slots,"indicator",{},(()=>[m("span",{class:f(o.dropdownIconClass)},null,2)]))]),m("span",M,b(o.searchResultMessageText),1),w(a,{appendTo:i.appendTo},{default:S((()=>[w(C,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onAfterEnter:o.onOverlayAfterEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:S((()=>[s.overlayVisible?(d(),c("div",I({key:0,ref:o.overlayRef,style:i.panelStyle,class:o.panelStyleClass,onClick:t[3]||(t[3]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e)),onKeydown:t[4]||(t[4]=(...e)=>o.onOverlayKeyDown&&o.onOverlayKeyDown(...e))},i.panelProps),[m("div",T,[w(l,{id:o.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:o.id,focusedOptionId:s.focused?o.focusedOptionId:void 0,options:o.processedOptions,activeOptionPath:s.activeOptionPath,level:0,templates:e.$slots,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:o.onOptionChange},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange"])]),m("span",A,b(o.selectedMessageText),1)],16)):g("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1},8,["appendTo"])],2)};export{E as default};
1
+ import e from"primevue/overlayeventbus";import t from"primevue/portal";import{ObjectUtils as i,DomHandler as n,UniqueComponentId as s,ZIndexUtils as o,ConnectedOverlayScrollHandler as l}from"primevue/utils";import a from"primevue/ripple";import{resolveComponent as r,resolveDirective as p,openBlock as d,createElementBlock as c,Fragment as h,renderList as u,normalizeClass as f,withDirectives as O,createBlock as y,resolveDynamicComponent as v,toDisplayString as b,createCommentVNode as g,createElementVNode as m,mergeProps as I,renderSlot as x,createTextVNode as L,createVNode as w,withCtx as S,Transition as C}from"vue";var V={name:"CascadeSelectSub",emits:["option-change"],props:{selectId:String,focusedOptionId:String,options:Array,optionLabel:String,optionValue:String,optionDisabled:null,optionGroupIcon:String,optionGroupLabel:String,optionGroupChildren:Array,activeOptionPath:Array,level:Number,templates:null},mounted(){i.isNotEmpty(this.parentKey)&&this.position()},methods:{getOptionId(e){return`${this.selectId}_${e.key}`},getOptionLabel(e){return this.optionLabel?i.resolveFieldData(e.option,this.optionLabel):e.option},getOptionValue(e){return this.optionValue?i.resolveFieldData(e.option,this.optionValue):e.option},isOptionDisabled(e){return!!this.optionDisabled&&i.resolveFieldData(e.option,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?i.resolveFieldData(e.option,this.optionGroupLabel):null},getOptionGroupChildren:e=>e.children,isOptionGroup:e=>i.isNotEmpty(e.children),isOptionSelected(e){return!this.isOptionGroup(e)&&this.isOptionActive(e)},isOptionActive(e){return this.activeOptionPath.some((t=>t.key===e.key))},isOptionFocused(e){return this.focusedOptionId===this.getOptionId(e)},getOptionLabelToRender(e){return this.isOptionGroup(e)?this.getOptionGroupLabel(e):this.getOptionLabel(e)},onOptionClick(e,t){this.$emit("option-change",{originalEvent:e,processedOption:t,isFocus:!0})},onOptionChange(e){this.$emit("option-change",e)},position(){const e=this.$el.parentElement,t=n.getOffset(e),i=n.getViewport(),s=this.$el.offsetParent?this.$el.offsetWidth:n.getHiddenElementOuterWidth(this.$el),o=n.getOuterWidth(e.children[0]);parseInt(t.left,10)+o+s>i.width-n.calculateScrollbarWidth()&&(this.$el.style.left="-100%")},getOptionClass(e){return["p-cascadeselect-item",{"p-cascadeselect-item-group":this.isOptionGroup(e),"p-cascadeselect-item-active p-highlight":this.isOptionActive(e),"p-focus":this.isOptionFocused(e),"p-disabled":this.isOptionDisabled(e)}]}},directives:{ripple:a}};const k={class:"p-cascadeselect-panel p-cascadeselect-items"},K=["id","aria-label","aria-selected","aria-expanded","aria-level","aria-setsize","aria-posinset"],G=["onClick"],P={key:1,class:"p-cascadeselect-item-text"};V.render=function(e,t,i,n,s,o){const l=r("CascadeSelectSub",!0),a=p("ripple");return d(),c("ul",k,[(d(!0),c(h,null,u(i.options,((e,t)=>(d(),c("li",{key:o.getOptionLabelToRender(e),id:o.getOptionId(e),class:f(o.getOptionClass(e)),role:"treeitem","aria-label":o.getOptionLabelToRender(e),"aria-selected":o.isOptionGroup(e)?void 0:o.isOptionSelected(e),"aria-expanded":o.isOptionGroup(e)?o.isOptionActive(e):void 0,"aria-level":i.level+1,"aria-setsize":i.options.length,"aria-posinset":t+1},[O((d(),c("div",{class:"p-cascadeselect-item-content",onClick:t=>o.onOptionClick(t,e)},[i.templates.option?(d(),y(v(i.templates.option),{key:0,option:e.option},null,8,["option"])):(d(),c("span",P,b(o.getOptionLabelToRender(e)),1)),o.isOptionGroup(e)?(d(),c("span",{key:2,class:f(["p-cascadeselect-group-icon",i.optionGroupIcon]),"aria-hidden":"true"},null,2)):g("",!0)],8,G)),[[a]]),o.isOptionGroup(e)&&o.isOptionActive(e)?(d(),y(l,{key:0,role:"group",class:"p-cascadeselect-sublist",selectId:i.selectId,focusedOptionId:i.focusedOptionId,options:o.getOptionGroupChildren(e),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:o.onOptionChange},null,8,["selectId","focusedOptionId","options","activeOptionPath","level","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange"])):g("",!0)],10,K)))),128))])};var E={name:"CascadeSelect",emits:["update:modelValue","change","focus","blur","click","group-change","before-show","before-hide","hide","show"],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,default:null},inputStyle:{type:null,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},dropdownIcon:{type:String,default:"pi pi-chevron-down"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},optionGroupIcon:{type:String,default:"pi pi-angle-right"},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},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,searchTimeout:null,searchValue:null,focusOnHover:!1,data(){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()},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||s(),this.autoUpdateModel()},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(o.clear(this.overlay),this.overlay=null)},methods:{getOptionLabel(e){return this.optionLabel?i.resolveFieldData(e,this.optionLabel):e},getOptionValue(e){return this.optionValue?i.resolveFieldData(e,this.optionValue):e},isOptionDisabled(e){return!!this.optionDisabled&&i.resolveFieldData(e,this.optionDisabled)},getOptionGroupLabel(e){return this.optionGroupLabel?i.resolveFieldData(e,this.optionGroupLabel):null},getOptionGroupChildren(e,t){return i.resolveFieldData(e,this.optionGroupChildren[t])},isOptionGroup(e,t){return Object.prototype.hasOwnProperty.call(e,this.optionGroupChildren[t])},getProccessedOptionLabel(e){return this.isProccessedOptionGroup(e)?this.getOptionGroupLabel(e.option,e.level):this.getOptionLabel(e.option)},isProccessedOptionGroup:e=>i.isNotEmpty(e.children),show(e){if(this.$emit("before-show"),this.overlayVisible=!0,this.activeOptionPath=this.hasSelectedOption?this.findOptionPathByValue(this.modelValue):this.activeOptionPath,this.hasSelectedOption&&i.isNotEmpty(this.activeOptionPath)){const e=this.activeOptionPath[this.activeOptionPath.length-1];this.focusedOptionInfo={index:this.autoOptionFocus?e.index:-1,level:e.level,parentKey:e.parentKey}}else this.focusedOptionInfo={index:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,level:0,parentKey:""};e&&n.focus(this.$refs.focusInput)},hide(e){const t=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.activeOptionPath=[],this.focusedOptionInfo={index:-1,level:0,parentKey:""},e&&n.focus(this.$refs.focusInput)};setTimeout((()=>{t()}),0)},onFocus(e){this.disabled||(this.focused=!0,this.$emit("focus",e))},onBlur(e){this.focused=!1,this.focusedOptionInfo={index:-1,level:0,parentKey:""},this.searchValue="",this.$emit("blur",e)},onKeyDown(e){if(this.disabled||this.loading)return void e.preventDefault();const t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&i.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e,e.key))}},onOptionChange(e){const{originalEvent:t,processedOption:s,isFocus:o,isHide:l}=e;if(i.isEmpty(s))return;const{index:a,level:r,parentKey:p,children:d}=s,c=i.isNotEmpty(d),h=this.activeOptionPath.filter((e=>e.parentKey!==p));h.push(s),this.focusedOptionInfo={index:a,level:r,parentKey:p},this.activeOptionPath=h,c?this.onOptionGroupSelect(t,s):this.onOptionSelect(t,s,l),o&&n.focus(this.$refs.focusInput)},onOptionSelect(e,t,i=!0){const n=this.getOptionValue(t.option);this.activeOptionPath.forEach((e=>e.selected=!0)),this.updateModel(e,n),i&&this.hide(!0)},onOptionGroupSelect(e,t){this.dirty=!0,this.$emit("group-change",{originalEvent:e,value:t.option})},onContainerClick(e){this.disabled||this.loading||(this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide():this.show(),n.focus(this.$refs.focusInput)),this.$emit("click",e))},onOverlayClick(t){e.emit("overlay-click",{originalEvent:t,target:this.$el})},onOverlayKeyDown(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey(e){const t=-1!==this.focusedOptionInfo.index?this.findNextOptionIndex(this.focusedOptionInfo.index):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey(e){if(e.altKey){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide(),e.preventDefault()}else{const t=-1!==this.focusedOptionInfo.index?this.findPrevOptionIndex(this.focusedOptionInfo.index):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index],n=this.activeOptionPath.find((e=>e.key===t.parentKey)),s=""===this.focusedOptionInfo.parentKey||n&&n.key===this.focusedOptionInfo.parentKey,o=i.isEmpty(t.parent);s&&(this.activeOptionPath=this.activeOptionPath.filter((e=>e.parentKey!==this.focusedOptionInfo.parentKey))),o||(this.focusedOptionInfo={index:-1,parentKey:n?n.parentKey:""},this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}},onArrowRightKey(e){if(this.overlayVisible){const t=this.visibleOptions[this.focusedOptionInfo.index];if(this.isProccessedOptionGroup(t)){this.activeOptionPath.some((e=>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(e){this.changeFocusedOptionIndex(e,this.findFirstOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEndKey(e){this.changeFocusedOptionIndex(e,this.findLastOptionIndex()),!this.overlayVisible&&this.show(),e.preventDefault()},onEnterKey(e){if(this.overlayVisible){if(-1!==this.focusedOptionInfo.index){const 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(e){this.onEnterKey(e)},onEscapeKey(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey(e){if(-1!==this.focusedOptionInfo.index){const t=this.visibleOptions[this.focusedOptionInfo.index];!this.isProccessedOptionGroup(t)&&this.onOptionChange({originalEvent:e,processedOption:t})}this.overlayVisible&&this.hide()},onOverlayEnter(e){o.set("overlay",e,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView()},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null,this.dirty=!1},onOverlayAfterLeave(e){o.clear(e)},alignOverlay(){"self"===this.appendTo?n.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=n.getOuterWidth(this.$el)+"px",n.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=e=>{this.overlayVisible&&this.overlay&&!this.$el.contains(e.target)&&!this.overlay.contains(e.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new l(this.$refs.container,(()=>{this.overlayVisible&&this.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!n.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOptionMatched(e){return this.isValidOption(e)&&this.getProccessedOptionLabel(e).toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale))},isValidOption(e){return!!e&&!this.isOptionDisabled(e.option)},isValidSelectedOption(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected(e){return this.activeOptionPath.some((t=>t.key===e.key))},findFirstOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidOption(e)))},findLastOptionIndex(){return i.findLastIndex(this.visibleOptions,(e=>this.isValidOption(e)))},findNextOptionIndex(e){const t=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((e=>this.isValidOption(e))):-1;return t>-1?t+e+1:e},findPrevOptionIndex(e){const t=e>0?i.findLastIndex(this.visibleOptions.slice(0,e),(e=>this.isValidOption(e))):-1;return t>-1?t:e},findSelectedOptionIndex(){return this.visibleOptions.findIndex((e=>this.isValidSelectedOption(e)))},findFirstFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex(){const e=this.findSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},findOptionPathByValue(e,t,n=0){if(!(t=t||0===n&&this.processedOptions))return null;if(i.isEmpty(e))return[];for(let s=0;s<t.length;s++){const o=t[s];if(i.equals(e,this.getOptionValue(o.option),this.equalityKey))return[o];const l=this.findOptionPathByValue(e,o.children,n+1);if(l)return l.unshift(o),l}},searchOptions(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,n=!1;return-1!==this.focusedOptionInfo.index?(i=this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))),i=-1===i?this.visibleOptions.slice(0,this.focusedOptionInfo.index).findIndex((e=>this.isOptionMatched(e))):i+this.focusedOptionInfo.index):i=this.visibleOptions.findIndex((e=>this.isOptionMatched(e))),-1!==i&&(n=!0),-1===i&&-1===this.focusedOptionInfo.index&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((()=>{this.searchValue="",this.searchTimeout=null}),500),n},changeFocusedOptionIndex(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(e=-1){const t=-1!==e?`${this.id}_${e}`:this.focusedOptionId,i=n.findSingle(this.list,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"})},autoUpdateModel(){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(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},createProcessedOptions(e,t=0,i={},n=""){const s=[];return e&&e.forEach(((e,o)=>{const l=(""!==n?n+"_":"")+o,a={option:e,index:o,level:t,key:l,parent:i,parentKey:n};a.children=this.createProcessedOptions(this.getOptionGroupChildren(e,t),t+1,a,l),s.push(a)})),s},overlayRef(e){this.overlay=e}},computed:{containerClass(){return["p-cascadeselect p-component p-inputwrapper",{"p-disabled":this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},labelClass(){return["p-cascadeselect-label p-inputtext",{"p-placeholder":this.label===this.placeholder,"p-cascadeselect-label-empty":!this.$slots.value&&("p-emptylabel"===this.label||0===this.label.length)}]},panelStyleClass(){return["p-cascadeselect-panel p-component",this.panelClass,{"p-input-filled":"filled"===this.$primevue.config.inputStyle,"p-ripple-disabled":!1===this.$primevue.config.ripple}]},dropdownIconClass(){return["p-cascadeselect-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},hasSelectedOption(){return i.isNotEmpty(this.modelValue)},label(){const e=this.placeholder||"p-emptylabel";if(this.hasSelectedOption){const t=this.findOptionPathByValue(this.modelValue),n=i.isNotEmpty(t)?t[t.length-1]:null;return n?this.getOptionLabel(n.option):e}return e},processedOptions(){return this.createProcessedOptions(this.options||[])},visibleOptions(){const e=this.activeOptionPath.find((e=>e.key===this.focusedOptionInfo.parentKey));return e?e.children:this.processedOptions},equalityKey(){return this.optionValue?null:this.dataKey},searchResultMessageText(){return i.isNotEmpty(this.visibleOptions)?this.searchMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptySearchMessageText},searchMessageText(){return this.searchMessage||this.$primevue.config.locale.searchMessage||""},emptySearchMessageText(){return this.emptySearchMessage||this.$primevue.config.locale.emptySearchMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return-1!==this.focusedOptionInfo.index?`${this.id}${i.isNotEmpty(this.focusedOptionInfo.parentKey)?"_"+this.focusedOptionInfo.parentKey:""}_${this.focusedOptionInfo.index}`:null}},components:{CascadeSelectSub:V,Portal:t}};const D={class:"p-hidden-accessible"},$=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],F={class:"p-cascadeselect-trigger",role:"button",tabindex:"-1","aria-hidden":"true"},M={role:"status","aria-live":"polite",class:"p-hidden-accessible"},T={class:"p-cascadeselect-items-wrapper"},A={role:"status","aria-live":"polite",class:"p-hidden-accessible"};!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css","top"===i&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}}("\n.p-cascadeselect {\n display: inline-flex;\n cursor: pointer;\n position: relative;\n user-select: none;\n}\n.p-cascadeselect-trigger {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n}\n.p-cascadeselect-label {\n display: block;\n white-space: nowrap;\n overflow: hidden;\n flex: 1 1 auto;\n width: 1%;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.p-cascadeselect-label-empty {\n overflow: hidden;\n visibility: hidden;\n}\n.p-cascadeselect .p-cascadeselect-panel {\n min-width: 100%;\n}\n.p-cascadeselect-panel {\n position: absolute;\n top: 0;\n left: 0;\n}\n.p-cascadeselect-item {\n cursor: pointer;\n font-weight: normal;\n white-space: nowrap;\n}\n.p-cascadeselect-item-content {\n display: flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n}\n.p-cascadeselect-group-icon {\n margin-left: auto;\n}\n.p-cascadeselect-items {\n margin: 0;\n padding: 0;\n list-style-type: none;\n min-width: 100%;\n}\n.p-fluid .p-cascadeselect {\n display: flex;\n}\n.p-fluid .p-cascadeselect .p-cascadeselect-label {\n width: 1%;\n}\n.p-cascadeselect-sublist {\n position: absolute;\n min-width: 100%;\n z-index: 1;\n display: none;\n}\n.p-cascadeselect-item-active {\n overflow: visible !important;\n}\n.p-cascadeselect-item-active > .p-cascadeselect-sublist {\n display: block;\n left: 100%;\n top: 0;\n}\n"),E.render=function(e,t,i,n,s,o){const l=r("CascadeSelectSub"),a=r("Portal");return d(),c("div",{ref:"container",class:f(o.containerClass),onClick:t[5]||(t[5]=e=>o.onContainerClick(e))},[m("div",D,[m("input",I({ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:i.inputClass,readonly:"",disabled:i.disabled,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"tree","aria-expanded":s.overlayVisible,"aria-controls":s.id+"_tree","aria-activedescendant":s.focused?o.focusedOptionId:void 0,onFocus:t[0]||(t[0]=(...e)=>o.onFocus&&o.onFocus(...e)),onBlur:t[1]||(t[1]=(...e)=>o.onBlur&&o.onBlur(...e)),onKeydown:t[2]||(t[2]=(...e)=>o.onKeyDown&&o.onKeyDown(...e))},i.inputProps),null,16,$)]),m("span",{class:f(o.labelClass)},[x(e.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},(()=>[L(b(o.label),1)]))],2),m("div",F,[x(e.$slots,"indicator",{},(()=>[m("span",{class:f(o.dropdownIconClass)},null,2)]))]),m("span",M,b(o.searchResultMessageText),1),w(a,{appendTo:i.appendTo},{default:S((()=>[w(C,{name:"p-connected-overlay",onEnter:o.onOverlayEnter,onAfterEnter:o.onOverlayAfterEnter,onLeave:o.onOverlayLeave,onAfterLeave:o.onOverlayAfterLeave},{default:S((()=>[s.overlayVisible?(d(),c("div",I({key:0,ref:o.overlayRef,style:i.panelStyle,class:o.panelStyleClass,onClick:t[3]||(t[3]=(...e)=>o.onOverlayClick&&o.onOverlayClick(...e)),onKeydown:t[4]||(t[4]=(...e)=>o.onOverlayKeyDown&&o.onOverlayKeyDown(...e))},i.panelProps),[m("div",T,[w(l,{id:s.id+"_tree",role:"tree","aria-orientation":"horizontal",selectId:s.id,focusedOptionId:s.focused?o.focusedOptionId:void 0,options:o.processedOptions,activeOptionPath:s.activeOptionPath,level:0,templates:e.$slots,optionLabel:i.optionLabel,optionValue:i.optionValue,optionDisabled:i.optionDisabled,optionGroupIcon:i.optionGroupIcon,optionGroupLabel:i.optionGroupLabel,optionGroupChildren:i.optionGroupChildren,onOptionChange:o.onOptionChange},null,8,["id","selectId","focusedOptionId","options","activeOptionPath","templates","optionLabel","optionValue","optionDisabled","optionGroupIcon","optionGroupLabel","optionGroupChildren","onOptionChange"])]),m("span",A,b(o.selectedMessageText),1)],16)):g("",!0)])),_:1},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])])),_:1},8,["appendTo"])],2)};export{E as default};
@@ -287,6 +287,7 @@ this.primevue.cascadeselect = (function (OverlayEventBus, Portal, utils, Ripple,
287
287
  focusOnHover: false,
288
288
  data() {
289
289
  return {
290
+ id: this.$attrs.id,
290
291
  focused: false,
291
292
  focusedOptionInfo: { index: -1, level: 0, parentKey: '' },
292
293
  activeOptionPath: [],
@@ -295,11 +296,16 @@ this.primevue.cascadeselect = (function (OverlayEventBus, Portal, utils, Ripple,
295
296
  };
296
297
  },
297
298
  watch: {
299
+ '$attrs.id': function (newValue) {
300
+ this.id = newValue || utils.UniqueComponentId();
301
+ },
298
302
  options() {
299
303
  this.autoUpdateModel();
300
304
  }
301
305
  },
302
306
  mounted() {
307
+ this.id = this.id || utils.UniqueComponentId();
308
+
303
309
  this.autoUpdateModel();
304
310
  },
305
311
  beforeUnmount() {
@@ -938,9 +944,6 @@ this.primevue.cascadeselect = (function (OverlayEventBus, Portal, utils, Ripple,
938
944
  selectedMessageText() {
939
945
  return this.hasSelectedOption ? this.selectionMessageText.replaceAll('{0}', '1') : this.emptySelectionMessageText;
940
946
  },
941
- id() {
942
- return this.$attrs.id || utils.UniqueComponentId();
943
- },
944
947
  focusedOptionId() {
945
948
  return this.focusedOptionInfo.index !== -1 ? `${this.id}${utils.ObjectUtils.isNotEmpty(this.focusedOptionInfo.parentKey) ? '_' + this.focusedOptionInfo.parentKey : ''}_${this.focusedOptionInfo.index}` : null;
946
949
  }
@@ -996,7 +999,7 @@ this.primevue.cascadeselect = (function (OverlayEventBus, Portal, utils, Ripple,
996
999
  "aria-labelledby": _ctx.ariaLabelledby,
997
1000
  "aria-haspopup": "tree",
998
1001
  "aria-expanded": $data.overlayVisible,
999
- "aria-controls": $options.id + '_tree',
1002
+ "aria-controls": $data.id + '_tree',
1000
1003
  "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
1001
1004
  onFocus: _cache[0] || (_cache[0] = (...args) => ($options.onFocus && $options.onFocus(...args))),
1002
1005
  onBlur: _cache[1] || (_cache[1] = (...args) => ($options.onBlur && $options.onBlur(...args))),
@@ -1042,10 +1045,10 @@ this.primevue.cascadeselect = (function (OverlayEventBus, Portal, utils, Ripple,
1042
1045
  }, $props.panelProps), [
1043
1046
  vue.createElementVNode("div", _hoisted_5, [
1044
1047
  vue.createVNode(_component_CascadeSelectSub, {
1045
- id: $options.id + '_tree',
1048
+ id: $data.id + '_tree',
1046
1049
  role: "tree",
1047
1050
  "aria-orientation": "horizontal",
1048
- selectId: $options.id,
1051
+ selectId: $data.id,
1049
1052
  focusedOptionId: $data.focused ? $options.focusedOptionId : undefined,
1050
1053
  options: $options.processedOptions,
1051
1054
  activeOptionPath: $data.activeOptionPath,