@limetech/lime-elements 39.11.0 → 39.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js +4 -4
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +51 -9
- package/dist/cjs/limel-helper-line_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-masonry-layout.cjs.entry.js +213 -0
- package/dist/cjs/limel-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-popover_2.cjs.entry.js +2 -2
- package/dist/cjs/limel-portal_3.cjs.entry.js +4 -4
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-radio-button-group.cjs.entry.js +1 -1
- package/dist/cjs/limel-radio-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-select.cjs.entry.js +1 -1
- package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
- package/dist/cjs/limel-slider.cjs.entry.js +2 -2
- package/dist/cjs/limel-snackbar.cjs.entry.js +2 -2
- package/dist/cjs/limel-split-button.cjs.entry.js +2 -2
- package/dist/cjs/limel-switch.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +2 -2
- package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +3 -3
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +3 -3
- package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/date-picker/flatpickr-adapter/deferred-destroy.js +31 -0
- package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.js +10 -3
- package/dist/collection/components/date-picker/pickers/month-picker.js +1 -1
- package/dist/collection/components/date-picker/pickers/picker.js +7 -3
- package/dist/collection/components/date-picker/pickers/quarter-picker.js +1 -1
- package/dist/collection/components/date-picker/pickers/year-picker.js +1 -1
- package/dist/collection/components/masonry-layout/masonry-layout.css +21 -0
- package/dist/collection/components/masonry-layout/masonry-layout.js +267 -0
- package/dist/collection/components/menu/menu.js +1 -1
- package/dist/collection/components/menu-list/menu-list.js +1 -1
- package/dist/collection/components/menu-surface/menu-surface.js +1 -1
- package/dist/collection/components/notched-outline/notched-outline.js +1 -1
- package/dist/collection/components/picker/picker.js +1 -1
- package/dist/collection/components/popover/popover.js +1 -1
- package/dist/collection/components/popover-surface/popover-surface.js +1 -1
- package/dist/collection/components/portal/portal.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
- package/dist/collection/components/radio-button-group/radio-button.js +2 -2
- package/dist/collection/components/select/select.js +1 -1
- package/dist/collection/components/shortcut/shortcut.js +1 -1
- package/dist/collection/components/slider/slider.js +2 -2
- package/dist/collection/components/snackbar/snackbar.js +2 -2
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/split-button/split-button.js +2 -2
- package/dist/collection/components/switch/switch.js +1 -1
- package/dist/collection/components/tab-bar/tab-bar.js +2 -2
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/table/table.js +3 -3
- package/dist/collection/components/text-editor/link-menu/editor-link-menu.js +3 -3
- package/dist/collection/components/text-editor/prosemirror-adapter/prosemirror-adapter.js +1 -1
- package/dist/collection/components/text-editor/text-editor.js +1 -1
- package/dist/collection/components/tooltip/tooltip-content.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-breadcrumbs_7.entry.js +4 -4
- package/dist/esm/limel-flatpickr-adapter.entry.js +51 -9
- package/dist/esm/limel-helper-line_2.entry.js +1 -1
- package/dist/esm/limel-masonry-layout.entry.js +211 -0
- package/dist/esm/limel-picker.entry.js +1 -1
- package/dist/esm/limel-popover_2.entry.js +2 -2
- package/dist/esm/limel-portal_3.entry.js +4 -4
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-radio-button-group.entry.js +1 -1
- package/dist/esm/limel-radio-button.entry.js +2 -2
- package/dist/esm/limel-select.entry.js +1 -1
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-slider.entry.js +2 -2
- package/dist/esm/limel-snackbar.entry.js +2 -2
- package/dist/esm/limel-split-button.entry.js +2 -2
- package/dist/esm/limel-switch.entry.js +1 -1
- package/dist/esm/limel-tab-bar.entry.js +2 -2
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +3 -3
- package/dist/esm/limel-text-editor-link-menu.entry.js +3 -3
- package/dist/esm/limel-text-editor.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-3d724fc2.entry.js → p-0ea2db02.entry.js} +1 -1
- package/dist/lime-elements/{p-730a05e3.entry.js → p-0f4b1953.entry.js} +1 -1
- package/dist/lime-elements/{p-2906606d.entry.js → p-173def13.entry.js} +1 -1
- package/dist/lime-elements/{p-fe993f80.entry.js → p-341857fa.entry.js} +1 -1
- package/dist/lime-elements/p-469ec146.entry.js +1 -0
- package/dist/lime-elements/p-58615011.entry.js +1 -0
- package/dist/lime-elements/{p-8203eea8.entry.js → p-79c797f5.entry.js} +1 -1
- package/dist/lime-elements/{p-1635ece7.entry.js → p-7e584d40.entry.js} +1 -1
- package/dist/lime-elements/{p-3f188493.entry.js → p-803ec458.entry.js} +1 -1
- package/dist/lime-elements/{p-e0716b51.entry.js → p-811c4820.entry.js} +1 -1
- package/dist/lime-elements/{p-c308e2a5.entry.js → p-8fed01b1.entry.js} +2 -2
- package/dist/lime-elements/{p-de203f64.entry.js → p-92539877.entry.js} +1 -1
- package/dist/lime-elements/{p-8805080c.entry.js → p-9728aa4a.entry.js} +1 -1
- package/dist/lime-elements/{p-89b35965.entry.js → p-a6fe98eb.entry.js} +1 -1
- package/dist/lime-elements/{p-8b106865.entry.js → p-bd77c457.entry.js} +1 -1
- package/dist/lime-elements/{p-3e68cbda.entry.js → p-c4e2885d.entry.js} +1 -1
- package/dist/lime-elements/{p-afd4be62.entry.js → p-d1477eca.entry.js} +1 -1
- package/dist/lime-elements/{p-9aa07388.entry.js → p-d1717de1.entry.js} +1 -1
- package/dist/lime-elements/{p-faceccc0.entry.js → p-d4d4236b.entry.js} +1 -1
- package/dist/lime-elements/{p-9015c90c.entry.js → p-e7438c81.entry.js} +1 -1
- package/dist/lime-elements/{p-50f51eb9.entry.js → p-fbdca779.entry.js} +1 -1
- package/dist/types/components/date-picker/flatpickr-adapter/deferred-destroy.d.ts +19 -0
- package/dist/types/components/date-picker/flatpickr-adapter/flatpickr-adapter.d.ts +2 -0
- package/dist/types/components/masonry-layout/masonry-layout.d.ts +94 -0
- package/dist/types/components.d.ts +90 -0
- package/package.json +1 -1
- package/dist/lime-elements/p-59716b48.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as l,H as t}from"./p-DBTJNfo7.js";const o=class{constructor(t){e(this,t),this.invalid=!1,this.hasContent=()=>!!(this.maxLength>0||this.helperText&&this.helperText.length>0),this.renderHelperText=()=>{if(this.helperText)return l("span",{class:"helper-text",id:this.helperTextId},this.helperText)},this.renderCharacterCounter=()=>{if(this.maxLength)return l("span",{class:"counter"},`${this.length} / ${this.maxLength}`)}}render(){return l(t,{key:"8ef6eb3b3e372e5dc61af1424a88c1c342023d13",tabIndex:-1,class:{invalid:this.invalid},style:this.hasContent()?{}:{display:"none"},"aria-hidden":!this.hasContent()},l("div",{key:"3b4e31c23f5964aabb67556e68bd1785c871d934"},this.renderHelperText(),this.renderCharacterCounter()))}};o.style=":host(limel-helper-line){transition:opacity 0.2s ease;box-sizing:border-box;display:grid;min-width:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:0.6875rem;line-height:normal;color:rgb(var(--contrast-1200))}div{display:flex;justify-content:space-between;gap:0.75rem;overflow:hidden;padding:0 1rem}:host(limel-helper-line.invalid){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-helper-line.invalid) .helper-text{color:var(--limel-theme-error-color)}.counter{flex-shrink:0;margin-left:auto}.helper-text,.counter{padding-top:0.125rem}:host(limel-helper-line){transition:grid-template-rows var(--limel-h-l-grid-template-rows-transition-speed, 0.46s) cubic-bezier(1, 0.09, 0, 0.89);grid-template-rows:var(--limel-h-l-grid-template-rows, 1fr)}:host(limel-helper-line.hide){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}";const i=class{constructor(l){e(this,l),this.required=!1,this.readonly=!1,this.invalid=!1,this.disabled=!1,this.hasValue=!1,this.hasLeadingIcon=!1,this.hasFloatingLabel=!1}render(){return l("div",{key:"
|
|
1
|
+
import{r as e,h as l,H as t}from"./p-DBTJNfo7.js";const o=class{constructor(t){e(this,t),this.invalid=!1,this.hasContent=()=>!!(this.maxLength>0||this.helperText&&this.helperText.length>0),this.renderHelperText=()=>{if(this.helperText)return l("span",{class:"helper-text",id:this.helperTextId},this.helperText)},this.renderCharacterCounter=()=>{if(this.maxLength)return l("span",{class:"counter"},`${this.length} / ${this.maxLength}`)}}render(){return l(t,{key:"8ef6eb3b3e372e5dc61af1424a88c1c342023d13",tabIndex:-1,class:{invalid:this.invalid},style:this.hasContent()?{}:{display:"none"},"aria-hidden":!this.hasContent()},l("div",{key:"3b4e31c23f5964aabb67556e68bd1785c871d934"},this.renderHelperText(),this.renderCharacterCounter()))}};o.style=":host(limel-helper-line){transition:opacity 0.2s ease;box-sizing:border-box;display:grid;min-width:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:0.6875rem;line-height:normal;color:rgb(var(--contrast-1200))}div{display:flex;justify-content:space-between;gap:0.75rem;overflow:hidden;padding:0 1rem}:host(limel-helper-line.invalid){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-helper-line.invalid) .helper-text{color:var(--limel-theme-error-color)}.counter{flex-shrink:0;margin-left:auto}.helper-text,.counter{padding-top:0.125rem}:host(limel-helper-line){transition:grid-template-rows var(--limel-h-l-grid-template-rows-transition-speed, 0.46s) cubic-bezier(1, 0.09, 0, 0.89);grid-template-rows:var(--limel-h-l-grid-template-rows, 1fr)}:host(limel-helper-line.hide){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}";const i=class{constructor(l){e(this,l),this.required=!1,this.readonly=!1,this.invalid=!1,this.disabled=!1,this.hasValue=!1,this.hasLeadingIcon=!1,this.hasFloatingLabel=!1}render(){return l("div",{key:"075d440c16ca092fd36dfc72b59937d09db55b50",class:"limel-notched-outline"},l("slot",{key:"5efa4c54ce73c15d7d259d2f8d856be9e40ebc16",name:"content"}),l("span",{key:"2ad07b5b8b404d2ac59b05de0a22e52c77ced6a3",class:"limel-notched-outline--outlines","aria-hidden":"true"},l("span",{key:"1f70d37ebf40173162e71b3ca4bd31bf14bf3dec",class:"limel-notched-outline--leading-outline"}),this.renderLabel(),l("span",{key:"0097c9838a78c1972a014faa4f6439f40c6dee66",class:"limel-notched-outline--trailing-outline"}),this.renderEmptyReadonlyValue()))}renderLabel(){if(this.label)return l("span",{class:"limel-notched-outline--notch"},l("label",{htmlFor:this.labelId},this.label))}renderEmptyReadonlyValue(){if(this.readonly&&!this.hasValue)return l("span",{class:"limel-notched-outline--empty-readonly-value","aria-hidden":"true"},"–")}};i.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}limel-notched-outline{--limel-notched-outline-border-color:rgba(var(--contrast-700), 0.65);--limel-notched-outline-background-color:rgba(var(--contrast-200), 0.5);display:block;width:100%;height:fit-content}.limel-notched-outline{position:relative;width:100%;height:100%}.limel-notched-outline [slot=content]{background-color:var(--limel-notched-outline-background-color);border-radius:var(--limel-notched-outline-border-radius, 0.25rem)}.limel-notched-outline--outlines{pointer-events:none;position:absolute;inset:0;z-index:var(--limel-notched-outline-z-index, 0);display:flex}.limel-notched-outline--leading-outline,.limel-notched-outline--notch,.limel-notched-outline--trailing-outline{transition:border-color 0.2s ease;border-width:1px;border-style:solid;border-color:var(--limel-notched-outline-border-color)}.limel-notched-outline--leading-outline{flex-shrink:0;width:0.75rem;border-right-width:0;border-top-left-radius:var(--limel-notched-outline-border-radius, 0.25rem);border-bottom-left-radius:var(--limel-notched-outline-border-radius, 0.25rem)}.limel-notched-outline--notch{flex-shrink:0;position:relative;z-index:2;border-top-color:var(--limel-notched-outline-notch-border-top-color, var(--limel-notched-outline-border-color));border-right-width:0;border-left-width:0;max-width:calc(100% - 1.5rem)}.limel-notched-outline--notch label{all:unset;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;position:relative;transition:color 0.2s ease, font-size 0.2s ease, transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);transform:translate3d(var(--limel-notched-outline-label-transform-x, 0), var(--limel-notched-outline-label-transform-y, 0.62rem), 0);display:block;padding:0 0.25rem;color:var(--limel-notched-outline-label-color, rgba(var(--contrast-1200), 1));font-size:var(--limel-notched-outline-label-font-size, var(--limel-theme-default-font-size));letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, 0.009375em);line-height:normal}.limel-notched-outline--notch label:after{position:absolute;right:0;padding:0 0.25rem}.limel-notched-outline--trailing-outline{flex-grow:1;border-left-width:0;border-top-right-radius:var(--limel-notched-outline-border-radius, 0.25rem);border-bottom-right-radius:var(--limel-notched-outline-border-radius, 0.25rem)}.limel-notched-outline--empty-readonly-value .lime-looks-like-input-value{line-height:1.75rem;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:rgba(var(--contrast-1400), 1);font-size:var(--limel-theme-default-font-size);font-weight:400;font-family:inherit;letter-spacing:0.009375em}.mdc-text-field--disabled .limel-notched-outline--empty-readonly-value .lime-looks-like-input-value{cursor:not-allowed;opacity:0.4}.limel-notched-outline--empty-readonly-value{position:absolute;top:0.62rem;left:1rem}limel-notched-outline:not([disabled]:not([disabled=false])):hover{--limel-notched-outline-border-color:rgba(var(--contrast-700), 1);--limel-notched-outline-background-color:rgba(var(--contrast-200), 1)}limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-visible),limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-within){--limel-notched-outline-border-color:var(--lime-primary-color, var(--limel-theme-primary-color));--limel-notched-outline-background-color:rgba(var(--contrast-100), 0.8)}limel-notched-outline[disabled]:not([disabled=false]){--limel-notched-outline-label-color:rgba(var(--contrast-1200), 0.5)}limel-notched-outline[required]:not([required=false]) .limel-notched-outline--notch label{padding-right:0.75rem}limel-notched-outline[required]:not([required=false]) .limel-notched-outline--notch label:after{content:"*";scale:1.3}limel-notched-outline[invalid]:not([invalid=false]):not([disabled]:not([disabled=false])){--limel-notched-outline-border-color:var( --limel-theme-error-text-color )}limel-notched-outline[invalid]:not([invalid=false]):not([disabled]:not([disabled=false])):hover{--limel-notched-outline-border-color:var( --limel-theme-error-color )}limel-notched-outline[invalid]:not([invalid=false]) .limel-notched-outline--notch label:after{color:var(--limel-theme-error-text-color)}limel-notched-outline[readonly]:not([readonly=false]){--limel-notched-outline-border-color:transparent !important;--limel-notched-outline-background-color:transparent !important}limel-notched-outline[readonly]:not([readonly=false]) .limel-notched-outline--notch label{transition-duration:0s}limel-notched-outline[has-leading-icon]:not([has-leading-icon=false]):not([has-floating-label]):not([has-value]){--limel-notched-outline-label-transform-x:1.25rem}limel-notched-outline[has-leading-icon] .limel-notched-outline--empty-readonly-value{left:2.25rem}limel-notched-outline:not([disabled]:not([disabled=false])):hover label,limel-notched-outline:not([disabled]:not([disabled=false])):focus label,limel-notched-outline:not([disabled]:not([disabled=false])):focus-within label{will-change:color, transform, font-size}limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-visible),limel-notched-outline:not([disabled]:not([disabled=false])):has([slot=content]:focus-within){--limel-notched-outline-label-font-size:0.65rem;--limel-notched-outline-label-transform-x:0;--limel-notched-outline-label-transform-y:calc(-50% - 0.09375rem);--limel-notched-outline-notch-border-top-color:transparent}limel-notched-outline[has-floating-label],limel-notched-outline[has-value]:not([has-value=false]),limel-notched-outline[readonly]:not([has-value]:not([has-value=true])){--limel-notched-outline-label-font-size:0.65rem;--limel-notched-outline-label-transform-x:0;--limel-notched-outline-label-transform-y:calc(-50% - 0.09375rem);--limel-notched-outline-notch-border-top-color:transparent}';export{o as limel_helper_line,i as limel_notched_outline}
|
|
@@ -87,7 +87,7 @@ var X,H;Y.style='@charset "UTF-8";:host([type=url]) .mdc-text-field--with-traili
|
|
|
87
87
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
88
88
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
89
89
|
* THE SOFTWARE.
|
|
90
|
-
*/class vt{constructor(){this.defaultConfig={isOpen:!0,badgeIcons:!1},this.getAriaOrientation=t=>"listbox"===t||"radiogroup"===t?"vertical":null,this.getIndexForWhichToApplyTabIndex=t=>{let e;for(let i=0,l=t.length;i<l;i+=1)if("separator"in t[i]);else{const l=t[i];if(l.disabled)continue;if(l.selected){e=i;break}void 0===e&&(e=i)}return e},this.renderListItem=(t,e)=>{var l;if("separator"in t)return i("li",{class:"mdc-deprecated-list-divider",role:"separator",key:`sep-${e}`},this.renderTextForSeparator(t),i("div",{class:"limel-list-divider-line"}));const n={};let r;e===this.applyTabIndexToItemAtIndex&&(n.tabindex="0"),r="radio"===this.config.type||"checkbox"===this.config.type?this.config.type:"selectable"===this.config.type?"option":"listitem";const d=null!==(l=t.id)&&void 0!==l?l:`item-${e}`;return i("limel-list-item",Object.assign({key:d,class:{"mdc-deprecated-list-item":!0,"mdc-deprecated-list-item--disabled":!!t.disabled}},n,{"data-index":e,type:r,text:t.text,secondaryText:t.secondaryText,icon:t.icon,image:t.image,primaryComponent:t.primaryComponent,badgeIcon:this.config.badgeIcons,iconSize:this.config.iconSize,selected:t.selected,disabled:t.disabled,actions:t.actions}))},this.renderTextForSeparator=t=>{if("text"in t)return i("h2",{class:"limel-list-divider-title"},t.text)}}render(t,e={}){let l;switch(t=t||[],this.config=Object.assign(Object.assign({},this.defaultConfig),e),this.config.type){case"checkbox":l="group";break;case"radio":l="radiogroup";break;default:l="listbox"}return this.applyTabIndexToItemAtIndex=this.getIndexForWhichToApplyTabIndex(t),i("ul",{class:"mdc-deprecated-list",role:l,"aria-orientation":this.getAriaOrientation(l)},t.map(this.renderListItem))}}const{ACTION_EVENT:_t}=W,yt=class{constructor(i){t(this,i),this.change=e(this,"change"),this.select=e(this,"select"),this.interact=e(this,"interact"),this.iconSize="small",this.maxLinesSecondaryText=3,this.listRenderer=new vt,this.setup=()=>{this.setupList(),this.setupListeners()},this.setupList=()=>{this.mdcList&&(this.teardown(),this.mdcList=null);const t=this.element.shadowRoot.querySelector(".mdc-deprecated-list");t&&(this.mdcList=new gt(t),this.mdcList.hasTypeahead=!0)},this.setupListeners=()=>{this.mdcList&&(this.mdcList.unlisten(_t,this.handleAction),this.selectable=["selectable","radio","checkbox"].includes(this.type),this.multiple="checkbox"===this.type,this.selectable&&(this.mdcList.listen(_t,this.handleAction),this.mdcList.singleSelection=!this.multiple))},this.teardown=()=>{var t,e;null===(t=this.mdcList)||void 0===t||t.unlisten(_t,this.handleAction),null===(e=this.mdcList)||void 0===e||e.destroy()},this.handleAction=t=>{this.multiple?this.handleMultiSelect(t.detail.index):this.handleSingleSelect(t.detail.index)},this.handleSingleSelect=t=>{const e=this.items.filter(this.isListItem);if(e[t].disabled)return;const i=e.find((t=>!!t.selected));let l;i&&("radio"!==this.type&&(this.mdcList.selectedIndex=-1),l=Object.assign(Object.assign({},i),{selected:!1}),this.change.emit(l)),e[t]!==i&&(l=Object.assign(Object.assign({},e[t]),{selected:!0}),this.change.emit(l)),this.interact.emit(l)},this.handleMultiSelect=t=>{const e=this.items.filter(this.isListItem);if(e[t].disabled)return;const i=e.filter(((e,i)=>i===t?!e.selected:e.selected)).map((t=>Object.assign(Object.assign({},t),{selected:!0})));this.change.emit(i),this.interact.emit(Object.assign({},i[t]))},this.isListItem=t=>!("separator"in t)}connectedCallback(){this.setup()}disconnectedCallback(){this.teardown()}componentDidLoad(){this.setup(),this.triggerIconColorWarning()}render(){var t;this.config={badgeIcons:this.badgeIcons,type:this.type,iconSize:this.iconSize};let e=+(null===(t=this.maxLinesSecondaryText)||void 0===t?void 0:t.toFixed());this.maxLinesSecondaryText<1&&(e=1);const l=this.listRenderer.render(this.items,this.config);return i(n,{key:"cbe0fda77189118ad3515dc3c4ab02c6cd9bc58a",style:{"--maxLinesSecondaryText":`${e}`}},l)}handleType(){this.setupListeners()}itemsChanged(){this.mdcList&&setTimeout((()=>{this.setup();const t=this.items.filter(this.isListItem);if(this.multiple)this.mdcList.selectedIndex=t.filter((t=>t.selected)).map((e=>t.indexOf(e)));else{const e=t.findIndex((t=>t.selected));-1===e?this.mdcList.initializeListType():this.mdcList.selectedIndex=e}}),0)}triggerIconColorWarning(){var t;(null===(t=this.items)||void 0===t?void 0:t.some((t=>"iconColor"in t)))&&console.warn("The `iconColor` prop is deprecated, has no visual effect anymore, and will soon be removed! Use the new `Icon` interface, and instead of `iconColor: 'color-name'` write `icon: { name: 'icon-name', color: 'color-name' }`.")}static get delegatesFocus(){return!0}get element(){return l(this)}static get watchers(){return{type:[{handleType:0}],items:[{itemsChanged:0}]}}};yt.style='@charset "UTF-8";:host(.has-striped-rows) .mdc-deprecated-list{border:1px solid rgb(var(--contrast-400))}:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even),:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even){background-color:var(--list-background-color-of-odd-interactive-items, rgb(var(--contrast-200)))}:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd),:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd){background-color:var(--list-background-color-of-even-interactive-items, rgb(var(--contrast-100)))}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]){transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible{will-change:color, background-color, box-shadow, transform}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover{box-shadow:var(--button-shadow-hovered)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host(.has-grid-layout){--gap:var(--list-grid-gap, 0.5rem);padding:var(--gap);}:host(.has-grid-layout) .mdc-deprecated-list{display:grid;gap:var(--gap);grid-template-columns:repeat(auto-fit, minmax(min(100%, max(var(--list-grid-item-max-width, 10rem) - var(--gap), var(--list-grid-item-min-width, 7.5rem))), 1fr));max-width:var(--list-grid-max-width, 100%)}:host(.has-grid-layout) .mdc-deprecated-list limel-list-item{border-radius:var(--limel-list-border-radius) !important}:host(.has-grid-layout) .mdc-deprecated-list-divider{grid-column:1/-1}:host(.static-actions-list){z-index:1;background-color:var(--limel-theme-surface-background-color)}:host(.has-position-sticky){position:sticky;box-shadow:0 0 0.75rem 0.5rem var(--limel-theme-surface-background-color)}:host(.has-position-sticky.is-on-top){top:0}:host(.has-position-sticky.is-at-bottom){bottom:0}:host(.is-on-top){border-bottom:1px solid rgb(var(--contrast-400));margin-bottom:0.5rem;padding-bottom:0.25rem}:host(.is-at-bottom){border-top:1px solid rgb(var(--contrast-400));margin-top:0.5rem;padding-top:0.25rem}:host(limel-list){--limel-list-border-radius:0.5rem;display:block;isolation:isolate}:host([hidden]){display:none}ul{--mdc-theme-text-icon-on-background:var( --icon-color, rgb(var(--contrast-900)) );margin:var(--list-margin, 0.25rem);border-radius:var(--limel-list-border-radius);padding:0;list-style:none}.mdc-deprecated-list-divider{border-bottom-color:transparent;display:flex;align-items:center;gap:0.75rem;height:auto;padding:0 0.5rem}.limel-list-divider-line{background-color:rgb(var(--contrast-400));height:0.125rem;border-radius:1rem;min-width:1rem;flex-grow:1}.limel-list-divider-title{all:unset;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:rgb(var(--contrast-900));font-size:var(--limel-theme-default-small-font-size)}';const wt={text:"",icon:{name:"home"},type:"icon-only"},kt=class{constructor(l){t(this,l),this.cancel=e(this,"cancel"),this.select=e(this,"select"),this.navigateMenu=e(this,"navigateMenu"),this.items=[],this.disabled=!1,this.openDirection="bottom-start",this.surfaceWidth="inherit-from-items",this.open=!1,this.badgeIcons=!1,this.gridLayout=!1,this.loading=!1,this.rootItem=wt,this.shouldRestoreFocusOnClose=!1,this.normalizedHotkeyCache=new Map,this.cachedSubMenuSource=null,this.cachedSubMenuItems=null,this.handleDocumentKeyDown=t=>{if(t.key===f&&this.open&&(this.shouldRestoreFocusOnClose=!0),!this.open||t.defaultPrevented||t.repeat)return;if(this.isFromTextInput(t)&&!this.hasModifier(t))return;const e=R(t);if(!e)return;if(this.isReservedMenuHotkey(e))return;const i=this.findMenuItemByHotkey(e);i&&(t.stopPropagation(),t.preventDefault(),this.handleSelect(i))},this.renderLoader=()=>{if(!this.loadingSubItems&&!this.loading)return;const t=this.getCssProperties();return i("div",{style:{width:t["--menu-surface-width"],display:"flex","align-items":"center","justify-content":"center",padding:"0.5rem 0"}},i("limel-spinner",{size:"mini",limeBranded:!1}))},this.renderBreadcrumb=()=>{const t=this.getBreadcrumbsItems();if(0!==t.length)return i("limel-breadcrumbs",{ref:this.setBreadcrumbsElement,style:{"border-bottom":"solid 1px rgb(var(--contrast-500))","flex-shrink":"0"},onSelect:this.handleBreadcrumbsSelect,onKeyDown:this.handleBreadcrumbsKeyDown,items:t})},this.handleBreadcrumbsSelect=t=>{if(!t.detail.menuItem)return this.currentSubMenu=null,this.clearSearch(),this.navigateMenu.emit(null),void this.setFocus();this.handleSelect(t.detail.menuItem)},this.renderSearchField=()=>{if(this.searcher)return i("limel-input-field",{tabindex:"0",ref:this.setSearchElement,placeholder:this.searchPlaceholder,type:"search",leadingIcon:"search",style:{padding:"0.25rem","box-sizing":"border-box"},value:this.searchValue,onChange:this.handleTextInput,onKeyDown:this.handleInputKeyDown})},this.renderEmptyMessage=()=>{var t;return this.loading||this.loadingSubItems||!this.emptyResultMessage||!Array.isArray(this.searchResults)||(null===(t=this.searchResults)||void 0===t?void 0:t.length)?null:i("p",{style:{padding:"0 1rem","text-align":"center"}},this.emptyResultMessage)},this.renderMenuList=()=>{let t=this.visibleItems;return(this.loadingSubItems||this.loading)&&(t=[]),i("limel-menu-list",{style:{"overflow-y":"auto","flex-grow":"1"},class:{"has-grid-layout has-interactive-items":this.gridLayout},items:t,badgeIcons:this.badgeIcons,onSelect:this.onSelect,ref:this.setListElement,onKeyDown:this.handleMenuKeyDown})},this.handleTextInput=async t=>{t.stopPropagation();const e=t.detail;if(this.searchValue=e,""===e)return this.searchResults=null,void(this.loadingSubItems=!1);this.loadingSubItems=!0;const i=await this.searcher(e);this.searchValue===e&&(this.searchResults=i,this.loadingSubItems=!1)},this.handleInputKeyDown=t=>{if(t.defaultPrevented)return;const e=t.key===c&&!t.altKey&&!t.metaKey&&!t.shiftKey,i=t.key===m,l=t.key===h;if(e||i||l)if(t.stopPropagation(),t.preventDefault(),e||l){if(this.focusBreadcrumbs())return;this.focusFirstListItem()}else i&&this.focusLastListItem()},this.handleListKeyDownCapture=t=>{const e=t.key===m,i=t.key===h;if(e||i)return e&&this.isFirstListItemFocused()?this.focusBreadcrumbs()?(t.stopPropagation(),void t.preventDefault()):void(this.searchInput&&(t.stopPropagation(),t.preventDefault(),this.searchInput.focus())):void(i&&this.isLastListItemFocused()&&this.searchInput&&(t.stopPropagation(),t.preventDefault(),this.searchInput.focus()))},this.handleMenuKeyDown=t=>{var e;const i=t.key===c&&!t.altKey&&!t.metaKey&&t.shiftKey,l=t.key===p,n=t.key===b;if(i||l||n){if(i)return t.stopPropagation(),t.preventDefault(),void(null===(e=this.searchInput)||void 0===e||e.focus());if(!this.gridLayout&&(l||n)){const e=this.getCurrentItem();t.stopPropagation(),t.preventDefault(),n?this.goForward(e):l&&this.goBack()}}},this.handleBreadcrumbsKeyDown=t=>{var e;const i=t.key===m,l=t.key===h;(i||l)&&(t.stopPropagation(),t.preventDefault(),i?null===(e=this.searchInput)||void 0===e||e.focus():l&&this.focusFirstListItem())},this.clearSearch=()=>{this.searchValue="",this.searchResults=null,this.loadingSubItems=!1},this.getCurrentItem=()=>{var t,e,i,l,n,r;let d=null!==(i=null===(e=null===(t=this.list)||void 0===t?void 0:t.shadowRoot)||void 0===e?void 0:e.activeElement)&&void 0!==i?i:null;d&&"menuitem"!==d.getAttribute("role")&&(d=d.closest('[role="menuitem"]')),d||(d=null===(n=null===(l=this.list)||void 0===l?void 0:l.shadowRoot)||void 0===n?void 0:n.querySelector('[role="menuitem"][tabindex="0"]'));const o=Number.parseInt(null!==(r=null==d?void 0:d.dataset.index)&&void 0!==r?r:"0",10),a=this.visibleItems[o];return null!=a?a:this.visibleItems[0]},this.goForward=t=>{this.handleSelect(t,!1)},this.goBack=()=>{if(!this.currentSubMenu)return;const t=this.currentSubMenu.parentItem;if(!t)return this.currentSubMenu=null,this.clearSearch(),this.navigateMenu.emit(null),void this.setFocus();this.handleSelect(t)},this.setTriggerAttributes=t=>{const e={"aria-haspopup":!0,"aria-expanded":this.open,"aria-controls":this.portalId,disabled:this.disabled,role:"button"};for(const[i,l]of Object.entries(e))l?t.setAttribute(i,String(l)):t.removeAttribute(i)},this.onClose=()=>{const t=this.shouldRestoreFocusOnClose;this.shouldRestoreFocusOnClose=!1,this.cancel.emit(),this.open=!1,this.currentSubMenu=null,t&&setTimeout(this.focusTrigger,0)},this.onTriggerClick=t=>{t.stopPropagation(),this.disabled||(this.open=!this.open)},this.handleSelect=async(t,e=!0)=>{if(Array.isArray(null==t?void 0:t.items)&&t.items.length>0)return this.selectedMenuItem=t,this.clearSearch(),this.currentSubMenu=t,this.navigateMenu.emit(t),void this.setFocus();if(M(null==t?void 0:t.items)){const e=t.items;this.selectedMenuItem=t,this.loadingSubItems=!0;const i=await e(t);if(this.selectedMenuItem!==t)return;if(t.items=i,this.loadingSubItems=!1,null==i?void 0:i.length)return this.currentSubMenu=t,this.clearSearch(),this.navigateMenu.emit(t),void this.setFocus()}e&&(this.selectedMenuItem=t,this.loadingSubItems=!1,this.select.emit(t),this.open=!1,this.currentSubMenu=null,setTimeout(this.focusTrigger,0))},this.onSelect=t=>{t.stopPropagation(),this.handleSelect(t.detail)},this.setListElement=t=>{this.list&&this.list.removeEventListener("keydown",this.handleListKeyDownCapture,!0),this.list=t,this.list&&this.list.addEventListener("keydown",this.handleListKeyDownCapture,!0)},this.setFocus=()=>{setTimeout((()=>{if(this.open)if(this.searchInput&&this.searcher){const t=new IntersectionObserver((()=>{t.unobserve(this.searchInput),this.searchInput!==window.document.activeElement&&this.searchInput.focus()}));t.observe(this.searchInput)}else if(this.list){const t=new IntersectionObserver((()=>{t.unobserve(this.list),this.focusMenuItem()}));t.observe(this.list)}}),0)},this.focusTrigger=()=>{var t,e;const i=null===(e=null===(t=this.triggerElement)||void 0===t?void 0:t.assignedElements())||void 0===e?void 0:e[0];S(i)},this.setSearchElement=t=>{this.searchInput=t},this.setBreadcrumbsElement=t=>{this.breadcrumbs=t},this.focusBreadcrumbs=()=>{var t;if(!this.breadcrumbs)return!1;const e=null===(t=this.breadcrumbs.shadowRoot)||void 0===t?void 0:t.querySelector("button, a");return!!e&&(e.focus(),!0)},this.focusFirstListItem=()=>{const t=this.getListItems(),e=null==t?void 0:t[0];null==e||e.focus()},this.focusLastListItem=()=>{const t=this.getListItems(),e=null==t?void 0:t.at(-1);null==e||e.focus()},this.isFirstListItemFocused=()=>{var t;const e=this.getListItems();return!!e&&e[0]===(null===(t=this.list.shadowRoot)||void 0===t?void 0:t.activeElement)},this.isLastListItemFocused=()=>{var t;const e=this.getListItems();return!!e&&e.at(-1)===(null===(t=this.list.shadowRoot)||void 0===t?void 0:t.activeElement)},this.getListItems=()=>{var t;if(!this.list)return null;const e=null===(t=this.list.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".mdc-deprecated-list-item");return(null==e?void 0:e.length)?[...e]:null},this.focusMenuItem=()=>{var t;if(!this.list)return;const e=this.list.shadowRoot.activeElement;null==e||e.blur();const i=this.visibleItems.filter(this.isMenuItem),l=Math.max(i.findIndex((t=>t.selected)),0);null===(t=[...this.list.shadowRoot.querySelectorAll('[role="menuitem"]')][l])||void 0===t||t.focus()},this.renderNotificationBadge=()=>{if(this.items.some(this.hasNotificationBadge))return i("limel-badge",null)},this.hasNotificationBadge=t=>this.isMenuItem(t)&&void 0!==t.badge,this.setTriggerRef=t=>{this.triggerElement=t},this.portalId=o()}componentDidRender(){this.host.shadowRoot.querySelector("slot").assignedElements().forEach(this.setTriggerAttributes)}render(){const t=this.getCssProperties(),e=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index"),l=this.getMenuSurfaceWidth(t["--menu-surface-width"]);return i("div",{key:"720330cf7d07c491a5a9e58a2567896f5526c45a",class:"mdc-menu-surface--anchor",onClick:this.onTriggerClick},i("slot",{key:"d3db72fa9e12bafbb039e6a94a1052edf64e060e",ref:this.setTriggerRef,name:"trigger"}),this.renderNotificationBadge(),i("limel-portal",{key:"591f97a745488fbff7eb8fc06b14d2f6e0d21fa6",visible:this.open,containerId:this.portalId,openDirection:this.openDirection,position:"absolute",containerStyle:{"z-index":e}},i("limel-menu-surface",{key:"829a9578894165b28100c4cab519ced0cb7689a0",open:this.open,onDismiss:this.onClose,style:Object.assign(Object.assign({},t),{"--menu-surface-width":l,"--limel-menu-surface-display":"flex","--limel-menu-surface-flex-direction":"column"}),class:{"has-grid-layout":this.gridLayout}},this.renderSearchField(),this.renderBreadcrumb(),this.renderLoader(),this.renderEmptyMessage(),this.renderMenuList())))}itemsWatcher(){this.clearSearch(),this.normalizedHotkeyCache.clear(),this.setFocus()}connectedCallback(){this.open&&document.addEventListener("keydown",this.handleDocumentKeyDown,!0)}disconnectedCallback(){document.removeEventListener("keydown",this.handleDocumentKeyDown,!0)}openWatcher(t){t?(document.addEventListener("keydown",this.handleDocumentKeyDown,!0),this.setFocus()):(document.removeEventListener("keydown",this.handleDocumentKeyDown,!0),this.clearSearch())}isFromTextInput(t){const e="function"==typeof t.composedPath?t.composedPath():[];for(const t of e){if(!(t instanceof HTMLElement))continue;if(t.isContentEditable)return!0;const e=t.tagName;if("INPUT"===e||"TEXTAREA"===e||"SELECT"===e)return!0}return!1}hasModifier(t){var e;return!(null===(e=t.getModifierState)||void 0===e?void 0:e.call(t,"AltGraph"))&&(t.ctrlKey||t.metaKey)}isReservedMenuHotkey(t){const e=D(t),i=e.at(-1);return!!i&&!(e.length>1||"arrowup"!==i&&"arrowdown"!==i&&"arrowleft"!==i&&"arrowright"!==i&&"tab"!==i&&"enter"!==i&&"space"!==i&&"escape"!==i)}findMenuItemByHotkey(t){for(const e of this.visibleItems){if(!this.isMenuItem(e)||e.disabled)continue;const i=e.hotkey;if(!i)continue;const l=this.getNormalizedHotkey(i);if(l&&l===t)return e}return null}getNormalizedHotkey(t){var e;const i=t.trim();if(this.normalizedHotkeyCache.has(i))return null!==(e=this.normalizedHotkeyCache.get(i))&&void 0!==e?e:null;const l=j(i);return this.normalizedHotkeyCache.set(i,l),l}getBreadcrumbsItems(){const t=[];let e=this.currentSubMenu;for(;e;)t.push({text:e.text,icon:e.icon,menuItem:e}),e=e.parentItem;return(t.length>0||this.rootItem!==wt)&&t.push(this.rootItem),t.reverse()}getCssProperties(){const t=["--menu-surface-width","--list-grid-item-max-width","--list-grid-item-min-width","--list-grid-gap","--notification-badge-background-color","--notification-badge-text-color"],e=getComputedStyle(this.host),i=t.map((t=>e.getPropertyValue(t)));return L(t,i)}isMenuItem(t){return!("separator"in t)}getMenuSurfaceWidth(t){var e,i,l,n;if(t)return t;if("inherit-from-trigger"===this.surfaceWidth){const t=null===(e=this.triggerElement)||void 0===e?void 0:e.assignedElements();return(null==t?void 0:t.length)&&(null===(i=t[0])||void 0===i?void 0:i.clientWidth)?`${t[0].clientWidth}px`:""}return"inherit-from-menu"===this.surfaceWidth&&(null===(l=this.host)||void 0===l?void 0:l.clientWidth)?`${null===(n=this.host)||void 0===n?void 0:n.clientWidth}px`:""}get visibleItems(){var t;return Array.isArray(this.searchResults)&&this.searchValue?this.searchResults:Array.isArray(null===(t=this.currentSubMenu)||void 0===t?void 0:t.items)?(this.cachedSubMenuSource!==this.currentSubMenu&&(this.cachedSubMenuSource=this.currentSubMenu,this.cachedSubMenuItems=this.currentSubMenu.items.map((t=>Object.assign(Object.assign({},t),{parentItem:this.currentSubMenu})))),this.cachedSubMenuItems):this.items}get host(){return l(this)}static get watchers(){return{items:[{itemsWatcher:0}],open:[{openWatcher:0}]}}};kt.style=":host(limel-menu){isolation:isolate;position:relative;display:inline-block;--badge-background-color:var( --notification-badge-background-color, rgb(var(--color-red-default)) );--badge-text-color:var( --notification-badge-text-color, rgb(var(--color-white)) )}:host([hidden]){display:none}.menu__trigger{border-color:transparent;border-width:1px;border-style:solid;background:none;color:rgb(var(--contrast-800));height:2.25rem}.menu__trigger-enabled:hover{border-color:rgb(var(--contrast-800));color:rgb(var(--contrast-1100))}.mdc-menu-surface--anchor{position:relative}limel-badge{position:absolute;top:-0.25rem;right:-0.25rem}";
|
|
90
|
+
*/class vt{constructor(){this.defaultConfig={isOpen:!0,badgeIcons:!1},this.getAriaOrientation=t=>"listbox"===t||"radiogroup"===t?"vertical":null,this.getIndexForWhichToApplyTabIndex=t=>{let e;for(let i=0,l=t.length;i<l;i+=1)if("separator"in t[i]);else{const l=t[i];if(l.disabled)continue;if(l.selected){e=i;break}void 0===e&&(e=i)}return e},this.renderListItem=(t,e)=>{var l;if("separator"in t)return i("li",{class:"mdc-deprecated-list-divider",role:"separator",key:`sep-${e}`},this.renderTextForSeparator(t),i("div",{class:"limel-list-divider-line"}));const n={};let r;e===this.applyTabIndexToItemAtIndex&&(n.tabindex="0"),r="radio"===this.config.type||"checkbox"===this.config.type?this.config.type:"selectable"===this.config.type?"option":"listitem";const d=null!==(l=t.id)&&void 0!==l?l:`item-${e}`;return i("limel-list-item",Object.assign({key:d,class:{"mdc-deprecated-list-item":!0,"mdc-deprecated-list-item--disabled":!!t.disabled}},n,{"data-index":e,type:r,text:t.text,secondaryText:t.secondaryText,icon:t.icon,image:t.image,primaryComponent:t.primaryComponent,badgeIcon:this.config.badgeIcons,iconSize:this.config.iconSize,selected:t.selected,disabled:t.disabled,actions:t.actions}))},this.renderTextForSeparator=t=>{if("text"in t)return i("h2",{class:"limel-list-divider-title"},t.text)}}render(t,e={}){let l;switch(t=t||[],this.config=Object.assign(Object.assign({},this.defaultConfig),e),this.config.type){case"checkbox":l="group";break;case"radio":l="radiogroup";break;default:l="listbox"}return this.applyTabIndexToItemAtIndex=this.getIndexForWhichToApplyTabIndex(t),i("ul",{class:"mdc-deprecated-list",role:l,"aria-orientation":this.getAriaOrientation(l)},t.map(this.renderListItem))}}const{ACTION_EVENT:_t}=W,yt=class{constructor(i){t(this,i),this.change=e(this,"change"),this.select=e(this,"select"),this.interact=e(this,"interact"),this.iconSize="small",this.maxLinesSecondaryText=3,this.listRenderer=new vt,this.setup=()=>{this.setupList(),this.setupListeners()},this.setupList=()=>{this.mdcList&&(this.teardown(),this.mdcList=null);const t=this.element.shadowRoot.querySelector(".mdc-deprecated-list");t&&(this.mdcList=new gt(t),this.mdcList.hasTypeahead=!0)},this.setupListeners=()=>{this.mdcList&&(this.mdcList.unlisten(_t,this.handleAction),this.selectable=["selectable","radio","checkbox"].includes(this.type),this.multiple="checkbox"===this.type,this.selectable&&(this.mdcList.listen(_t,this.handleAction),this.mdcList.singleSelection=!this.multiple))},this.teardown=()=>{var t,e;null===(t=this.mdcList)||void 0===t||t.unlisten(_t,this.handleAction),null===(e=this.mdcList)||void 0===e||e.destroy()},this.handleAction=t=>{this.multiple?this.handleMultiSelect(t.detail.index):this.handleSingleSelect(t.detail.index)},this.handleSingleSelect=t=>{const e=this.items.filter(this.isListItem);if(e[t].disabled)return;const i=e.find((t=>!!t.selected));let l;i&&("radio"!==this.type&&(this.mdcList.selectedIndex=-1),l=Object.assign(Object.assign({},i),{selected:!1}),this.change.emit(l)),e[t]!==i&&(l=Object.assign(Object.assign({},e[t]),{selected:!0}),this.change.emit(l)),this.interact.emit(l)},this.handleMultiSelect=t=>{const e=this.items.filter(this.isListItem);if(e[t].disabled)return;const i=e.filter(((e,i)=>i===t?!e.selected:e.selected)).map((t=>Object.assign(Object.assign({},t),{selected:!0})));this.change.emit(i),this.interact.emit(Object.assign({},i[t]))},this.isListItem=t=>!("separator"in t)}connectedCallback(){this.setup()}disconnectedCallback(){this.teardown()}componentDidLoad(){this.setup(),this.triggerIconColorWarning()}render(){var t;this.config={badgeIcons:this.badgeIcons,type:this.type,iconSize:this.iconSize};let e=+(null===(t=this.maxLinesSecondaryText)||void 0===t?void 0:t.toFixed());this.maxLinesSecondaryText<1&&(e=1);const l=this.listRenderer.render(this.items,this.config);return i(n,{key:"cbe0fda77189118ad3515dc3c4ab02c6cd9bc58a",style:{"--maxLinesSecondaryText":`${e}`}},l)}handleType(){this.setupListeners()}itemsChanged(){this.mdcList&&setTimeout((()=>{this.setup();const t=this.items.filter(this.isListItem);if(this.multiple)this.mdcList.selectedIndex=t.filter((t=>t.selected)).map((e=>t.indexOf(e)));else{const e=t.findIndex((t=>t.selected));-1===e?this.mdcList.initializeListType():this.mdcList.selectedIndex=e}}),0)}triggerIconColorWarning(){var t;(null===(t=this.items)||void 0===t?void 0:t.some((t=>"iconColor"in t)))&&console.warn("The `iconColor` prop is deprecated, has no visual effect anymore, and will soon be removed! Use the new `Icon` interface, and instead of `iconColor: 'color-name'` write `icon: { name: 'icon-name', color: 'color-name' }`.")}static get delegatesFocus(){return!0}get element(){return l(this)}static get watchers(){return{type:[{handleType:0}],items:[{itemsChanged:0}]}}};yt.style='@charset "UTF-8";:host(.has-striped-rows) .mdc-deprecated-list{border:1px solid rgb(var(--contrast-400))}:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even),:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even){background-color:var(--list-background-color-of-odd-interactive-items, rgb(var(--contrast-200)))}:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd),:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd){background-color:var(--list-background-color-of-even-interactive-items, rgb(var(--contrast-100)))}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]){transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible{will-change:color, background-color, box-shadow, transform}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover{box-shadow:var(--button-shadow-hovered)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host(.has-grid-layout){--gap:var(--list-grid-gap, 0.5rem);padding:var(--gap);}:host(.has-grid-layout) .mdc-deprecated-list{display:grid;gap:var(--gap);grid-template-columns:repeat(auto-fit, minmax(min(100%, max(var(--list-grid-item-max-width, 10rem) - var(--gap), var(--list-grid-item-min-width, 7.5rem))), 1fr));max-width:var(--list-grid-max-width, 100%)}:host(.has-grid-layout) .mdc-deprecated-list limel-list-item{border-radius:var(--limel-list-border-radius) !important}:host(.has-grid-layout) .mdc-deprecated-list-divider{grid-column:1/-1}:host(.static-actions-list){z-index:1;background-color:var(--limel-theme-surface-background-color)}:host(.has-position-sticky){position:sticky;box-shadow:0 0 0.75rem 0.5rem var(--limel-theme-surface-background-color)}:host(.has-position-sticky.is-on-top){top:0}:host(.has-position-sticky.is-at-bottom){bottom:0}:host(.is-on-top){border-bottom:1px solid rgb(var(--contrast-400));margin-bottom:0.5rem;padding-bottom:0.25rem}:host(.is-at-bottom){border-top:1px solid rgb(var(--contrast-400));margin-top:0.5rem;padding-top:0.25rem}:host(limel-list){--limel-list-border-radius:0.5rem;display:block;isolation:isolate}:host([hidden]){display:none}ul{--mdc-theme-text-icon-on-background:var( --icon-color, rgb(var(--contrast-900)) );margin:var(--list-margin, 0.25rem);border-radius:var(--limel-list-border-radius);padding:0;list-style:none}.mdc-deprecated-list-divider{border-bottom-color:transparent;display:flex;align-items:center;gap:0.75rem;height:auto;padding:0 0.5rem}.limel-list-divider-line{background-color:rgb(var(--contrast-400));height:0.125rem;border-radius:1rem;min-width:1rem;flex-grow:1}.limel-list-divider-title{all:unset;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:rgb(var(--contrast-900));font-size:var(--limel-theme-default-small-font-size)}';const wt={text:"",icon:{name:"home"},type:"icon-only"},kt=class{constructor(l){t(this,l),this.cancel=e(this,"cancel"),this.select=e(this,"select"),this.navigateMenu=e(this,"navigateMenu"),this.items=[],this.disabled=!1,this.openDirection="bottom-start",this.surfaceWidth="inherit-from-items",this.open=!1,this.badgeIcons=!1,this.gridLayout=!1,this.loading=!1,this.rootItem=wt,this.shouldRestoreFocusOnClose=!1,this.normalizedHotkeyCache=new Map,this.cachedSubMenuSource=null,this.cachedSubMenuItems=null,this.handleDocumentKeyDown=t=>{if(t.key===f&&this.open&&(this.shouldRestoreFocusOnClose=!0),!this.open||t.defaultPrevented||t.repeat)return;if(this.isFromTextInput(t)&&!this.hasModifier(t))return;const e=R(t);if(!e)return;if(this.isReservedMenuHotkey(e))return;const i=this.findMenuItemByHotkey(e);i&&(t.stopPropagation(),t.preventDefault(),this.handleSelect(i))},this.renderLoader=()=>{if(!this.loadingSubItems&&!this.loading)return;const t=this.getCssProperties();return i("div",{style:{width:t["--menu-surface-width"],display:"flex","align-items":"center","justify-content":"center",padding:"0.5rem 0"}},i("limel-spinner",{size:"mini",limeBranded:!1}))},this.renderBreadcrumb=()=>{const t=this.getBreadcrumbsItems();if(0!==t.length)return i("limel-breadcrumbs",{ref:this.setBreadcrumbsElement,style:{"border-bottom":"solid 1px rgb(var(--contrast-500))","flex-shrink":"0"},onSelect:this.handleBreadcrumbsSelect,onKeyDown:this.handleBreadcrumbsKeyDown,items:t})},this.handleBreadcrumbsSelect=t=>{if(!t.detail.menuItem)return this.currentSubMenu=null,this.clearSearch(),this.navigateMenu.emit(null),void this.setFocus();this.handleSelect(t.detail.menuItem)},this.renderSearchField=()=>{if(this.searcher)return i("limel-input-field",{tabindex:"0",ref:this.setSearchElement,placeholder:this.searchPlaceholder,type:"search",leadingIcon:"search",style:{padding:"0.25rem","box-sizing":"border-box"},value:this.searchValue,onChange:this.handleTextInput,onKeyDown:this.handleInputKeyDown})},this.renderEmptyMessage=()=>{var t;return this.loading||this.loadingSubItems||!this.emptyResultMessage||!Array.isArray(this.searchResults)||(null===(t=this.searchResults)||void 0===t?void 0:t.length)?null:i("p",{style:{padding:"0 1rem","text-align":"center"}},this.emptyResultMessage)},this.renderMenuList=()=>{let t=this.visibleItems;return(this.loadingSubItems||this.loading)&&(t=[]),i("limel-menu-list",{style:{"overflow-y":"auto","flex-grow":"1"},class:{"has-grid-layout has-interactive-items":this.gridLayout},items:t,badgeIcons:this.badgeIcons,onSelect:this.onSelect,ref:this.setListElement,onKeyDown:this.handleMenuKeyDown})},this.handleTextInput=async t=>{t.stopPropagation();const e=t.detail;if(this.searchValue=e,""===e)return this.searchResults=null,void(this.loadingSubItems=!1);this.loadingSubItems=!0;const i=await this.searcher(e);this.searchValue===e&&(this.searchResults=i,this.loadingSubItems=!1)},this.handleInputKeyDown=t=>{if(t.defaultPrevented)return;const e=t.key===c&&!t.altKey&&!t.metaKey&&!t.shiftKey,i=t.key===m,l=t.key===h;if(e||i||l)if(t.stopPropagation(),t.preventDefault(),e||l){if(this.focusBreadcrumbs())return;this.focusFirstListItem()}else i&&this.focusLastListItem()},this.handleListKeyDownCapture=t=>{const e=t.key===m,i=t.key===h;if(e||i)return e&&this.isFirstListItemFocused()?this.focusBreadcrumbs()?(t.stopPropagation(),void t.preventDefault()):void(this.searchInput&&(t.stopPropagation(),t.preventDefault(),this.searchInput.focus())):void(i&&this.isLastListItemFocused()&&this.searchInput&&(t.stopPropagation(),t.preventDefault(),this.searchInput.focus()))},this.handleMenuKeyDown=t=>{var e;const i=t.key===c&&!t.altKey&&!t.metaKey&&t.shiftKey,l=t.key===p,n=t.key===b;if(i||l||n){if(i)return t.stopPropagation(),t.preventDefault(),void(null===(e=this.searchInput)||void 0===e||e.focus());if(!this.gridLayout&&(l||n)){const e=this.getCurrentItem();t.stopPropagation(),t.preventDefault(),n?this.goForward(e):l&&this.goBack()}}},this.handleBreadcrumbsKeyDown=t=>{var e;const i=t.key===m,l=t.key===h;(i||l)&&(t.stopPropagation(),t.preventDefault(),i?null===(e=this.searchInput)||void 0===e||e.focus():l&&this.focusFirstListItem())},this.clearSearch=()=>{this.searchValue="",this.searchResults=null,this.loadingSubItems=!1},this.getCurrentItem=()=>{var t,e,i,l,n,r;let d=null!==(i=null===(e=null===(t=this.list)||void 0===t?void 0:t.shadowRoot)||void 0===e?void 0:e.activeElement)&&void 0!==i?i:null;d&&"menuitem"!==d.getAttribute("role")&&(d=d.closest('[role="menuitem"]')),d||(d=null===(n=null===(l=this.list)||void 0===l?void 0:l.shadowRoot)||void 0===n?void 0:n.querySelector('[role="menuitem"][tabindex="0"]'));const o=Number.parseInt(null!==(r=null==d?void 0:d.dataset.index)&&void 0!==r?r:"0",10),a=this.visibleItems[o];return null!=a?a:this.visibleItems[0]},this.goForward=t=>{this.handleSelect(t,!1)},this.goBack=()=>{if(!this.currentSubMenu)return;const t=this.currentSubMenu.parentItem;if(!t)return this.currentSubMenu=null,this.clearSearch(),this.navigateMenu.emit(null),void this.setFocus();this.handleSelect(t)},this.setTriggerAttributes=t=>{const e={"aria-haspopup":!0,"aria-expanded":this.open,"aria-controls":this.portalId,disabled:this.disabled,role:"button"};for(const[i,l]of Object.entries(e))l?t.setAttribute(i,String(l)):t.removeAttribute(i)},this.onClose=()=>{const t=this.shouldRestoreFocusOnClose;this.shouldRestoreFocusOnClose=!1,this.cancel.emit(),this.open=!1,this.currentSubMenu=null,t&&setTimeout(this.focusTrigger,0)},this.onTriggerClick=t=>{t.stopPropagation(),this.disabled||(this.open=!this.open)},this.handleSelect=async(t,e=!0)=>{if(Array.isArray(null==t?void 0:t.items)&&t.items.length>0)return this.selectedMenuItem=t,this.clearSearch(),this.currentSubMenu=t,this.navigateMenu.emit(t),void this.setFocus();if(M(null==t?void 0:t.items)){const e=t.items;this.selectedMenuItem=t,this.loadingSubItems=!0;const i=await e(t);if(this.selectedMenuItem!==t)return;if(t.items=i,this.loadingSubItems=!1,null==i?void 0:i.length)return this.currentSubMenu=t,this.clearSearch(),this.navigateMenu.emit(t),void this.setFocus()}e&&(this.selectedMenuItem=t,this.loadingSubItems=!1,this.select.emit(t),this.open=!1,this.currentSubMenu=null,setTimeout(this.focusTrigger,0))},this.onSelect=t=>{t.stopPropagation(),this.handleSelect(t.detail)},this.setListElement=t=>{this.list&&this.list.removeEventListener("keydown",this.handleListKeyDownCapture,!0),this.list=t,this.list&&this.list.addEventListener("keydown",this.handleListKeyDownCapture,!0)},this.setFocus=()=>{setTimeout((()=>{if(this.open)if(this.searchInput&&this.searcher){const t=new IntersectionObserver((()=>{t.unobserve(this.searchInput),this.searchInput!==window.document.activeElement&&this.searchInput.focus()}));t.observe(this.searchInput)}else if(this.list){const t=new IntersectionObserver((()=>{t.unobserve(this.list),this.focusMenuItem()}));t.observe(this.list)}}),0)},this.focusTrigger=()=>{var t,e;const i=null===(e=null===(t=this.triggerElement)||void 0===t?void 0:t.assignedElements())||void 0===e?void 0:e[0];S(i)},this.setSearchElement=t=>{this.searchInput=t},this.setBreadcrumbsElement=t=>{this.breadcrumbs=t},this.focusBreadcrumbs=()=>{var t;if(!this.breadcrumbs)return!1;const e=null===(t=this.breadcrumbs.shadowRoot)||void 0===t?void 0:t.querySelector("button, a");return!!e&&(e.focus(),!0)},this.focusFirstListItem=()=>{const t=this.getListItems(),e=null==t?void 0:t[0];null==e||e.focus()},this.focusLastListItem=()=>{const t=this.getListItems(),e=null==t?void 0:t.at(-1);null==e||e.focus()},this.isFirstListItemFocused=()=>{var t;const e=this.getListItems();return!!e&&e[0]===(null===(t=this.list.shadowRoot)||void 0===t?void 0:t.activeElement)},this.isLastListItemFocused=()=>{var t;const e=this.getListItems();return!!e&&e.at(-1)===(null===(t=this.list.shadowRoot)||void 0===t?void 0:t.activeElement)},this.getListItems=()=>{var t;if(!this.list)return null;const e=null===(t=this.list.shadowRoot)||void 0===t?void 0:t.querySelectorAll(".mdc-deprecated-list-item");return(null==e?void 0:e.length)?[...e]:null},this.focusMenuItem=()=>{var t;if(!this.list)return;const e=this.list.shadowRoot.activeElement;null==e||e.blur();const i=this.visibleItems.filter(this.isMenuItem),l=Math.max(i.findIndex((t=>t.selected)),0);null===(t=[...this.list.shadowRoot.querySelectorAll('[role="menuitem"]')][l])||void 0===t||t.focus()},this.renderNotificationBadge=()=>{if(this.items.some(this.hasNotificationBadge))return i("limel-badge",null)},this.hasNotificationBadge=t=>this.isMenuItem(t)&&void 0!==t.badge,this.setTriggerRef=t=>{this.triggerElement=t},this.portalId=o()}componentDidRender(){this.host.shadowRoot.querySelector("slot").assignedElements().forEach(this.setTriggerAttributes)}render(){const t=this.getCssProperties(),e=getComputedStyle(this.host).getPropertyValue("--dropdown-z-index"),l=this.getMenuSurfaceWidth(t["--menu-surface-width"]);return i("div",{key:"2092a7969b69b03062b4db3188b5c14e63cb20c5",class:"mdc-menu-surface--anchor",onClick:this.onTriggerClick},i("slot",{key:"a6b4e705ec6cf6b77d4a4071faee771b2bb3a86b",ref:this.setTriggerRef,name:"trigger"}),this.renderNotificationBadge(),i("limel-portal",{key:"c574ec67d773a18900cd9e85b6df4a7664f1018c",visible:this.open,containerId:this.portalId,openDirection:this.openDirection,position:"absolute",containerStyle:{"z-index":e}},i("limel-menu-surface",{key:"56edb093385ecc773f8a4abb8373b3c98c21f2d4",open:this.open,onDismiss:this.onClose,style:Object.assign(Object.assign({},t),{"--menu-surface-width":l,"--limel-menu-surface-display":"flex","--limel-menu-surface-flex-direction":"column"}),class:{"has-grid-layout":this.gridLayout}},this.renderSearchField(),this.renderBreadcrumb(),this.renderLoader(),this.renderEmptyMessage(),this.renderMenuList())))}itemsWatcher(){this.clearSearch(),this.normalizedHotkeyCache.clear(),this.setFocus()}connectedCallback(){this.open&&document.addEventListener("keydown",this.handleDocumentKeyDown,!0)}disconnectedCallback(){document.removeEventListener("keydown",this.handleDocumentKeyDown,!0)}openWatcher(t){t?(document.addEventListener("keydown",this.handleDocumentKeyDown,!0),this.setFocus()):(document.removeEventListener("keydown",this.handleDocumentKeyDown,!0),this.clearSearch())}isFromTextInput(t){const e="function"==typeof t.composedPath?t.composedPath():[];for(const t of e){if(!(t instanceof HTMLElement))continue;if(t.isContentEditable)return!0;const e=t.tagName;if("INPUT"===e||"TEXTAREA"===e||"SELECT"===e)return!0}return!1}hasModifier(t){var e;return!(null===(e=t.getModifierState)||void 0===e?void 0:e.call(t,"AltGraph"))&&(t.ctrlKey||t.metaKey)}isReservedMenuHotkey(t){const e=D(t),i=e.at(-1);return!!i&&!(e.length>1||"arrowup"!==i&&"arrowdown"!==i&&"arrowleft"!==i&&"arrowright"!==i&&"tab"!==i&&"enter"!==i&&"space"!==i&&"escape"!==i)}findMenuItemByHotkey(t){for(const e of this.visibleItems){if(!this.isMenuItem(e)||e.disabled)continue;const i=e.hotkey;if(!i)continue;const l=this.getNormalizedHotkey(i);if(l&&l===t)return e}return null}getNormalizedHotkey(t){var e;const i=t.trim();if(this.normalizedHotkeyCache.has(i))return null!==(e=this.normalizedHotkeyCache.get(i))&&void 0!==e?e:null;const l=j(i);return this.normalizedHotkeyCache.set(i,l),l}getBreadcrumbsItems(){const t=[];let e=this.currentSubMenu;for(;e;)t.push({text:e.text,icon:e.icon,menuItem:e}),e=e.parentItem;return(t.length>0||this.rootItem!==wt)&&t.push(this.rootItem),t.reverse()}getCssProperties(){const t=["--menu-surface-width","--list-grid-item-max-width","--list-grid-item-min-width","--list-grid-gap","--notification-badge-background-color","--notification-badge-text-color"],e=getComputedStyle(this.host),i=t.map((t=>e.getPropertyValue(t)));return L(t,i)}isMenuItem(t){return!("separator"in t)}getMenuSurfaceWidth(t){var e,i,l,n;if(t)return t;if("inherit-from-trigger"===this.surfaceWidth){const t=null===(e=this.triggerElement)||void 0===e?void 0:e.assignedElements();return(null==t?void 0:t.length)&&(null===(i=t[0])||void 0===i?void 0:i.clientWidth)?`${t[0].clientWidth}px`:""}return"inherit-from-menu"===this.surfaceWidth&&(null===(l=this.host)||void 0===l?void 0:l.clientWidth)?`${null===(n=this.host)||void 0===n?void 0:n.clientWidth}px`:""}get visibleItems(){var t;return Array.isArray(this.searchResults)&&this.searchValue?this.searchResults:Array.isArray(null===(t=this.currentSubMenu)||void 0===t?void 0:t.items)?(this.cachedSubMenuSource!==this.currentSubMenu&&(this.cachedSubMenuSource=this.currentSubMenu,this.cachedSubMenuItems=this.currentSubMenu.items.map((t=>Object.assign(Object.assign({},t),{parentItem:this.currentSubMenu})))),this.cachedSubMenuItems):this.items}get host(){return l(this)}static get watchers(){return{items:[{itemsWatcher:0}],open:[{openWatcher:0}]}}};kt.style=":host(limel-menu){isolation:isolate;position:relative;display:inline-block;--badge-background-color:var( --notification-badge-background-color, rgb(var(--color-red-default)) );--badge-text-color:var( --notification-badge-text-color, rgb(var(--color-white)) )}:host([hidden]){display:none}.menu__trigger{border-color:transparent;border-width:1px;border-style:solid;background:none;color:rgb(var(--contrast-800));height:2.25rem}.menu__trigger-enabled:hover{border-color:rgb(var(--contrast-800));color:rgb(var(--contrast-1100))}.mdc-menu-surface--anchor{position:relative}limel-badge{position:absolute;top:-0.25rem;right:-0.25rem}";
|
|
91
91
|
/**
|
|
92
92
|
* @license
|
|
93
93
|
* Copyright 2018 Google Inc.
|
|
@@ -245,4 +245,4 @@ var Mt=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))|
|
|
|
245
245
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
246
246
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
247
247
|
* THE SOFTWARE.
|
|
248
|
-
*/class Nt{constructor(){this.defaultConfig={isOpen:!0,badgeIcons:!1},this.getIndexForWhichToApplyTabIndex=t=>{let e;for(let i=0,l=t.length;i<l;i+=1)if("separator"in t[i]);else{const l=t[i];if(l.disabled)continue;if(l.selected){e=i;break}void 0===e&&(e=i)}return e},this.renderMenuItem=(t,e)=>{var l;if("separator"in t)return i("li",{class:"mdc-deprecated-list-divider",role:"separator",key:`sep-${e}`},this.renderTextForSeparator(t),i("div",{class:"limel-list-divider-line"}));const n={};e===this.applyTabIndexToItemAtIndex&&(n.tabindex="0");const r=this.hasSubItems(t),d=null!==(l=t.id)&&void 0!==l?l:`item-${e}`;return i("limel-list-item",Object.assign({key:d,class:{"mdc-deprecated-list-item":!0,"mdc-deprecated-list-item--disabled":!!t.disabled},"data-index":e},n,{"aria-haspopup":r?"menu":void 0,"aria-expanded":r?"false":void 0,type:"menuitem",text:t.text,secondaryText:t.secondaryText,icon:t.icon,primaryComponent:r||void 0!==t.badge||t.hotkey||t.commandText?{name:"limel-menu-item-meta",props:{commandText:t.commandText,hotkey:t.hotkey,disabled:!!t.disabled,badge:t.badge,showChevron:r}}:void 0,badgeIcon:this.config.badgeIcons,selected:t.selected,disabled:t.disabled}))},this.renderTextForSeparator=t=>{if("text"in t)return i("h2",{class:"limel-list-divider-title"},t.text)},this.hasSubItems=t=>Array.isArray(t.items)&&t.items.length>0||M(t.items)}render(t,e={}){return t=t||[],this.config=Object.assign(Object.assign({},this.defaultConfig),e),this.applyTabIndexToItemAtIndex=this.getIndexForWhichToApplyTabIndex(t),i("ul",{class:"mdc-deprecated-list",role:"menu","aria-orientation":"vertical",style:{"--maxLinesSecondaryText":"2"}},t.map(this.renderMenuItem))}}const{SELECTED_EVENT:Bt}=Dt,Yt=class{constructor(i){t(this,i),this.select=e(this,"select"),this.interact=e(this,"interact"),this.iconSize="small",this.MenuListRenderer=new Nt,this.setup=()=>{this.setupMenu(),this.setupListeners()},this.setupMenu=()=>{this.mdcMenu&&(this.teardown(),this.mdcMenu=null);const t=this.element.shadowRoot.querySelector(".mdc-menu");if(t){this.mdcMenu=new Ft(t),this.mdcMenu.hasTypeahead=!0,this.mdcMenu.wrapFocus=!0;for(const t of this.mdcMenu.items)new F(t)}},this.setupListeners=()=>{this.mdcMenu&&(this.mdcMenu.unlisten(Bt,this.handleMenuSelect),this.mdcMenu.listen(Bt,this.handleMenuSelect))},this.teardown=()=>{var t,e;null===(t=this.mdcMenu)||void 0===t||t.unlisten(Bt,this.handleMenuSelect),null===(e=this.mdcMenu)||void 0===e||e.destroy()},this.handleMenuSelect=t=>{this.handleSingleSelect(t.detail.index)},this.handleSingleSelect=t=>{const e=this.items.filter(this.isMenuItem);if(e[t].disabled)return;const i=e.find((t=>!!t.selected));let l;i&&(l=Object.assign(Object.assign({},i),{selected:!1}),this.select.emit(l)),e[t]!==i&&(l=Object.assign(Object.assign({},e[t]),{selected:!1}),this.select.emit(l)),this.interact.emit(l)},this.isMenuItem=t=>!("separator"in t)}connectedCallback(){this.setup()}disconnectedCallback(){this.teardown()}componentDidLoad(){this.setup(),this.triggerIconColorWarning()}render(){this.config={badgeIcons:this.badgeIcons,iconSize:this.iconSize};const t=this.MenuListRenderer.render(this.items,this.config);return i("div",{key:"1c044c711555d155c5559f8b787a3bbad09b7526",class:"mdc-menu mdc-menu-surface"},t)}itemsChanged(){setTimeout((()=>{this.setup()}),0)}triggerIconColorWarning(){var t;(null===(t=this.items)||void 0===t?void 0:t.some((t=>"iconColor"in t)))&&console.warn("The `iconColor` prop is deprecated, has no visual effect anymore, and will soon be removed! Use the new `Icon` interface, and instead of `iconColor: 'color-name'` write `icon: { name: 'icon-name', color: 'color-name' }`.")}static get delegatesFocus(){return!0}get element(){return l(this)}static get watchers(){return{items:[{itemsChanged:0}]}}};Yt.style='@charset "UTF-8";:host(.has-striped-rows) .mdc-deprecated-list{border:1px solid rgb(var(--contrast-400))}:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even),:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even){background-color:var(--list-background-color-of-odd-interactive-items, rgb(var(--contrast-200)))}:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd),:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd){background-color:var(--list-background-color-of-even-interactive-items, rgb(var(--contrast-100)))}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]){transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible{will-change:color, background-color, box-shadow, transform}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover{box-shadow:var(--button-shadow-hovered)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host(.has-grid-layout){--gap:var(--list-grid-gap, 0.5rem);padding:var(--gap);}:host(.has-grid-layout) .mdc-deprecated-list{display:grid;gap:var(--gap);grid-template-columns:repeat(auto-fit, minmax(min(100%, max(var(--list-grid-item-max-width, 10rem) - var(--gap), var(--list-grid-item-min-width, 7.5rem))), 1fr));max-width:var(--list-grid-max-width, 100%)}:host(.has-grid-layout) .mdc-deprecated-list limel-list-item{border-radius:var(--limel-list-border-radius) !important}:host(.has-grid-layout) .mdc-deprecated-list-divider{grid-column:1/-1}:host(.static-actions-list){z-index:1;background-color:var(--limel-theme-surface-background-color)}:host(.has-position-sticky){position:sticky;box-shadow:0 0 0.75rem 0.5rem var(--limel-theme-surface-background-color)}:host(.has-position-sticky.is-on-top){top:0}:host(.has-position-sticky.is-at-bottom){bottom:0}:host(.is-on-top){border-bottom:1px solid rgb(var(--contrast-400));margin-bottom:0.5rem;padding-bottom:0.25rem}:host(.is-at-bottom){border-top:1px solid rgb(var(--contrast-400));margin-top:0.5rem;padding-top:0.25rem}:host(limel-list){--limel-list-border-radius:0.5rem;display:block;isolation:isolate}:host([hidden]){display:none}ul{--mdc-theme-text-icon-on-background:var( --icon-color, rgb(var(--contrast-900)) );margin:var(--list-margin, 0.25rem);border-radius:var(--limel-list-border-radius);padding:0;list-style:none}.mdc-deprecated-list-divider{border-bottom-color:transparent;display:flex;align-items:center;gap:0.75rem;height:auto;padding:0 0.5rem}.limel-list-divider-line{background-color:rgb(var(--contrast-400));height:0.125rem;border-radius:1rem;min-width:1rem;flex-grow:1}.limel-list-divider-title{all:unset;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:rgb(var(--contrast-900));font-size:var(--limel-theme-default-small-font-size)}:host(limel-menu-list){display:block;--badge-background-color:var( --notification-badge-background-color, rgb(var(--color-red-default)) );--badge-text-color:var( --notification-badge-text-color, rgb(var(--color-white)) )}.mdc-menu{max-height:70vh}.mdc-deprecated-list{margin:0.25rem}';const Xt=class{constructor(i){t(this,i),this.dismiss=e(this,"dismiss"),this.open=!1,this.setup=()=>{const t=this.host.shadowRoot.querySelector(".mdc-menu-surface");t&&(this.menuSurface=new Lt(t),this.menuSurface.setAnchorCorner(Tt.TOP_START),document.addEventListener("mousedown",this.handleDocumentClick,{capture:!0}),this.host.addEventListener("keydown",this.handleKeyDown))},this.teardown=()=>{var t;null===(t=this.menuSurface)||void 0===t||t.destroy(),document.removeEventListener("mousedown",this.handleDocumentClick,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyDown)},this.handleDocumentClick=t=>{const e=t.composedPath?t.composedPath():[];if(this.open&&!N(t.target,this.host)){if(this.allowClicksElement&&e.includes(this.allowClicksElement))return;this.dismiss.emit(),this.preventClickEventPropagation()}},this.preventClickEventPropagation=()=>{document.addEventListener("click",this.stopEvent,{capture:!0,once:!0}),document.addEventListener("mouseup",this.stopEvent,{capture:!0,once:!0}),document.addEventListener("mouseup",(()=>{document.removeEventListener("click",this.stopEvent,{capture:!0})}),{once:!0})},this.stopEvent=t=>{t.stopPropagation(),t.preventDefault()},this.handleKeyDown=t=>{this.open&&(t.key===f||t.key===c)&&(t.stopPropagation(),this.dismiss.emit())}}connectedCallback(){this.setup()}disconnectedCallback(){this.teardown()}componentDidLoad(){this.setup()}render(){return i("div",{key:"254247a3cd25908f96e55028df567663dd4d736a",class:{"mdc-menu":!0,"mdc-menu-surface":!0,"mdc-menu-surface--open":this.open,"mdc-elevation-transition":!0,"mdc-elevation--z4":!0},tabindex:"-1"},i("slot",{key:"eb7d1042a28585242d212cf40a34018240cb0502"}))}get host(){return l(this)}};Xt.style=":host(limel-menu-surface){display:block;max-height:inherit}.mdc-menu-surface{display:none;position:absolute;box-sizing:border-box;max-width:calc(100vw - 32px);max-width:var(--mdc-menu-max-width, calc(100vw - 32px));max-height:calc(100vh - 32px);max-height:var(--mdc-menu-max-height, calc(100vh - 32px));margin:0;padding:0;transform:scale(1);transform-origin:top left;opacity:0;overflow:auto;will-change:transform, opacity;z-index:8;transition:opacity 0.03s linear, transform 0.12s cubic-bezier(0, 0, 0.2, 1), height 250ms cubic-bezier(0, 0, 0.2, 1)}.mdc-menu-surface:focus{outline:none}.mdc-menu-surface--animating-open{display:inline-block;transform:scale(0.8);opacity:0}.mdc-menu-surface--open{display:inline-block;transform:scale(1);opacity:1}.mdc-menu-surface--animating-closed{display:inline-block;opacity:0;transition:opacity 0.075s linear}.mdc-menu-surface{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);background-color:#fff;background-color:var(--mdc-theme-surface, #fff);color:#000;color:var(--mdc-theme-on-surface, #000);border-radius:4px;border-radius:var(--mdc-shape-medium, 4px);transform-origin-left:top left;transform-origin-right:top right}[dir=rtl] .mdc-menu-surface,.mdc-menu-surface[dir=rtl]{transform-origin-left:top right;transform-origin-right:top left;}.mdc-menu-surface--anchor{position:relative;overflow:visible}.mdc-menu-surface--fixed{position:fixed}.mdc-menu-surface--fullwidth{width:100%}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}.mdc-menu .mdc-deprecated-list-item__meta{color:rgba(0, 0, 0, 0.87)}.mdc-menu .mdc-deprecated-list-item__graphic{color:rgba(0, 0, 0, 0.87)}.mdc-menu{min-width:112px;min-width:var(--mdc-menu-min-width, 112px)}.mdc-menu .mdc-deprecated-list{color:rgba(0, 0, 0, 0.87)}.mdc-menu .mdc-deprecated-list,.mdc-menu .mdc-list{position:relative}.mdc-menu .mdc-deprecated-list .mdc-elevation-overlay,.mdc-menu .mdc-list .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-menu .mdc-deprecated-list-divider{margin:8px 0}.mdc-menu .mdc-deprecated-list-item{user-select:none}.mdc-menu .mdc-deprecated-list-item--disabled{cursor:auto}.mdc-menu a.mdc-deprecated-list-item .mdc-deprecated-list-item__text,.mdc-menu a.mdc-deprecated-list-item .mdc-deprecated-list-item__graphic{pointer-events:none}.mdc-menu__selection-group{padding:0;fill:currentColor}.mdc-menu__selection-group .mdc-deprecated-list-item{padding-left:56px;padding-right:16px}[dir=rtl] .mdc-menu__selection-group .mdc-deprecated-list-item,.mdc-menu__selection-group .mdc-deprecated-list-item[dir=rtl]{padding-left:16px;padding-right:56px;}.mdc-menu__selection-group .mdc-menu__selection-group-icon{left:16px;right:initial}[dir=rtl] .mdc-menu__selection-group .mdc-menu__selection-group-icon,.mdc-menu__selection-group .mdc-menu__selection-group-icon[dir=rtl]{left:initial;right:16px;}.mdc-menu__selection-group .mdc-menu__selection-group-icon{display:none;position:absolute;top:50%;transform:translateY(-50%)}.mdc-menu-item--selected .mdc-menu__selection-group-icon{display:inline}.mdc-menu-surface{opacity:1;display:var(--limel-menu-surface-display, block);flex-direction:var(--limel-menu-surface-flex-direction, row);max-height:inherit;position:relative;--mdc-menu-max-width:calc( 100vw - 2rem );width:var(--menu-surface-width, auto);background-color:var(--lime-elevated-surface-background-color)}:host(limel-menu-surface.has-grid-layout) .mdc-menu-surface{width:var(--menu-surface-width, min(100vw - 2rem, 40rem));max-width:unset}";const Ht=class{constructor(e){t(this,e),this.size="mini",this.limeBranded=!1}render(){return i(n,{key:"bb72728921dd48ab02cad031e3b35641c92b4dce"},i("svg",{key:"fccd59e394e3e4a0101d2e7f903b1b4f9dffc630",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},this.renderSpinner()))}renderSpinner(){return this.limeBranded?i("g",null,i("g",{"clip-path":"url(#mask)"},i("circle",{class:"outline thick",cx:"12",cy:"12",r:"12"}),i("g",{class:"spinner"},i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}))),i("clipPath",{id:"mask"},i("path",{d:"M2.166 11.248C2.166 5.04 7.058 0 13.083 0 19.108 0 24 5.04 24 11.248c0 3.229-1.307 6.548-4.533 9.306-3.908 3.343-9.15 3.8-17.254 3.249-2.405-.164-2.753-.588-1.51-1.533C4.61 19.3 2.165 17.025 2.165 11.248zm3.124 9.834c5.563.227 9.416-.246 12.397-2.76 2.432-2.05 3.482-4.56 3.51-7.074.05-4.613-3.636-8.36-8.114-8.36-4.478 0-8.114 3.746-8.114 8.36 0 2.793.607 4.737.726 6.345.092 1.252.03 2.388-.405 3.49z"}))):i("g",null,i("circle",{class:"outline",cx:"12",cy:"12",r:"10"}),i("g",{class:"spinner"},i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"})))}};Ht.style=":host(limel-spinner){display:block}@keyframes spin{50%{transform:rotate(180deg)}100%{transform:rotate(720deg)}}@keyframes fade-in-the-spinner{0%{transform:scale(0.7);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes animate-colored-circles{5%{stroke-dashoffset:0}10%,100%{stroke-dashoffset:63}}:host([hidden]){display:none}:host{box-sizing:border-box;display:flex;align-items:center;justify-content:center;height:1.5rem;width:1.5rem;transform:translate3d(0, 0, 0);animation:fade-in-the-spinner 0.5s ease forwards}:host([size=x-small]){height:2rem;width:2rem}:host([size=small]){height:2.125rem;width:2.125rem}:host([size=medium]){height:2.75rem;width:2.75rem}:host([size=large]){height:4rem;width:4rem}.spinner{animation:spin 1s linear infinite;transform-origin:center}.color{animation:animate-colored-circles 10s linear infinite;fill:none;stroke-dasharray:63;stroke-dashoffset:63;stroke-linecap:round;stroke-width:4}.color.thick{stroke-width:10}.color:nth-child(1){stroke:var(--spinner-color-1, rgb(var(--lime-brand-color-lime-green)))}.color:nth-child(2){stroke:var(--spinner-color-2, rgb(var(--lime-brand-color-ocean-teal)));animation-delay:1s}.color:nth-child(3){stroke:var(--spinner-color-3, rgb(var(--lime-brand-color-aqua)));animation-delay:2s}.color:nth-child(4){stroke:var(--spinner-color-4, rgb(var(--lime-brand-color-bubble-gum)));animation-delay:3s}.color:nth-child(5){stroke:var(--spinner-color-5, rgb(var(--lime-brand-color-sunny-orange)));animation-delay:4s}.color:nth-child(6){stroke:var(--spinner-color-6, rgb(var(--lime-brand-color-lime-green)));animation-delay:5s}.color:nth-child(7){stroke:var(--spinner-color-7, rgb(var(--lime-brand-color-ocean-teal)));animation-delay:6s}.color:nth-child(8){stroke:var(--spinner-color-8, rgb(var(--lime-brand-color-aqua)));animation-delay:7s}.color:nth-child(9){stroke:var(--spinner-color-9, rgb(var(--lime-brand-color-bubble-gum)));animation-delay:8s}.color:nth-child(10){stroke:var(--spinner-color-10, rgb(var(--contrast-700)));animation-delay:9s}.outline{stroke:rgba(var(--lime-brand-color-light-grey), 0.3);fill:none;stroke-linecap:round;stroke-width:4}.outline.thick{stroke-width:10}";export{B as limel_breadcrumbs,Y as limel_input_field,yt as limel_list,kt as limel_menu,Yt as limel_menu_list,Xt as limel_menu_surface,Ht as limel_spinner}
|
|
248
|
+
*/class Nt{constructor(){this.defaultConfig={isOpen:!0,badgeIcons:!1},this.getIndexForWhichToApplyTabIndex=t=>{let e;for(let i=0,l=t.length;i<l;i+=1)if("separator"in t[i]);else{const l=t[i];if(l.disabled)continue;if(l.selected){e=i;break}void 0===e&&(e=i)}return e},this.renderMenuItem=(t,e)=>{var l;if("separator"in t)return i("li",{class:"mdc-deprecated-list-divider",role:"separator",key:`sep-${e}`},this.renderTextForSeparator(t),i("div",{class:"limel-list-divider-line"}));const n={};e===this.applyTabIndexToItemAtIndex&&(n.tabindex="0");const r=this.hasSubItems(t),d=null!==(l=t.id)&&void 0!==l?l:`item-${e}`;return i("limel-list-item",Object.assign({key:d,class:{"mdc-deprecated-list-item":!0,"mdc-deprecated-list-item--disabled":!!t.disabled},"data-index":e},n,{"aria-haspopup":r?"menu":void 0,"aria-expanded":r?"false":void 0,type:"menuitem",text:t.text,secondaryText:t.secondaryText,icon:t.icon,primaryComponent:r||void 0!==t.badge||t.hotkey||t.commandText?{name:"limel-menu-item-meta",props:{commandText:t.commandText,hotkey:t.hotkey,disabled:!!t.disabled,badge:t.badge,showChevron:r}}:void 0,badgeIcon:this.config.badgeIcons,selected:t.selected,disabled:t.disabled}))},this.renderTextForSeparator=t=>{if("text"in t)return i("h2",{class:"limel-list-divider-title"},t.text)},this.hasSubItems=t=>Array.isArray(t.items)&&t.items.length>0||M(t.items)}render(t,e={}){return t=t||[],this.config=Object.assign(Object.assign({},this.defaultConfig),e),this.applyTabIndexToItemAtIndex=this.getIndexForWhichToApplyTabIndex(t),i("ul",{class:"mdc-deprecated-list",role:"menu","aria-orientation":"vertical",style:{"--maxLinesSecondaryText":"2"}},t.map(this.renderMenuItem))}}const{SELECTED_EVENT:Bt}=Dt,Yt=class{constructor(i){t(this,i),this.select=e(this,"select"),this.interact=e(this,"interact"),this.iconSize="small",this.MenuListRenderer=new Nt,this.setup=()=>{this.setupMenu(),this.setupListeners()},this.setupMenu=()=>{this.mdcMenu&&(this.teardown(),this.mdcMenu=null);const t=this.element.shadowRoot.querySelector(".mdc-menu");if(t){this.mdcMenu=new Ft(t),this.mdcMenu.hasTypeahead=!0,this.mdcMenu.wrapFocus=!0;for(const t of this.mdcMenu.items)new F(t)}},this.setupListeners=()=>{this.mdcMenu&&(this.mdcMenu.unlisten(Bt,this.handleMenuSelect),this.mdcMenu.listen(Bt,this.handleMenuSelect))},this.teardown=()=>{var t,e;null===(t=this.mdcMenu)||void 0===t||t.unlisten(Bt,this.handleMenuSelect),null===(e=this.mdcMenu)||void 0===e||e.destroy()},this.handleMenuSelect=t=>{this.handleSingleSelect(t.detail.index)},this.handleSingleSelect=t=>{const e=this.items.filter(this.isMenuItem);if(e[t].disabled)return;const i=e.find((t=>!!t.selected));let l;i&&(l=Object.assign(Object.assign({},i),{selected:!1}),this.select.emit(l)),e[t]!==i&&(l=Object.assign(Object.assign({},e[t]),{selected:!1}),this.select.emit(l)),this.interact.emit(l)},this.isMenuItem=t=>!("separator"in t)}connectedCallback(){this.setup()}disconnectedCallback(){this.teardown()}componentDidLoad(){this.setup(),this.triggerIconColorWarning()}render(){this.config={badgeIcons:this.badgeIcons,iconSize:this.iconSize};const t=this.MenuListRenderer.render(this.items,this.config);return i("div",{key:"4740635dd33eb64cccfaa762ae6a51bbff6d8a6f",class:"mdc-menu mdc-menu-surface"},t)}itemsChanged(){setTimeout((()=>{this.setup()}),0)}triggerIconColorWarning(){var t;(null===(t=this.items)||void 0===t?void 0:t.some((t=>"iconColor"in t)))&&console.warn("The `iconColor` prop is deprecated, has no visual effect anymore, and will soon be removed! Use the new `Icon` interface, and instead of `iconColor: 'color-name'` write `icon: { name: 'icon-name', color: 'color-name' }`.")}static get delegatesFocus(){return!0}get element(){return l(this)}static get watchers(){return{items:[{itemsChanged:0}]}}};Yt.style='@charset "UTF-8";:host(.has-striped-rows) .mdc-deprecated-list{border:1px solid rgb(var(--contrast-400))}:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even),:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(even){background-color:var(--list-background-color-of-odd-interactive-items, rgb(var(--contrast-200)))}:host(.has-striped-rows) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd),:host(.has-striped-rows.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):not(:hover):nth-child(odd){background-color:var(--list-background-color-of-even-interactive-items, rgb(var(--contrast-100)))}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]){transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible{will-change:color, background-color, box-shadow, transform}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover{box-shadow:var(--button-shadow-hovered)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):hover,:host(.has-interactive-items) limel-list-item:not([disabled]):not([disabled=true]):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host(.has-grid-layout){--gap:var(--list-grid-gap, 0.5rem);padding:var(--gap);}:host(.has-grid-layout) .mdc-deprecated-list{display:grid;gap:var(--gap);grid-template-columns:repeat(auto-fit, minmax(min(100%, max(var(--list-grid-item-max-width, 10rem) - var(--gap), var(--list-grid-item-min-width, 7.5rem))), 1fr));max-width:var(--list-grid-max-width, 100%)}:host(.has-grid-layout) .mdc-deprecated-list limel-list-item{border-radius:var(--limel-list-border-radius) !important}:host(.has-grid-layout) .mdc-deprecated-list-divider{grid-column:1/-1}:host(.static-actions-list){z-index:1;background-color:var(--limel-theme-surface-background-color)}:host(.has-position-sticky){position:sticky;box-shadow:0 0 0.75rem 0.5rem var(--limel-theme-surface-background-color)}:host(.has-position-sticky.is-on-top){top:0}:host(.has-position-sticky.is-at-bottom){bottom:0}:host(.is-on-top){border-bottom:1px solid rgb(var(--contrast-400));margin-bottom:0.5rem;padding-bottom:0.25rem}:host(.is-at-bottom){border-top:1px solid rgb(var(--contrast-400));margin-top:0.5rem;padding-top:0.25rem}:host(limel-list){--limel-list-border-radius:0.5rem;display:block;isolation:isolate}:host([hidden]){display:none}ul{--mdc-theme-text-icon-on-background:var( --icon-color, rgb(var(--contrast-900)) );margin:var(--list-margin, 0.25rem);border-radius:var(--limel-list-border-radius);padding:0;list-style:none}.mdc-deprecated-list-divider{border-bottom-color:transparent;display:flex;align-items:center;gap:0.75rem;height:auto;padding:0 0.5rem}.limel-list-divider-line{background-color:rgb(var(--contrast-400));height:0.125rem;border-radius:1rem;min-width:1rem;flex-grow:1}.limel-list-divider-title{all:unset;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:rgb(var(--contrast-900));font-size:var(--limel-theme-default-small-font-size)}:host(limel-menu-list){display:block;--badge-background-color:var( --notification-badge-background-color, rgb(var(--color-red-default)) );--badge-text-color:var( --notification-badge-text-color, rgb(var(--color-white)) )}.mdc-menu{max-height:70vh}.mdc-deprecated-list{margin:0.25rem}';const Xt=class{constructor(i){t(this,i),this.dismiss=e(this,"dismiss"),this.open=!1,this.setup=()=>{const t=this.host.shadowRoot.querySelector(".mdc-menu-surface");t&&(this.menuSurface=new Lt(t),this.menuSurface.setAnchorCorner(Tt.TOP_START),document.addEventListener("mousedown",this.handleDocumentClick,{capture:!0}),this.host.addEventListener("keydown",this.handleKeyDown))},this.teardown=()=>{var t;null===(t=this.menuSurface)||void 0===t||t.destroy(),document.removeEventListener("mousedown",this.handleDocumentClick,{capture:!0}),this.host.removeEventListener("keydown",this.handleKeyDown)},this.handleDocumentClick=t=>{const e=t.composedPath?t.composedPath():[];if(this.open&&!N(t.target,this.host)){if(this.allowClicksElement&&e.includes(this.allowClicksElement))return;this.dismiss.emit(),this.preventClickEventPropagation()}},this.preventClickEventPropagation=()=>{document.addEventListener("click",this.stopEvent,{capture:!0,once:!0}),document.addEventListener("mouseup",this.stopEvent,{capture:!0,once:!0}),document.addEventListener("mouseup",(()=>{document.removeEventListener("click",this.stopEvent,{capture:!0})}),{once:!0})},this.stopEvent=t=>{t.stopPropagation(),t.preventDefault()},this.handleKeyDown=t=>{this.open&&(t.key===f||t.key===c)&&(t.stopPropagation(),this.dismiss.emit())}}connectedCallback(){this.setup()}disconnectedCallback(){this.teardown()}componentDidLoad(){this.setup()}render(){return i("div",{key:"730ef068d80ac9e2fd561cd871cca45c16747b56",class:{"mdc-menu":!0,"mdc-menu-surface":!0,"mdc-menu-surface--open":this.open,"mdc-elevation-transition":!0,"mdc-elevation--z4":!0},tabindex:"-1"},i("slot",{key:"bc02c14a725340086b2c6459f5218242854341b4"}))}get host(){return l(this)}};Xt.style=":host(limel-menu-surface){display:block;max-height:inherit}.mdc-menu-surface{display:none;position:absolute;box-sizing:border-box;max-width:calc(100vw - 32px);max-width:var(--mdc-menu-max-width, calc(100vw - 32px));max-height:calc(100vh - 32px);max-height:var(--mdc-menu-max-height, calc(100vh - 32px));margin:0;padding:0;transform:scale(1);transform-origin:top left;opacity:0;overflow:auto;will-change:transform, opacity;z-index:8;transition:opacity 0.03s linear, transform 0.12s cubic-bezier(0, 0, 0.2, 1), height 250ms cubic-bezier(0, 0, 0.2, 1)}.mdc-menu-surface:focus{outline:none}.mdc-menu-surface--animating-open{display:inline-block;transform:scale(0.8);opacity:0}.mdc-menu-surface--open{display:inline-block;transform:scale(1);opacity:1}.mdc-menu-surface--animating-closed{display:inline-block;opacity:0;transition:opacity 0.075s linear}.mdc-menu-surface{box-shadow:0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);background-color:#fff;background-color:var(--mdc-theme-surface, #fff);color:#000;color:var(--mdc-theme-on-surface, #000);border-radius:4px;border-radius:var(--mdc-shape-medium, 4px);transform-origin-left:top left;transform-origin-right:top right}[dir=rtl] .mdc-menu-surface,.mdc-menu-surface[dir=rtl]{transform-origin-left:top right;transform-origin-right:top left;}.mdc-menu-surface--anchor{position:relative;overflow:visible}.mdc-menu-surface--fixed{position:fixed}.mdc-menu-surface--fullwidth{width:100%}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-elevation-overlay{position:absolute;border-radius:inherit;pointer-events:none;opacity:0;opacity:var(--mdc-elevation-overlay-opacity, 0);transition:opacity 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:#fff;background-color:var(--mdc-elevation-overlay-color, #fff)}.mdc-menu .mdc-deprecated-list-item__meta{color:rgba(0, 0, 0, 0.87)}.mdc-menu .mdc-deprecated-list-item__graphic{color:rgba(0, 0, 0, 0.87)}.mdc-menu{min-width:112px;min-width:var(--mdc-menu-min-width, 112px)}.mdc-menu .mdc-deprecated-list{color:rgba(0, 0, 0, 0.87)}.mdc-menu .mdc-deprecated-list,.mdc-menu .mdc-list{position:relative}.mdc-menu .mdc-deprecated-list .mdc-elevation-overlay,.mdc-menu .mdc-list .mdc-elevation-overlay{width:100%;height:100%;top:0;left:0}.mdc-menu .mdc-deprecated-list-divider{margin:8px 0}.mdc-menu .mdc-deprecated-list-item{user-select:none}.mdc-menu .mdc-deprecated-list-item--disabled{cursor:auto}.mdc-menu a.mdc-deprecated-list-item .mdc-deprecated-list-item__text,.mdc-menu a.mdc-deprecated-list-item .mdc-deprecated-list-item__graphic{pointer-events:none}.mdc-menu__selection-group{padding:0;fill:currentColor}.mdc-menu__selection-group .mdc-deprecated-list-item{padding-left:56px;padding-right:16px}[dir=rtl] .mdc-menu__selection-group .mdc-deprecated-list-item,.mdc-menu__selection-group .mdc-deprecated-list-item[dir=rtl]{padding-left:16px;padding-right:56px;}.mdc-menu__selection-group .mdc-menu__selection-group-icon{left:16px;right:initial}[dir=rtl] .mdc-menu__selection-group .mdc-menu__selection-group-icon,.mdc-menu__selection-group .mdc-menu__selection-group-icon[dir=rtl]{left:initial;right:16px;}.mdc-menu__selection-group .mdc-menu__selection-group-icon{display:none;position:absolute;top:50%;transform:translateY(-50%)}.mdc-menu-item--selected .mdc-menu__selection-group-icon{display:inline}.mdc-menu-surface{opacity:1;display:var(--limel-menu-surface-display, block);flex-direction:var(--limel-menu-surface-flex-direction, row);max-height:inherit;position:relative;--mdc-menu-max-width:calc( 100vw - 2rem );width:var(--menu-surface-width, auto);background-color:var(--lime-elevated-surface-background-color)}:host(limel-menu-surface.has-grid-layout) .mdc-menu-surface{width:var(--menu-surface-width, min(100vw - 2rem, 40rem));max-width:unset}";const Ht=class{constructor(e){t(this,e),this.size="mini",this.limeBranded=!1}render(){return i(n,{key:"b5577d30805f87fcb6f670886ff22af94554d18a"},i("svg",{key:"895db390ea2b9393d315622ffb9e23b40f036c39",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},this.renderSpinner()))}renderSpinner(){return this.limeBranded?i("g",null,i("g",{"clip-path":"url(#mask)"},i("circle",{class:"outline thick",cx:"12",cy:"12",r:"12"}),i("g",{class:"spinner"},i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}),i("circle",{class:"color thick",cx:"12",cy:"12",r:"12"}))),i("clipPath",{id:"mask"},i("path",{d:"M2.166 11.248C2.166 5.04 7.058 0 13.083 0 19.108 0 24 5.04 24 11.248c0 3.229-1.307 6.548-4.533 9.306-3.908 3.343-9.15 3.8-17.254 3.249-2.405-.164-2.753-.588-1.51-1.533C4.61 19.3 2.165 17.025 2.165 11.248zm3.124 9.834c5.563.227 9.416-.246 12.397-2.76 2.432-2.05 3.482-4.56 3.51-7.074.05-4.613-3.636-8.36-8.114-8.36-4.478 0-8.114 3.746-8.114 8.36 0 2.793.607 4.737.726 6.345.092 1.252.03 2.388-.405 3.49z"}))):i("g",null,i("circle",{class:"outline",cx:"12",cy:"12",r:"10"}),i("g",{class:"spinner"},i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"}),i("circle",{class:"color",cx:"12",cy:"12",r:"10"})))}};Ht.style=":host(limel-spinner){display:block}@keyframes spin{50%{transform:rotate(180deg)}100%{transform:rotate(720deg)}}@keyframes fade-in-the-spinner{0%{transform:scale(0.7);opacity:0}100%{transform:scale(1);opacity:1}}@keyframes animate-colored-circles{5%{stroke-dashoffset:0}10%,100%{stroke-dashoffset:63}}:host([hidden]){display:none}:host{box-sizing:border-box;display:flex;align-items:center;justify-content:center;height:1.5rem;width:1.5rem;transform:translate3d(0, 0, 0);animation:fade-in-the-spinner 0.5s ease forwards}:host([size=x-small]){height:2rem;width:2rem}:host([size=small]){height:2.125rem;width:2.125rem}:host([size=medium]){height:2.75rem;width:2.75rem}:host([size=large]){height:4rem;width:4rem}.spinner{animation:spin 1s linear infinite;transform-origin:center}.color{animation:animate-colored-circles 10s linear infinite;fill:none;stroke-dasharray:63;stroke-dashoffset:63;stroke-linecap:round;stroke-width:4}.color.thick{stroke-width:10}.color:nth-child(1){stroke:var(--spinner-color-1, rgb(var(--lime-brand-color-lime-green)))}.color:nth-child(2){stroke:var(--spinner-color-2, rgb(var(--lime-brand-color-ocean-teal)));animation-delay:1s}.color:nth-child(3){stroke:var(--spinner-color-3, rgb(var(--lime-brand-color-aqua)));animation-delay:2s}.color:nth-child(4){stroke:var(--spinner-color-4, rgb(var(--lime-brand-color-bubble-gum)));animation-delay:3s}.color:nth-child(5){stroke:var(--spinner-color-5, rgb(var(--lime-brand-color-sunny-orange)));animation-delay:4s}.color:nth-child(6){stroke:var(--spinner-color-6, rgb(var(--lime-brand-color-lime-green)));animation-delay:5s}.color:nth-child(7){stroke:var(--spinner-color-7, rgb(var(--lime-brand-color-ocean-teal)));animation-delay:6s}.color:nth-child(8){stroke:var(--spinner-color-8, rgb(var(--lime-brand-color-aqua)));animation-delay:7s}.color:nth-child(9){stroke:var(--spinner-color-9, rgb(var(--lime-brand-color-bubble-gum)));animation-delay:8s}.color:nth-child(10){stroke:var(--spinner-color-10, rgb(var(--contrast-700)));animation-delay:9s}.outline{stroke:rgba(var(--lime-brand-color-light-grey), 0.3);fill:none;stroke-linecap:round;stroke-width:4}.outline.thick{stroke-width:10}";export{B as limel_breadcrumbs,Y as limel_input_field,yt as limel_list,kt as limel_menu,Yt as limel_menu_list,Xt as limel_menu_surface,Ht as limel_spinner}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as
|
|
1
|
+
import{r as t,c as s,h as e,H as a,a as i}from"./p-DBTJNfo7.js";import{d as h}from"./p-z_E3sq3p.js";const o=class{constructor(e){t(this,e),this.changeTab=s(this,"changeTab"),this.tabs=[],this.slotElements=[],this.handleChangeTabs=this.handleChangeTabs.bind(this),this.setSlotElements=this.setSlotElements.bind(this),this.setTabStatus=this.setTabStatus.bind(this)}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}initialize(){const t=this.getSlot();t&&(t.addEventListener("slotchange",this.setSlotElements),this.setSlotElements(),this.tabs.forEach(this.setTabStatus))}disconnectedCallback(){this.getSlot().removeEventListener("slotchange",this.setSlotElements)}tabsChanged(){this.hidePanels(),this.tabs.forEach(this.setTabStatus)}render(){return e(a,{key:"cc2be22eb941e72c7333ee435d912e55bc38fd20",onChangeTab:this.handleChangeTabs},e("div",{key:"a5ea8894f2bb8121320dabf15757ec6d667c3e9d",class:"tab-panel"},e("limel-tab-bar",{key:"42be419551f9c3e1310de21bb89bab89bd759dee",tabs:this.tabs}),e("div",{key:"13e156b564873aaa4de691bd3cefc703ba7d2f65",class:"tab-content"},e("slot",{key:"b48cff50f857f337af2c60a0d7411a6b8860ae3d"}))))}setSlotElements(){const t=this.getSlot();this.hidePanels(),this.slotElements=Array.prototype.slice.call(t.assignedElements()),this.tabs.forEach(this.setTabStatus)}setTabStatus(t){const s=this.slotElements.find((s=>s.id===t.id));s&&(s.style.display=t.active?"":"none",s.tab=t)}handleChangeTabs(t){this.tabs=this.tabs.map((s=>s.id===t.detail.id?t.detail:s)),this.setTabStatus(t.detail),setTimeout(h)}getSlot(){return this.host.shadowRoot.querySelector("slot")}hidePanels(){for(const t of this.slotElements)t.style.display="none"}get host(){return i(this)}static get watchers(){return{tabs:[{tabsChanged:0}]}}};o.style=":host(limel-tab-panel){--tab-panel-background-color:rgb(var(--contrast-100));display:block;height:100%}.tab-panel{height:100%;position:relative;display:flex;flex-direction:column}.tab-content{height:100%;flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box;background-color:var(--tab-panel-background-color)}";export{o as limel_tab_panel}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as o,h as t,a as r}from"./p-DBTJNfo7.js";import{c as i}from"./p-JbKhhoXs.js";import{E as s}from"./p-rI0IeKpx.js";import{f as a,z as n}from"./p-BqiDn_Sf.js";import"./p-ZcW3uvZL.js";import"./p-Cs5T63LB.js";import"./p-f_1nwOC8.js";import"./p-efBXH4mj.js";import"./p-DtS35Df5.js";import"./p-BJQylLSL.js";function p(e,o){var t;if(e.contains(o)||(null===(t=e.shadowRoot)||void 0===t?void 0:t.contains(o)))return!0;const r=function(e){const o=e.closest(".limel-portal--container");if(o)return o.portalSource;return e.getRootNode().host}(o);return!!r&&p(e,r)}const c=class{constructor(t){e(this,t),this.close=o(this,"close"),this.open=!1,this.shouldRestoreFocusOnClose=!1,this.handleGlobalKeyPress=e=>{e.key===s&&(e.stopPropagation(),e.preventDefault(),this.requestCloseAndRestoreFocus())},this.requestCloseAndRestoreFocus=()=>{this.shouldRestoreFocusOnClose=!0,this.close.emit()},this.setTriggerRef=e=>{this.triggerSlot=e},this.focusTrigger=()=>{var e,o;const t=null===(o=null===(e=this.triggerSlot)||void 0===e?void 0:e.assignedElements())||void 0===o?void 0:o[0];a(t)},this.setTriggerAttributes=e=>{const o={"aria-haspopup":!0,"aria-expanded":this.open,"aria-controls":this.portalId,role:"button"};for(const[t,r]of Object.entries(o))r?e.setAttribute(t,String(r)):e.removeAttribute(t)},this.portalId=i(),this.globalClickListener=this.globalClickListener.bind(this)}watchOpen(){this.setupGlobalHandlers(),!this.open&&this.shouldRestoreFocusOnClose&&(this.shouldRestoreFocusOnClose=!1,setTimeout(this.focusTrigger,0))}componentWillLoad(){this.setupGlobalHandlers()}componentDidRender(){this.triggerSlot&&this.triggerSlot.assignedElements().forEach(this.setTriggerAttributes)}setupGlobalHandlers(){this.open?(document.addEventListener("click",this.globalClickListener,{capture:!0}),document.addEventListener("keydown",this.handleGlobalKeyPress)):(document.removeEventListener("click",this.globalClickListener),document.removeEventListener("keydown",this.handleGlobalKeyPress))}render(){const e=this.getCssProperties(),o=getComputedStyle(this.host).getPropertyValue("--popover-z-index");return t("div",{key:"
|
|
1
|
+
import{r as e,c as o,h as t,a as r}from"./p-DBTJNfo7.js";import{c as i}from"./p-JbKhhoXs.js";import{E as s}from"./p-rI0IeKpx.js";import{f as a,z as n}from"./p-BqiDn_Sf.js";import"./p-ZcW3uvZL.js";import"./p-Cs5T63LB.js";import"./p-f_1nwOC8.js";import"./p-efBXH4mj.js";import"./p-DtS35Df5.js";import"./p-BJQylLSL.js";function p(e,o){var t;if(e.contains(o)||(null===(t=e.shadowRoot)||void 0===t?void 0:t.contains(o)))return!0;const r=function(e){const o=e.closest(".limel-portal--container");if(o)return o.portalSource;return e.getRootNode().host}(o);return!!r&&p(e,r)}const c=class{constructor(t){e(this,t),this.close=o(this,"close"),this.open=!1,this.shouldRestoreFocusOnClose=!1,this.handleGlobalKeyPress=e=>{e.key===s&&(e.stopPropagation(),e.preventDefault(),this.requestCloseAndRestoreFocus())},this.requestCloseAndRestoreFocus=()=>{this.shouldRestoreFocusOnClose=!0,this.close.emit()},this.setTriggerRef=e=>{this.triggerSlot=e},this.focusTrigger=()=>{var e,o;const t=null===(o=null===(e=this.triggerSlot)||void 0===e?void 0:e.assignedElements())||void 0===o?void 0:o[0];a(t)},this.setTriggerAttributes=e=>{const o={"aria-haspopup":!0,"aria-expanded":this.open,"aria-controls":this.portalId,role:"button"};for(const[t,r]of Object.entries(o))r?e.setAttribute(t,String(r)):e.removeAttribute(t)},this.portalId=i(),this.globalClickListener=this.globalClickListener.bind(this)}watchOpen(){this.setupGlobalHandlers(),!this.open&&this.shouldRestoreFocusOnClose&&(this.shouldRestoreFocusOnClose=!1,setTimeout(this.focusTrigger,0))}componentWillLoad(){this.setupGlobalHandlers()}componentDidRender(){this.triggerSlot&&this.triggerSlot.assignedElements().forEach(this.setTriggerAttributes)}setupGlobalHandlers(){this.open?(document.addEventListener("click",this.globalClickListener,{capture:!0}),document.addEventListener("keydown",this.handleGlobalKeyPress)):(document.removeEventListener("click",this.globalClickListener),document.removeEventListener("keydown",this.handleGlobalKeyPress))}render(){const e=this.getCssProperties(),o=getComputedStyle(this.host).getPropertyValue("--popover-z-index");return t("div",{key:"7bc94b0e636ab16a04e76947731eb815f9a33e38",class:"trigger-anchor"},t("slot",{key:"e35b20eb6e38755cd50f71ada0413efcc79ce9e0",name:"trigger",ref:this.setTriggerRef}),t("limel-portal",{key:"397107a1f1fa9f796f0801da60df81084a0862ea",visible:this.open,containerId:this.portalId,containerStyle:{"z-index":o},openDirection:this.openDirection},t("limel-popover-surface",{key:"f63f011a8d529a68b535fcbed4685a5bb508dded",contentCollection:this.host.children,style:e})))}globalClickListener(e){const o=p(this.host,e.target);this.open&&!o&&(e.stopPropagation(),e.preventDefault(),this.close.emit())}getCssProperties(){const e=["--popover-surface-width","--popover-body-background-color","--popover-border-radius","--popover-box-shadow"],o=getComputedStyle(this.host),t=e.map((e=>o.getPropertyValue(e)));return n(e,t)}get host(){return r(this)}static get watchers(){return{open:[{watchOpen:0}]}}};c.style=".trigger-anchor{display:inline-block;position:relative}";const l=class{constructor(o){e(this,o)}componentDidLoad(){this.appendElement()}render(){return t("div",{key:"2ade664e817c3559b6721f0567736c8942afd2f1",class:"limel-popover-surface",tabindex:"0"})}appendElement(){const e=this.host.shadowRoot.querySelector(".limel-popover-surface"),o=[...this.contentCollection];for(const t of o)"trigger"!==t.slot&&e.append(t)}get host(){return r(this)}};l.style='@charset "UTF-8";:host(limel-popover-surface){isolation:isolate;position:relative;display:flex;width:var(--popover-surface-width, auto);max-height:inherit;max-width:calc(100vw - 2rem);margin:0 0.25rem}.limel-popover-surface{flex:1;min-width:0;min-height:0;border-radius:var(--popover-border-radius, 0.75rem);box-shadow:var(--popover-box-shadow, var(--shadow-depth-16));backdrop-filter:blur(0.3125rem);-webkit-backdrop-filter:blur(0.3125rem)}.limel-popover-surface:after{transition:opacity 0.4s ease;pointer-events:none;content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;opacity:0.95;border-radius:var(--popover-border-radius, 0.75rem);background-color:var(--popover-body-background-color, var(--lime-elevated-surface-background-color))}.limel-popover-surface:focus{outline:none}.limel-popover-surface:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.limel-popover-surface:focus:after,.limel-popover-surface:focus-within:after{opacity:1}.limel-popover-surface>*{box-sizing:border-box}';export{c as limel_popover,l as limel_popover_surface}
|