@paperless/core 3.1.1 → 3.2.1

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 (116) hide show
  1. package/dist/assets/icons/general/lamp.svg +5 -0
  2. package/dist/assets/icons/general/math.svg +9 -0
  3. package/dist/assets/icons/general/newtab.svg +5 -0
  4. package/dist/assets/icons/general/spinner.svg +0 -7
  5. package/dist/assets/icons/general/spinning.svg +0 -7
  6. package/dist/assets/icons/general/stack.svg +5 -0
  7. package/dist/build/index.esm.js +1 -1
  8. package/dist/{paperless/p-673c243e.entry.js → build/p-2c0ca302.entry.js} +1 -1
  9. package/dist/build/p-381c13a8.entry.js +1 -0
  10. package/dist/{paperless/p-CXVK8SLW.js → build/p-DPmts3W0.js} +1 -1
  11. package/dist/build/{p-3a5ebbd7.js → p-b47f3a0f.js} +1 -1
  12. package/dist/build/paperless.esm.js +1 -1
  13. package/dist/cjs/{icons-C2jYPq9N.js → icons-BHz4nb3U.js} +40 -14
  14. package/dist/cjs/index.cjs.js +1 -1
  15. package/dist/cjs/p-button_3.cjs.entry.js +1 -1
  16. package/dist/cjs/p-empty-state_8.cjs.entry.js +17 -11
  17. package/dist/collection/assets/icons/general/lamp.svg +5 -0
  18. package/dist/collection/assets/icons/general/math.svg +9 -0
  19. package/dist/collection/assets/icons/general/newtab.svg +5 -0
  20. package/dist/collection/assets/icons/general/spinner.svg +0 -7
  21. package/dist/collection/assets/icons/general/spinning.svg +0 -7
  22. package/dist/collection/assets/icons/general/stack.svg +5 -0
  23. package/dist/collection/components/atoms/card/header/card-header.component.js +1 -1
  24. package/dist/collection/components/atoms/dropdown-menu/item/dropdown-menu-item.component.js +1 -1
  25. package/dist/collection/components/atoms/floating-menu/item/floating-menu-item.component.js +1 -1
  26. package/dist/collection/components/atoms/icon/icon.component.js +1 -1
  27. package/dist/collection/components/atoms/listing/item/listing-item.component.js +1 -1
  28. package/dist/collection/components/atoms/segment/item/segment-item.component.js +1 -1
  29. package/dist/collection/components/helpers/table/row-action/table-row-action.component.js +1 -1
  30. package/dist/collection/components/molecules/button/button.component.js +1 -1
  31. package/dist/collection/components/molecules/empty-state/empty-state.component.js +1 -1
  32. package/dist/collection/components/molecules/field/field/field.component.js +1 -1
  33. package/dist/collection/components/molecules/label/label.component.js +1 -1
  34. package/dist/collection/components/molecules/navigation/item/navigation-item.component.js +1 -1
  35. package/dist/collection/components/molecules/select/select.component.js +2 -2
  36. package/dist/collection/components/molecules/table/header/table-header.component.js +1 -1
  37. package/dist/collection/components/molecules/toast/toast.component.js +1 -1
  38. package/dist/collection/components/organisms/table/table.component.js +1 -1
  39. package/dist/collection/utils/icons.js +12 -0
  40. package/dist/components/index.js +1 -1
  41. package/dist/components/{p-BKXDGrK7.js → p-0Uawv030.js} +1 -1
  42. package/dist/components/{p-C4dZ9NAe.js → p-48UlhVtz.js} +1 -1
  43. package/dist/components/{p-B_7CTN-Q.js → p-AkD55vN_.js} +1 -1
  44. package/dist/components/{p-0EHH7Dl0.js → p-BAvGAs2F.js} +1 -1
  45. package/dist/components/{p-BfH-C6uv.js → p-BEu_Xlbv.js} +1 -1
  46. package/dist/components/{p-C1HzSmDf.js → p-BmU3MAfH.js} +1 -1
  47. package/dist/components/{p-DXsoAHFt.js → p-COFt46UN.js} +1 -1
  48. package/dist/components/{p-BCZqknrJ.js → p-Cat2_HoM.js} +1 -1
  49. package/dist/components/{p-G57Mci8u.js → p-Cr_WB0kg.js} +1 -1
  50. package/dist/components/{p-Bru1muWj.js → p-CtxKjhiD.js} +1 -1
  51. package/dist/components/{p-BtI7diO6.js → p-D8FhwO0Q.js} +1 -1
  52. package/dist/components/p-DKnCWy7F.js +1 -0
  53. package/dist/components/{p-CXVK8SLW.js → p-DPmts3W0.js} +1 -1
  54. package/dist/components/{p--52gTdZ4.js → p-DR1auS78.js} +1 -1
  55. package/dist/components/{p-DSv8ajJ4.js → p-DT72kk3I.js} +1 -1
  56. package/dist/components/{p-BrLLMmZa.js → p-DlQumf-0.js} +1 -1
  57. package/dist/components/{p-4DN7zVtS.js → p-Dy1wXwZf.js} +1 -1
  58. package/dist/components/{p-BBwQm_OH.js → p-NEqovphH.js} +1 -1
  59. package/dist/components/{p-D6iTsl8U.js → p-SYK2C-7G.js} +1 -1
  60. package/dist/components/{p-DncIsq-f.js → p-ShAy0ruV.js} +1 -1
  61. package/dist/components/{p-DLBcQv2y.js → p-aZcUXH1b.js} +1 -1
  62. package/dist/components/p-accordion.js +1 -1
  63. package/dist/components/p-attachment.js +1 -1
  64. package/dist/components/p-button.js +1 -1
  65. package/dist/components/p-calendar.js +1 -1
  66. package/dist/components/p-card-header.js +1 -1
  67. package/dist/components/p-checkbox.js +1 -1
  68. package/dist/components/p-cropper.js +2 -2
  69. package/dist/components/p-datepicker.js +1 -1
  70. package/dist/components/p-drawer-header.js +1 -1
  71. package/dist/components/p-drawer.js +1 -1
  72. package/dist/components/p-dropdown-menu-item.js +1 -1
  73. package/dist/components/p-empty-state.js +1 -1
  74. package/dist/components/p-field-container.js +1 -1
  75. package/dist/components/p-field.js +1 -1
  76. package/dist/components/p-floating-menu-container.js +1 -1
  77. package/dist/components/p-floating-menu-item.js +1 -1
  78. package/dist/components/p-helper.js +1 -1
  79. package/dist/components/p-icon.js +1 -1
  80. package/dist/components/p-info-panel.js +1 -1
  81. package/dist/components/p-label.js +1 -1
  82. package/dist/components/p-listing-item.js +1 -1
  83. package/dist/components/p-modal-header.js +1 -1
  84. package/dist/components/p-modal.js +1 -1
  85. package/dist/components/p-navbar.js +1 -1
  86. package/dist/components/p-navigation-item.js +1 -1
  87. package/dist/components/p-pagination-pages.js +1 -1
  88. package/dist/components/p-pagination-size.js +1 -1
  89. package/dist/components/p-pagination.js +1 -1
  90. package/dist/components/p-profile.js +1 -1
  91. package/dist/components/p-range.js +1 -1
  92. package/dist/components/p-segment-item.js +1 -1
  93. package/dist/components/p-select.js +1 -1
  94. package/dist/components/p-table-footer.js +1 -1
  95. package/dist/components/p-table-header.js +1 -1
  96. package/dist/components/p-table.js +1 -1
  97. package/dist/components/p-toast.js +1 -1
  98. package/dist/esm/{icons-CXVK8SLW.js → icons-DPmts3W0.js} +40 -14
  99. package/dist/esm/index.js +1 -1
  100. package/dist/esm/p-button_3.entry.js +1 -1
  101. package/dist/esm/p-empty-state_8.entry.js +17 -11
  102. package/dist/index.html +1 -1
  103. package/dist/paperless/index.esm.js +1 -1
  104. package/dist/{build/p-673c243e.entry.js → paperless/p-2c0ca302.entry.js} +1 -1
  105. package/dist/paperless/p-381c13a8.entry.js +1 -0
  106. package/dist/{build/p-CXVK8SLW.js → paperless/p-DPmts3W0.js} +1 -1
  107. package/dist/paperless/paperless.esm.js +1 -1
  108. package/dist/sw.js +1 -1
  109. package/dist/sw.js.map +1 -1
  110. package/dist/types/utils/icons.d.ts +8 -0
  111. package/hydrate/index.js +53 -25
  112. package/hydrate/index.mjs +53 -25
  113. package/package.json +1 -1
  114. package/dist/build/p-b745b141.entry.js +0 -1
  115. package/dist/components/p-BSsW37JK.js +0 -1
  116. package/dist/paperless/p-b745b141.entry.js +0 -1
@@ -1 +1 @@
1
- import{R as o,d as r}from"./p-BKXDGrK7.js";const s=o,p=r;export{s as PRange,p as defineCustomElement}
1
+ import{R as o,d as s}from"./p-0Uawv030.js";const a=o,p=s;export{a as PRange,p as defineCustomElement}
@@ -1 +1 @@
1
- import{S as o,d as s}from"./p--52gTdZ4.js";const p=o,r=s;export{p as PSegmentItem,r as defineCustomElement}
1
+ import{S as o,d as s}from"./p-DR1auS78.js";const a=o,p=s;export{a as PSegmentItem,p as defineCustomElement}
@@ -1 +1 @@
1
- import{t,p as e,H as i,c as s,h as a}from"./p-CySg37XO.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-Au2WuEGF.js";import{a as h}from"./p-TyZ7uPES.js";import{c as n}from"./p-xs4N_Y-0.js";import{S as l}from"./p-CEaB2BT0.js";import{d as c}from"./p-iLGr9rDU.js";import{d}from"./p-B_7CTN-Q.js";import{d as p}from"./p-DncIsq-f.js";import{d as m}from"./p-BtliZ0U_.js";import{d as u}from"./p-BtH8h7p9.js";import{d as w}from"./p-BrLLMmZa.js";import{d as y}from"./p-4DN7zVtS.js";import{d as x}from"./p-G57Mci8u.js";import{d as g}from"./p-D6iTsl8U.js";import{d as v}from"./p-DLBcQv2y.js";import{d as f}from"./p-D8faiybE.js";import{d as b}from"./p-2yaxaWU2.js";const k=r(["flex items-center gap-2","h-full min-w-0 flex-1","pointer-events-none overflow-hidden"]),C=r(["item group/item","pointer-events-auto cursor-pointer","flex h-[1.625rem] items-center gap-2","h-[1.625rem] px-2","whitespace-nowrap text-sm font-semibold","rounded-lg","bg-indigo-100","dark:bg-white/15"]),_=r("block w-full overflow-hidden text-start",{variants:{variant:{placeholder:"\n text-storm-400\n dark:text-white\n ",default:null},enableTextWrap:{true:!1,false:"text-ellipsis whitespace-nowrap"},error:{true:"\n text-negative-red-700\n group-hover/button:text-negative-red-800\n dark:text-negative-red-alternative\n ",false:null}}}),I=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.queryChange=s(this,"queryChange",3),this.valueChange=s(this,"valueChange",3),this.selectAllChange=s(this,"selectAllChange",3),this.dropdownShown=s(this,"dropdownShown",3),this.add=s(this,"add",3),this._internals=this.attachInternals()}items;multi;strategy="absolute";icon;query;placeholder;autocompletePlaceholder="Search...";value;displayKey="text";dropdownDisplayKey;selectionDisplayKey;valueKey;avatarKey;iconKey="icon";iconClassKey="iconClass";showIconOnSelectedItem;classKey="class";applyClassOnSelectedItem;applyClassOnSelectedItemInMenu;avatarLettersKey;identifierKey;queryKey;autoSelectFirst=!0;showChevron=!0;maxDisplayedItems=l;enableAutocomplete=!0;enableTextWrap=!1;asyncFilter=!1;loading=!1;enableSelectAll=!1;selectAllText="Select all";selectAllIcon;queryChange;valueChange;selectAllChange;dropdownShown;size="base";prefix;label;helper;required=!0;showOptional=!0;error;disabled=!1;showAddItem=!1;addItemText="Add item";add;emptyStateText="No items available";get _el(){return this}_showDropdown=!1;_selectedItem=null;_allSelected=!1;_amountHidden=0;_internals;_inputRef;autocompleteInputRef;_multiContainerRef;_resizeObserver;_resizeDebounceTimer;_checkSelectedItemsTimeout;get _items(){return this._getParsedItems()}get _displayValue(){const t=a("div",{class:_({variant:"placeholder"})},this.placeholder);return this._selectedItem?this.multi?0===this._selectedItem?.length?t:a("div",{class:k(),ref:t=>this._multiContainerRef=t},this._selectedItem.map((t=>a("div",{class:C(),onClick:()=>this._selectValue(t)},t[this.selectionDisplayKey??this.displayKey],a("p-icon",{class:"\n text-xs text-indigo-500\n group-hover/item:text-indigo-800\n dark:text-white/15\n dark:group-hover/item:text-white\n ",variant:"negative"})))),a("div",{class:"extra pointer-events-none hidden text-sm text-storm-100"},"+",this._amountHidden)):this._getDisplay(this._selectedItem,!0):t}get _identifierKey(){return this.identifierKey??this.valueKey??"value"}formResetCallback(){this._selectValue(null)}componentDidLoad(){if(!this.valueKey&&!this.identifierKey)throw Error("You must provide a valueKey or identifierKey");this.multi&&(this._setMultiContainerMaxWidth(),this._resizeObserver=new ResizeObserver((()=>{this._resizeDebounceTimer&&(clearTimeout(this._resizeDebounceTimer),this._resizeDebounceTimer=null),this._resizeDebounceTimer=setTimeout((()=>{this._setMultiContainerMaxWidth(),this._setCheckSelectedItemsTimeout()}),200)})),this._resizeObserver.observe(this._el)),this.value?this._valueChange():this.itemChanges()}componentDidRender(){this.multi&&this._setMultiContainerMaxWidth()}disconnectedCallback(){this.multi&&this._resizeObserver.disconnect()}render(){let t=this.icon;return this._selectedItem&&!this.avatarKey&&this.iconKey&&this._selectedItem?.[this.iconKey]&&!this.showIconOnSelectedItem&&(t=this._selectedItem[this.iconKey]),(this.avatarKey&&this._selectedItem?.[this.avatarKey]||this.avatarLettersKey&&this._selectedItem?.[this.avatarLettersKey])&&(t=null),this.error?.length&&(t="warning"),a(o,{key:"76b10df3dbbf0a1758ea13c7205ea4c11ea05056"},a("p-field-container",{key:"e17bca429b8a24a4c5e4399911c9efcebd8a6b24",error:this.error,forceShowTooltip:!!this.error?.length&&!this._showDropdown,helper:this.helper,label:this.label,prefix:this.prefix,required:this.required,showOptional:this.showOptional,variant:"write"},a("p-dropdown",{key:"1bcd1b15692330794bed8b34fbe203b8015681d9",applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,"disable-trigger-click":this.disabled,insideClick:!0,manual:!0,manualChevron:!0,scrollable:!this.enableAutocomplete||"large",show:this._showDropdown,slot:"content",strategy:this.strategy,onIsOpen:t=>this._onDropdownOpen(t)},a("p-button",{key:"383466f2cec3fa3e7aa65aa3db077445cb2917ef",active:this._showDropdown,chevron:!!this.showChevron&&(this._showDropdown?"up":"down"),class:"w-full",error:!!this.error?.length,icon:t,iconClass:this.applyClassOnSelectedItem&&this._selectedItem?.[this.iconClassKey],size:this.size,slot:"trigger",variant:"secondary",onClick:t=>this._onClick(t)},a("div",{key:"8d5b4d842f4d49f029f1a61f98a8d768c61cf3ef",class:"relative min-w-0 flex-1",ref:t=>this._inputRef=t},this._displayValue)),this.loading?this._getLoadingItems():this._getItems(),this.showAddItem&&this._getAddItem())))}documentClickHandler(t){this._showDropdown&&!h(t,this._el)&&(this._showDropdown=!1)}_valueChange(){setTimeout((()=>{this._preselectItem(),this._setCheckSelectedItemsTimeout()}))}itemChanges(){setTimeout((()=>this._preselectItem()))}_showDropdownChanges(){this.dropdownShown.emit({value:this._showDropdown,query:this.query})}multiChanges(){this._selectedItem&&!Array.isArray(this._selectedItem)&&(this._selectedItem=[])}_preselectItem(){let t="string"==typeof this.value&&this.multi?JSON.parse(this.value):this.value;if(this.multi)return Array.isArray(t)?(this.value=t,0===t.length?void(this._selectedItem=[]):void(this._selectedItem=this.valueKey&&"false"!==this.valueKey?this._items.filter((e=>t.includes(e?.[this.valueKey]))):[...t])):(this.value=[],void this.valueChange.emit(this.value));this._selectedItem||t||!this.autoSelectFirst||(t=this._items[0]);const e="object"==typeof t&&null!==t?t[this._identifierKey]:t,i="string"==typeof e||"number"==typeof e?e:JSON.stringify(e),s=this._selectedItem?this._selectedItem?.[this._identifierKey]:null,a="string"==typeof s||"number"==typeof s?s:JSON.stringify(s);if(this._selectedItem&&a===i)return;if(!this._items?.length&&t)return void this._selectValue(t,!1);const r=this._getParsedItems(!1).find((t=>{const e=t?.[this._identifierKey];return("string"==typeof e||"number"==typeof e?e:JSON.stringify(e))===i}));this._selectValue(r??t,!1)}_selectValue(t,e=!0){let i=this.valueKey&&"false"!==this.valueKey&&null!==t&&!this.loading?t?.[this.valueKey]:t;if(this.multi){this._selectedItem&&Array.isArray(this._selectedItem)||(this._selectedItem=[]),this.value&&Array.isArray(this.value)||(this.value=[]);const e=[...this._selectedItem],s=[...this.value],a=e.findIndex((e=>e[this._identifierKey]===t[this._identifierKey]));return-1===a?(e.push(t),s.push(i)):(e.splice(a,1),s.splice(a,1)),this._selectedItem=e,this.value=s,void this.valueChange.emit(s)}this._selectedItem=t,this._onBlur(e),i!==this.value&&(this.value=i,this.valueChange.emit(i))}_onClick(t){const e=t?.composedPath();for(const t of e){if("p-button"===t.nodeName.toLowerCase())break;if(t.classList?.contains("item"))return}this._showDropdown=!this._showDropdown}_onBlur(t=!1){this.enableAutocomplete&&!t||(this._showDropdown=!1)}_onAutoComplete(t){this.enableAutocomplete&&(this._showDropdown=!0,this.query=t.detail,this.queryChange.emit(t.detail))}_checkvalue(t,e){return e?.[t]?.toString()?.toLowerCase().indexOf(this.query?.toLowerCase())>=0}_getItems(){let t=this._items.map((t=>{const e=this.multi&&this._selectedItem&&Array.isArray(this._selectedItem)?this._selectedItem.some((e=>e[this._identifierKey]===t[this._identifierKey])):t[this._identifierKey]===this._selectedItem?.[this._identifierKey];return a("p-dropdown-menu-item",{active:e,checkbox:!!this.multi,enableTextWrap:this.enableTextWrap,slot:"items",useContainer:!1,onClick:()=>this._selectValue(t)},this._getDisplay(t,!1,e))}));return 0===this._items.length&&(t=[a("p",{class:"\n w-full p-2 text-center text-sm text-storm-400\n dark:text-hurricane-200\n ",slot:"items"},this.emptyStateText)]),this.enableSelectAll&&this._items.length>0&&t.unshift(a("p-dropdown-menu-item",{active:this._allSelected,slot:"items",useContainer:!1,checkbox:!0,onClick:()=>this._selectAllChange()},this.selectAllIcon?.length?a("span",{class:"flex items-center gap-2"},a("div",{class:"flex w-6 justify-center text-lg"},a("p-icon",{variant:this.selectAllIcon}))," ",this.selectAllText):this.selectAllText)),this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAddItem(){return a("p-dropdown-menu-item",{slot:"items",useContainer:!1,onClick:()=>this.add.emit()},a("span",{class:"flex items-center gap-1 font-semibold text-indigo-600"},this.addItemText,a("p-icon",{variant:"plus"})))}_getLoadingItems(){const t=[0,0,0].map((()=>a("p-dropdown-menu-item",{enableHover:!1,slot:"items"},a("p-loader",{class:"h-6 w-full rounded",variant:"ghost"}))));return this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAutoCompleteItem(){return a("div",{class:"sticky top-0 z-10 mb-3 h-8",slot:"items"},a("p-field",{class:"block",placeholder:this.autocompletePlaceholder,value:this.query,onInputRefChange:t=>this.autocompleteInputRef=t.detail,onValueChange:t=>this._onAutoComplete(t)}))}_setMultiContainerMaxWidth(){this._inputRef&&this._multiContainerRef&&(this._multiContainerRef.style.maxWidth=Math.max(this._inputRef.clientWidth-16,16)+"px")}_setCheckSelectedItemsTimeout(){this._checkSelectedItemsTimeout&&clearTimeout(this._checkSelectedItemsTimeout),this._checkSelectedItemsTimeout=setTimeout((()=>this._checkSelectedItems()),50)}_checkSelectedItems(){if(!this._multiContainerRef)return;const t=this._multiContainerRef.getBoundingClientRect(),e=this._multiContainerRef.querySelectorAll(".item");let i=0;for(const s of e)s.classList.remove("hidden"),s.classList.add("flex"),s.getBoundingClientRect().right>t.right&&(s.classList.remove("flex"),s.classList.add("hidden"),i++);this._amountHidden=i;const s=this._multiContainerRef.querySelector(".extra");s&&(s.classList.contains("hidden")||s.classList.add("hidden"),i>0&&s.classList.remove("hidden"))}_onDropdownOpen(t){t.detail&&this.autocompleteInputRef&&setTimeout((()=>this.autocompleteInputRef.focus()),100)}_selectAllChange(){this._allSelected=!this._allSelected,this.selectAllChange.emit(this._allSelected)}_getDisplay(t,e=!1,i=!1){let s=a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[e?this.selectionDisplayKey??this.displayKey:this.displayKey]);return this.avatarKey&&(s=a("span",{class:"flex items-center gap-2"},a("p-avatar",{letters:t[this.avatarLettersKey],size:"sm",src:t[this.avatarKey]}),a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),!this.iconKey||e&&!this.showIconOnSelectedItem||(s=a("span",{class:"flex items-center gap-2"},t[this.iconKey]&&a("p-icon",{class:n("\n text-storm-300\n dark:text-hurricane-200\n ",e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu?"":t?.[this.iconClassKey]??""),variant:t[this.iconKey]}),a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu||!t?.[this.classKey]?.length?s:a("div",{class:t[this.classKey]},s)}_getParsedItems(t=!0){if(!this.items||this.loading)return[];let e="string"==typeof this.items?JSON.parse(this.items):this.items;return"string"==typeof e?.[0]&&(this.displayKey="text",this.valueKey="value",e=e.map((t=>({value:t,text:t})))),this.query?.length&&!this.asyncFilter&&(e=e.filter((t=>this.queryKey?this._checkvalue(this.queryKey,t):this._checkvalue(this._identifierKey,t)||this._checkvalue(this.displayKey,t)))),t?e?.slice(0,this.maxDisplayedItems):e}static get formAssociated(){return!0}static get watchers(){return{value:[{_valueChange:0}],items:[{itemChanges:0}],_showDropdown:[{_showDropdownChanges:0}],multi:[{multiChanges:0}]}}static get style(){return"*{box-sizing:border-box}:host{--tw-translate-y:0px!important;--tw-translate-x:0px!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.mb-3{margin-bottom:.75rem}.block{display:block}.flex{display:flex}.hidden{display:none}.h-6{height:1.5rem}.h-8{height:2rem}.h-\\[1\\.625rem\\]{height:1.625rem}.h-full{height:100%}.w-6{width:1.5rem}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(227 236 254/var(--tw-bg-opacity,1))}.p-2{padding:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-start{text-align:start}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-indigo-500{--tw-text-opacity:1;color:rgb(142 179 251/var(--tw-text-opacity,1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity,1))}.text-negative-red-700{--tw-text-opacity:1;color:rgb(147 16 16/var(--tw-text-opacity,1))}.text-storm-100{--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group\\/button:hover .group-hover\\/button\\:text-negative-red-800{--tw-text-opacity:1;color:rgb(141 16 16/var(--tw-text-opacity,1))}.group\\/item:hover .group-hover\\/item\\:text-indigo-800{--tw-text-opacity:1;color:rgb(27 88 210/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where([data-theme=dark],[data-theme=dark] *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[576,"p-select",{items:[1],multi:[516],strategy:[1],icon:[1],query:[1],placeholder:[1],autocompletePlaceholder:[1,"autocomplete-placeholder"],value:[8],displayKey:[1,"display-key"],dropdownDisplayKey:[1,"dropdown-display-key"],selectionDisplayKey:[1,"selection-display-key"],valueKey:[1,"value-key"],avatarKey:[1,"avatar-key"],iconKey:[1,"icon-key"],iconClassKey:[1,"icon-class-key"],showIconOnSelectedItem:[1,"show-icon-on-selected-item"],classKey:[1,"class-key"],applyClassOnSelectedItem:[4,"apply-class-on-selected-item"],applyClassOnSelectedItemInMenu:[4,"apply-class-on-selected-item-in-menu"],avatarLettersKey:[1,"avatar-letters-key"],identifierKey:[1,"identifier-key"],queryKey:[1,"query-key"],autoSelectFirst:[4,"auto-select-first"],showChevron:[4,"show-chevron"],maxDisplayedItems:[2,"max-displayed-items"],enableAutocomplete:[4,"enable-autocomplete"],enableTextWrap:[4,"enable-text-wrap"],asyncFilter:[4,"async-filter"],loading:[4],enableSelectAll:[4,"enable-select-all"],selectAllText:[1,"select-all-text"],selectAllIcon:[1,"select-all-icon"],size:[1],prefix:[1],label:[1],helper:[1],required:[516],showOptional:[516,"show-optional"],error:[513],disabled:[516],showAddItem:[4,"show-add-item"],addItemText:[1,"add-item-text"],emptyStateText:[1,"empty-state-text"],_showDropdown:[32],_selectedItem:[32],_allSelected:[32],_amountHidden:[32]},[[6,"click","documentClickHandler"]],{value:[{_valueChange:0}],items:[{itemChanges:0}],_showDropdown:[{_showDropdownChanges:0}],multi:[{multiChanges:0}]}]);function S(){"undefined"!=typeof customElements&&["p-select","p-avatar","p-button","p-checkbox","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-field","p-field-container","p-helper","p-icon","p-loader","p-tooltip"].forEach((e=>{switch(e){case"p-select":customElements.get(t(e))||customElements.define(t(e),I);break;case"p-avatar":customElements.get(t(e))||c();break;case"p-button":customElements.get(t(e))||d();break;case"p-checkbox":customElements.get(t(e))||p();break;case"p-dropdown":customElements.get(t(e))||m();break;case"p-dropdown-menu-container":customElements.get(t(e))||u();break;case"p-dropdown-menu-item":customElements.get(t(e))||w();break;case"p-field":customElements.get(t(e))||y();break;case"p-field-container":customElements.get(t(e))||x();break;case"p-helper":customElements.get(t(e))||g();break;case"p-icon":customElements.get(t(e))||v();break;case"p-loader":customElements.get(t(e))||f();break;case"p-tooltip":customElements.get(t(e))||b()}}))}S();const T=I,K=S;export{T as PSelect,K as defineCustomElement}
1
+ import{t,p as e,H as i,c as s,h as a}from"./p-CySg37XO.js";import{c as r}from"./p-CBWjHURv.js";import{T as o}from"./p-Au2WuEGF.js";import{a as h}from"./p-TyZ7uPES.js";import{c as n}from"./p-xs4N_Y-0.js";import{S as l}from"./p-CEaB2BT0.js";import{d as c}from"./p-iLGr9rDU.js";import{d}from"./p-AkD55vN_.js";import{d as p}from"./p-ShAy0ruV.js";import{d as m}from"./p-BtliZ0U_.js";import{d as u}from"./p-BtH8h7p9.js";import{d as w}from"./p-DlQumf-0.js";import{d as y}from"./p-Dy1wXwZf.js";import{d as x}from"./p-Cr_WB0kg.js";import{d as g}from"./p-SYK2C-7G.js";import{d as v}from"./p-aZcUXH1b.js";import{d as f}from"./p-D8faiybE.js";import{d as b}from"./p-2yaxaWU2.js";const k=r(["flex items-center gap-2","h-full min-w-0 flex-1","pointer-events-none overflow-hidden"]),C=r(["item group/item","pointer-events-auto cursor-pointer","flex h-[1.625rem] items-center gap-2","h-[1.625rem] px-2","whitespace-nowrap text-sm font-semibold","rounded-lg","bg-indigo-100","dark:bg-white/15"]),_=r("block w-full overflow-hidden text-start",{variants:{variant:{placeholder:"\n text-storm-400\n dark:text-white\n ",default:null},enableTextWrap:{true:!1,false:"text-ellipsis whitespace-nowrap"},error:{true:"\n text-negative-red-700\n group-hover/button:text-negative-red-800\n dark:text-negative-red-alternative\n ",false:null}}}),I=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.queryChange=s(this,"queryChange",3),this.valueChange=s(this,"valueChange",3),this.selectAllChange=s(this,"selectAllChange",3),this.dropdownShown=s(this,"dropdownShown",3),this.add=s(this,"add",3),this._internals=this.attachInternals()}items;multi;strategy="absolute";icon;query;placeholder;autocompletePlaceholder="Search...";value;displayKey="text";dropdownDisplayKey;selectionDisplayKey;valueKey;avatarKey;iconKey="icon";iconClassKey="iconClass";showIconOnSelectedItem;classKey="class";applyClassOnSelectedItem;applyClassOnSelectedItemInMenu;avatarLettersKey;identifierKey;queryKey;autoSelectFirst=!0;showChevron=!0;maxDisplayedItems=l;enableAutocomplete=!0;enableTextWrap=!1;asyncFilter=!1;loading=!1;enableSelectAll=!1;selectAllText="Select all";selectAllIcon;queryChange;valueChange;selectAllChange;dropdownShown;size="base";prefix;label;helper;required=!0;showOptional=!0;error;disabled=!1;showAddItem=!1;addItemText="Add item";add;emptyStateText="No items available";get _el(){return this}_showDropdown=!1;_selectedItem=null;_allSelected=!1;_amountHidden=0;_internals;_inputRef;autocompleteInputRef;_multiContainerRef;_resizeObserver;_resizeDebounceTimer;_checkSelectedItemsTimeout;get _items(){return this._getParsedItems()}get _displayValue(){const t=a("div",{class:_({variant:"placeholder"})},this.placeholder);return this._selectedItem?this.multi?0===this._selectedItem?.length?t:a("div",{class:k(),ref:t=>this._multiContainerRef=t},this._selectedItem.map((t=>a("div",{class:C(),onClick:()=>this._selectValue(t)},t[this.selectionDisplayKey??this.displayKey],a("p-icon",{class:"\n text-xs text-indigo-500\n group-hover/item:text-indigo-800\n dark:text-white/15\n dark:group-hover/item:text-white\n ",variant:"negative"})))),a("div",{class:"extra pointer-events-none hidden text-sm text-storm-100"},"+",this._amountHidden)):this._getDisplay(this._selectedItem,!0):t}get _identifierKey(){return this.identifierKey??this.valueKey??"value"}formResetCallback(){this._selectValue(null)}componentDidLoad(){if(!this.valueKey&&!this.identifierKey)throw Error("You must provide a valueKey or identifierKey");this.multi&&(this._setMultiContainerMaxWidth(),this._resizeObserver=new ResizeObserver((()=>{this._resizeDebounceTimer&&(clearTimeout(this._resizeDebounceTimer),this._resizeDebounceTimer=null),this._resizeDebounceTimer=setTimeout((()=>{this._setMultiContainerMaxWidth(),this._setCheckSelectedItemsTimeout()}),200)})),this._resizeObserver.observe(this._el)),this.value?this._valueChange():this.itemChanges()}componentDidRender(){this.multi&&this._setMultiContainerMaxWidth()}disconnectedCallback(){this.multi&&this._resizeObserver.disconnect()}render(){let t=this.icon;return this._selectedItem&&!this.avatarKey&&this.iconKey&&this._selectedItem?.[this.iconKey]&&!this.showIconOnSelectedItem&&(t=this._selectedItem[this.iconKey]),(this.avatarKey&&this._selectedItem?.[this.avatarKey]||this.avatarLettersKey&&this._selectedItem?.[this.avatarLettersKey])&&(t=null),this.error?.length&&(t="warning"),a(o,{key:"76b10df3dbbf0a1758ea13c7205ea4c11ea05056"},a("p-field-container",{key:"e17bca429b8a24a4c5e4399911c9efcebd8a6b24",error:this.error,forceShowTooltip:!!this.error?.length&&!this._showDropdown,helper:this.helper,label:this.label,prefix:this.prefix,required:this.required,showOptional:this.showOptional,variant:"write"},a("p-dropdown",{key:"1bcd1b15692330794bed8b34fbe203b8015681d9",applyChevron:!1,applyFullWidth:!0,applyMaxWidth:!1,"disable-trigger-click":this.disabled,insideClick:!0,manual:!0,manualChevron:!0,scrollable:!this.enableAutocomplete||"large",show:this._showDropdown,slot:"content",strategy:this.strategy,onIsOpen:t=>this._onDropdownOpen(t)},a("p-button",{key:"383466f2cec3fa3e7aa65aa3db077445cb2917ef",active:this._showDropdown,chevron:!!this.showChevron&&(this._showDropdown?"up":"down"),class:"w-full",error:!!this.error?.length,icon:t,iconClass:this.applyClassOnSelectedItem&&this._selectedItem?.[this.iconClassKey],size:this.size,slot:"trigger",variant:"secondary",onClick:t=>this._onClick(t)},a("div",{key:"8d5b4d842f4d49f029f1a61f98a8d768c61cf3ef",class:"relative min-w-0 flex-1",ref:t=>this._inputRef=t},this._displayValue)),this.loading?this._getLoadingItems():this._getItems(),this.showAddItem&&this._getAddItem())))}documentClickHandler(t){this._showDropdown&&!h(t,this._el)&&(this._showDropdown=!1)}_valueChange(){setTimeout((()=>{this._preselectItem(),this._setCheckSelectedItemsTimeout()}))}itemChanges(){setTimeout((()=>this._preselectItem()))}_showDropdownChanges(){this.dropdownShown.emit({value:this._showDropdown,query:this.query})}multiChanges(){this._selectedItem&&!Array.isArray(this._selectedItem)&&(this._selectedItem=[])}_preselectItem(){let t="string"==typeof this.value&&this.multi?JSON.parse(this.value):this.value;if(this.multi)return Array.isArray(t)?(this.value=t,0===t.length?void(this._selectedItem=[]):void(this._selectedItem=this.valueKey&&"false"!==this.valueKey?this._items.filter((e=>t.includes(e?.[this.valueKey]))):[...t])):(this.value=[],void this.valueChange.emit(this.value));this._selectedItem||t||!this.autoSelectFirst||(t=this._items[0]);const e="object"==typeof t&&null!==t?t[this._identifierKey]:t,i="string"==typeof e||"number"==typeof e?e:JSON.stringify(e),s=this._selectedItem?this._selectedItem?.[this._identifierKey]:null,a="string"==typeof s||"number"==typeof s?s:JSON.stringify(s);if(this._selectedItem&&a===i)return;if(!this._items?.length&&t)return void this._selectValue(t,!1);const r=this._getParsedItems(!1).find((t=>{const e=t?.[this._identifierKey];return("string"==typeof e||"number"==typeof e?e:JSON.stringify(e))===i}));this._selectValue(r??t,!1)}_selectValue(t,e=!0){let i=this.valueKey&&"false"!==this.valueKey&&null!==t&&!this.loading?t?.[this.valueKey]:t;if(this.multi){this._selectedItem&&Array.isArray(this._selectedItem)||(this._selectedItem=[]),this.value&&Array.isArray(this.value)||(this.value=[]);const e=[...this._selectedItem],s=[...this.value],a=e.findIndex((e=>e[this._identifierKey]===t[this._identifierKey]));return-1===a?(e.push(t),s.push(i)):(e.splice(a,1),s.splice(a,1)),this._selectedItem=e,this.value=s,void this.valueChange.emit(s)}this._selectedItem=t,this._onBlur(e),i!==this.value&&(this.value=i,this.valueChange.emit(i))}_onClick(t){const e=t?.composedPath();for(const t of e){if("p-button"===t.nodeName.toLowerCase())break;if(t.classList?.contains("item"))return}this._showDropdown=!this._showDropdown}_onBlur(t=!1){this.enableAutocomplete&&!t||(this._showDropdown=!1)}_onAutoComplete(t){this.enableAutocomplete&&(this._showDropdown=!0,this.query=t.detail,this.queryChange.emit(t.detail))}_checkvalue(t,e){return e?.[t]?.toString()?.toLowerCase().indexOf(this.query?.toLowerCase())>=0}_getItems(){let t=this._items.map((t=>{const e=this.multi&&this._selectedItem&&Array.isArray(this._selectedItem)?this._selectedItem.some((e=>e[this._identifierKey]===t[this._identifierKey])):t[this._identifierKey]===this._selectedItem?.[this._identifierKey];return a("p-dropdown-menu-item",{active:e,checkbox:!!this.multi,enableTextWrap:this.enableTextWrap,slot:"items",useContainer:!1,onClick:()=>this._selectValue(t)},this._getDisplay(t,!1,e))}));return 0===this._items.length&&(t=[a("p",{class:"\n w-full p-2 text-center text-sm text-storm-400\n dark:text-hurricane-200\n ",slot:"items"},this.emptyStateText)]),this.enableSelectAll&&this._items.length>0&&t.unshift(a("p-dropdown-menu-item",{active:this._allSelected,slot:"items",useContainer:!1,checkbox:!0,onClick:()=>this._selectAllChange()},this.selectAllIcon?.length?a("span",{class:"flex items-center gap-2"},a("div",{class:"flex w-6 justify-center text-lg"},a("p-icon",{variant:this.selectAllIcon}))," ",this.selectAllText):this.selectAllText)),this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAddItem(){return a("p-dropdown-menu-item",{slot:"items",useContainer:!1,onClick:()=>this.add.emit()},a("span",{class:"flex items-center gap-1 font-semibold text-indigo-600"},this.addItemText,a("p-icon",{variant:"plus"})))}_getLoadingItems(){const t=[0,0,0].map((()=>a("p-dropdown-menu-item",{enableHover:!1,slot:"items"},a("p-loader",{class:"h-6 w-full rounded",variant:"ghost"}))));return this.enableAutocomplete&&t.unshift(this._getAutoCompleteItem()),t}_getAutoCompleteItem(){return a("div",{class:"sticky top-0 z-10 mb-3 h-8",slot:"items"},a("p-field",{class:"block",placeholder:this.autocompletePlaceholder,value:this.query,onInputRefChange:t=>this.autocompleteInputRef=t.detail,onValueChange:t=>this._onAutoComplete(t)}))}_setMultiContainerMaxWidth(){this._inputRef&&this._multiContainerRef&&(this._multiContainerRef.style.maxWidth=Math.max(this._inputRef.clientWidth-16,16)+"px")}_setCheckSelectedItemsTimeout(){this._checkSelectedItemsTimeout&&clearTimeout(this._checkSelectedItemsTimeout),this._checkSelectedItemsTimeout=setTimeout((()=>this._checkSelectedItems()),50)}_checkSelectedItems(){if(!this._multiContainerRef)return;const t=this._multiContainerRef.getBoundingClientRect(),e=this._multiContainerRef.querySelectorAll(".item");let i=0;for(const s of e)s.classList.remove("hidden"),s.classList.add("flex"),s.getBoundingClientRect().right>t.right&&(s.classList.remove("flex"),s.classList.add("hidden"),i++);this._amountHidden=i;const s=this._multiContainerRef.querySelector(".extra");s&&(s.classList.contains("hidden")||s.classList.add("hidden"),i>0&&s.classList.remove("hidden"))}_onDropdownOpen(t){t.detail&&this.autocompleteInputRef&&setTimeout((()=>this.autocompleteInputRef.focus()),100)}_selectAllChange(){this._allSelected=!this._allSelected,this.selectAllChange.emit(this._allSelected)}_getDisplay(t,e=!1,i=!1){let s=a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[e?this.selectionDisplayKey??this.displayKey:this.displayKey]);return this.avatarKey&&(s=a("span",{class:"flex items-center gap-2"},a("p-avatar",{letters:t[this.avatarLettersKey],size:"sm",src:t[this.avatarKey]}),a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),!this.iconKey||e&&!this.showIconOnSelectedItem||(s=a("span",{class:"flex items-center gap-2"},t[this.iconKey]&&a("p-icon",{class:n("\n text-storm-300\n dark:text-hurricane-200\n ",e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu?"":t?.[this.iconClassKey]??""),variant:t[this.iconKey]}),a("div",{class:_({variant:"default",error:!!this.error?.length,enableTextWrap:this.enableTextWrap&&!e})},t[this.dropdownDisplayKey??this.displayKey]))),e&&!this.applyClassOnSelectedItem||i&&!this.applyClassOnSelectedItemInMenu||!t?.[this.classKey]?.length?s:a("div",{class:t[this.classKey]},s)}_getParsedItems(t=!0){if(!this.items||this.loading)return[];let e="string"==typeof this.items?JSON.parse(this.items):this.items;return"string"==typeof e?.[0]&&(this.displayKey="text",this.valueKey="value",e=e.map((t=>({value:t,text:t})))),this.query?.length&&!this.asyncFilter&&(e=e.filter((t=>this.queryKey?this._checkvalue(this.queryKey,t):this._checkvalue(this._identifierKey,t)||this._checkvalue(this.displayKey,t)))),t?e?.slice(0,this.maxDisplayedItems):e}static get formAssociated(){return!0}static get watchers(){return{value:[{_valueChange:0}],items:[{itemChanges:0}],_showDropdown:[{_showDropdownChanges:0}],multi:[{multiChanges:0}]}}static get style(){return"*{box-sizing:border-box}:host{--tw-translate-y:0px!important;--tw-translate-x:0px!important}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.top-0{top:0}.z-10{z-index:10}.mb-3{margin-bottom:.75rem}.block{display:block}.flex{display:flex}.hidden{display:none}.h-6{height:1.5rem}.h-8{height:2rem}.h-\\[1\\.625rem\\]{height:1.625rem}.h-full{height:100%}.w-6{width:1.5rem}.w-full{width:100%}.min-w-0{min-width:0}.flex-1{flex:1 1 0%}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(227 236 254/var(--tw-bg-opacity,1))}.p-2{padding:.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.text-center{text-align:center}.text-start{text-align:start}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-indigo-500{--tw-text-opacity:1;color:rgb(142 179 251/var(--tw-text-opacity,1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity,1))}.text-negative-red-700{--tw-text-opacity:1;color:rgb(147 16 16/var(--tw-text-opacity,1))}.text-storm-100{--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group\\/button:hover .group-hover\\/button\\:text-negative-red-800{--tw-text-opacity:1;color:rgb(141 16 16/var(--tw-text-opacity,1))}.group\\/item:hover .group-hover\\/item\\:text-indigo-800{--tw-text-opacity:1;color:rgb(27 88 210/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where(:host([data-theme=dark]),:host([data-theme=dark]) *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-white\\/15:where([data-theme=dark],[data-theme=dark] *){background-color:hsla(0,0%,100%,.15)}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 92 92/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:text-white\\/15:where([data-theme=dark],[data-theme=dark] *){color:hsla(0,0%,100%,.15)}.group\\/item:hover .dark\\:group-hover\\/item\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[576,"p-select",{items:[1],multi:[516],strategy:[1],icon:[1],query:[1],placeholder:[1],autocompletePlaceholder:[1,"autocomplete-placeholder"],value:[8],displayKey:[1,"display-key"],dropdownDisplayKey:[1,"dropdown-display-key"],selectionDisplayKey:[1,"selection-display-key"],valueKey:[1,"value-key"],avatarKey:[1,"avatar-key"],iconKey:[1,"icon-key"],iconClassKey:[1,"icon-class-key"],showIconOnSelectedItem:[1,"show-icon-on-selected-item"],classKey:[1,"class-key"],applyClassOnSelectedItem:[4,"apply-class-on-selected-item"],applyClassOnSelectedItemInMenu:[4,"apply-class-on-selected-item-in-menu"],avatarLettersKey:[1,"avatar-letters-key"],identifierKey:[1,"identifier-key"],queryKey:[1,"query-key"],autoSelectFirst:[4,"auto-select-first"],showChevron:[4,"show-chevron"],maxDisplayedItems:[2,"max-displayed-items"],enableAutocomplete:[4,"enable-autocomplete"],enableTextWrap:[4,"enable-text-wrap"],asyncFilter:[4,"async-filter"],loading:[4],enableSelectAll:[4,"enable-select-all"],selectAllText:[1,"select-all-text"],selectAllIcon:[1,"select-all-icon"],size:[1],prefix:[1],label:[1],helper:[1],required:[516],showOptional:[516,"show-optional"],error:[513],disabled:[516],showAddItem:[4,"show-add-item"],addItemText:[1,"add-item-text"],emptyStateText:[1,"empty-state-text"],_showDropdown:[32],_selectedItem:[32],_allSelected:[32],_amountHidden:[32]},[[6,"click","documentClickHandler"]],{value:[{_valueChange:0}],items:[{itemChanges:0}],_showDropdown:[{_showDropdownChanges:0}],multi:[{multiChanges:0}]}]);function S(){"undefined"!=typeof customElements&&["p-select","p-avatar","p-button","p-checkbox","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-field","p-field-container","p-helper","p-icon","p-loader","p-tooltip"].forEach((e=>{switch(e){case"p-select":customElements.get(t(e))||customElements.define(t(e),I);break;case"p-avatar":customElements.get(t(e))||c();break;case"p-button":customElements.get(t(e))||d();break;case"p-checkbox":customElements.get(t(e))||p();break;case"p-dropdown":customElements.get(t(e))||m();break;case"p-dropdown-menu-container":customElements.get(t(e))||u();break;case"p-dropdown-menu-item":customElements.get(t(e))||w();break;case"p-field":customElements.get(t(e))||y();break;case"p-field-container":customElements.get(t(e))||x();break;case"p-helper":customElements.get(t(e))||g();break;case"p-icon":customElements.get(t(e))||v();break;case"p-loader":customElements.get(t(e))||f();break;case"p-tooltip":customElements.get(t(e))||b()}}))}S();const T=I,A=S;export{T as PSelect,A as defineCustomElement}
@@ -1 +1 @@
1
- import{T as o,d as s}from"./p-DXsoAHFt.js";const t=o,p=s;export{t as PTableFooter,p as defineCustomElement}
1
+ import{T as o,d as s}from"./p-COFt46UN.js";const t=o,p=s;export{t as PTableFooter,p as defineCustomElement}
@@ -1 +1 @@
1
- import{T as s,d as o}from"./p-BSsW37JK.js";const p=s,r=o;export{p as PTableHeader,r as defineCustomElement}
1
+ import{T as o,d as s}from"./p-DKnCWy7F.js";const p=o,r=s;export{p as PTableHeader,r as defineCustomElement}
@@ -1 +1 @@
1
- import{t,p as e,H as i,c as s,h as o,d as a}from"./p-CySg37XO.js";import{f as n,g as l}from"./p-CwQG70_4.js";import{f as r}from"./p-WEZng7dj.js";import{f as c}from"./p-CWO2YJCh.js";import{c as h}from"./p-xs4N_Y-0.js";import{P as p,a as d,T as m}from"./p-CEaB2BT0.js";import{d as u}from"./p-Crasy6LB.js";import{d as b}from"./p-B_7CTN-Q.js";import{d as f}from"./p-DncIsq-f.js";import{d as g}from"./p-DP6H82uQ.js";import{d as w}from"./p-BtliZ0U_.js";import{d as k}from"./p-BtH8h7p9.js";import{d as y}from"./p-BrLLMmZa.js";import{d as S}from"./p-0EHH7Dl0.js";import{d as _}from"./p-4DN7zVtS.js";import{d as x}from"./p-G57Mci8u.js";import{d as C}from"./p-DSv8ajJ4.js";import{d as v}from"./p-C1HzSmDf.js";import{d as E}from"./p-D6iTsl8U.js";import{d as j}from"./p-DLBcQv2y.js";import{d as A}from"./p-CMmvAq1F.js";import{d as F}from"./p-D8faiybE.js";import{d as R}from"./p-Bru1muWj.js";import{d as D}from"./p-BBwQm_OH.js";import{d as B}from"./p-BBAR0LE7.js";import{d as z}from"./p-BtI7diO6.js";import{d as L}from"./p-DDV-lx3_.js";import{d as H}from"./p--52gTdZ4.js";import{d as T}from"./p-CTQuFuDk.js";import{d as I}from"./p-CtAGaRd5.js";import{d as O}from"./p-DXsoAHFt.js";import{d as P}from"./p-BSsW37JK.js";import{d as q}from"./p-MeQ48Q-1.js";import{d as Q}from"./p-qeQ4j6y4.js";import{d as M}from"./p-2yaxaWU2.js";const U=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectedRowsChange=s(this,"selectedRowsChange",3),this.rowClick=s(this,"rowClick",3),this.rowSelected=s(this,"rowSelected",3),this.rowDeselected=s(this,"rowDeselected",3),this.hasRendered=s(this,"hasRendered",3),this.quickFilter=s(this,"quickFilter",3),this.queryChange=s(this,"queryChange",3),this.filter=s(this,"filter",3),this.action=s(this,"action",3),this.pageChange=s(this,"pageChange",3),this.pageSizeChange=s(this,"pageSizeChange",3),this.export=s(this,"export",3),this.emptyStateActionClick=s(this,"emptyStateActionClick",3)}items;loading=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=t=>n((1===t?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=!0;quickFilters=[];activeQuickFilterIdentifier;enableSearch=!0;query;enableFilter=!0;enableFilterDesktop=!0;selectedFiltersAmount;filterButtonTemplate;enableAction=!1;actionButtonLoading=!1;actionButtonEnabled=!1;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=!0;enablePaginationSize=!0;enablePaginationPages=!0;enableExport=!0;page=1;total;pageChange;pageSize=p;pageSizeOptions=d;pageSizeChange;export;hideOnSinglePage=!0;emptyStateHeader=()=>n(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>n(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>n(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=!0;emptyStateFilteredHeader=()=>n(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>n(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return this}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return o(a,{key:"7ece1479d7c90b408fa55f045feba734f9e27b28",class:"z-0 flex flex-col"},o("p-table-container",{key:"290cf20abdacab6257ebef5479b834df529bccbd"},this.enableHeader&&o("p-table-header",{key:"6a1af71c86b2b23d26d8d344b1528b1356d7bd7b",actionButtonTemplate:this.actionButtonTemplate,actionIcon:this.actionButtonIcon,actionLoading:this.actionButtonLoading,actionText:this.actionButtonText,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,canUseAction:this.actionButtonEnabled,class:"mb-8",enableAction:this.enableAction,enableExport:this.enableExport,enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,enableSearch:this.enableSearch,filterButtonTemplate:this.filterButtonTemplate,itemsSelectedAmount:this.selectedRows?.length,loading:this.headerLoading,query:this.query,quickFilters:this.quickFilters,selectedFiltersAmount:this.selectedFiltersAmount,onAction:()=>this.action.emit(),onExport:()=>this.export.emit(),onFilter:()=>this.filter.emit(),onQueryChange:({detail:t})=>this.queryChange.emit(t),onQuickFilter:({detail:t})=>this.quickFilter.emit(t)},this._hasCustomFilterSlot&&o("slot",{key:"6bfe4727050ba7d6a3e6e280cc1c467259b9166b",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&o("slot",{key:"da4f2aea31f0daa62749393a0390219fa4342b20",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),o("div",{key:"799d65d57bf36a924ff40e6cb9416c4be0da4eaf",class:"flex flex-1 flex-col"},this._getRows(),o("slot",{key:"b0060fa16edf49898787df195c86a35adf397798",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?o("p-floating-menu-container",{amount:this.selectedRows?.length,amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,class:r({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),enableAmountSelected:!!this._rowActionsFloating?.length,usedInTable:!0,onClose:()=>this._selectAllChange(null,!1)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((t=>o("p-floating-menu-item",{disabled:t.disabled,icon:t.icon,iconFlip:t.iconFlip,iconRotate:t.iconRotate,loading:t.loading,slot:"floating-menu-item",onClick:()=>t.disabled||t.loading||!t.action||"single"!==t.type?t.action(this.selectedRows,!0):t.action(this.selectedRows[0],!1)},t.label)))):"",this.enableFooter&&o("p-table-footer",{key:"57d24f1f3803e58053eba3da5fad1ab6474eccc6",enablePaginationPages:this.enablePaginationPages,enablePaginationSize:this.enablePaginationSize,hideOnSinglePage:this.hideOnSinglePage,loading:this.footerLoading,page:this.page,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled,total:this.total,onHiddenChange:({detail:t})=>this._footerHidden=t,onPageChange:({detail:t})=>this.pageChange.emit(t),onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t)})))}async _setLocales(){this._locales=await l(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){"Control"===t&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:t}){"Control"===t&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(t){this._items=t?Array.isArray(t)?t:JSON.parse(t):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const t=c(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?o("p-table-row",{isLast:!0,variant:"header-secondary"},this._extraHeaders.map(((t,e)=>o("p-table-cell",{checkboxOffset:0===e&&this._enableRowSelection,definition:t,index:e,variant:"header-secondary"},o("b",null,t.name))))):null}_getHeader(){return o("p-table-row",{variant:"header"},this._columns.map(((t,e)=>o("p-table-cell",{checkbox:0===e||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,definition:t,index:e,value:t.name,variant:"header"}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((t,e)=>o("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>o("p-table-row",{checked:this._selectionContains(e),enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this._items.length-1,onClick:t=>this._rowClick(t,e)},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>!e.showFunction||e.showFunction(t)));return i?.length&&!c()?o("p-table-row-actions-container",{checked:this._selectionContains(e),slot:"actions"},i.map((e=>o("p-tooltip",{content:e.label,strategy:"fixed"},o("p-button",{icon:e.icon,iconFlip:e.iconFlip,iconOnly:!0,iconRotate:e.iconRotate,size:"sm",slot:"trigger",variant:"secondary","data-is-action":!0,onClick:()=>"function"==typeof e.action&&e.action?.(t,!1)}))))):null}_getRowColumns(t,e){return this._columns.map(((i,s)=>o("p-table-cell",{checkbox:0===s||i.hasCheckbox?this._getCheckbox(e):null,definition:i,index:s,item:t,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>o("p-table-cell",{checkbox:0===i||e.hasCheckbox?this._getCheckbox(t,"loading"):null,definition:e,index:i,rowIndex:t,variant:"loading"})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===e)return o("p-loader",{class:"h-6 w-6 rounded",variant:"ghost"});if("header"===e)return o("p-checkbox",{checked:this._selectionContainsAll(),class:h({"opacity-0":void 0!==this._rowSelectionLimit}),disabled:void 0!==this._rowSelectionLimit,indeterminate:this._selectionIndeterminate(),onCheckedChange:t=>this._selectAllChange(t)});const i=this._items[t],s=this._selectionContains(t);return o("p-checkbox",{checked:s,class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!s&&this.selectedRows.length===this._rowSelectionLimit,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){return o("p-empty-state",this.query?.length||this.selectedFiltersAmount?{class:"my-16 self-center",content:this.emptyStateFilteredContent(),header:this.emptyStateFilteredHeader(),illustration:"search"}:{actionIcon:"plus",actionText:this.emptyStateAction(),class:"my-16 self-center",content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,header:this.emptyStateHeader(),illustration:"table",onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(t,e){if(this._enableRowSelection){if(void 0===e?t?.detail??e:e){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(e)&&(t.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+t.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...t],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t],i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection)return;if(t&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(e.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(e.checked=!1);if(t)return this.selectedRows=[...this.selectedRows,{...s,index:i}],this.selectedRowsChange.emit(this.selectedRows),this.rowSelected.emit(s),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu());const o=this._selectionContains(i,!0),a=[...this.selectedRows];a.splice(o,1),this.selectedRows=a,this.selectedRowsChange.emit(this.selectedRows),this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey&&t?.[this.selectionKey]||e}_selectionContains(t,e=!1){const i=this.selectedRows.findIndex((e=>e.index===t));return e?i:-1!==i}_selectionContainsAll(){let t=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let e=0;e<this._items?.length;e++)if(!this._selectionContains(e)){t=!1;break}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let t=0;for(let e=0;e<this._items?.length;e++)this._selectionContains(e)&&t++;return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(t.target);if(this._findRowAction(t.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[e],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const o=s?.querySelector('input[type="checkbox"]');o&&(o.checked=!o.checked,this._checkboxChange(o,e))}_findRow(t){return t?"p-table-row"===t?.tagName?.toLowerCase()?t:this._findRow(t?.parentElement):t}_findRowAction(t){return t?null!==t.dataset.isAction&&"false"!==t.dataset.isAction?t:"p-table-row"===t?.tagName?.toLowerCase()?null:this._findRowAction(t?.parentElement):null}_showFloatingMenu(){let t=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&t.some((t=>("single"===t.type||"both"===t.type)&&t.showFunction))&&(t=t.filter((t=>"multi"===t.type||!t.showFunction||t.showFunction(this.selectedRows[0])))),this._rowActionsFloating=t,this._floatingMenuShown=!0}_parseDefinitions(t){return t.map((t=>this._parseDefinitionSizes(t)))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};"string"!=typeof t.sizes||["auto","hidden","full"].includes(t.sizes)||(t.sizes=JSON.parse(t.sizes));for(const[t,s]of m.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[m[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}"}},[772,"p-table",{items:[1],loading:[4],headerLoading:[4,"header-loading"],footerLoading:[4,"footer-loading"],amountOfLoadingRows:[2,"amount-of-loading-rows"],enableRowSelection:[4,"enable-row-selection"],rowSelectionLimit:[2,"row-selection-limit"],enableRowClick:[4,"enable-row-click"],selectedRows:[16],enableFloatingMenu:[4,"enable-floating-menu"],floatingMenuAmountSelectedTemplate:[16],selectionKey:[1,"selection-key"],canSelectKey:[1,"can-select-key"],enableHeader:[4,"enable-header"],quickFilters:[1,"quick-filters"],activeQuickFilterIdentifier:[1,"active-quick-filter-identifier"],enableSearch:[4,"enable-search"],query:[1025],enableFilter:[4,"enable-filter"],enableFilterDesktop:[4,"enable-filter-desktop"],selectedFiltersAmount:[2,"selected-filters-amount"],filterButtonTemplate:[16],enableAction:[4,"enable-action"],actionButtonLoading:[4,"action-button-loading"],actionButtonEnabled:[4,"action-button-enabled"],actionButtonIcon:[1,"action-button-icon"],actionButtonText:[1,"action-button-text"],actionButtonTemplate:[16],enableFooter:[4,"enable-footer"],enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],enableExport:[4,"enable-export"],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],hideOnSinglePage:[4,"hide-on-single-page"],emptyStateHeader:[16],emptyStateContent:[16],emptyStateAction:[16],enableEmptyStateAction:[4,"enable-empty-state-action"],emptyStateFilteredHeader:[16],emptyStateFilteredContent:[16],shadow:[4],_locales:[32],_extraHeaders:[32],_columns:[32],_items:[32],_enableRowSelection:[32],_rowSelectionLimit:[32],_rowActionsFloating:[32],_rowActionsRow:[32],_footerHidden:[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}]);function W(){"undefined"!=typeof customElements&&["p-table","p-badge","p-button","p-checkbox","p-divider","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-empty-state","p-field","p-field-container","p-floating-menu-container","p-floating-menu-item","p-helper","p-icon","p-illustration","p-loader","p-pagination","p-pagination-pages","p-pagination-pages-item","p-pagination-size","p-segment-container","p-segment-item","p-table-cell","p-table-container","p-table-footer","p-table-header","p-table-row","p-table-row-actions-container","p-tooltip"].forEach((e=>{switch(e){case"p-table":customElements.get(t(e))||customElements.define(t(e),U);break;case"p-badge":customElements.get(t(e))||u();break;case"p-button":customElements.get(t(e))||b();break;case"p-checkbox":customElements.get(t(e))||f();break;case"p-divider":customElements.get(t(e))||g();break;case"p-dropdown":customElements.get(t(e))||w();break;case"p-dropdown-menu-container":customElements.get(t(e))||k();break;case"p-dropdown-menu-item":customElements.get(t(e))||y();break;case"p-empty-state":customElements.get(t(e))||S();break;case"p-field":customElements.get(t(e))||_();break;case"p-field-container":customElements.get(t(e))||x();break;case"p-floating-menu-container":customElements.get(t(e))||C();break;case"p-floating-menu-item":customElements.get(t(e))||v();break;case"p-helper":customElements.get(t(e))||E();break;case"p-icon":customElements.get(t(e))||j();break;case"p-illustration":customElements.get(t(e))||A();break;case"p-loader":customElements.get(t(e))||F();break;case"p-pagination":customElements.get(t(e))||R();break;case"p-pagination-pages":customElements.get(t(e))||D();break;case"p-pagination-pages-item":customElements.get(t(e))||B();break;case"p-pagination-size":customElements.get(t(e))||z();break;case"p-segment-container":customElements.get(t(e))||L();break;case"p-segment-item":customElements.get(t(e))||H();break;case"p-table-cell":customElements.get(t(e))||T();break;case"p-table-container":customElements.get(t(e))||I();break;case"p-table-footer":customElements.get(t(e))||O();break;case"p-table-header":customElements.get(t(e))||P();break;case"p-table-row":customElements.get(t(e))||q();break;case"p-table-row-actions-container":customElements.get(t(e))||Q();break;case"p-tooltip":customElements.get(t(e))||M()}}))}W();const J=U,K=W;export{J as PTable,K as defineCustomElement}
1
+ import{t,p as e,H as i,c as s,h as o,d as a}from"./p-CySg37XO.js";import{f as n,g as l}from"./p-CwQG70_4.js";import{f as r}from"./p-WEZng7dj.js";import{f as h}from"./p-CWO2YJCh.js";import{c}from"./p-xs4N_Y-0.js";import{P as p,a as d,T as m}from"./p-CEaB2BT0.js";import{d as u}from"./p-Crasy6LB.js";import{d as b}from"./p-AkD55vN_.js";import{d as f}from"./p-ShAy0ruV.js";import{d as g}from"./p-DP6H82uQ.js";import{d as w}from"./p-BtliZ0U_.js";import{d as k}from"./p-BtH8h7p9.js";import{d as y}from"./p-DlQumf-0.js";import{d as S}from"./p-BAvGAs2F.js";import{d as _}from"./p-Dy1wXwZf.js";import{d as x}from"./p-Cr_WB0kg.js";import{d as C}from"./p-DT72kk3I.js";import{d as v}from"./p-BmU3MAfH.js";import{d as E}from"./p-SYK2C-7G.js";import{d as A}from"./p-aZcUXH1b.js";import{d as F}from"./p-CMmvAq1F.js";import{d as j}from"./p-D8faiybE.js";import{d as R}from"./p-CtxKjhiD.js";import{d as D}from"./p-NEqovphH.js";import{d as z}from"./p-BBAR0LE7.js";import{d as B}from"./p-D8FhwO0Q.js";import{d as L}from"./p-DDV-lx3_.js";import{d as H}from"./p-DR1auS78.js";import{d as T}from"./p-CTQuFuDk.js";import{d as O}from"./p-CtAGaRd5.js";import{d as P}from"./p-COFt46UN.js";import{d as q}from"./p-DKnCWy7F.js";import{d as I}from"./p-MeQ48Q-1.js";import{d as Q}from"./p-qeQ4j6y4.js";import{d as U}from"./p-2yaxaWU2.js";const M=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.selectedRowsChange=s(this,"selectedRowsChange",3),this.rowClick=s(this,"rowClick",3),this.rowSelected=s(this,"rowSelected",3),this.rowDeselected=s(this,"rowDeselected",3),this.hasRendered=s(this,"hasRendered",3),this.quickFilter=s(this,"quickFilter",3),this.queryChange=s(this,"queryChange",3),this.filter=s(this,"filter",3),this.action=s(this,"action",3),this.pageChange=s(this,"pageChange",3),this.pageSizeChange=s(this,"pageSizeChange",3),this.export=s(this,"export",3),this.emptyStateActionClick=s(this,"emptyStateActionClick",3)}items;loading=!1;headerLoading=!1;footerLoading=!1;amountOfLoadingRows=6;enableRowSelection=!0;rowSelectionLimit;enableRowClick=!0;selectedRows=[];enableFloatingMenu=!0;floatingMenuAmountSelectedTemplate=t=>n((1===t?this._locales.floating_menu?.amount_selected:this._locales.floating_menu?.amount_selected_plural)?.replace("{{amount}}",t));selectedRowsChange;selectionKey;canSelectKey;rowClick;rowSelected;rowDeselected;hasRendered;enableHeader=!0;quickFilters=[];activeQuickFilterIdentifier;enableSearch=!0;query;enableFilter=!0;enableFilterDesktop=!0;selectedFiltersAmount;filterButtonTemplate;enableAction=!1;actionButtonLoading=!1;actionButtonEnabled=!1;actionButtonIcon="pencil";actionButtonText;actionButtonTemplate;quickFilter;queryChange;filter;action;enableFooter=!0;enablePaginationSize=!0;enablePaginationPages=!0;enableExport=!0;page=1;total;pageChange;pageSize=p;pageSizeOptions=d;pageSizeChange;export;hideOnSinglePage=!0;emptyStateHeader=()=>n(this._locales.empty_state?.no_filter.header);emptyStateContent=()=>n(this._locales.empty_state?.no_filter.content);emptyStateAction=()=>n(this._locales.empty_state?.no_filter.action);enableEmptyStateAction=!0;emptyStateFilteredHeader=()=>n(this._locales.empty_state.filtered.header);emptyStateFilteredContent=()=>n(this._locales.empty_state.filtered.content);emptyStateActionClick;shadow=!0;get _el(){return this}_locales={};_extraHeaders=[];_columns=[];_items=[];_enableRowSelection=this.enableRowSelection;_rowSelectionLimit;_rowActionsFloatingAll=[];_rowActionsFloating=[];_rowActionsRow=[];_footerHidden=!1;_ctrlDown=!1;_hasCustomFilterSlot=!1;_hasCustomActionsSlot=!1;_floatingMenuShown=!1;_resizeTimeout;componentWillLoad(){this._hasCustomFilterSlot=!!this._el.querySelector(':scope > [slot="custom-filter"]'),this._hasCustomActionsSlot=!!this._el.querySelector(':scope > [slot="custom-actions"]'),this._setRowSelectionData(),this._setLocales(),this._parseItems(this.items),this._generateExtraHeaders(),this._generateColumns()}componentDidRender(){this.hasRendered.emit()}render(){return o(a,{key:"7ece1479d7c90b408fa55f045feba734f9e27b28",class:"z-0 flex flex-col"},o("p-table-container",{key:"290cf20abdacab6257ebef5479b834df529bccbd"},this.enableHeader&&o("p-table-header",{key:"6a1af71c86b2b23d26d8d344b1528b1356d7bd7b",actionButtonTemplate:this.actionButtonTemplate,actionIcon:this.actionButtonIcon,actionLoading:this.actionButtonLoading,actionText:this.actionButtonText,activeQuickFilterIdentifier:this.activeQuickFilterIdentifier,canUseAction:this.actionButtonEnabled,class:"mb-8",enableAction:this.enableAction,enableExport:this.enableExport,enableFilter:this.enableFilter,enableFilterDesktop:this.enableFilterDesktop,enableSearch:this.enableSearch,filterButtonTemplate:this.filterButtonTemplate,itemsSelectedAmount:this.selectedRows?.length,loading:this.headerLoading,query:this.query,quickFilters:this.quickFilters,selectedFiltersAmount:this.selectedFiltersAmount,onAction:()=>this.action.emit(),onExport:()=>this.export.emit(),onFilter:()=>this.filter.emit(),onQueryChange:({detail:t})=>this.queryChange.emit(t),onQuickFilter:({detail:t})=>this.quickFilter.emit(t)},this._hasCustomFilterSlot&&o("slot",{key:"6bfe4727050ba7d6a3e6e280cc1c467259b9166b",name:"custom-filter",slot:"custom-filter"}),this._hasCustomActionsSlot&&o("slot",{key:"da4f2aea31f0daa62749393a0390219fa4342b20",name:"custom-actions",slot:"custom-actions"})),this._getExtraHeader(),this._getHeader(),o("div",{key:"799d65d57bf36a924ff40e6cb9416c4be0da4eaf",class:"flex flex-1 flex-col"},this._getRows(),o("slot",{key:"b0060fa16edf49898787df195c86a35adf397798",name:"custom-rows"})),this.enableFloatingMenu&&this._enableRowSelection?o("p-floating-menu-container",{amount:this.selectedRows?.length,amountSelectedTemplate:this.floatingMenuAmountSelectedTemplate,class:r({hasFooter:this.enableFooter&&!this._footerHidden,active:!!this.selectedRows?.length,shown:this._floatingMenuShown}),enableAmountSelected:!!this._rowActionsFloating?.length,usedInTable:!0,onClose:()=>this._selectAllChange(null,!1)},this._rowActionsFloating?.length&&this._rowActionsFloating.map((t=>o("p-floating-menu-item",{disabled:t.disabled,icon:t.icon,iconFlip:t.iconFlip,iconRotate:t.iconRotate,loading:t.loading,slot:"floating-menu-item",onClick:()=>t.disabled||t.loading||!t.action||"single"!==t.type?t.action(this.selectedRows,!0):t.action(this.selectedRows[0],!1)},t.label)))):"",this.enableFooter&&o("p-table-footer",{key:"57d24f1f3803e58053eba3da5fad1ab6474eccc6",enablePaginationPages:this.enablePaginationPages,enablePaginationSize:this.enablePaginationSize,hideOnSinglePage:this.hideOnSinglePage,loading:this.footerLoading,page:this.page,pageSize:this.pageSize,pageSizeOptions:this.pageSizeOptions,tableHeaderHasAction:this.enableHeader&&this.enableAction&&this.actionButtonEnabled,total:this.total,onHiddenChange:({detail:t})=>this._footerHidden=t,onPageChange:({detail:t})=>this.pageChange.emit(t),onPageSizeChange:({detail:t})=>this.pageSizeChange.emit(t)})))}async _setLocales(){this._locales=await l(this._el)}onTableDefinitionUpdated(){this._generateColumns()}keyDown({key:t}){"Control"===t&&!0!==this._ctrlDown&&(this._ctrlDown=!0)}keyUp({key:t}){"Control"===t&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}visibilityChange(){"hidden"===document.visibilityState&&!1!==this._ctrlDown&&(this._ctrlDown=!1)}_parseItems(t){this._items=t?Array.isArray(t)?t:JSON.parse(t):[]}_setRowSelectionData(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout((()=>{const t=h(),e=[...this._el.querySelectorAll(":scope > p-table-row-action")];this._rowActionsRow=e.filter((t=>"both"===t.type||"single"===t.type)),this._rowActionsFloatingAll=e.filter((e=>this.enableRowSelection&&("both"===e.type||"multi"===e.type)||t&&"single"===e.type)).map((t=>("single"===t.type&&(t.disabled=this.selectedRows?.length>1),t)));let i=this.rowSelectionLimit;t&&this._rowActionsFloatingAll?.length&&(void 0!==i&&this.enableRowSelection||!this.enableRowSelection)&&(i=1),this._rowSelectionLimit=i;let s=this.enableRowSelection;t&&this._rowActionsFloatingAll?.length&&!s&&(s=!0),this._enableRowSelection=s,this._floatingMenuShown&&this._showFloatingMenu()}),200)}_generateExtraHeaders(){let t=[...this._el.querySelectorAll("p-table-extra-header")];t=this._parseDefinitions(t),this._extraHeaders=t}_generateColumns(){let t=[...this._el.querySelectorAll("p-table-column")];t=this._parseDefinitions(t),this._columns=t}_getExtraHeader(){return this._extraHeaders?.length?o("p-table-row",{isLast:!0,variant:"header-secondary"},this._extraHeaders.map(((t,e)=>o("p-table-cell",{checkboxOffset:0===e&&this._enableRowSelection,definition:t,index:e,variant:"header-secondary"},o("b",null,t.name))))):null}_getHeader(){return o("p-table-row",{variant:"header"},this._columns.map(((t,e)=>o("p-table-cell",{checkbox:0===e||t.hasCheckbox?this._getCheckbox(null,this.loading?"loading":"header"):null,definition:t,index:e,value:t.name,variant:"header"}))))}_getRows(){return this.loading?Array.from({length:this.amountOfLoadingRows},((t,e)=>o("p-table-row",{enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this.amountOfLoadingRows-1},this._getLoadingColumns(e)))):0===this._items.length?this._getEmptyState():this._items.map(((t,e)=>o("p-table-row",{checked:this._selectionContains(e),enableHover:this._enableRowSelection||this.enableRowClick,isLast:e===this._items.length-1,onClick:t=>this._rowClick(t,e)},this._getRowColumns(t,e),this._getActions(t,e))))}_getActions(t,e){const i=this._rowActionsRow.filter((e=>!e.showFunction||e.showFunction(t)));return i?.length&&!h()?o("p-table-row-actions-container",{checked:this._selectionContains(e),slot:"actions"},i.map((e=>o("p-tooltip",{content:e.label,strategy:"fixed"},o("p-button",{icon:e.icon,iconFlip:e.iconFlip,iconOnly:!0,iconRotate:e.iconRotate,size:"sm",slot:"trigger",variant:"secondary","data-is-action":!0,onClick:()=>"function"==typeof e.action&&e.action?.(t,!1)}))))):null}_getRowColumns(t,e){return this._columns.map(((i,s)=>o("p-table-cell",{checkbox:0===s||i.hasCheckbox?this._getCheckbox(e):null,definition:i,index:s,item:t,rowIndex:e})))}_getLoadingColumns(t){return this._columns.map(((e,i)=>o("p-table-cell",{checkbox:0===i||e.hasCheckbox?this._getCheckbox(t,"loading"):null,definition:e,index:i,rowIndex:t,variant:"loading"})))}_getCheckbox(t,e="default"){if(!this._enableRowSelection||!this.selectionKey&&!this._rowActionsFloating?.length)return;if("loading"===e)return o("p-loader",{class:"h-6 w-6 rounded",variant:"ghost"});if("header"===e)return o("p-checkbox",{checked:this._selectionContainsAll(),class:c({"opacity-0":void 0!==this._rowSelectionLimit}),disabled:void 0!==this._rowSelectionLimit,indeterminate:this._selectionIndeterminate(),onCheckedChange:t=>this._selectAllChange(t)});const i=this._items[t],s=this._selectionContains(t);return o("p-checkbox",{checked:s,class:"flex-shrink-0",disabled:this.canSelectKey&&!i[this.canSelectKey]||void 0!==this._rowSelectionLimit&&!s&&this.selectedRows.length===this._rowSelectionLimit,onCheckedChange:e=>this._checkboxChange(e,t)})}_getEmptyState(){return o("p-empty-state",this.query?.length||this.selectedFiltersAmount?{class:"my-16 self-center",content:this.emptyStateFilteredContent(),header:this.emptyStateFilteredHeader(),illustration:"search"}:{actionIcon:"plus",actionText:this.emptyStateAction(),class:"my-16 self-center",content:this.emptyStateContent(),enableAction:this.enableEmptyStateAction,header:this.emptyStateHeader(),illustration:"table",onAction:()=>this.enableAction&&this.action.emit()})}_selectAllChange(t,e){if(this._enableRowSelection){if(void 0===e?t?.detail??e:e){const t=[];for(let e=0;e<this._items.length;e++){const i=this._items[e];if((!this.canSelectKey||i[this.canSelectKey])&&!this._selectionContains(e)&&(t.push(i),this.rowSelected.emit(i),void 0!==this._rowSelectionLimit&&this.selectedRows.length+t.length===this._rowSelectionLimit))break}return this.selectedRows=[...this.selectedRows,...t],this.selectedRowsChange.emit(this.selectedRows),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu())}for(let t=0;t<this.selectedRows.length;t++){const e=this.selectedRows[t],i=this._items.find((i=>this._getSelectionValue(i,t)===this._getSelectionValue(e,t)));i&&this.rowDeselected.emit(i)}this.selectedRows=[],this.selectedRowsChange.emit(this.selectedRows)}}_checkboxChange({detail:t,target:e},i){if(!this._enableRowSelection)return;if(t&&void 0!==this._rowSelectionLimit&&this.selectedRows.length>=this._rowSelectionLimit)return void(e.checked=!1);const s=this._items[i];if(this.canSelectKey&&!s[this.canSelectKey])return void(e.checked=!1);if(t)return this.selectedRows=[...this.selectedRows,{...s,index:i}],this.selectedRowsChange.emit(this.selectedRows),this.rowSelected.emit(s),void(this.enableFloatingMenu&&!this._floatingMenuShown&&this._showFloatingMenu());const o=this._selectionContains(i,!0),a=[...this.selectedRows];a.splice(o,1),this.selectedRows=a,this.selectedRowsChange.emit(this.selectedRows),this.rowDeselected.emit(s)}_getSelectionValue(t,e){return this.selectionKey&&t?.[this.selectionKey]||e}_selectionContains(t,e=!1){const i=this.selectedRows.findIndex((e=>e.index===t));return e?i:-1!==i}_selectionContainsAll(){let t=!0;if(!this._items?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!0;for(let e=0;e<this._items?.length;e++)if(!this._selectionContains(e)){t=!1;break}return t}_selectionIndeterminate(){if(!this._items?.length||!this.selectedRows?.length)return!1;if(void 0!==this._rowSelectionLimit&&this.selectedRows.length===this._rowSelectionLimit)return!1;let t=0;for(let e=0;e<this._items?.length;e++)this._selectionContains(e)&&t++;return t>0&&t!==this._items.length}_rowClick(t,e){const i=t.target;if("input"===i.tagName.toLowerCase()||"checkbox"===i.type)return;const s=this._findRow(t.target);if(this._findRowAction(t.target))return;if(this.enableRowClick)return void this.rowClick.emit({item:this._items[e],ctrlDown:this._ctrlDown});if(!this._enableRowSelection)return;const o=s?.querySelector('input[type="checkbox"]');o&&(o.checked=!o.checked,this._checkboxChange(o,e))}_findRow(t){return t?"p-table-row"===t?.tagName?.toLowerCase()?t:this._findRow(t?.parentElement):t}_findRowAction(t){return t?null!==t.dataset.isAction&&"false"!==t.dataset.isAction?t:"p-table-row"===t?.tagName?.toLowerCase()?null:this._findRowAction(t?.parentElement):null}_showFloatingMenu(){let t=this._rowActionsFloatingAll;1===this.rowSelectionLimit&&t.some((t=>("single"===t.type||"both"===t.type)&&t.showFunction))&&(t=t.filter((t=>"multi"===t.type||!t.showFunction||t.showFunction(this.selectedRows[0])))),this._rowActionsFloating=t,this._floatingMenuShown=!0}_parseDefinitions(t){return t.map((t=>this._parseDefinitionSizes(t)))}_parseDefinitionSizes(t){const e=t;let i={default:"full"};"string"!=typeof t.sizes||["auto","hidden","full"].includes(t.sizes)||(t.sizes=JSON.parse(t.sizes));for(const[t,s]of m.entries())i[s]="auto"!==e.sizes&&"hidden"!==e.sizes&&"full"!==e.sizes&&"number"!=typeof e.sizes?e.sizes[s]??i[m[t-1]]:"auto"===e.sizes?"full":e.sizes;return t.parsedSizes=i,t}static get watchers(){return{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}}static get style(){return"*{box-sizing:border-box}.static{position:static}.fixed{position:fixed}.z-0{z-index:0}.my-16{margin-bottom:4rem;margin-top:4rem}.mb-8{margin-bottom:2rem}.flex{display:flex}.table{display:table}.hidden{display:none}.h-6{height:1.5rem}.w-6{width:1.5rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.resize{resize:both}.flex-col{flex-direction:column}.self-center{align-self:center}.rounded{border-radius:.25rem}.opacity-0{opacity:0}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}"}},[772,"p-table",{items:[1],loading:[4],headerLoading:[4,"header-loading"],footerLoading:[4,"footer-loading"],amountOfLoadingRows:[2,"amount-of-loading-rows"],enableRowSelection:[4,"enable-row-selection"],rowSelectionLimit:[2,"row-selection-limit"],enableRowClick:[4,"enable-row-click"],selectedRows:[16],enableFloatingMenu:[4,"enable-floating-menu"],floatingMenuAmountSelectedTemplate:[16],selectionKey:[1,"selection-key"],canSelectKey:[1,"can-select-key"],enableHeader:[4,"enable-header"],quickFilters:[1,"quick-filters"],activeQuickFilterIdentifier:[1,"active-quick-filter-identifier"],enableSearch:[4,"enable-search"],query:[1025],enableFilter:[4,"enable-filter"],enableFilterDesktop:[4,"enable-filter-desktop"],selectedFiltersAmount:[2,"selected-filters-amount"],filterButtonTemplate:[16],enableAction:[4,"enable-action"],actionButtonLoading:[4,"action-button-loading"],actionButtonEnabled:[4,"action-button-enabled"],actionButtonIcon:[1,"action-button-icon"],actionButtonText:[1,"action-button-text"],actionButtonTemplate:[16],enableFooter:[4,"enable-footer"],enablePaginationSize:[4,"enable-pagination-size"],enablePaginationPages:[4,"enable-pagination-pages"],enableExport:[4,"enable-export"],page:[1538],total:[2],pageSize:[2,"page-size"],pageSizeOptions:[16],hideOnSinglePage:[4,"hide-on-single-page"],emptyStateHeader:[16],emptyStateContent:[16],emptyStateAction:[16],enableEmptyStateAction:[4,"enable-empty-state-action"],emptyStateFilteredHeader:[16],emptyStateFilteredContent:[16],shadow:[4],_locales:[32],_extraHeaders:[32],_columns:[32],_items:[32],_enableRowSelection:[32],_rowSelectionLimit:[32],_rowActionsFloating:[32],_rowActionsRow:[32],_footerHidden:[32]},[[16,"localeChanged","_setLocales"],[16,"tableDefinitionChanged","onTableDefinitionUpdated"],[4,"keydown","keyDown"],[4,"keyup","keyUp"],[4,"visibilitychange","visibilityChange"],[9,"resize","_setRowSelectionData"]],{items:[{_parseItems:0}],enableRowSelection:[{_setRowSelectionData:0}],rowSelectionLimit:[{_setRowSelectionData:0}],selectedRows:[{_setRowSelectionData:0}]}]);function K(){"undefined"!=typeof customElements&&["p-table","p-badge","p-button","p-checkbox","p-divider","p-dropdown","p-dropdown-menu-container","p-dropdown-menu-item","p-empty-state","p-field","p-field-container","p-floating-menu-container","p-floating-menu-item","p-helper","p-icon","p-illustration","p-loader","p-pagination","p-pagination-pages","p-pagination-pages-item","p-pagination-size","p-segment-container","p-segment-item","p-table-cell","p-table-container","p-table-footer","p-table-header","p-table-row","p-table-row-actions-container","p-tooltip"].forEach((e=>{switch(e){case"p-table":customElements.get(t(e))||customElements.define(t(e),M);break;case"p-badge":customElements.get(t(e))||u();break;case"p-button":customElements.get(t(e))||b();break;case"p-checkbox":customElements.get(t(e))||f();break;case"p-divider":customElements.get(t(e))||g();break;case"p-dropdown":customElements.get(t(e))||w();break;case"p-dropdown-menu-container":customElements.get(t(e))||k();break;case"p-dropdown-menu-item":customElements.get(t(e))||y();break;case"p-empty-state":customElements.get(t(e))||S();break;case"p-field":customElements.get(t(e))||_();break;case"p-field-container":customElements.get(t(e))||x();break;case"p-floating-menu-container":customElements.get(t(e))||C();break;case"p-floating-menu-item":customElements.get(t(e))||v();break;case"p-helper":customElements.get(t(e))||E();break;case"p-icon":customElements.get(t(e))||A();break;case"p-illustration":customElements.get(t(e))||F();break;case"p-loader":customElements.get(t(e))||j();break;case"p-pagination":customElements.get(t(e))||R();break;case"p-pagination-pages":customElements.get(t(e))||D();break;case"p-pagination-pages-item":customElements.get(t(e))||z();break;case"p-pagination-size":customElements.get(t(e))||B();break;case"p-segment-container":customElements.get(t(e))||L();break;case"p-segment-item":customElements.get(t(e))||H();break;case"p-table-cell":customElements.get(t(e))||T();break;case"p-table-container":customElements.get(t(e))||O();break;case"p-table-footer":customElements.get(t(e))||P();break;case"p-table-header":customElements.get(t(e))||q();break;case"p-table-row":customElements.get(t(e))||I();break;case"p-table-row-actions-container":customElements.get(t(e))||Q();break;case"p-tooltip":customElements.get(t(e))||U()}}))}K();const N=M,W=K;export{N as PTable,W as defineCustomElement}
@@ -1 +1 @@
1
- import{t,p as e,H as a,c as r,h as o}from"./p-CySg37XO.js";import{c as i}from"./p-CBWjHURv.js";import{T as d}from"./p-Au2WuEGF.js";import{d as c}from"./p-DLBcQv2y.js";const n=i("h-9 w-[2px] flex-shrink-0 rounded-full",{variants:{variant:{neutral:"\n bg-indigo-800\n dark:bg-indigo-400\n ",positive:"\n bg-positive-green-500\n dark:bg-positive-green-alternative\n ",biased:"\n bg-amber-500\n dark:bg-amber-alternative\n ",negative:"\n bg-negative-red-500\n dark:bg-negative-red-alternative\n "}}}),b=i(["flex items-center justify-between gap-2","w-[calc(100%-2px-0.5rem)]"]),s=e(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.action=r(this,"action",3)}variant="positive";header;content;enableAction=!0;actionIcon="negative";actionIconFlip;actionIconRotate;action;render(){return o(d,{key:"691f56d7bd82c2c908b4773e39bf327174af3784"},o("div",{key:"d7ea2273b9ac2685b2a6583d25f7e7236061eeda",class:"\n flex gap-2 rounded-lg border border-solid border-storm-100 bg-white p-2\n shadow-2\n dark:border-hurricane-800 dark:bg-hurricane-800\n ",onClick:()=>this._onClick()},o("div",{key:"e7dba6bb34063d4c20df2c16bd87be7dbbe53815",class:n({variant:this.variant})}),o("div",{key:"1fc1320c89627a6da22f3010abcb7c6b7af25109",class:b()},o("div",{key:"1122c87ff8fa6f3410d416ee223fc7532c723652",class:"flex w-full min-w-0 flex-col"},o("p",{key:"78ea333ecd424872e1a1e99b14e6427ec1b3a68d",class:"\n m-0 overflow-hidden text-ellipsis whitespace-nowrap text-sm\n font-semibold text-storm-500\n dark:text-white\n "},this.header?.length?this.header:o("slot",{name:"header"})),o("p",{key:"899613703dc181f980c2e45ef54d6aeb24d7f3ab",class:"\n m-0 w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs\n text-storm-300\n dark:text-hurricane-200\n "},this.content?.length?this.content:o("slot",{name:"content"}))),this.enableAction&&o("div",{key:"2fcede21976b5f039715905c282c0990f7b7b7cf",class:"\n flex-shrink-0 cursor-pointer p-2 text-storm-200\n hover:text-storm-500 hover:text-white\n dark:text-hurricane-200\n "},o("p-icon",{key:"12a6725ddedad306f9af430fb0e61f6ad3d4f9ef",flip:this.actionIconFlip,rotate:this.actionIconRotate,variant:this.actionIcon})))))}_onClick(){this.enableAction&&this.action.emit()}static get style(){return"*{box-sizing:border-box}.static{position:static}.m-0{margin:0}.flex{display:flex}.h-9{height:2.25rem}.w-\\[2px\\]{width:2px}.w-\\[calc\\(100\\%-2px-0\\.5rem\\)\\]{width:calc(100% - 2px - .5rem)}.w-full{width:100%}.min-w-0{min-width:0}.flex-shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.border-storm-100{--tw-border-opacity:1;border-color:rgb(209 210 212/var(--tw-border-opacity,1))}.bg-amber-500{--tw-bg-opacity:1;background-color:rgb(225 159 35/var(--tw-bg-opacity,1))}.bg-indigo-800{--tw-bg-opacity:1;background-color:rgb(27 88 210/var(--tw-bg-opacity,1))}.bg-negative-red-500{--tw-bg-opacity:1;background-color:rgb(230 30 30/var(--tw-bg-opacity,1))}.bg-positive-green-500{--tw-bg-opacity:1;background-color:rgb(92 195 14/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-2{padding:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-storm-200{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.shadow-2{--tw-shadow:0 1px 1px rgba(0,2,2,.04),0 2px 2px rgba(0,2,2,.04),0 4px 4px rgba(0,2,2,.04);--tw-shadow-colored:0 1px 1px var(--tw-shadow-color),0 2px 2px var(--tw-shadow-color),0 4px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:text-storm-500:hover{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.hover\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(24 30 41/var(--tw-border-opacity,1))}.dark\\:bg-amber-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 231 92/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(165 194 252/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-positive-green-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(98 255 92/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(24 30 41/var(--tw-border-opacity,1))}.dark\\:bg-amber-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 231 92/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-400:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(165 194 252/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-positive-green-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(98 255 92/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[769,"p-toast",{variant:[1],header:[1],content:[1],enableAction:[4,"enable-action"],actionIcon:[1,"action-icon"],actionIconFlip:[1,"action-icon-flip"],actionIconRotate:[2,"action-icon-rotate"]}]);function h(){"undefined"!=typeof customElements&&["p-toast","p-icon"].forEach((e=>{switch(e){case"p-toast":customElements.get(t(e))||customElements.define(t(e),s);break;case"p-icon":customElements.get(t(e))||c()}}))}h();const g=s,p=h;export{g as PToast,p as defineCustomElement}
1
+ import{t,p as e,H as a,c as r,h as o}from"./p-CySg37XO.js";import{c as i}from"./p-CBWjHURv.js";import{T as d}from"./p-Au2WuEGF.js";import{d as c}from"./p-aZcUXH1b.js";const n=i("h-9 w-[2px] flex-shrink-0 rounded-full",{variants:{variant:{neutral:"\n bg-indigo-800\n dark:bg-indigo-400\n ",positive:"\n bg-positive-green-500\n dark:bg-positive-green-alternative\n ",biased:"\n bg-amber-500\n dark:bg-amber-alternative\n ",negative:"\n bg-negative-red-500\n dark:bg-negative-red-alternative\n "}}}),b=i(["flex items-center justify-between gap-2","w-[calc(100%-2px-0.5rem)]"]),s=e(class extends a{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.action=r(this,"action",3)}variant="positive";header;content;enableAction=!0;actionIcon="negative";actionIconFlip;actionIconRotate;action;render(){return o(d,{key:"691f56d7bd82c2c908b4773e39bf327174af3784"},o("div",{key:"d7ea2273b9ac2685b2a6583d25f7e7236061eeda",class:"\n flex gap-2 rounded-lg border border-solid border-storm-100 bg-white p-2\n shadow-2\n dark:border-hurricane-800 dark:bg-hurricane-800\n ",onClick:()=>this._onClick()},o("div",{key:"e7dba6bb34063d4c20df2c16bd87be7dbbe53815",class:n({variant:this.variant})}),o("div",{key:"1fc1320c89627a6da22f3010abcb7c6b7af25109",class:b()},o("div",{key:"1122c87ff8fa6f3410d416ee223fc7532c723652",class:"flex w-full min-w-0 flex-col"},o("p",{key:"78ea333ecd424872e1a1e99b14e6427ec1b3a68d",class:"\n m-0 overflow-hidden text-ellipsis whitespace-nowrap text-sm\n font-semibold text-storm-500\n dark:text-white\n "},this.header?.length?this.header:o("slot",{name:"header"})),o("p",{key:"899613703dc181f980c2e45ef54d6aeb24d7f3ab",class:"\n m-0 w-full overflow-hidden text-ellipsis whitespace-nowrap text-xs\n text-storm-300\n dark:text-hurricane-200\n "},this.content?.length?this.content:o("slot",{name:"content"}))),this.enableAction&&o("div",{key:"2fcede21976b5f039715905c282c0990f7b7b7cf",class:"\n flex-shrink-0 cursor-pointer p-2 text-storm-200\n hover:text-storm-500 hover:text-white\n dark:text-hurricane-200\n "},o("p-icon",{key:"12a6725ddedad306f9af430fb0e61f6ad3d4f9ef",flip:this.actionIconFlip,rotate:this.actionIconRotate,variant:this.actionIcon})))))}_onClick(){this.enableAction&&this.action.emit()}static get style(){return"*{box-sizing:border-box}.static{position:static}.m-0{margin:0}.flex{display:flex}.h-9{height:2.25rem}.w-\\[2px\\]{width:2px}.w-\\[calc\\(100\\%-2px-0\\.5rem\\)\\]{width:calc(100% - 2px - .5rem)}.w-full{width:100%}.min-w-0{min-width:0}.flex-shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-solid{border-style:solid}.border-storm-100{--tw-border-opacity:1;border-color:rgb(209 210 212/var(--tw-border-opacity,1))}.bg-amber-500{--tw-bg-opacity:1;background-color:rgb(225 159 35/var(--tw-bg-opacity,1))}.bg-indigo-800{--tw-bg-opacity:1;background-color:rgb(27 88 210/var(--tw-bg-opacity,1))}.bg-negative-red-500{--tw-bg-opacity:1;background-color:rgb(230 30 30/var(--tw-bg-opacity,1))}.bg-positive-green-500{--tw-bg-opacity:1;background-color:rgb(92 195 14/var(--tw-bg-opacity,1))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.p-2{padding:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-storm-200{--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.shadow-2{--tw-shadow:0 1px 1px rgba(0,2,2,.04),0 2px 2px rgba(0,2,2,.04),0 4px 4px rgba(0,2,2,.04);--tw-shadow-colored:0 1px 1px var(--tw-shadow-color),0 2px 2px var(--tw-shadow-color),0 4px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:text-storm-500:hover{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.hover\\:text-white:hover{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-border-opacity:1;border-color:rgb(24 30 41/var(--tw-border-opacity,1))}.dark\\:bg-amber-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 231 92/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-800:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(165 194 252/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-positive-green-alternative:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(98 255 92/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:border-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-border-opacity:1;border-color:rgb(24 30 41/var(--tw-border-opacity,1))}.dark\\:bg-amber-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 231 92/var(--tw-bg-opacity,1))}.dark\\:bg-hurricane-800:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(24 30 41/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-400:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(165 194 252/var(--tw-bg-opacity,1))}.dark\\:bg-negative-red-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(255 92 92/var(--tw-bg-opacity,1))}.dark\\:bg-positive-green-alternative:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(98 255 92/var(--tw-bg-opacity,1))}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}"}},[769,"p-toast",{variant:[1],header:[1],content:[1],enableAction:[4,"enable-action"],actionIcon:[1,"action-icon"],actionIconFlip:[1,"action-icon-flip"],actionIconRotate:[2,"action-icon-rotate"]}]);function h(){"undefined"!=typeof customElements&&["p-toast","p-icon"].forEach((e=>{switch(e){case"p-toast":customElements.get(t(e))||customElements.define(t(e),s);break;case"p-icon":customElements.get(t(e))||c()}}))}h();const g=s,p=h;export{g as PToast,p as defineCustomElement}
@@ -735,6 +735,13 @@ var integration = `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1
735
735
  </svg>
736
736
  `;
737
737
 
738
+ var lamp = `<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
739
+ <path d="M5.5 14.5H10.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
740
+ <path d="M4.91874 10.4375C4.32434 9.97317 3.8429 9.38018 3.51058 8.70308C3.17825 8.02598 3.00368 7.28238 2.99999 6.52813C2.98499 3.81813 5.16999 1.5625 7.87936 1.5C8.92937 1.47457 9.96072 1.78044 10.8271 2.37421C11.6935 2.96799 12.3508 3.81951 12.706 4.80797C13.0611 5.79643 13.0959 6.87162 12.8055 7.88099C12.5151 8.89036 11.9142 9.78265 11.0881 10.4313C10.9059 10.5725 10.7582 10.7535 10.6563 10.9603C10.5544 11.1671 10.501 11.3944 10.5 11.625V12C10.5 12.1326 10.4473 12.2598 10.3535 12.3536C10.2598 12.4473 10.1326 12.5 9.99999 12.5H5.99999C5.86738 12.5 5.7402 12.4473 5.64643 12.3536C5.55266 12.2598 5.49999 12.1326 5.49999 12V11.625C5.49975 11.3959 5.44727 11.1699 5.34655 10.9641C5.24583 10.7583 5.09952 10.5782 4.91874 10.4375Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
741
+ <path d="M8.5 3.5C9.75 3.71062 10.7881 4.75 11 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
742
+ </svg>
743
+ `;
744
+
738
745
  var language = `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 16 16">
739
746
  <g clip-path="url(#a)">
740
747
  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m15 13.5-3.5-7-3.5 7m1-2h5M6 2v1.5m-4 0h8m-2 0a6 6 0 0 1-6 6"/>
@@ -786,6 +793,17 @@ var mail = `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fil
786
793
  </svg>
787
794
  `;
788
795
 
796
+ var math = `<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
797
+ <path d="M2.5 4.5H6.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
798
+ <path d="M4.5 9.5V13.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
799
+ <path d="M2.5 11.5H6.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
800
+ <path d="M9.5 10.5H13.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
801
+ <path d="M9.5 12.5H13.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
802
+ <path d="M10 3L13 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
803
+ <path d="M13 3L10 6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
804
+ </svg>
805
+ `;
806
+
789
807
  var medal = `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 16 16">
790
808
  <g clip-path="url(#a)">
791
809
  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8 11A5 5 0 1 0 8 1a5 5 0 0 0 0 10Z"/>
@@ -871,6 +889,13 @@ var negative = `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em"
871
889
  </svg>
872
890
  `;
873
891
 
892
+ var newTab = `<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
893
+ <path d="M8.5 7.5L13.5 2.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
894
+ <path d="M13.5 6.5L13.4994 2.50062L9.5 2.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
895
+ <path d="M11.5 8.5V13C11.5 13.1326 11.4473 13.2598 11.3536 13.3536C11.2598 13.4473 11.1326 13.5 11 13.5H3C2.86739 13.5 2.74021 13.4473 2.64645 13.3536C2.55268 13.2598 2.5 13.1326 2.5 13V5C2.5 4.86739 2.55268 4.74021 2.64645 4.64645C2.74021 4.55268 2.86739 4.5 3 4.5H7.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
896
+ </svg>
897
+ `;
898
+
874
899
  var other = `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="none" viewBox="0 0 16 16">
875
900
  <g clip-path="url(#a)">
876
901
  <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm-5 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm10 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"/>
@@ -1111,7 +1136,6 @@ var sparkle = `<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em"
1111
1136
  `;
1112
1137
 
1113
1138
  var spinner = `<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1114
- <g clip-path="url(#clip0_4515_39790)">
1115
1139
  <path d="M8 2V4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1116
1140
  <path d="M12.2425 3.75757L10.8281 5.17194" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1117
1141
  <path d="M14 8H12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -1120,17 +1144,10 @@ var spinner = `<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xml
1120
1144
  <path d="M3.75751 12.2425L5.17188 10.8281" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1121
1145
  <path d="M2 8H4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1122
1146
  <path d="M3.75751 3.75757L5.17188 5.17194" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1123
- </g>
1124
- <defs>
1125
- <clipPath id="clip0_4515_39790">
1126
- <rect width="16" height="16" fill="white"/>
1127
- </clipPath>
1128
- </defs>
1129
1147
  </svg>
1130
1148
  `;
1131
1149
 
1132
1150
  var spinning = `<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1133
- <g clip-path="url(#clip0_4515_39800)">
1134
1151
  <path d="M8 2V4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1135
1152
  <path d="M14 8H12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1136
1153
  <path d="M12.2425 12.2425L10.8281 10.8281" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
@@ -1138,12 +1155,13 @@ var spinning = `<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xm
1138
1155
  <path d="M3.75751 12.2425L5.17188 10.8281" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1139
1156
  <path d="M2 8H4" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1140
1157
  <path d="M3.75751 3.75757L5.17188 5.17194" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1141
- </g>
1142
- <defs>
1143
- <clipPath id="clip0_4515_39800">
1144
- <rect width="16" height="16" fill="white"/>
1145
- </clipPath>
1146
- </defs>
1158
+ </svg>
1159
+ `;
1160
+
1161
+ var stack = `<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
1162
+ <path d="M2 11L8 14.5L14 11" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1163
+ <path d="M2 8L8 11.5L14 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1164
+ <path d="M2 5L8 8.5L14 5L8 1.5L2 5Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
1147
1165
  </svg>
1148
1166
  `;
1149
1167
 
@@ -1590,10 +1608,12 @@ const categorized = {
1590
1608
  hat,
1591
1609
  home,
1592
1610
  integration,
1611
+ lamp,
1593
1612
  language,
1594
1613
  laptop,
1595
1614
  location,
1596
1615
  mail,
1616
+ math,
1597
1617
  medal,
1598
1618
  menu,
1599
1619
  'menu-arrow': menuArrow,
@@ -1601,6 +1621,7 @@ const categorized = {
1601
1621
  moon,
1602
1622
  more,
1603
1623
  negative,
1624
+ 'new-tab': newTab,
1604
1625
  other,
1605
1626
  pay,
1606
1627
  pencil,
@@ -1622,6 +1643,7 @@ const categorized = {
1622
1643
  sparkle,
1623
1644
  spinner,
1624
1645
  spinning,
1646
+ stack,
1625
1647
  star,
1626
1648
  stroller,
1627
1649
  tag,
@@ -1726,10 +1748,12 @@ const icons = {
1726
1748
  hat,
1727
1749
  home,
1728
1750
  integration,
1751
+ lamp,
1729
1752
  language,
1730
1753
  laptop,
1731
1754
  location,
1732
1755
  mail,
1756
+ math,
1733
1757
  medal,
1734
1758
  menu,
1735
1759
  'menu-arrow': menuArrow,
@@ -1737,6 +1761,7 @@ const icons = {
1737
1761
  moon,
1738
1762
  more,
1739
1763
  negative,
1764
+ 'new-tab': newTab,
1740
1765
  other,
1741
1766
  pay,
1742
1767
  pencil,
@@ -1758,6 +1783,7 @@ const icons = {
1758
1783
  sparkle,
1759
1784
  spinner,
1760
1785
  spinning,
1786
+ stack,
1761
1787
  star,
1762
1788
  stroller,
1763
1789
  tag,
package/dist/esm/index.js CHANGED
@@ -2,7 +2,7 @@ import { s as screens } from './screens-CWO2YJCh.js';
2
2
  export { g as getScreenSize, b as getScreenSizeInPixels, a as getScreenSizeInRem, d as isBetweenScreens, i as isBiggerThanScreen, j as isDesktop, f as isMobile, c as isSmallerThanScreen, h as isTablet, e as isTouchDevice } from './screens-CWO2YJCh.js';
3
3
  export { i as initTheme, o as onStateChange, s as state, a as stateLocaleOptions, b as stateThemeOptions } from './state-BJbOyUuL.js';
4
4
  export { c as childOf, a as childOfComposed } from './child-of-TyZ7uPES.js';
5
- export { c as categorized, i as icons } from './icons-CXVK8SLW.js';
5
+ export { c as categorized, i as icons } from './icons-DPmts3W0.js';
6
6
  export { f as formatTranslation, g as getLocaleComponentStrings } from './localization-CwQG70_4.js';
7
7
  export { f as floatingMenuContainerClass, g as getTableCellColumnClasses, a as getTableCellSizes } from './table-helpers-Bvtfm-ta.js';
8
8
  export { o as objectGetByPath } from './object-get-by-path-CLLU0oUD.js';
@@ -3,7 +3,7 @@ import { c as cva } from './index-CO0T2jO4.js';
3
3
  import { T as ThemedHost } from './themed-host.component-CUNsbvgN.js';
4
4
  import { a as asBoolean } from './as-boolean-C5CTp9IA.js';
5
5
  import { c as cn } from './cn-CsNqHcjL.js';
6
- import { i as icons } from './icons-CXVK8SLW.js';
6
+ import { i as icons } from './icons-DPmts3W0.js';
7
7
  import './clsx-ChV9xqsO.js';
8
8
  import './state-BJbOyUuL.js';
9
9
 
@@ -2816,7 +2816,7 @@ function requireAnimationFrameAction () {
2816
2816
  return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
2817
2817
  }
2818
2818
  var actions = scheduler.actions;
2819
- if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
2819
+ if (id != null && id === scheduler._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
2820
2820
  animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
2821
2821
  scheduler._scheduled = undefined;
2822
2822
  }
@@ -2861,8 +2861,14 @@ function requireAnimationFrameScheduler () {
2861
2861
  }
2862
2862
  AnimationFrameScheduler.prototype.flush = function (action) {
2863
2863
  this._active = true;
2864
- var flushId = this._scheduled;
2865
- this._scheduled = undefined;
2864
+ var flushId;
2865
+ if (action) {
2866
+ flushId = action.id;
2867
+ }
2868
+ else {
2869
+ flushId = this._scheduled;
2870
+ this._scheduled = undefined;
2871
+ }
2866
2872
  var actions = this.actions;
2867
2873
  var error;
2868
2874
  action = action || actions.shift();
@@ -4012,11 +4018,13 @@ function requireEmptyError () {
4012
4018
  Object.defineProperty(EmptyError, "__esModule", { value: true });
4013
4019
  EmptyError.EmptyError = void 0;
4014
4020
  var createErrorClass_1 = /*@__PURE__*/ requireCreateErrorClass();
4015
- EmptyError.EmptyError = createErrorClass_1.createErrorClass(function (_super) { return function EmptyErrorImpl() {
4016
- _super(this);
4017
- this.name = 'EmptyError';
4018
- this.message = 'no elements in sequence';
4019
- }; });
4021
+ EmptyError.EmptyError = createErrorClass_1.createErrorClass(function (_super) {
4022
+ return function EmptyErrorImpl() {
4023
+ _super(this);
4024
+ this.name = 'EmptyError';
4025
+ this.message = 'no elements in sequence';
4026
+ };
4027
+ });
4020
4028
 
4021
4029
  return EmptyError;
4022
4030
  }
@@ -6827,7 +6835,7 @@ function requireDistinctUntilKeyChanged () {
6827
6835
  distinctUntilKeyChanged.distinctUntilKeyChanged = void 0;
6828
6836
  var distinctUntilChanged_1 = /*@__PURE__*/ requireDistinctUntilChanged();
6829
6837
  function distinctUntilKeyChanged$1(key, compare) {
6830
- return distinctUntilChanged_1.distinctUntilChanged(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });
6838
+ return distinctUntilChanged_1.distinctUntilChanged(function (x, y) { return (compare ? compare(x[key], y[key]) : x[key] === y[key]); });
6831
6839
  }
6832
6840
  distinctUntilKeyChanged.distinctUntilKeyChanged = distinctUntilKeyChanged$1;
6833
6841
 
@@ -7505,7 +7513,6 @@ function requireMerge () {
7505
7513
  Object.defineProperty(merge, "__esModule", { value: true });
7506
7514
  merge.merge = void 0;
7507
7515
  var lift_1 = /*@__PURE__*/ requireLift();
7508
- var argsOrArgArray_1 = /*@__PURE__*/ requireArgsOrArgArray();
7509
7516
  var mergeAll_1 = /*@__PURE__*/ requireMergeAll();
7510
7517
  var args_1 = /*@__PURE__*/ requireArgs();
7511
7518
  var from_1 = /*@__PURE__*/ requireFrom();
@@ -7516,7 +7523,6 @@ function requireMerge () {
7516
7523
  }
7517
7524
  var scheduler = args_1.popScheduler(args);
7518
7525
  var concurrent = args_1.popNumber(args, Infinity);
7519
- args = argsOrArgArray_1.argsOrArgArray(args);
7520
7526
  return lift_1.operate(function (source, subscriber) {
7521
7527
  mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray([source], __read(args)), scheduler)).subscribe(subscriber);
7522
7528
  });
package/dist/index.html CHANGED
@@ -1,4 +1,4 @@
1
- <!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" name="viewport"> <title>Stencil Component Starter</title> <link rel="modulepreload" href="/build/p-3a5ebbd7.js"><link rel="modulepreload" href="/build/p-6XOzWrsN.js"><link rel="modulepreload" href="/build/p-C5CTp9IA.js"><link rel="modulepreload" href="/build/p-CBWjHURv.js"><link rel="modulepreload" href="/build/p-CSySY6aC.js"><link rel="modulepreload" href="/build/p-CXVK8SLW.js"><link rel="modulepreload" href="/build/p-ChV9xqsO.js"><link rel="modulepreload" href="/build/p-xs4N_Y-0.js"><link rel="modulepreload" href="/build/p-yFtRjnrU.js"><script type="module" src="/build/p-3a5ebbd7.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> <link href="/build/p-ea6cc0bf.css" rel="stylesheet"> </head> <body> <p-button>Test</p-button> <script data-build="2026-02-19T13:22:19">
1
+ <!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" name="viewport"> <title>Stencil Component Starter</title> <link rel="modulepreload" href="/build/p-b47f3a0f.js"><link rel="modulepreload" href="/build/p-6XOzWrsN.js"><link rel="modulepreload" href="/build/p-C5CTp9IA.js"><link rel="modulepreload" href="/build/p-CBWjHURv.js"><link rel="modulepreload" href="/build/p-CSySY6aC.js"><link rel="modulepreload" href="/build/p-ChV9xqsO.js"><link rel="modulepreload" href="/build/p-DPmts3W0.js"><link rel="modulepreload" href="/build/p-xs4N_Y-0.js"><link rel="modulepreload" href="/build/p-yFtRjnrU.js"><script type="module" src="/build/p-b47f3a0f.js" data-stencil data-resources-url="/build/" data-stencil-namespace="paperless"></script> <script nomodule="" src="/build/paperless.js" data-stencil></script> <link href="/build/p-ea6cc0bf.css" rel="stylesheet"> </head> <body> <p-button>Test</p-button> <script data-build="2026-02-23T15:04:57">
2
2
  if ('serviceWorker' in navigator && location.protocol !== 'file:') {
3
3
  window.addEventListener('load', function() {
4
4
  navigator.serviceWorker.register('/sw.js')