playbook_ui 13.32.0.pre.alpha.PLAY14143272 → 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 (96) 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 +12 -7
  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/_dropdown_default_value.html.erb +10 -0
  8. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_value.jsx +31 -0
  9. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +4 -0
  10. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +3 -1
  11. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +4 -4
  12. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +11 -0
  13. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.rb +1 -1
  14. data/app/pb_kits/playbook/pb_dropdown/index.js +54 -3
  15. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +108 -5
  16. data/app/pb_kits/playbook/pb_form_pill/_form_pill.test.jsx +53 -0
  17. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +11 -2
  18. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_example.html.erb +5 -1
  19. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_example.jsx +1 -0
  20. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.html.erb +2 -0
  21. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.jsx +2 -0
  22. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.html.erb +4 -1
  23. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.jsx +3 -2
  24. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.html.erb +2 -0
  25. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.jsx +2 -0
  26. data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
  27. data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +5 -1
  28. data/app/pb_kits/playbook/pb_icon/_icon.scss +210 -1
  29. data/app/pb_kits/playbook/pb_icon/_icon.tsx +100 -41
  30. data/app/pb_kits/playbook/pb_icon/icon.rb +33 -19
  31. data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +2 -2
  32. data/app/pb_kits/playbook/pb_nav/docs/_tab_nav.html.erb +48 -0
  33. data/app/pb_kits/playbook/pb_nav/docs/_tab_nav.md +3 -0
  34. data/app/pb_kits/playbook/pb_nav/docs/example.yml +1 -0
  35. data/app/pb_kits/playbook/pb_nav/index.js +43 -0
  36. data/app/pb_kits/playbook/pb_nav/nav.rb +9 -0
  37. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +1 -1
  38. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +1 -1
  39. data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +11 -2
  40. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_interactive.html.erb +1 -0
  41. data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +1 -1
  42. data/app/pb_kits/playbook/pb_star_rating/index.js +50 -0
  43. data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +25 -5
  44. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +6 -0
  45. data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
  46. data/app/pb_kits/playbook/pb_table/index.ts +4 -4
  47. data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +1 -1
  48. data/app/pb_kits/playbook/pb_table/subcomponents/_table_cell.tsx +1 -1
  49. data/app/pb_kits/playbook/pb_table/subcomponents/_table_head.tsx +1 -1
  50. data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +1 -1
  51. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +1 -1
  52. data/app/pb_kits/playbook/pb_table/table.test.js +2 -0
  53. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
  54. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +1 -1
  55. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +45 -27
  56. data/app/pb_kits/playbook/pb_textarea/index.ts +3 -3
  57. data/app/pb_kits/playbook/pb_time/_time.tsx +3 -3
  58. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
  59. data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
  60. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
  61. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +10 -10
  62. data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
  63. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +2 -2
  64. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -2
  65. data/app/pb_kits/playbook/pb_treemap_chart/treemapChart.test.js +2 -0
  66. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +3 -3
  67. data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +4 -4
  68. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +11 -7
  69. data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +8 -3
  70. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +6 -1
  71. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +18 -19
  72. data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +6 -6
  73. data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +6 -6
  74. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +3 -3
  75. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +2 -0
  76. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +22 -57
  77. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +2 -2
  78. data/app/pb_kits/playbook/pb_typeahead/index.ts +31 -31
  79. data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
  80. data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +6 -6
  81. data/app/pb_kits/playbook/pb_user_badge/badges/million-dollar.tsx +236 -235
  82. data/app/pb_kits/playbook/pb_user_badge/badges/veteran.tsx +1 -1
  83. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +68 -63
  84. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
  85. data/dist/chunks/_typeahead.js +14 -32
  86. data/dist/chunks/_weekday_stacked.js +7 -7
  87. data/dist/chunks/vendor.js +1 -1
  88. data/dist/playbook-doc.js +83 -83
  89. data/dist/playbook-rails-react-bindings.js +1 -1
  90. data/dist/playbook-rails.js +1 -1
  91. data/dist/playbook.css +1 -1
  92. data/lib/playbook/forms/builder/star_rating_field.rb +14 -0
  93. data/lib/playbook/forms/builder.rb +1 -0
  94. data/lib/playbook/version.rb +1 -1
  95. metadata +13 -3
  96. data/app/pb_kits/playbook/pb_icon/icon_aliases.json +0 -39
@@ -1 +1 @@
1
- import r from"webpacker-react";import{B as d,C as l,D as u,a as f,b as p,c as h,d as c,M as v,L as E,e as b,P as w,R as k,T as y,f as g,G as m,g as C}from"./chunks/_typeahead.js";import"react";import"./chunks/lib.js";import"react-dom";var o={};Object.defineProperty(o,"__esModule",{value:!0});var j={handleEvent:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{once:!1},t=i.once,s=typeof window.jQuery<"u"&&window.jQuery;s?t?s(document).one(e,n):s(document).on(e,n):document.addEventListener(e,n,{once:t})},setup:function(e,n){var i=typeof window.jQuery<"u"&&window.jQuery,t=window.Turbolinks;typeof t<"u"&&t.supported?typeof t.EVENTS<"u"?this.turbolinksClassic(e,n):typeof t.controller<"u"?this.turbolinks5(e,n):this.turbolinksClassicDeprecated(e,n):i&&typeof i.pjax=="function"?this.pjax(e,n):this.native(e)},turbolinks5:function(e,n){this.handleEvent("turbolinks:load",e,{once:!0}),this.handleEvent("turbolinks:render",e),this.handleEvent("turbolinks:before-render",n)},turbolinksClassic:function(e,n){var i=window.Turbolinks;this.handleEvent(i.EVENTS.CHANGE,e),this.handleEvent(i.EVENTS.BEFORE_UNLOAD,n)},turbolinksClassicDeprecated:function(e,n){var i=window.Turbolinks;i.pagesCached(0),this.handleEvent("page:change",e),this.handleEvent("page:receive",n)},pjax:function(e,n){this.handleEvent("ready",e),this.handleEvent("pjax:end",e),this.handleEvent("pjax:beforeReplace",n)},native:function(e){var n=typeof window.jQuery<"u"&&window.jQuery;n?n(function(){return e()}):"addEventListener"in window?document.addEventListener("DOMContentLoaded",e):window.attachEvent("onload",e)}},T=o.default=j;r.registerComponents({BarGraph:d,CircleChart:l,Dialog:u,DialogBody:f,DialogFooter:p,DialogHeader:h,DistributionBar:c,MultiLevelSelect:v,Legend:E,LineGraph:b,Passphrase:w,RichTextEditor:k,TreemapChart:y,Typeahead:g,Gauge:m,PhoneNumberInput:C});T.setup(()=>r.mountComponents(),()=>r.unmountComponents());
1
+ import r from"webpacker-react";import{B as d,C as l,D as u,a as p,b as f,c as h,d as c,M as v,L as E,e as b,P as w,R as m,T as k,f as y,G as g,g as C}from"./chunks/_typeahead.js";import"react/jsx-runtime";import"react";import"./chunks/lib.js";import"react-dom";import"react-is";var o={};Object.defineProperty(o,"__esModule",{value:!0});var j={handleEvent:function(e,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{once:!1},t=i.once,s=typeof window.jQuery<"u"&&window.jQuery;s?t?s(document).one(e,n):s(document).on(e,n):document.addEventListener(e,n,{once:t})},setup:function(e,n){var i=typeof window.jQuery<"u"&&window.jQuery,t=window.Turbolinks;typeof t<"u"&&t.supported?typeof t.EVENTS<"u"?this.turbolinksClassic(e,n):typeof t.controller<"u"?this.turbolinks5(e,n):this.turbolinksClassicDeprecated(e,n):i&&typeof i.pjax=="function"?this.pjax(e,n):this.native(e)},turbolinks5:function(e,n){this.handleEvent("turbolinks:load",e,{once:!0}),this.handleEvent("turbolinks:render",e),this.handleEvent("turbolinks:before-render",n)},turbolinksClassic:function(e,n){var i=window.Turbolinks;this.handleEvent(i.EVENTS.CHANGE,e),this.handleEvent(i.EVENTS.BEFORE_UNLOAD,n)},turbolinksClassicDeprecated:function(e,n){var i=window.Turbolinks;i.pagesCached(0),this.handleEvent("page:change",e),this.handleEvent("page:receive",n)},pjax:function(e,n){this.handleEvent("ready",e),this.handleEvent("pjax:end",e),this.handleEvent("pjax:beforeReplace",n)},native:function(e){var n=typeof window.jQuery<"u"&&window.jQuery;n?n(function(){return e()}):"addEventListener"in window?document.addEventListener("DOMContentLoaded",e):window.attachEvent("onload",e)}},T=o.default=j;r.registerComponents({BarGraph:d,CircleChart:l,Dialog:u,DialogBody:p,DialogFooter:f,DialogHeader:h,DistributionBar:c,MultiLevelSelect:v,Legend:E,LineGraph:b,Passphrase:w,RichTextEditor:m,TreemapChart:k,Typeahead:y,Gauge:g,PhoneNumberInput:C});T.setup(()=>r.mountComponents(),()=>r.unmountComponents());
@@ -1 +1 @@
1
- import"./chunks/pb_form_validation.js";import{P as l,d as w,a as y,b as E,c as m,e as b,f as _,g as f}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-dom";const O="[data-collapsible-main]",L="[data-collapsible-content]",v="#collapsible_open_icon",T="#collapsible_close_icon";class A extends l{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(L)}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(v),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 S extends l{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],r=parseInt(i);setTimeout(()=>{this.removeToast(t)},r)}}}const C="[data-dropdown-option-label]";class k{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 D="[data-pb-dropdown]",R="[data-dropdown-trigger]",h="[data-dropdown-container]",q="#dropdown_open_icon",x="#dropdown_close_icon",d="[data-dropdown-option-label]",c="[data-dropdown-custom-trigger]",p="#dropdown-form-validation";class N extends l{static get selector(){return D}get target(){return this.element.parentNode.querySelector(h)}connect(){this.keyboardHandler=new k(this),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(d),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,r=o?!o.contains(t.target):!0;return i&&r}}onOptionSelected(t,e){const s=this.element.querySelector("#dropdown_trigger_display"),o=this.element.querySelector("#dropdown_trigger_custom_display");if(s){const a=JSON.parse(t).label;s.textContent=a,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(d).forEach(a=>{a.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(d).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(x);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()}}}const P="[data-advanced-table]",I='[data-advanced-table-content="id"]',u="#advanced-table_open_icon",g="#advanced-table_close_icon";class H extends l{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;A.start();E.start();m.start();S.start();b.start();_.start();f.start();N.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();