playbook_ui 13.32.0.pre.alpha.PLAY14143288 → 13.32.0.pre.alpha.PLAY14143297

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +4 -0
  3. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +1 -1
  4. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +9 -6
  5. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.html.erb +10 -0
  6. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_blank_selection.jsx +31 -0
  7. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
  8. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
  9. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +2 -2
  10. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +6 -0
  11. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +1 -1
  12. data/app/pb_kits/playbook/pb_dropdown/index.js +33 -7
  13. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +108 -5
  14. data/app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx +53 -0
  15. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +11 -2
  16. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_example.html.erb +5 -1
  17. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_example.jsx +1 -0
  18. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.html.erb +2 -0
  19. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.jsx +2 -0
  20. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.html.erb +4 -1
  21. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.jsx +3 -2
  22. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.html.erb +2 -0
  23. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.jsx +2 -0
  24. data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
  25. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +5 -1
  26. data/app/pb_kits/playbook/pb_icon/_icon.scss +210 -1
  27. data/app/pb_kits/playbook/pb_icon/_icon.tsx +100 -41
  28. data/app/pb_kits/playbook/pb_icon/icon.rb +33 -19
  29. data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +2 -2
  30. data/app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb +48 -0
  31. data/app/pb_kits/playbook/pb_nav/docs/_tab_nav.md +3 -0
  32. data/app/pb_kits/playbook/pb_nav/docs/example.yml +1 -0
  33. data/app/pb_kits/playbook/pb_nav/index.js +43 -0
  34. data/app/pb_kits/playbook/pb_nav/nav.rb +9 -0
  35. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +1 -1
  36. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +1 -1
  37. data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +11 -2
  38. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_interactive.html.erb +1 -0
  39. data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +1 -1
  40. data/app/pb_kits/playbook/pb_star_rating/index.js +50 -0
  41. data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +25 -5
  42. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +6 -0
  43. data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
  44. data/app/pb_kits/playbook/pb_table/index.ts +4 -4
  45. data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +1 -1
  46. data/app/pb_kits/playbook/pb_table/subcomponents/_table_cell.tsx +1 -1
  47. data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +1 -1
  48. data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +1 -1
  49. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +1 -1
  50. data/app/pb_kits/playbook/pb_table/table.test.js +2 -0
  51. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
  52. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +1 -1
  53. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +45 -27
  54. data/app/pb_kits/playbook/pb_textarea/index.ts +3 -3
  55. data/app/pb_kits/playbook/pb_time/_time.tsx +3 -3
  56. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
  57. data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
  58. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
  59. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +10 -10
  60. data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
  61. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +2 -2
  62. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -2
  63. data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +2 -0
  64. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -3
  65. data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +4 -4
  66. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +11 -7
  67. data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +8 -3
  68. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +6 -1
  69. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +18 -19
  70. data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +6 -6
  71. data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +6 -6
  72. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +3 -3
  73. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +2 -0
  74. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +22 -57
  75. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +2 -2
  76. data/app/pb_kits/playbook/pb_typeahead/index.ts +31 -31
  77. data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
  78. data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +6 -6
  79. data/app/pb_kits/playbook/pb_user_badge/badges/million-dollar.tsx +236 -235
  80. data/app/pb_kits/playbook/pb_user_badge/badges/veteran.tsx +1 -1
  81. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +68 -63
  82. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
  83. data/dist/chunks/_typeahead.js +11 -11
  84. data/dist/chunks/_weekday_stacked.js +7 -7
  85. data/dist/playbook-doc.js +26 -26
  86. data/dist/playbook-rails.js +1 -1
  87. data/dist/playbook.css +1 -1
  88. data/lib/playbook/forms/builder/star_rating_field.rb +14 -0
  89. data/lib/playbook/forms/builder.rb +1 -0
  90. data/lib/playbook/version.rb +1 -1
  91. metadata +11 -3
  92. data/app/pb_kits/playbook/pb_icon/icon_aliases.json +0 -39
@@ -1 +1 @@
1
- import"./chunks/pb_form_validation.js";import{P as a,d as w,a as y,b as E,c as m,e as b,f,g as _}from"./chunks/lib.js";import"./chunks/lazysizes.js";import"./playbook-rails-react-bindings.js";import"react";import"webpacker-react";import"./chunks/_typeahead.js";import"react/jsx-runtime";import"react-dom";import"react-is";const O="[data-collapsible-main]",v="[data-collapsible-content]",L="#collapsible_open_icon",T="#collapsible_close_icon";class S extends a{static get selector(){return O}connect(){this.element.addEventListener("click",()=>{this.toggleElement(this.target)}),this.target.classList.contains("is-visible")?this.displayUpArrow():this.displayDownArrow(),document.addEventListener(`${this.target.id}`,()=>{this.toggleElement(this.target)})}get target(){return this.element.parentNode.querySelector(v)}showElement(t){const s=(()=>{t.style.display="block";const o=t.scrollHeight+"px";return t.style.display="",o})();t.classList.add("is-visible"),t.style.height=s,t.style.overflow="hidden",window.setTimeout(()=>{t.style.height="",t.style.overflow="visible"},300)}hideElement(t){t.style.height=t.scrollHeight+"px",window.setTimeout(()=>{t.style.height="0",t.style.paddingTop="0",t.style.paddingBottom="0",t.style.overflow="hidden"},1),window.setTimeout(()=>{t.classList.remove("is-visible"),t.style.overflow=""},300)}toggleElement(t){if(t.classList.contains("is-visible")){this.hideElement(t),this.displayDownArrow();return}this.showElement(t),this.displayUpArrow()}toggleArrows(t){const e=this.element.querySelector(L),s=this.element.querySelector(T);e&&(e.style.display=t?"inline-block":"none"),s&&(s.style.display=t?"none":"inline-block")}displayDownArrow(){this.toggleArrows(!0)}displayUpArrow(){this.toggleArrows(!1)}}class A extends a{static get selector(){return".remove_toast"}connect(){this.self=this.element,this.autoCloseToast(this.self),this.self.addEventListener("click",()=>{this.removeToast(this.self)})}removeToast(t){t.parentNode.removeChild(t)}autoCloseToast(t){const e=t.classList.value;if(e.includes("auto_close")){const o=e.split(" "),i=o[o.length-1].split("_")[2],n=parseInt(i);setTimeout(()=>{this.removeToast(t)},n)}}}const C="[data-dropdown-option-label]";class D{constructor(t){this.dropdown=t,this.dropdownElement=t.element,this.options=Array.from(this.dropdownElement.querySelectorAll(C)),this.focusedOptionIndex=-1,this.init()}init(){this.dropdownElement.addEventListener("keydown",this.handleKeyDown.bind(this))}handleKeyDown(t){switch(t.key){case"ArrowDown":t.preventDefault(),this.dropdown.target.classList.contains("open")||(this.dropdown.showElement(this.dropdown.target),this.dropdown.updateArrowDisplay(!0)),this.moveFocus(1);break;case"ArrowUp":t.preventDefault(),this.moveFocus(-1);break;case"Enter":t.preventDefault(),this.focusedOptionIndex!==-1?this.selectOption():this.dropdown.target.classList.contains("open")||(this.dropdown.showElement(this.dropdown.target),this.dropdown.updateArrowDisplay(!0));break;case"Escape":this.dropdown.hideElement(this.dropdown.target);break;case"Tab":this.dropdown.hideElement(this.dropdown.target),this.dropdown.updateArrowDisplay(!1),this.resetFocus();break}}moveFocus(t){this.focusedOptionIndex!==-1&&this.options[this.focusedOptionIndex].classList.remove("pb_dropdown_option_focused"),this.focusedOptionIndex=(this.focusedOptionIndex+t+this.options.length)%this.options.length,this.options[this.focusedOptionIndex].classList.add("pb_dropdown_option_focused")}selectOption(){const t=this.options[this.focusedOptionIndex];this.dropdown.onOptionSelected(t.dataset.dropdownOptionLabel,t),this.dropdown.hideElement(this.dropdown.target)}}const k="[data-pb-dropdown]",R="[data-dropdown-trigger]",h="[data-dropdown-container]",q="#dropdown_open_icon",N="#dropdown_close_icon",l="[data-dropdown-option-label]",c="[data-dropdown-custom-trigger]",p="#dropdown-form-validation";class x extends a{static get selector(){return k}get target(){return this.element.parentNode.querySelector(h)}connect(){this.keyboardHandler=new D(this),this.setDefaultValue(),this.bindEventListeners(),this.updateArrowDisplay(!1),this.handleFormValidation()}bindEventListeners(){(this.element.querySelector(c)||this.element).addEventListener("click",()=>this.toggleElement(this.target)),this.target.addEventListener("click",this.handleOptionClick.bind(this)),document.addEventListener("click",this.handleDocumentClick.bind(this),!0)}handleOptionClick(t){const e=t.target.closest(l),s=this.element.querySelector("#dropdown-selected-option"),o=this.element.querySelector(p);if(e){const i=e.dataset.dropdownOptionLabel;s.value=JSON.parse(i).id,o.value=JSON.parse(i).id,this.clearFormValidation(o),this.onOptionSelected(i,e)}}handleDocumentClick(t){this.isClickOutside(t)&&this.target.classList.contains("open")&&(this.hideElement(this.target),this.updateArrowDisplay(!1))}isClickOutside(t){const e=this.element.querySelector(c);if(e)return!e.contains(t.target);{const s=this.element.querySelector(R),o=this.element.parentNode.querySelector(h),i=s?!s.contains(t.target):!0,n=o?!o.contains(t.target):!0;return i&&n}}onOptionSelected(t,e){const s=this.element.querySelector("#dropdown_trigger_display"),o=this.element.querySelector("#dropdown_trigger_custom_display");if(s){const d=JSON.parse(t).label;s.textContent=d,o&&(o.style.display="block",o.style.paddingRight="8px")}this.element.querySelector(c)&&this.target.classList.contains("open")&&(this.hideElement(this.target),this.updateArrowDisplay(!1)),this.element.querySelectorAll(l).forEach(d=>{d.classList.remove("pb_dropdown_option_selected")}),e.classList.add("pb_dropdown_option_selected")}showElement(t){t.classList.remove("close"),t.classList.add("open"),t.style.height=t.scrollHeight+"px"}hideElement(t){t.style.height=t.scrollHeight+"px",window.setTimeout(()=>{t.classList.add("close"),t.classList.remove("open"),this.resetFocus()},0)}resetFocus(){this.keyboardHandler&&(this.keyboardHandler.focusedOptionIndex=-1,this.element.querySelectorAll(l).forEach(e=>e.classList.remove("pb_dropdown_option_focused")))}toggleElement(t){if(t.classList.contains("open")){this.hideElement(t),this.updateArrowDisplay(!1);return}this.showElement(t),this.updateArrowDisplay(!0)}updateArrowDisplay(t){const e=this.element.querySelector(q),s=this.element.querySelector(N);e&&s&&(e.style.display=t?"none":"inline-block",s.style.display=t?"inline-block":"none")}handleFormValidation(){const t=this.element.querySelector(p);t.addEventListener("invalid",function(e){t.hasAttribute("required")&&t.value===""&&(e.preventDefault(),t.closest(".dropdown_wrapper").classList.add("error"))},!0)}clearFormValidation(t){if(t.checkValidity()){const e=t.closest(".dropdown_wrapper");e.classList.remove("error");const s=e.querySelector(".pb_body_kit_negative");s&&s.remove()}}setDefaultValue(){const t=this.element.querySelector("#dropdown-selected-option");if(t.value){const e=this.element.querySelector(p),s=JSON.parse(t.value.replaceAll("=>",":"));this.element.querySelectorAll(l).forEach(n=>{s.id===JSON.parse(n.dataset.dropdownOptionLabel).id&&n.classList.add("pb_dropdown_option_selected")});const i=this.element.querySelector("#dropdown_trigger_display");i&&(i.textContent=s.label),t.value=s.id,e.value=s.id}}}const P="[data-advanced-table]",I='[data-advanced-table-content="id"]',u="#advanced-table_open_icon",g="#advanced-table_close_icon";class H extends a{static get selector(){return P}get target(){return document.querySelector(I.replace("id",this.element.id))}connect(){this.element.addEventListener("click",()=>{this.toggleElement(this.target)})}showElement(t){const s=(()=>{t.style.display="block";const o=t.scrollHeight+"px";return t.style.display="",o})();t.classList.add("is-visible"),t.style.height=s,t.style.overflow="hidden",window.setTimeout(()=>{t.style.height="",t.style.overflow="visible"},250)}hideElement(t){t.style.height=t.scrollHeight+"px",window.setTimeout(()=>{t.style.height="0",t.style.paddingTop="0",t.style.paddingBottom="0",t.style.overflow="hidden"},1),window.setTimeout(()=>{t.classList.remove("is-visible"),t.style.overflow=""},200)}toggleElement(t){if(t.classList.contains("is-visible")){this.hideElement(t),this.displayDownArrow();return}this.showElement(t),this.displayUpArrow()}displayDownArrow(){this.element.querySelector(u).style.display="inline-block",this.element.querySelector(g).style.display="none"}displayUpArrow(){this.element.querySelector(g).style.display="inline-block",this.element.querySelector(u).style.display="none"}}window.datePickerHelper=w;window.dialogHelper=y;S.start();E.start();m.start();A.start();b.start();f.start();_.start();x.start();H.start();
1
+ import"./chunks/pb_form_validation.js";import{P as r,d as m,a as E,b,c as f,e as v,f as _,g as T}from"./chunks/lib.js";import"./chunks/lazysizes.js";import"./playbook-rails-react-bindings.js";import"react";import"webpacker-react";import"./chunks/_typeahead.js";import"react/jsx-runtime";import"react-dom";import"react-is";const L="[data-collapsible-main]",O="[data-collapsible-content]",S="#collapsible_open_icon",A="#collapsible_close_icon";class C extends r{static get selector(){return L}connect(){this.element.addEventListener("click",()=>{this.toggleElement(this.target)}),this.target.classList.contains("is-visible")?this.displayUpArrow():this.displayDownArrow(),document.addEventListener(`${this.target.id}`,()=>{this.toggleElement(this.target)})}get target(){return this.element.parentNode.querySelector(O)}showElement(t){const s=(()=>{t.style.display="block";const o=t.scrollHeight+"px";return t.style.display="",o})();t.classList.add("is-visible"),t.style.height=s,t.style.overflow="hidden",window.setTimeout(()=>{t.style.height="",t.style.overflow="visible"},300)}hideElement(t){t.style.height=t.scrollHeight+"px",window.setTimeout(()=>{t.style.height="0",t.style.paddingTop="0",t.style.paddingBottom="0",t.style.overflow="hidden"},1),window.setTimeout(()=>{t.classList.remove("is-visible"),t.style.overflow=""},300)}toggleElement(t){if(t.classList.contains("is-visible")){this.hideElement(t),this.displayDownArrow();return}this.showElement(t),this.displayUpArrow()}toggleArrows(t){const e=this.element.querySelector(S),s=this.element.querySelector(A);e&&(e.style.display=t?"inline-block":"none"),s&&(s.style.display=t?"none":"inline-block")}displayDownArrow(){this.toggleArrows(!0)}displayUpArrow(){this.toggleArrows(!1)}}class D extends r{static get selector(){return".remove_toast"}connect(){this.self=this.element,this.autoCloseToast(this.self),this.self.addEventListener("click",()=>{this.removeToast(this.self)})}removeToast(t){t.parentNode.removeChild(t)}autoCloseToast(t){const e=t.classList.value;if(e.includes("auto_close")){const o=e.split(" "),i=o[o.length-1].split("_")[2],l=parseInt(i);setTimeout(()=>{this.removeToast(t)},l)}}}const R="[data-dropdown-option-label]";class k{constructor(t){this.dropdown=t,this.dropdownElement=t.element,this.options=Array.from(this.dropdownElement.querySelectorAll(R)),this.focusedOptionIndex=-1,this.init()}init(){this.dropdownElement.addEventListener("keydown",this.handleKeyDown.bind(this))}handleKeyDown(t){switch(t.key){case"ArrowDown":t.preventDefault(),this.dropdown.target.classList.contains("open")||(this.dropdown.showElement(this.dropdown.target),this.dropdown.updateArrowDisplay(!0)),this.moveFocus(1);break;case"ArrowUp":t.preventDefault(),this.moveFocus(-1);break;case"Enter":t.preventDefault(),this.focusedOptionIndex!==-1?this.selectOption():this.dropdown.target.classList.contains("open")||(this.dropdown.showElement(this.dropdown.target),this.dropdown.updateArrowDisplay(!0));break;case"Escape":this.dropdown.hideElement(this.dropdown.target);break;case"Tab":this.dropdown.hideElement(this.dropdown.target),this.dropdown.updateArrowDisplay(!1),this.resetFocus();break}}moveFocus(t){this.focusedOptionIndex!==-1&&this.options[this.focusedOptionIndex].classList.remove("pb_dropdown_option_focused"),this.focusedOptionIndex=(this.focusedOptionIndex+t+this.options.length)%this.options.length,this.options[this.focusedOptionIndex].classList.add("pb_dropdown_option_focused")}selectOption(){const t=this.options[this.focusedOptionIndex];this.dropdown.onOptionSelected(t.dataset.dropdownOptionLabel,t),this.dropdown.hideElement(this.dropdown.target)}}const q="[data-pb-dropdown]",N="[data-dropdown-trigger]",u="[data-dropdown-container]",I="#dropdown_open_icon",P="#dropdown_close_icon",a="[data-dropdown-option-label]",h="[data-dropdown-custom-trigger]",d="#dropdown-form-validation",g="#dropdown_trigger_display",x="[data-dropdown-placeholder]";class V extends r{static get selector(){return q}get target(){return this.element.parentNode.querySelector(u)}connect(){this.keyboardHandler=new k(this),this.setDefaultValue(),this.bindEventListeners(),this.updateArrowDisplay(!1),this.handleFormValidation(),this.handleFormReset()}bindEventListeners(){(this.element.querySelector(h)||this.element).addEventListener("click",()=>this.toggleElement(this.target)),this.target.addEventListener("click",this.handleOptionClick.bind(this)),document.addEventListener("click",this.handleDocumentClick.bind(this),!0)}handleOptionClick(t){const e=t.target.closest(a),s=this.element.querySelector("#dropdown-selected-option"),o=this.element.querySelector(d);if(e){const i=e.dataset.dropdownOptionLabel;s.value=JSON.parse(i).id,o.value=JSON.parse(i).id,this.clearFormValidation(o),this.onOptionSelected(i,e)}}handleDocumentClick(t){this.isClickOutside(t)&&this.target.classList.contains("open")&&(this.hideElement(this.target),this.updateArrowDisplay(!1))}isClickOutside(t){const e=this.element.querySelector(h);if(e)return!e.contains(t.target);{const s=this.element.querySelector(N),o=this.element.parentNode.querySelector(u),i=s?!s.contains(t.target):!0,l=o?!o.contains(t.target):!0;return i&&l}}onOptionSelected(t,e){const s=this.element.querySelector(g),o=this.element.querySelector("#dropdown_trigger_custom_display");if(s){const c=JSON.parse(t).label;s.textContent=c,o&&(o.style.display="block",o.style.paddingRight="8px")}this.element.querySelector(h)&&this.target.classList.contains("open")&&(this.hideElement(this.target),this.updateArrowDisplay(!1)),this.element.querySelectorAll(a).forEach(c=>{c.classList.remove("pb_dropdown_option_selected")}),e.classList.add("pb_dropdown_option_selected")}showElement(t){t.classList.remove("close"),t.classList.add("open"),t.style.height=t.scrollHeight+"px"}hideElement(t){t.style.height=t.scrollHeight+"px",window.setTimeout(()=>{t.classList.add("close"),t.classList.remove("open"),this.resetFocus()},0)}resetFocus(){this.keyboardHandler&&(this.keyboardHandler.focusedOptionIndex=-1,this.element.querySelectorAll(a).forEach(e=>e.classList.remove("pb_dropdown_option_focused")))}toggleElement(t){if(t.classList.contains("open")){this.hideElement(t),this.updateArrowDisplay(!1);return}this.showElement(t),this.updateArrowDisplay(!0)}updateArrowDisplay(t){const e=this.element.querySelector(I),s=this.element.querySelector(P);e&&s&&(e.style.display=t?"none":"inline-block",s.style.display=t?"inline-block":"none")}handleFormValidation(){const t=this.element.querySelector(d);t.addEventListener("invalid",function(e){t.hasAttribute("required")&&t.value===""&&(e.preventDefault(),t.closest(".dropdown_wrapper").classList.add("error"))},!0)}clearFormValidation(t){if(t.checkValidity()){const e=t.closest(".dropdown_wrapper");e.classList.remove("error");const s=e.querySelector(".pb_body_kit_negative");s&&s.remove()}}setDefaultValue(){const t=this.element.querySelector("#dropdown-selected-option");if(t.value){const e=this.element.querySelector(d),s=JSON.parse(t.value.replaceAll("=>",":"));this.element.querySelectorAll(a).forEach(i=>{s.id===JSON.parse(i.dataset.dropdownOptionLabel).id&&i.classList.add("pb_dropdown_option_selected")}),this.setTriggerElementText(s.label),t.value=s.id,e.value=s.id}}handleFormReset(){const t=this.element.closest("form");t&&t.addEventListener("reset",()=>{this.resetDropdownValue()})}resetDropdownValue(){const t=this.element.querySelector("#dropdown-selected-option"),e=this.element.querySelector(d);t.value="",e.value="";const s=this.element.querySelector(x);this.setTriggerElementText(s.dataset.dropdownPlaceholder)}setTriggerElementText(t){const e=this.element.querySelector(g);e&&(e.textContent=t)}}const F="[data-advanced-table]",H='[data-advanced-table-content="id"]',w="#advanced-table_open_icon",y="#advanced-table_close_icon";class W extends r{static get selector(){return F}get target(){return document.querySelector(H.replace("id",this.element.id))}connect(){this.element.addEventListener("click",()=>{this.toggleElement(this.target)})}showElement(t){const s=(()=>{t.style.display="block";const o=t.scrollHeight+"px";return t.style.display="",o})();t.classList.add("is-visible"),t.style.height=s,t.style.overflow="hidden",window.setTimeout(()=>{t.style.height="",t.style.overflow="visible"},250)}hideElement(t){t.style.height=t.scrollHeight+"px",window.setTimeout(()=>{t.style.height="0",t.style.paddingTop="0",t.style.paddingBottom="0",t.style.overflow="hidden"},1),window.setTimeout(()=>{t.classList.remove("is-visible"),t.style.overflow=""},200)}toggleElement(t){if(t.classList.contains("is-visible")){this.hideElement(t),this.displayDownArrow();return}this.showElement(t),this.displayUpArrow()}displayDownArrow(){this.element.querySelector(w).style.display="inline-block",this.element.querySelector(y).style.display="none"}displayUpArrow(){this.element.querySelector(y).style.display="inline-block",this.element.querySelector(w).style.display="none"}}const U="[data-pb-nav-tab]",p="[data-pb-tab-target]";class $ extends r{static get selector(){return U}connect(){this.hideAndAddEventListeners()}hideAndAddEventListeners(){this.element.querySelectorAll(p).forEach(e=>{e.className.includes("active")||this.changeContentDisplay(e.dataset.pbTabTarget,"none"),e.addEventListener("click",s=>this.handleNavItemClick(s))})}handleNavItemClick(t){t.preventDefault();const e=t.target.closest(p);this.changeContentDisplay(e.dataset.pbTabTarget,"block"),this.element.querySelectorAll(p).forEach(o=>{e!==o&&this.changeContentDisplay(o.dataset.pbTabTarget,"none")})}changeContentDisplay(t,e){const s=document.getElementById(t);s.style.display=e}}window.datePickerHelper=m;window.dialogHelper=E;C.start();b.start();f.start();D.start();v.start();_.start();T.start();V.start();W.start();$.start();