@limetech/lime-elements 39.34.3 → 39.35.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 +12 -0
- package/dist/cjs/{checkbox.template-BLkvZRs6.js → checkbox.template-BewtdTin.js} +1 -1
- package/dist/cjs/image.template-DZC6_5a4.js +24 -0
- package/dist/cjs/{index-8x93m5oI.js → index-DYg_7kkT.js} +4 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +1 -1
- package/dist/cjs/limel-action-bar_3.cjs.entry.js +1 -1
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
- package/dist/cjs/limel-badge.cjs.entry.js +1 -1
- package/dist/cjs/limel-banner.cjs.entry.js +1 -1
- package/dist/cjs/limel-breadcrumbs_8.cjs.entry.js +1 -1
- package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
- package/dist/cjs/limel-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +1 -1
- package/dist/cjs/limel-card.cjs.entry.js +4 -3
- package/dist/cjs/limel-chart.cjs.entry.js +1 -1
- package/dist/cjs/limel-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/limel-chip-set.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +4 -3
- package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-diff.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
- package/dist/cjs/limel-color-picker-palette.cjs.entry.js +1 -1
- package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-config.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-dialog.cjs.entry.js +1 -1
- package/dist/cjs/limel-dock-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-dock.cjs.entry.js +1 -1
- package/dist/cjs/limel-drag-handle.cjs.entry.js +1 -1
- package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
- package/dist/cjs/limel-email-viewer.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +8 -5
- package/dist/cjs/limel-file.cjs.entry.js +1 -1
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
- package/dist/cjs/limel-form.cjs.entry.js +1 -1
- package/dist/cjs/limel-grid.cjs.entry.js +1 -1
- package/dist/cjs/limel-header.cjs.entry.js +1 -1
- package/dist/cjs/limel-help-content.cjs.entry.js +1 -1
- package/dist/cjs/limel-help.cjs.entry.js +1 -1
- package/dist/cjs/limel-helper-line.cjs.entry.js +1 -1
- package/dist/cjs/limel-hotkey_4.cjs.entry.js +1 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-icon.cjs.entry.js +1 -1
- package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
- package/dist/cjs/limel-list-item.cjs.entry.js +7 -6
- package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
- package/dist/cjs/limel-masonry-layout.cjs.entry.js +1 -1
- package/dist/cjs/limel-menu-item-meta.cjs.entry.js +1 -1
- package/dist/cjs/limel-picker.cjs.entry.js +1 -1
- package/dist/cjs/limel-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-profile-picture.cjs.entry.js +4 -3
- package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-progress-flow.cjs.entry.js +1 -1
- 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 +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +2 -2
- package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
- package/dist/cjs/limel-slider.cjs.entry.js +1 -1
- package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-switch.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-bar.cjs.entry.js +1 -1
- package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/limel-text-editor-link-menu.cjs.entry.js +1 -1
- package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{render-list-component-DAV1Dyg1.js → render-list-component-1GrRKk_R.js} +1 -1
- package/dist/collection/components/card/card.js +3 -2
- package/dist/collection/components/chip/chip.js +3 -2
- package/dist/collection/components/file-viewer/file-viewer.js +8 -5
- package/dist/collection/components/list-item/list-item.js +4 -3
- package/dist/collection/components/profile-picture/profile-picture.js +3 -2
- package/dist/collection/util/image.template.js +19 -0
- package/dist/esm/{checkbox.template-CtIjSGPt.js → checkbox.template-LN1xNaDw.js} +1 -1
- package/dist/esm/image.template-BXDvrqGw.js +22 -0
- package/dist/esm/{index-VCOjLfyP.js → index-BGxJfR2f.js} +4 -1
- package/dist/esm/lime-elements.js +2 -2
- package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
- package/dist/esm/limel-action-bar_3.entry.js +1 -1
- package/dist/esm/limel-ai-avatar.entry.js +1 -1
- package/dist/esm/limel-badge.entry.js +1 -1
- package/dist/esm/limel-banner.entry.js +1 -1
- package/dist/esm/limel-breadcrumbs_8.entry.js +1 -1
- package/dist/esm/limel-button-group.entry.js +1 -1
- package/dist/esm/limel-button.entry.js +1 -1
- package/dist/esm/limel-callout.entry.js +1 -1
- package/dist/esm/limel-card.entry.js +4 -3
- package/dist/esm/limel-chart.entry.js +1 -1
- package/dist/esm/limel-checkbox.entry.js +2 -2
- package/dist/esm/limel-chip-set.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +4 -3
- package/dist/esm/limel-circular-progress.entry.js +1 -1
- package/dist/esm/limel-code-diff.entry.js +1 -1
- package/dist/esm/limel-code-editor.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +1 -1
- package/dist/esm/limel-color-picker-palette.entry.js +1 -1
- package/dist/esm/limel-color-picker.entry.js +1 -1
- package/dist/esm/limel-config.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +1 -1
- package/dist/esm/limel-dialog.entry.js +1 -1
- package/dist/esm/limel-dock-button.entry.js +1 -1
- package/dist/esm/limel-dock.entry.js +1 -1
- package/dist/esm/limel-drag-handle.entry.js +1 -1
- package/dist/esm/limel-dynamic-label.entry.js +1 -1
- package/dist/esm/limel-email-viewer.entry.js +1 -1
- package/dist/esm/limel-file-dropzone_2.entry.js +1 -1
- package/dist/esm/limel-file-viewer.entry.js +8 -5
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-flex-container.entry.js +1 -1
- package/dist/esm/limel-form.entry.js +1 -1
- package/dist/esm/limel-grid.entry.js +1 -1
- package/dist/esm/limel-header.entry.js +1 -1
- package/dist/esm/limel-help-content.entry.js +1 -1
- package/dist/esm/limel-help.entry.js +1 -1
- package/dist/esm/limel-helper-line.entry.js +1 -1
- package/dist/esm/limel-hotkey_4.entry.js +1 -1
- package/dist/esm/limel-icon-button.entry.js +1 -1
- package/dist/esm/limel-icon.entry.js +1 -1
- package/dist/esm/limel-info-tile.entry.js +1 -1
- package/dist/esm/limel-list-item.entry.js +7 -6
- package/dist/esm/limel-markdown.entry.js +1 -1
- package/dist/esm/limel-masonry-layout.entry.js +1 -1
- package/dist/esm/limel-menu-item-meta.entry.js +1 -1
- package/dist/esm/limel-picker.entry.js +1 -1
- package/dist/esm/limel-popover_2.entry.js +1 -1
- package/dist/esm/limel-profile-picture.entry.js +4 -3
- package/dist/esm/limel-progress-flow-item.entry.js +1 -1
- package/dist/esm/limel-progress-flow.entry.js +1 -1
- 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 +1 -1
- package/dist/esm/limel-select.entry.js +2 -2
- package/dist/esm/limel-shortcut.entry.js +1 -1
- package/dist/esm/limel-slider.entry.js +1 -1
- package/dist/esm/limel-snackbar.entry.js +1 -1
- package/dist/esm/limel-split-button.entry.js +1 -1
- package/dist/esm/limel-switch.entry.js +1 -1
- package/dist/esm/limel-tab-bar.entry.js +1 -1
- package/dist/esm/limel-tab-panel.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/limel-text-editor-link-menu.entry.js +1 -1
- package/dist/esm/limel-text-editor.entry.js +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{render-list-component-BdncB2vG.js → render-list-component-CUJ2wdo4.js} +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-31965f6c.entry.js → p-068e7087.entry.js} +1 -1
- package/dist/lime-elements/{p-d8d6e12a.entry.js → p-09fb0765.entry.js} +1 -1
- package/dist/lime-elements/{p-9bb07225.entry.js → p-0ecf8399.entry.js} +1 -1
- package/dist/lime-elements/{p-7f891de4.entry.js → p-120182f5.entry.js} +1 -1
- package/dist/lime-elements/{p-44bd59ac.entry.js → p-13d56964.entry.js} +1 -1
- package/dist/lime-elements/{p-1153e2ba.entry.js → p-1525274d.entry.js} +1 -1
- package/dist/lime-elements/{p-fc435802.entry.js → p-1907a5be.entry.js} +1 -1
- package/dist/lime-elements/{p-90a506aa.entry.js → p-191efd88.entry.js} +1 -1
- package/dist/lime-elements/{p-9e8eaa86.entry.js → p-19347686.entry.js} +1 -1
- package/dist/lime-elements/{p-a827a280.entry.js → p-21558be2.entry.js} +1 -1
- package/dist/lime-elements/{p-444e3088.entry.js → p-2531a103.entry.js} +1 -1
- package/dist/lime-elements/{p-719dc4c0.entry.js → p-2737cade.entry.js} +1 -1
- package/dist/lime-elements/p-2a871a95.entry.js +1 -0
- package/dist/lime-elements/p-2b9f4bd9.entry.js +1 -0
- package/dist/lime-elements/{p-08e7006f.entry.js → p-36ccc68e.entry.js} +1 -1
- package/dist/lime-elements/{p-10955e5d.entry.js → p-4f396a5e.entry.js} +1 -1
- package/dist/lime-elements/{p-317d56a7.entry.js → p-51cb779f.entry.js} +1 -1
- package/dist/lime-elements/{p-a73f70d7.entry.js → p-54961e0e.entry.js} +1 -1
- package/dist/lime-elements/{p-0605c490.entry.js → p-54cf3d4d.entry.js} +1 -1
- package/dist/lime-elements/{p-45801616.entry.js → p-6665e14b.entry.js} +1 -1
- package/dist/lime-elements/{p-e38a13fb.entry.js → p-6acd82ce.entry.js} +1 -1
- package/dist/lime-elements/{p-9b7966f1.entry.js → p-6edf13b1.entry.js} +1 -1
- package/dist/lime-elements/{p-33ab319b.entry.js → p-70087de6.entry.js} +1 -1
- package/dist/lime-elements/{p-e59d7177.entry.js → p-79caf3f6.entry.js} +1 -1
- package/dist/lime-elements/{p-66600fc3.entry.js → p-7bfac292.entry.js} +1 -1
- package/dist/lime-elements/p-7df111bb.entry.js +1 -0
- package/dist/lime-elements/{p-e7b9716f.entry.js → p-7fe6a073.entry.js} +1 -1
- package/dist/lime-elements/{p-ed70059b.entry.js → p-8175c53a.entry.js} +1 -1
- package/dist/lime-elements/{p-6c60d915.entry.js → p-86b9f9d0.entry.js} +1 -1
- package/dist/lime-elements/{p-8376ac0d.entry.js → p-8f4273e4.entry.js} +2 -2
- package/dist/lime-elements/{p-caf1bca2.entry.js → p-92bbb643.entry.js} +1 -1
- package/dist/lime-elements/{p-fe64b285.entry.js → p-92ea6adc.entry.js} +1 -1
- package/dist/lime-elements/{p-f7695614.entry.js → p-946a33ea.entry.js} +1 -1
- package/dist/lime-elements/{p-5a00f0fb.entry.js → p-9af95bed.entry.js} +1 -1
- package/dist/lime-elements/{p-8aaf4f50.entry.js → p-9fb8bec9.entry.js} +1 -1
- package/dist/lime-elements/{p-VCOjLfyP.js → p-BGxJfR2f.js} +2 -2
- package/dist/lime-elements/{p-D9twpDvz.js → p-CYivp4-w.js} +1 -1
- package/dist/lime-elements/p-DQvn9bzh.js +1 -0
- package/dist/lime-elements/p-Dpg0OkbJ.js +1 -0
- package/dist/lime-elements/{p-aba01020.entry.js → p-a1c15727.entry.js} +1 -1
- package/dist/lime-elements/{p-f9b74b03.entry.js → p-a3a2aafe.entry.js} +1 -1
- package/dist/lime-elements/{p-2a27bf12.entry.js → p-a79361e1.entry.js} +1 -1
- package/dist/lime-elements/{p-6fa4b1b3.entry.js → p-ad4672b2.entry.js} +1 -1
- package/dist/lime-elements/{p-eef0cd8b.entry.js → p-b3274e2e.entry.js} +1 -1
- package/dist/lime-elements/{p-53b7bee8.entry.js → p-bb201b0d.entry.js} +1 -1
- package/dist/lime-elements/{p-17ff8353.entry.js → p-bb9b399c.entry.js} +1 -1
- package/dist/lime-elements/{p-aa8d7faa.entry.js → p-be5cc2ae.entry.js} +1 -1
- package/dist/lime-elements/{p-aa6190e8.entry.js → p-bf3c78a8.entry.js} +1 -1
- package/dist/lime-elements/{p-ac5d5099.entry.js → p-c0263530.entry.js} +1 -1
- package/dist/lime-elements/{p-a7e9e96c.entry.js → p-c8ce60a0.entry.js} +1 -1
- package/dist/lime-elements/p-ca0a8a5a.entry.js +1 -0
- package/dist/lime-elements/{p-e31d0b36.entry.js → p-d19ab443.entry.js} +1 -1
- package/dist/lime-elements/{p-fac02bae.entry.js → p-d521d599.entry.js} +1 -1
- package/dist/lime-elements/p-d8cb7d42.entry.js +1 -0
- package/dist/lime-elements/{p-2ef433e0.entry.js → p-dd9591a3.entry.js} +1 -1
- package/dist/lime-elements/{p-7b687fc6.entry.js → p-de070191.entry.js} +1 -1
- package/dist/lime-elements/{p-e4549e8b.entry.js → p-e08f770e.entry.js} +1 -1
- package/dist/lime-elements/{p-f91de6bd.entry.js → p-e3ba7e15.entry.js} +1 -1
- package/dist/lime-elements/{p-2486f61d.entry.js → p-e54bbdb3.entry.js} +1 -1
- package/dist/lime-elements/{p-db0bd965.entry.js → p-ea94f7fa.entry.js} +1 -1
- package/dist/lime-elements/{p-cdbab1d5.entry.js → p-ed53466d.entry.js} +1 -1
- package/dist/lime-elements/{p-9eb6879d.entry.js → p-ee58f0b4.entry.js} +1 -1
- package/dist/lime-elements/{p-a11abcb0.entry.js → p-eeb7fcb3.entry.js} +2 -2
- package/dist/lime-elements/{p-c6cbd842.entry.js → p-eecd1132.entry.js} +1 -1
- package/dist/lime-elements/{p-80b0bcb3.entry.js → p-f09822a6.entry.js} +1 -1
- package/dist/lime-elements/{p-c447d311.entry.js → p-f2c8b10b.entry.js} +1 -1
- package/dist/lime-elements/{p-f5e2f3b4.entry.js → p-fc43fb46.entry.js} +6 -6
- package/dist/lime-elements/{p-bcc2cb1a.entry.js → p-fd78537c.entry.js} +1 -1
- package/dist/lime-elements/{p-dc415221.entry.js → p-fe531211.entry.js} +1 -1
- package/dist/lime-elements/{p-7776313e.entry.js → p-ffd668d2.entry.js} +1 -1
- package/dist/types/global/shared-types/image.types.d.ts +8 -0
- package/dist/types/util/image.template.d.ts +35 -0
- package/package.json +2 -2
- package/dist/lime-elements/p-0b9f3cf1.entry.js +0 -1
- package/dist/lime-elements/p-2cb55d62.entry.js +0 -1
- package/dist/lime-elements/p-9eb06bf7.entry.js +0 -1
- package/dist/lime-elements/p-NN0EYecx.js +0 -1
- package/dist/lime-elements/p-b3b53dbc.entry.js +0 -1
- package/dist/lime-elements/p-b7649589.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,a as l,H as n}from"./p-VCOjLfyP.js";import{m as r,r as o}from"./p-BgTwPGeH.js";import{c as d}from"./p-JbKhhoXs.js";import{g as a,b as s}from"./p-CgNJbSP4.js";import{T as c,A as m,b as h,E as f,a as u,S as x,c as p,d as b}from"./p-rI0IeKpx.js";import{b as g,a as v,g as _}from"./p-5KsJICvh.js";import{g as y}from"./p-Dnt5w_Bp.js";import{d as w}from"./p-BviYUVSD.js";import{M as k}from"./p-DZkKQUDM.js";import{_ as I,a as T,M as E,m as C,d as A,c as O,b as z}from"./p-ChRGk668.js";import{f as S,z as R}from"./p-D0F7gOYG.js";import{h as L,t as D,n as j}from"./p-BxrRWYts.js";import{i as F}from"./p-BcJ-TDVt.js";import{M}from"./p-BN1-aIOw.js";import{i as N}from"./p-B9Ofc5RB.js";import"./p-BJQylLSL.js";import"./p-D6dCQvwl.js";import"./p-BOEi1C7r.js";import"./p-oiMYqRQ0.js";import"./p-C9yTLqR8.js";import"./p-ByzvFNMm.js";import"./p-9W8bTt2G.js";import"./p-DbBZn7JO.js";import"./p-CZ30nDJE.js";const B=class{constructor(l){t(this,l),this.select=e(this,"select"),this.divider="›",this.renderSteps=()=>{const t=this.items.slice(0,-1);return this.areItemsLinks(this.items)?t.map(this.renderAsLink):t.map(this.renderAsButton)},this.renderAsButton=t=>{const e=d();return[i("button",{role:"listitem",id:e,class:"step",onClick:this.handleClick(t)},this.renderIcon(t),this.renderLabel(t)),this.renderTooltip(t,e)]},this.renderAsLink=t=>{const e=d();return[i("a",{role:"listitem",id:e,class:"step",href:t.link.href,title:t.link.title},this.renderIcon(t),this.renderLabel(t)),this.renderTooltip(t,e)]},this.renderLastStep=()=>{const t=this.items.slice(-1);return i("li",{class:"last step",tabindex:"-1","aria-current":this.areItemsLinks(this.items)?"page":"step"},this.renderIcon(t[0]),i("span",{class:"text"},t[0].text))},this.renderIcon=t=>{const e=a(t.icon),l=s(t.icon);if(e)return i("limel-icon",{style:{color:`${l}`},name:e})},this.renderLabel=t=>{if("icon-only"!==t.type)return i("span",{class:"text"},t.text)},this.renderTooltip=(t,e)=>{if("icon-only"===t.type)return i("limel-tooltip",{elementId:e,label:t.text})},this.areItemsLinks=t=>t.some((t=>"link"in t)),this.handleClick=t=>e=>{e.stopPropagation(),this.select.emit(t)}}render(){return i("ol",{key:"66f28dfd61493e4aa5d86b0d2434c2039fee4636",role:"navigation","aria-label":"Breadcrumb",style:{"--limel-breadcrumbs-divider":`'${this.divider}'`}},this.renderSteps(),this.renderLastStep())}componentWillLoad(){r(this.host)}disconnectedCallback(){o(this.host)}get host(){return l(this)}};B.style='@charset "UTF-8";:host(limel-breadcrumbs){--limel-breadcrumbs-item-height:1.5rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-item-text-color:var( --breadcrumbs-item-text-color, rgb(var(--contrast-1500)) );--limel-overflow-mask-horizontal:linear-gradient( to right, transparent 0%, black calc(0% + var(--limel-left-edge-fade-width, 1rem)), black calc(100% - var(--limel-right-edge-fade-width, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-horizontal);mask-image:var(--limel-overflow-mask-horizontal);padding-left:var(--limel-left-edge-fade-width, 1rem);padding-right:var(--limel-right-edge-fade-width, 1rem);--limel-left-edge-fade-width:0.5rem;--limel-right-edge-fade-width:0.5rem}ol,li,.step{all:unset}*{box-sizing:border-box}ol{padding:0.5rem;gap:var(--limel-breadcrumbs-gap)}.step{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:0.25rem;max-width:var(--breadcrumbs-item-max-width, 10rem);height:var(--limel-breadcrumbs-item-height);color:var(--limel-breadcrumbs-item-text-color);border-radius:100vw;font-size:var(--limel-theme-default-font-size);padding:0 0.25rem}.step:not(:has(.text)){padding:0 0.125rem}.step:not(.last):focus{outline:none}.step:not(.last):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.step:not(.last):after{content:var(--limel-breadcrumbs-divider);display:flex;align-items:center;justify-content:center;width:var(--limel-breadcrumbs-gap);position:absolute;top:0;right:calc(var(--limel-breadcrumbs-gap) * -1);bottom:0;left:auto;text-align:center}a.step{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--limel-breadcrumbs-item-text-color)}a.step:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}a.step:hover{color:rgb(var(--color-blue-default))}a.step:hover:before{opacity:0.3;transform:scale(1)}button.step:not(.last){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-breadcrumbs-item-text-color);background-color:transparent}button.step:not(.last):hover,button.step:not(.last):focus,button.step:not(.last):focus-visible{will-change:color, background-color, box-shadow, transform}button.step:not(.last):hover,button.step:not(.last):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}button.step:not(.last):hover{box-shadow:var(--button-shadow-hovered)}button.step:not(.last):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)}button.step:not(.last):hover,button.step:not(.last):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limel-icon{flex-shrink:0;width:calc(var(--limel-breadcrumbs-item-height) - 0.25rem);height:calc(var(--limel-breadcrumbs-item-height) - 0.25rem)}.text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 0.25rem}.last{opacity:0.7}:host(limel-breadcrumbs){box-sizing:border-box;display:flex;width:100%;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}:host(limel-breadcrumbs)::-webkit-scrollbar{display:none}:host(limel-breadcrumbs){direction:rtl}ol{display:flex;flex-direction:row-reverse;justify-content:flex-end;margin-right:auto}.step{direction:ltr}';const Y=class{constructor(l){t(this,l),this.change=e(this,"change"),this.action=e(this,"action"),this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.type="text",this.formatNumber=!0,this.step="any",this.completions=[],this.showLink=!1,this.locale=y.defaultLocale,this.isFocused=!1,this.wasInvalid=!1,this.showCompletions=!1,this.completionsList=[],this.changeWaiting=!1,this.initialize=()=>{const t=this.limelInputField.shadowRoot.querySelector(".mdc-text-field");t&&(this.mdcTextField=new k(t),this.value&&(this.mdcTextField.value=this.value),this.invalid&&(this.mdcTextField.valid=!1),this.mapCompletions(),window.addEventListener("resize",this.layout,{passive:!0}),this.limelInputField.addEventListener("focus",this.setFocus))},this.mapCompletions=()=>{this.completionsList=[...this.completions].map((t=>({text:t})))},this.setFocus=()=>{this.mdcTextField.focus()},this.getContainerClassList=()=>{const t={"mdc-text-field":!0,"mdc-text-field--outlined":!0,"mdc-text-field--invalid":this.isInvalid(),"mdc-text-field--disabled":this.disabled||this.readonly,"lime-text-field--readonly":this.readonly,"mdc-text-field--required":this.required,"lime-text-field--empty":this.isEmpty(),"lime-has-prefix":this.hasPrefix(),"lime-has-suffix":this.hasSuffix()};return"textarea"===this.type?t["mdc-text-field--textarea"]=!0:(t["mdc-text-field--with-leading-icon"]=!!this.leadingIcon,t["mdc-text-field--with-trailing-icon"]=!!this.getTrailingIcon()),t},this.isEmpty=()=>{var t;return!("number"===this.type&&(null===(t=this.inputElement)||void 0===t?void 0:t.validity.badInput)||this.getCurrentValue())},this.getCurrentValue=()=>this.changeWaiting&&this.inputElement?this.inputElement.value:this.value,this.renderInput=t=>{if("textarea"!==this.type)return i("input",Object.assign({},t,{type:"urlAsText"===this.type?"text":this.type,pattern:this.pattern,onWheel:this.handleWheel,onKeyDown:this.onKeyDown,placeholder:this.placeholder}))},this.renderTextarea=t=>{if("textarea"===this.type)return i("span",{class:"mdc-text-field__resizer"},i("textarea",Object.assign({},t,{placeholder:this.placeholder})))},this.layout=()=>{var t;null===(t=this.mdcTextField)||void 0===t||t.layout(),this.restyleCompletionsDropDown()},this.restyleCompletionsDropDown=w((()=>{const t=this.showCompletions;this.showCompletions=!1,requestAnimationFrame((()=>{this.showCompletions=t}))}),100),this.getAdditionalProps=()=>{const t={};return"number"===this.type&&(t.step=this.step),"number"===this.type&&Number.isInteger(this.min)&&(t.min=this.min),"number"===this.type&&Number.isInteger(this.max)&&(t.max=this.max),this.minlength&&(t.minlength=this.minlength),this.maxlength&&(t.maxlength=this.maxlength),t},this.onFocus=()=>{this.isFocused=!0,this.showCompletions=!0},this.onBlur=()=>{this.isFocused=!1,this.validate(),this.changeEmitter.flush()},this.hasHelperText=()=>{var t;return!!(null!==(t=this.helperText)&&void 0!==t?t:this.validationMessage)},this.hasHelperLine=()=>this.maxlength>0||this.hasHelperText(),this.renderHelperLine=()=>{var t;const e=(this.getCurrentValue()||"").length;if(this.hasHelperLine())return i("limel-helper-line",{helperTextId:this.helperTextId,helperText:null!==(t=this.helperText)&&void 0!==t?t:this.validationMessage,length:e,maxLength:this.maxlength,invalid:this.isInvalid()})},this.renderSuffix=()=>{if(this.hasSuffix()&&"textarea"!==this.type)return i("span",{class:{"mdc-text-field__affix":!0,"mdc-text-field__affix--suffix":!0}},this.suffix)},this.hasSuffix=()=>null!=this.suffix,this.renderPrefix=()=>{if(this.hasPrefix()&&"textarea"!==this.type)return i("span",{class:{"mdc-text-field__affix":!0,"mdc-text-field__affix--prefix":!0}},this.prefix)},this.hasPrefix=()=>null!=this.prefix,this.isInvalid=()=>!this.readonly&&(!!this.invalid||this.wasInvalid),this.validate=()=>{this.readonly||this.invalid?this.wasInvalid=!1:this.inputElement&&(this.wasInvalid=!this.inputElement.checkValidity())},this.setInputElement=t=>{t&&(this.inputElement=t)},this.renderLeadingIcon=()=>{if("textarea"!==this.type)return this.leadingIcon?i("i",{class:"material-icons mdc-text-field__icon mdc-text-field__icon--leading"},i("limel-icon",{name:this.leadingIcon})):void 0},this.renderTrailingLinkOrButton=()=>{if("textarea"===this.type)return;const t=this.getTrailingIcon();return!this.isInvalid()&&this.hasLink()?this.renderLinkIcon(this.getLink(),t):t?this.renderTrailingIcon(t):void 0},this.hasLink=()=>this.showLink&&["email","tel","url","urlAsText"].includes(this.type),this.getLink=()=>{const t={href:""};switch(this.type){case"email":t.href=`mailto:${this.value}`;break;case"tel":t.href=`tel:${this.value}`;break;default:t.href=g(this.value),t.target=v(this.value),t.rel=_(t.target)}return t},this.renderLinkIcon=(t,e)=>i("a",Object.assign({},t,{class:"material-icons mdc-text-field__icon lime-trailing-icon-for-link",tabindex:this.disabled||this.isEmpty()?"-1":"0",role:"button"}),i("limel-icon",{name:e})),this.renderTrailingIcon=t=>this.isInvalid()?i("i",{key:"invalid",class:"material-icons mdc-text-field__icon invalid-icon"},i("limel-icon",{name:t})):i("i",{key:"action",class:"material-icons mdc-text-field__icon mdc-text-field__icon--trailing",tabIndex:0,role:"button",onKeyDown:this.handleIconKeyPress,onClick:this.handleIconClick},i("limel-icon",{name:t})),this.getTrailingIcon=()=>this.isInvalid()?"high_importance":this.trailingIcon?this.trailingIcon:this.showLink&&"email"===this.type?"filled_message":this.showLink&&"tel"===this.type?"phone":!this.showLink||"url"!==this.type&&"urlAsText"!==this.type?void 0:"external_link",this.renderFormattedNumber=()=>{if("number"!==this.type)return;let t=this.value;return this.formatNumber&&this.value&&(t=new Intl.NumberFormat(this.locale).format(Number(this.value)),"NaN"===t)?void 0:i("span",{class:"lime-formatted-input lime-looks-like-input-value"},t)},this.onKeyDown=t=>{this.showCompletions=!0;const e=t.key===c&&!t.altKey&&!t.metaKey&&!t.shiftKey,i=t.key===m,l=t.key===h;if(t.key===c&&t.shiftKey&&(this.showCompletions=!1),!e&&!i&&!l)return;const n=document.querySelector(` #${this.portalId} limel-list`);n&&(t.preventDefault(),e||l?n.shadowRoot.querySelector(".mdc-deprecated-list-item:first-child").focus():i&&n.shadowRoot.querySelector(".mdc-deprecated-list-item:last-child").focus())},this.handleCompletionChange=t=>{t.stopPropagation(),t.detail&&(this.showCompletions=!1,this.changeEmitter(t.detail.text),this.changeEmitter.flush())},this.renderAutocompleteList=()=>{if("textarea"===this.type||0===this.completions.length)return;const t=getComputedStyle(this.limelInputField).getPropertyValue("--dropdown-z-index");return i("limel-portal",{visible:this.showCompletions,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":t}},i("limel-menu-surface",{open:this.showCompletions,allowClicksElement:this.limelInputField,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},this.renderListResult()))},this.renderListResult=()=>{const t=this.filterCompletions(this.getCurrentValue());return t&&0!==t.length?i("limel-list",{onChange:this.handleCompletionChange,onKeyDown:this.handleKeyDownInDropdown,type:"selectable",items:t}):null},this.handleKeyDownInDropdown=t=>{[c,f,u].includes(t.key)&&this.setFocus()},this.handleCloseMenu=()=>{this.showCompletions=!1},this.filterCompletions=t=>t?this.completionsList.filter((e=>e.text.toLowerCase().includes(t.toLowerCase()))):this.completionsList,this.handleInput=t=>{t.stopPropagation();let e=t.target.value;if("number"===this.type){if(!e&&t.data)return void t.stopPropagation();e&&(e=Number(e))}this.changeWaiting=!0,this.changeEmitter(e)},this.changeEmitter=w((t=>{this.change.emit(t),this.changeWaiting=!1}),300),this.handleChange=t=>{t.stopPropagation(),this.changeEmitter.flush()},this.handleIconClick=()=>{this.action.emit()},this.handleIconKeyPress=t=>{(t.key===x||t.key===u)&&this.action.emit()},this.handleWheel=()=>{},this.portalId=d(),this.helperTextId=d(),this.labelId=d()}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}disconnectedCallback(){this.mdcTextField&&this.mdcTextField.destroy(),this.restyleCompletionsDropDown.cancel(),window.removeEventListener("resize",this.layout),this.limelInputField.removeEventListener("focus",this.setFocus)}componentDidUpdate(){this.invalid?this.mdcTextField.valid=!1:this.wasInvalid||(this.mdcTextField.valid=!0),this.mdcTextField.disabled=this.disabled||this.readonly}async getSelectionStart(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionStart)&&void 0!==e?e:null}catch(t){return null}}async getSelectionEnd(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionEnd)&&void 0!==e?e:null}catch(t){return null}}async getSelectionDirection(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionDirection)&&void 0!==e?e:null}catch(t){return null}}render(){const t=this.getAdditionalProps();t["aria-labelledby"]=this.labelId,t.class="mdc-text-field__input",t.ref=this.setInputElement,t.onInput=this.handleInput,t.onChange=this.handleChange,t.onFocus=this.onFocus,t.onBlur=this.onBlur,t.required=this.required,t.readonly=this.readonly,t.disabled=this.disabled||this.readonly;let e="";return this.hasHelperText()&&(e+=this.helperTextId,t["aria-describedby"]=this.helperTextId),this.renderAutocompleteList()&&(e&&(e+=" "),e+=this.portalId),e&&(t["aria-controls"]=e),i(n,{key:"e6f4d81dfdfef80077c4537a6e23220fc7c0dbce"},i("limel-notched-outline",{key:"a0feabbe707cd51308a40cea1bff974bc3459f74",labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid||this.isInvalid(),disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasLeadingIcon:!!this.leadingIcon},i("label",{key:"ef17b7ae25a2c4511aa7b4011f1692cd4065b5b2",slot:"content",class:this.getContainerClassList()},this.renderLeadingIcon(),this.renderPrefix(),this.renderFormattedNumber(),this.renderInput(t),this.renderSuffix(),this.renderTextarea(t),this.renderTrailingLinkOrButton())),this.renderHelperLine(),this.renderAutocompleteList())}valueWatcher(t){this.mdcTextField&&(this.changeWaiting||"number"===this.type&&this.isFocused&&Number(t)===Number(this.mdcTextField.value)||(t!==this.mdcTextField.value&&(this.mdcTextField.value=t||""),this.wasInvalid&&this.validate()))}completionsWatcher(){this.mapCompletions()}get validationMessage(){var t;return this.isInvalid()&&!this.invalid&&(null===(t=this.inputElement)||void 0===t?void 0:t.validationMessage)||""}static get delegatesFocus(){return!0}get limelInputField(){return l(this)}static get watchers(){return{value:[{valueWatcher:0}],completions:[{completionsWatcher:0}]}}};
|
|
1
|
+
import{r as t,c as e,h as i,a as l,H as n}from"./p-BGxJfR2f.js";import{m as r,r as o}from"./p-BgTwPGeH.js";import{c as d}from"./p-JbKhhoXs.js";import{g as a,b as s}from"./p-CgNJbSP4.js";import{T as c,A as m,b as h,E as f,a as u,S as x,c as p,d as b}from"./p-rI0IeKpx.js";import{b as g,a as v,g as _}from"./p-5KsJICvh.js";import{g as y}from"./p-Dnt5w_Bp.js";import{d as w}from"./p-BviYUVSD.js";import{M as k}from"./p-DZkKQUDM.js";import{_ as I,a as T,M as E,m as A,d as C,c as O,b as z}from"./p-ChRGk668.js";import{f as S,z as R}from"./p-D0F7gOYG.js";import{h as L,t as D,n as j}from"./p-BxrRWYts.js";import{i as F}from"./p-BcJ-TDVt.js";import{M}from"./p-BN1-aIOw.js";import{i as N}from"./p-B9Ofc5RB.js";import"./p-BJQylLSL.js";import"./p-D6dCQvwl.js";import"./p-BOEi1C7r.js";import"./p-oiMYqRQ0.js";import"./p-C9yTLqR8.js";import"./p-ByzvFNMm.js";import"./p-9W8bTt2G.js";import"./p-DbBZn7JO.js";import"./p-CZ30nDJE.js";const B=class{constructor(l){t(this,l),this.select=e(this,"select"),this.divider="›",this.renderSteps=()=>{const t=this.items.slice(0,-1);return this.areItemsLinks(this.items)?t.map(this.renderAsLink):t.map(this.renderAsButton)},this.renderAsButton=t=>{const e=d();return[i("button",{role:"listitem",id:e,class:"step",onClick:this.handleClick(t)},this.renderIcon(t),this.renderLabel(t)),this.renderTooltip(t,e)]},this.renderAsLink=t=>{const e=d();return[i("a",{role:"listitem",id:e,class:"step",href:t.link.href,title:t.link.title},this.renderIcon(t),this.renderLabel(t)),this.renderTooltip(t,e)]},this.renderLastStep=()=>{const t=this.items.slice(-1);return i("li",{class:"last step",tabindex:"-1","aria-current":this.areItemsLinks(this.items)?"page":"step"},this.renderIcon(t[0]),i("span",{class:"text"},t[0].text))},this.renderIcon=t=>{const e=a(t.icon),l=s(t.icon);if(e)return i("limel-icon",{style:{color:`${l}`},name:e})},this.renderLabel=t=>{if("icon-only"!==t.type)return i("span",{class:"text"},t.text)},this.renderTooltip=(t,e)=>{if("icon-only"===t.type)return i("limel-tooltip",{elementId:e,label:t.text})},this.areItemsLinks=t=>t.some((t=>"link"in t)),this.handleClick=t=>e=>{e.stopPropagation(),this.select.emit(t)}}render(){return i("ol",{key:"66f28dfd61493e4aa5d86b0d2434c2039fee4636",role:"navigation","aria-label":"Breadcrumb",style:{"--limel-breadcrumbs-divider":`'${this.divider}'`}},this.renderSteps(),this.renderLastStep())}componentWillLoad(){r(this.host)}disconnectedCallback(){o(this.host)}get host(){return l(this)}};B.style='@charset "UTF-8";:host(limel-breadcrumbs){--limel-breadcrumbs-item-height:1.5rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-gap:0.75rem;--limel-breadcrumbs-item-text-color:var( --breadcrumbs-item-text-color, rgb(var(--contrast-1500)) );--limel-overflow-mask-horizontal:linear-gradient( to right, transparent 0%, black calc(0% + var(--limel-left-edge-fade-width, 1rem)), black calc(100% - var(--limel-right-edge-fade-width, 1rem)), transparent 100% );-webkit-mask-image:var(--limel-overflow-mask-horizontal);mask-image:var(--limel-overflow-mask-horizontal);padding-left:var(--limel-left-edge-fade-width, 1rem);padding-right:var(--limel-right-edge-fade-width, 1rem);--limel-left-edge-fade-width:0.5rem;--limel-right-edge-fade-width:0.5rem}ol,li,.step{all:unset}*{box-sizing:border-box}ol{padding:0.5rem;gap:var(--limel-breadcrumbs-gap)}.step{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:0.25rem;max-width:var(--breadcrumbs-item-max-width, 10rem);height:var(--limel-breadcrumbs-item-height);color:var(--limel-breadcrumbs-item-text-color);border-radius:100vw;font-size:var(--limel-theme-default-font-size);padding:0 0.25rem}.step:not(:has(.text)){padding:0 0.125rem}.step:not(.last):focus{outline:none}.step:not(.last):focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.step:not(.last):after{content:var(--limel-breadcrumbs-divider);display:flex;align-items:center;justify-content:center;width:var(--limel-breadcrumbs-gap);position:absolute;top:0;right:calc(var(--limel-breadcrumbs-gap) * -1);bottom:0;left:auto;text-align:center}a.step{position:relative;cursor:pointer;transition:color 0.2s ease;color:var(--limel-breadcrumbs-item-text-color)}a.step:before{transition:opacity 0.2s ease, transform 0.3s ease-out;content:"";position:absolute;inset:auto 0 0 0;width:calc(100% - 0.5rem);margin:auto;height:0.125rem;border-radius:1rem;background-color:currentColor;opacity:0;transform:scale(0.6)}a.step:hover{color:rgb(var(--color-blue-default))}a.step:hover:before{opacity:0.3;transform:scale(1)}button.step:not(.last){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-breadcrumbs-item-text-color);background-color:transparent}button.step:not(.last):hover,button.step:not(.last):focus,button.step:not(.last):focus-visible{will-change:color, background-color, box-shadow, transform}button.step:not(.last):hover,button.step:not(.last):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}button.step:not(.last):hover{box-shadow:var(--button-shadow-hovered)}button.step:not(.last):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)}button.step:not(.last):hover,button.step:not(.last):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limel-icon{flex-shrink:0;width:calc(var(--limel-breadcrumbs-item-height) - 0.25rem);height:calc(var(--limel-breadcrumbs-item-height) - 0.25rem)}.text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:0 0.25rem}.last{opacity:0.7}:host(limel-breadcrumbs){box-sizing:border-box;display:flex;width:100%;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}:host(limel-breadcrumbs)::-webkit-scrollbar{display:none}:host(limel-breadcrumbs){direction:rtl}ol{display:flex;flex-direction:row-reverse;justify-content:flex-end;margin-right:auto}.step{direction:ltr}';const Y=class{constructor(l){t(this,l),this.change=e(this,"change"),this.action=e(this,"action"),this.disabled=!1,this.readonly=!1,this.invalid=!1,this.required=!1,this.type="text",this.formatNumber=!0,this.step="any",this.completions=[],this.showLink=!1,this.locale=y.defaultLocale,this.isFocused=!1,this.wasInvalid=!1,this.showCompletions=!1,this.completionsList=[],this.changeWaiting=!1,this.initialize=()=>{const t=this.limelInputField.shadowRoot.querySelector(".mdc-text-field");t&&(this.mdcTextField=new k(t),this.value&&(this.mdcTextField.value=this.value),this.invalid&&(this.mdcTextField.valid=!1),this.mapCompletions(),window.addEventListener("resize",this.layout,{passive:!0}),this.limelInputField.addEventListener("focus",this.setFocus))},this.mapCompletions=()=>{this.completionsList=[...this.completions].map((t=>({text:t})))},this.setFocus=()=>{this.mdcTextField.focus()},this.getContainerClassList=()=>{const t={"mdc-text-field":!0,"mdc-text-field--outlined":!0,"mdc-text-field--invalid":this.isInvalid(),"mdc-text-field--disabled":this.disabled||this.readonly,"lime-text-field--readonly":this.readonly,"mdc-text-field--required":this.required,"lime-text-field--empty":this.isEmpty(),"lime-has-prefix":this.hasPrefix(),"lime-has-suffix":this.hasSuffix()};return"textarea"===this.type?t["mdc-text-field--textarea"]=!0:(t["mdc-text-field--with-leading-icon"]=!!this.leadingIcon,t["mdc-text-field--with-trailing-icon"]=!!this.getTrailingIcon()),t},this.isEmpty=()=>{var t;return!("number"===this.type&&(null===(t=this.inputElement)||void 0===t?void 0:t.validity.badInput)||this.getCurrentValue())},this.getCurrentValue=()=>this.changeWaiting&&this.inputElement?this.inputElement.value:this.value,this.renderInput=t=>{if("textarea"!==this.type)return i("input",Object.assign({},t,{type:"urlAsText"===this.type?"text":this.type,pattern:this.pattern,onWheel:this.handleWheel,onKeyDown:this.onKeyDown,placeholder:this.placeholder}))},this.renderTextarea=t=>{if("textarea"===this.type)return i("span",{class:"mdc-text-field__resizer"},i("textarea",Object.assign({},t,{placeholder:this.placeholder})))},this.layout=()=>{var t;null===(t=this.mdcTextField)||void 0===t||t.layout(),this.restyleCompletionsDropDown()},this.restyleCompletionsDropDown=w((()=>{const t=this.showCompletions;this.showCompletions=!1,requestAnimationFrame((()=>{this.showCompletions=t}))}),100),this.getAdditionalProps=()=>{const t={};return"number"===this.type&&(t.step=this.step),"number"===this.type&&Number.isInteger(this.min)&&(t.min=this.min),"number"===this.type&&Number.isInteger(this.max)&&(t.max=this.max),this.minlength&&(t.minlength=this.minlength),this.maxlength&&(t.maxlength=this.maxlength),t},this.onFocus=()=>{this.isFocused=!0,this.showCompletions=!0},this.onBlur=()=>{this.isFocused=!1,this.validate(),this.changeEmitter.flush()},this.hasHelperText=()=>{var t;return!!(null!==(t=this.helperText)&&void 0!==t?t:this.validationMessage)},this.hasHelperLine=()=>this.maxlength>0||this.hasHelperText(),this.renderHelperLine=()=>{var t;const e=(this.getCurrentValue()||"").length;if(this.hasHelperLine())return i("limel-helper-line",{helperTextId:this.helperTextId,helperText:null!==(t=this.helperText)&&void 0!==t?t:this.validationMessage,length:e,maxLength:this.maxlength,invalid:this.isInvalid()})},this.renderSuffix=()=>{if(this.hasSuffix()&&"textarea"!==this.type)return i("span",{class:{"mdc-text-field__affix":!0,"mdc-text-field__affix--suffix":!0}},this.suffix)},this.hasSuffix=()=>null!=this.suffix,this.renderPrefix=()=>{if(this.hasPrefix()&&"textarea"!==this.type)return i("span",{class:{"mdc-text-field__affix":!0,"mdc-text-field__affix--prefix":!0}},this.prefix)},this.hasPrefix=()=>null!=this.prefix,this.isInvalid=()=>!this.readonly&&(!!this.invalid||this.wasInvalid),this.validate=()=>{this.readonly||this.invalid?this.wasInvalid=!1:this.inputElement&&(this.wasInvalid=!this.inputElement.checkValidity())},this.setInputElement=t=>{t&&(this.inputElement=t)},this.renderLeadingIcon=()=>{if("textarea"!==this.type)return this.leadingIcon?i("i",{class:"material-icons mdc-text-field__icon mdc-text-field__icon--leading"},i("limel-icon",{name:this.leadingIcon})):void 0},this.renderTrailingLinkOrButton=()=>{if("textarea"===this.type)return;const t=this.getTrailingIcon();return!this.isInvalid()&&this.hasLink()?this.renderLinkIcon(this.getLink(),t):t?this.renderTrailingIcon(t):void 0},this.hasLink=()=>this.showLink&&["email","tel","url","urlAsText"].includes(this.type),this.getLink=()=>{const t={href:""};switch(this.type){case"email":t.href=`mailto:${this.value}`;break;case"tel":t.href=`tel:${this.value}`;break;default:t.href=g(this.value),t.target=v(this.value),t.rel=_(t.target)}return t},this.renderLinkIcon=(t,e)=>i("a",Object.assign({},t,{class:"material-icons mdc-text-field__icon lime-trailing-icon-for-link",tabindex:this.disabled||this.isEmpty()?"-1":"0",role:"button"}),i("limel-icon",{name:e})),this.renderTrailingIcon=t=>this.isInvalid()?i("i",{key:"invalid",class:"material-icons mdc-text-field__icon invalid-icon"},i("limel-icon",{name:t})):i("i",{key:"action",class:"material-icons mdc-text-field__icon mdc-text-field__icon--trailing",tabIndex:0,role:"button",onKeyDown:this.handleIconKeyPress,onClick:this.handleIconClick},i("limel-icon",{name:t})),this.getTrailingIcon=()=>this.isInvalid()?"high_importance":this.trailingIcon?this.trailingIcon:this.showLink&&"email"===this.type?"filled_message":this.showLink&&"tel"===this.type?"phone":!this.showLink||"url"!==this.type&&"urlAsText"!==this.type?void 0:"external_link",this.renderFormattedNumber=()=>{if("number"!==this.type)return;let t=this.value;return this.formatNumber&&this.value&&(t=new Intl.NumberFormat(this.locale).format(Number(this.value)),"NaN"===t)?void 0:i("span",{class:"lime-formatted-input lime-looks-like-input-value"},t)},this.onKeyDown=t=>{this.showCompletions=!0;const e=t.key===c&&!t.altKey&&!t.metaKey&&!t.shiftKey,i=t.key===m,l=t.key===h;if(t.key===c&&t.shiftKey&&(this.showCompletions=!1),!e&&!i&&!l)return;const n=document.querySelector(` #${this.portalId} limel-list`);n&&(t.preventDefault(),e||l?n.shadowRoot.querySelector(".mdc-deprecated-list-item:first-child").focus():i&&n.shadowRoot.querySelector(".mdc-deprecated-list-item:last-child").focus())},this.handleCompletionChange=t=>{t.stopPropagation(),t.detail&&(this.showCompletions=!1,this.changeEmitter(t.detail.text),this.changeEmitter.flush())},this.renderAutocompleteList=()=>{if("textarea"===this.type||0===this.completions.length)return;const t=getComputedStyle(this.limelInputField).getPropertyValue("--dropdown-z-index");return i("limel-portal",{visible:this.showCompletions,containerId:this.portalId,inheritParentWidth:!0,containerStyle:{"z-index":t}},i("limel-menu-surface",{open:this.showCompletions,allowClicksElement:this.limelInputField,style:{"--menu-surface-width":"100%","max-height":"inherit",display:"flex"},onDismiss:this.handleCloseMenu},this.renderListResult()))},this.renderListResult=()=>{const t=this.filterCompletions(this.getCurrentValue());return t&&0!==t.length?i("limel-list",{onChange:this.handleCompletionChange,onKeyDown:this.handleKeyDownInDropdown,type:"selectable",items:t}):null},this.handleKeyDownInDropdown=t=>{[c,f,u].includes(t.key)&&this.setFocus()},this.handleCloseMenu=()=>{this.showCompletions=!1},this.filterCompletions=t=>t?this.completionsList.filter((e=>e.text.toLowerCase().includes(t.toLowerCase()))):this.completionsList,this.handleInput=t=>{t.stopPropagation();let e=t.target.value;if("number"===this.type){if(!e&&t.data)return void t.stopPropagation();e&&(e=Number(e))}this.changeWaiting=!0,this.changeEmitter(e)},this.changeEmitter=w((t=>{this.change.emit(t),this.changeWaiting=!1}),300),this.handleChange=t=>{t.stopPropagation(),this.changeEmitter.flush()},this.handleIconClick=()=>{this.action.emit()},this.handleIconKeyPress=t=>{(t.key===x||t.key===u)&&this.action.emit()},this.handleWheel=()=>{},this.portalId=d(),this.helperTextId=d(),this.labelId=d()}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}disconnectedCallback(){this.mdcTextField&&this.mdcTextField.destroy(),this.restyleCompletionsDropDown.cancel(),window.removeEventListener("resize",this.layout),this.limelInputField.removeEventListener("focus",this.setFocus)}componentDidUpdate(){this.invalid?this.mdcTextField.valid=!1:this.wasInvalid||(this.mdcTextField.valid=!0),this.mdcTextField.disabled=this.disabled||this.readonly}async getSelectionStart(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionStart)&&void 0!==e?e:null}catch(t){return null}}async getSelectionEnd(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionEnd)&&void 0!==e?e:null}catch(t){return null}}async getSelectionDirection(){var t,e;try{return null!==(e=null===(t=this.inputElement)||void 0===t?void 0:t.selectionDirection)&&void 0!==e?e:null}catch(t){return null}}render(){const t=this.getAdditionalProps();t["aria-labelledby"]=this.labelId,t.class="mdc-text-field__input",t.ref=this.setInputElement,t.onInput=this.handleInput,t.onChange=this.handleChange,t.onFocus=this.onFocus,t.onBlur=this.onBlur,t.required=this.required,t.readonly=this.readonly,t.disabled=this.disabled||this.readonly;let e="";return this.hasHelperText()&&(e+=this.helperTextId,t["aria-describedby"]=this.helperTextId),this.renderAutocompleteList()&&(e&&(e+=" "),e+=this.portalId),e&&(t["aria-controls"]=e),i(n,{key:"e6f4d81dfdfef80077c4537a6e23220fc7c0dbce"},i("limel-notched-outline",{key:"a0feabbe707cd51308a40cea1bff974bc3459f74",labelId:this.labelId,label:this.label,required:this.required,invalid:this.invalid||this.isInvalid(),disabled:this.disabled,readonly:this.readonly,hasValue:!!this.value,hasLeadingIcon:!!this.leadingIcon},i("label",{key:"ef17b7ae25a2c4511aa7b4011f1692cd4065b5b2",slot:"content",class:this.getContainerClassList()},this.renderLeadingIcon(),this.renderPrefix(),this.renderFormattedNumber(),this.renderInput(t),this.renderSuffix(),this.renderTextarea(t),this.renderTrailingLinkOrButton())),this.renderHelperLine(),this.renderAutocompleteList())}valueWatcher(t){this.mdcTextField&&(this.changeWaiting||"number"===this.type&&this.isFocused&&Number(t)===Number(this.mdcTextField.value)||(t!==this.mdcTextField.value&&(this.mdcTextField.value=t||""),this.wasInvalid&&this.validate()))}completionsWatcher(){this.mapCompletions()}get validationMessage(){var t;return this.isInvalid()&&!this.invalid&&(null===(t=this.inputElement)||void 0===t?void 0:t.validationMessage)||""}static get delegatesFocus(){return!0}get limelInputField(){return l(this)}static get watchers(){return{value:[{valueWatcher:0}],completions:[{completionsWatcher:0}]}}};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google Inc.
|
|
@@ -65,7 +65,7 @@ var X,U;Y.style='@charset "UTF-8";:host([type=url]) .mdc-text-field--with-traili
|
|
|
65
65
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
66
66
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
67
67
|
* THE SOFTWARE.
|
|
68
|
-
*/var bt=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.wrapFocus=!1,l.isVertical=!0,l.isSingleSelectionList=!1,l.selectedIndex=K.UNSET_INDEX,l.focusedItemIndex=K.UNSET_INDEX,l.useActivatedClass=!1,l.useSelectedAttr=!1,l.ariaCurrentAttrValue=null,l.isCheckboxList=!1,l.isRadioList=!1,l.hasTypeahead=!1,l.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},l.sortedIndexByFirstChar=new Map,l}return I(e,t),Object.defineProperty(e,"strings",{get:function(){return W},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return H},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return K},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!1,configurable:!0}),e.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},e.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex},e.prototype.setWrapFocus=function(t){this.wrapFocus=t},e.prototype.setVerticalOrientation=function(t){this.isVertical=t},e.prototype.setSingleSelection=function(t){this.isSingleSelectionList=t,t&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},e.prototype.maybeInitializeSingleSelection=function(){var t=this.getSelectedIndexFromDOM();t!==K.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=t)},e.prototype.getSelectedIndexFromDOM=function(){for(var t=K.UNSET_INDEX,e=this.adapter.getListItemCount(),i=0;i<e;i++){var l=this.adapter.listItemAtIndexHasClass(i,H.LIST_ITEM_SELECTED_CLASS),n=this.adapter.listItemAtIndexHasClass(i,H.LIST_ITEM_ACTIVATED_CLASS);if(l||n){t=i;break}}return t},e.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},e.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&ut(this.typeaheadState)},e.prototype.setUseActivatedClass=function(t){this.useActivatedClass=t},e.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.setSelectedIndex=function(t,e){var i=(void 0===e?{}:e).forceUpdate;this.isIndexValid(t)&&(this.isCheckboxList?this.setCheckboxAtIndex(t):this.isRadioList?this.setRadioAtIndex(t):this.setSingleSelectionAtIndex(t,{forceUpdate:i}))},e.prototype.handleFocusIn=function(t){t>=0&&(this.focusedItemIndex=t,this.adapter.setAttributeForElementIndex(t,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(t,"0"))},e.prototype.handleFocusOut=function(t){var e=this;t>=0&&(this.adapter.setAttributeForElementIndex(t,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(t,"-1")),setTimeout((function(){e.adapter.isFocusInsideList()||e.setTabindexToFirstSelectedOrFocusedItem()}),0)},e.prototype.handleKeydown=function(t,e,i){var l=this,n="ArrowLeft"===ct(t),r="ArrowUp"===ct(t),o="ArrowRight"===ct(t),d="ArrowDown"===ct(t),a="Home"===ct(t),s="End"===ct(t),c="Enter"===ct(t),m="Spacebar"===ct(t),h="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused())r||s?(t.preventDefault(),this.focusLastElement()):(d||a)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead&&pt({event:t,focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState);else{var f=this.adapter.getFocusedElementIndex();if(!(-1===f&&(f=i)<0)){if(this.isVertical&&d||!this.isVertical&&o)ht(t),this.focusNextElement(f);else if(this.isVertical&&r||!this.isVertical&&n)ht(t),this.focusPrevElement(f);else if(a)ht(t),this.focusFirstElement();else if(s)ht(t),this.focusLastElement();else if(h&&t.ctrlKey&&this.isCheckboxList)t.preventDefault(),this.toggleAll(this.selectedIndex===K.UNSET_INDEX?[]:this.selectedIndex);else if((c||m)&&e){var u=t.target;if(u&&"A"===u.tagName&&c)return;if(ht(t),this.adapter.listItemAtIndexHasClass(f,H.LIST_ITEM_DISABLED_CLASS))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(f),this.adapter.notifyAction(f))}this.hasTypeahead&&pt({event:t,focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)}}},e.prototype.handleClick=function(t,e){t!==K.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList()&&this.setSelectedIndexOnAction(t,e),this.adapter.notifyAction(t)))},e.prototype.focusNextElement=function(t){var e=t+1;if(e>=this.adapter.getListItemCount()){if(!this.wrapFocus)return t;e=0}return this.focusItemAtIndex(e),e},e.prototype.focusPrevElement=function(t){var e=t-1;if(e<0){if(!this.wrapFocus)return t;e=this.adapter.getListItemCount()-1}return this.focusItemAtIndex(e),e},e.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},e.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},e.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},e.prototype.setEnabled=function(t,e){this.isIndexValid(t)&&(e?(this.adapter.removeClassForElementIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,W.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,W.ARIA_DISABLED,"true")))},e.prototype.setSingleSelectionAtIndex=function(t,e){if(this.selectedIndex!==t||(void 0===e?{}:e).forceUpdate){var i=H.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(i=H.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==K.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,i),this.setAriaForSingleSelectionAtIndex(t),this.setTabindexAtIndex(t),t!==K.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,i),this.selectedIndex=t}},e.prototype.setAriaForSingleSelectionAtIndex=function(t){this.selectedIndex===K.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(t,W.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue,i=e?W.ARIA_CURRENT:W.ARIA_SELECTED;this.selectedIndex!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,i,"false"),t!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,i,e?this.ariaCurrentAttrValue:"true")},e.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?W.ARIA_SELECTED:W.ARIA_CHECKED},e.prototype.setRadioAtIndex=function(t){var e=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,e,"false"),this.adapter.setAttributeForElementIndex(t,e,"true"),this.selectedIndex=t},e.prototype.setCheckboxAtIndex=function(t){for(var e=this.getSelectionAttribute(),i=0;i<this.adapter.getListItemCount();i++){var l=!1;t.indexOf(i)>=0&&(l=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(i,l),this.adapter.setAttributeForElementIndex(i,e,l?"true":"false")}this.selectedIndex=t},e.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===K.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex instanceof Array||this.selectedIndex===t||this.adapter.setAttributeForElementIndex(this.selectedIndex,"tabindex","-1"),t!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},e.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},e.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},e.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"==typeof this.selectedIndex&&this.selectedIndex!==K.UNSET_INDEX?this.selectedIndex:this.selectedIndex instanceof Array&&this.selectedIndex.length>0?this.selectedIndex.reduce((function(t,e){return Math.min(t,e)})):0:Math.max(this.focusedItemIndex,0)},e.prototype.isIndexValid=function(t){var e=this;if(t instanceof Array){if(!this.isCheckboxList)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some((function(t){return e.isIndexInRange(t)}))}if("number"==typeof t){if(this.isCheckboxList)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange(t)||this.isSingleSelectionList&&t===K.UNSET_INDEX}return!1},e.prototype.isIndexInRange=function(t){var e=this.adapter.getListItemCount();return t>=0&&t<e},e.prototype.setSelectedIndexOnAction=function(t,e){void 0===e&&(e=!0),this.isCheckboxList?this.toggleCheckboxAtIndex(t,e):this.setSelectedIndex(t)},e.prototype.toggleCheckboxAtIndex=function(t,e){var i=this.getSelectionAttribute(),l=this.adapter.isCheckboxCheckedAtIndex(t);e&&this.adapter.setCheckedCheckboxOrRadioAtIndex(t,l=!l),this.adapter.setAttributeForElementIndex(t,i,l?"true":"false");var n=this.selectedIndex===K.UNSET_INDEX?[]:this.selectedIndex.slice();l?n.push(t):n=n.filter((function(e){return e!==t})),this.selectedIndex=n},e.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},e.prototype.toggleAll=function(t){var e=this.adapter.getListItemCount();if(t.length===e)this.setCheckboxAtIndex([]);else{for(var i=[],l=0;l<e;l++)(!this.adapter.listItemAtIndexHasClass(l,H.LIST_ITEM_DISABLED_CLASS)||t.indexOf(l)>-1)&&i.push(l);this.setCheckboxAtIndex(i)}},e.prototype.typeaheadMatchItem=function(t,e,i){var l=this;return void 0===i&&(i=!1),ft({focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:e||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:i,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},e.prototype.typeaheadInitSortedIndex=function(){return function(t,e){for(var i=new Map,l=0;l<t;l++){var n=e(l).trim();if(n){var r=n[0].toLowerCase();i.has(r)||i.set(r,[]),i.get(r).push({text:n.toLowerCase(),index:l})}}return i.forEach((function(t){t.sort((function(t,e){return t.index-e.index}))})),i}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},e.prototype.clearTypeaheadBuffer=function(){xt(this.typeaheadState)},e}(E),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),Object.defineProperty(e.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[H.LIST_ITEM_CLASS]))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!1,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled="evolution"in this.root.dataset,this.classNameMap=this.isEvolutionEnabled?P:C(this.root,W.DEPRECATED_SELECTOR)?G:Object.values(H).reduce((function(t,e){return t[e]=e,t}),{}),this.handleClick=this.handleClickEvent.bind(this),this.handleKeydown=this.handleKeydownEvent.bind(this),this.focusInEventListener=this.handleFocusInEvent.bind(this),this.focusOutEventListener=this.handleFocusOutEvent.bind(this),this.listen("keydown",this.handleKeydown),this.listen("click",this.handleClick),this.listen("focusin",this.focusInEventListener),this.listen("focusout",this.focusOutEventListener),this.layout(),this.initializeListType(),this.ensureFocusable()},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.focusInEventListener),this.unlisten("focusout",this.focusOutEventListener)},e.prototype.layout=function(){var t=this.root.getAttribute(W.ARIA_ORIENTATION);this.vertical=t!==W.ARIA_ORIENTATION_HORIZONTAL;var e=W.FOCUSABLE_CHILD_ELEMENTS,i=this.root.querySelectorAll("."+this.classNameMap[H.LIST_ITEM_CLASS]+":not([tabindex])");i.length&&Array.prototype.forEach.call(i,(function(t){t.setAttribute("tabindex","-1")}));var l=this.root.querySelectorAll(e);l.length&&Array.prototype.forEach.call(l,(function(t){t.setAttribute("tabindex","-1")})),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},e.prototype.getPrimaryText=function(t){var e,i=t.querySelector("."+this.classNameMap[H.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||i)return null!==(e=null==i?void 0:i.textContent)&&void 0!==e?e:"";var l=t.querySelector("."+this.classNameMap[H.LIST_ITEM_TEXT_CLASS]);return l&&l.textContent||""},e.prototype.initializeListType=function(){var t=this;if(this.isInteractive=C(this.root,W.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var e=Array.from(this.root.querySelectorAll(W.SELECTED_ITEM_SELECTOR),(function(e){return t.listElements.indexOf(e)}));C(this.root,W.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=e:e.length>0&&(this.selectedIndex=e[0])}else{var i=this.root.querySelectorAll(W.ARIA_ROLE_CHECKBOX_SELECTOR),l=this.root.querySelector(W.ARIA_CHECKED_RADIO_SELECTOR);if(i.length){var n=this.root.querySelectorAll(W.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(n,(function(e){return t.listElements.indexOf(e)}))}else l&&(this.selectedIndex=this.listElements.indexOf(l))}},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.typeaheadMatchItem=function(t,e){return this.foundation.typeaheadMatchItem(t,e,!0)},e.prototype.getDefaultFoundation=function(){var t=this;return new bt({addClassForElementIndex:function(e,i){var l=t.listElements[e];l&&l.classList.add(t.classNameMap[i])},focusItemAtIndex:function(e){var i=t.listElements[e];i&&i.focus()},getAttributeForElementIndex:function(e,i){return t.listElements[e].getAttribute(i)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(e){return t.getPrimaryText(t.listElements[e])},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(W.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(W.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(W.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(e,i){return t.listElements[e].classList.contains(t.classNameMap[i])},notifyAction:function(e){t.emit(W.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,i){var l=t.listElements[e];l&&l.classList.remove(t.classNameMap[i])},setAttributeForElementIndex:function(e,i,l){var n=t.listElements[e];n&&n.setAttribute(i,l)},setCheckedCheckboxOrRadioAtIndex:function(e,i){var l=t.listElements[e].querySelector(W.CHECKBOX_RADIO_SELECTOR);l.checked=i;var n=document.createEvent("Event");n.initEvent("change",!0,!0),l.dispatchEvent(n)},setTabIndexForListItemChildren:function(e,i){Array.prototype.forEach.call(t.listElements[e].querySelectorAll(W.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX),(function(t){t.setAttribute("tabindex",i)}))}})},e.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[H.LIST_ITEM_CLASS]+'[tabindex="0"]')){var t=this.initialFocusIndex();-1!==t&&(this.listElements[t].tabIndex=0)}},e.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&this.selectedIndex.length>0)return this.selectedIndex[0];if("number"==typeof this.selectedIndex&&this.selectedIndex!==K.UNSET_INDEX)return this.selectedIndex;var t=this.root.querySelector("."+this.classNameMap[H.LIST_ITEM_CLASS]+":not(."+this.classNameMap[H.LIST_ITEM_DISABLED_CLASS]+")");return null===t?-1:this.getListItemIndex(t)},e.prototype.getListItemIndex=function(t){var e=A(t,"."+this.classNameMap[H.LIST_ITEM_CLASS]+", ."+this.classNameMap[H.ROOT]);return e&&C(e,"."+this.classNameMap[H.LIST_ITEM_CLASS])?this.listElements.indexOf(e):-1},e.prototype.handleFocusInEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusIn(e)},e.prototype.handleFocusOutEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusOut(e)},e.prototype.handleKeydownEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleKeydown(t,t.target.classList.contains(this.classNameMap[H.LIST_ITEM_CLASS]),e)},e.prototype.handleClickEvent=function(t){var e=this.getListItemIndex(t.target),i=!C(t.target,W.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(e,i)},e}(O);
|
|
68
|
+
*/var bt=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.wrapFocus=!1,l.isVertical=!0,l.isSingleSelectionList=!1,l.selectedIndex=K.UNSET_INDEX,l.focusedItemIndex=K.UNSET_INDEX,l.useActivatedClass=!1,l.useSelectedAttr=!1,l.ariaCurrentAttrValue=null,l.isCheckboxList=!1,l.isRadioList=!1,l.hasTypeahead=!1,l.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},l.sortedIndexByFirstChar=new Map,l}return I(e,t),Object.defineProperty(e,"strings",{get:function(){return W},enumerable:!1,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return H},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return K},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!1,configurable:!0}),e.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},e.prototype.getFocusedItemIndex=function(){return this.focusedItemIndex},e.prototype.setWrapFocus=function(t){this.wrapFocus=t},e.prototype.setVerticalOrientation=function(t){this.isVertical=t},e.prototype.setSingleSelection=function(t){this.isSingleSelectionList=t,t&&(this.maybeInitializeSingleSelection(),this.selectedIndex=this.getSelectedIndexFromDOM())},e.prototype.maybeInitializeSingleSelection=function(){var t=this.getSelectedIndexFromDOM();t!==K.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_ACTIVATED_CLASS)&&this.setUseActivatedClass(!0),this.isSingleSelectionList=!0,this.selectedIndex=t)},e.prototype.getSelectedIndexFromDOM=function(){for(var t=K.UNSET_INDEX,e=this.adapter.getListItemCount(),i=0;i<e;i++){var l=this.adapter.listItemAtIndexHasClass(i,H.LIST_ITEM_SELECTED_CLASS),n=this.adapter.listItemAtIndexHasClass(i,H.LIST_ITEM_ACTIVATED_CLASS);if(l||n){t=i;break}}return t},e.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},e.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&ut(this.typeaheadState)},e.prototype.setUseActivatedClass=function(t){this.useActivatedClass=t},e.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.setSelectedIndex=function(t,e){var i=(void 0===e?{}:e).forceUpdate;this.isIndexValid(t)&&(this.isCheckboxList?this.setCheckboxAtIndex(t):this.isRadioList?this.setRadioAtIndex(t):this.setSingleSelectionAtIndex(t,{forceUpdate:i}))},e.prototype.handleFocusIn=function(t){t>=0&&(this.focusedItemIndex=t,this.adapter.setAttributeForElementIndex(t,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(t,"0"))},e.prototype.handleFocusOut=function(t){var e=this;t>=0&&(this.adapter.setAttributeForElementIndex(t,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(t,"-1")),setTimeout((function(){e.adapter.isFocusInsideList()||e.setTabindexToFirstSelectedOrFocusedItem()}),0)},e.prototype.handleKeydown=function(t,e,i){var l=this,n="ArrowLeft"===ct(t),r="ArrowUp"===ct(t),o="ArrowRight"===ct(t),d="ArrowDown"===ct(t),a="Home"===ct(t),s="End"===ct(t),c="Enter"===ct(t),m="Spacebar"===ct(t),h="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused())r||s?(t.preventDefault(),this.focusLastElement()):(d||a)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead&&pt({event:t,focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState);else{var f=this.adapter.getFocusedElementIndex();if(!(-1===f&&(f=i)<0)){if(this.isVertical&&d||!this.isVertical&&o)ht(t),this.focusNextElement(f);else if(this.isVertical&&r||!this.isVertical&&n)ht(t),this.focusPrevElement(f);else if(a)ht(t),this.focusFirstElement();else if(s)ht(t),this.focusLastElement();else if(h&&t.ctrlKey&&this.isCheckboxList)t.preventDefault(),this.toggleAll(this.selectedIndex===K.UNSET_INDEX?[]:this.selectedIndex);else if((c||m)&&e){var u=t.target;if(u&&"A"===u.tagName&&c)return;if(ht(t),this.adapter.listItemAtIndexHasClass(f,H.LIST_ITEM_DISABLED_CLASS))return;this.isTypeaheadInProgress()||(this.isSelectableList()&&this.setSelectedIndexOnAction(f),this.adapter.notifyAction(f))}this.hasTypeahead&&pt({event:t,focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)}}},e.prototype.handleClick=function(t,e){t!==K.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList()&&this.setSelectedIndexOnAction(t,e),this.adapter.notifyAction(t)))},e.prototype.focusNextElement=function(t){var e=t+1;if(e>=this.adapter.getListItemCount()){if(!this.wrapFocus)return t;e=0}return this.focusItemAtIndex(e),e},e.prototype.focusPrevElement=function(t){var e=t-1;if(e<0){if(!this.wrapFocus)return t;e=this.adapter.getListItemCount()-1}return this.focusItemAtIndex(e),e},e.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},e.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},e.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},e.prototype.setEnabled=function(t,e){this.isIndexValid(t)&&(e?(this.adapter.removeClassForElementIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,W.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,W.ARIA_DISABLED,"true")))},e.prototype.setSingleSelectionAtIndex=function(t,e){if(this.selectedIndex!==t||(void 0===e?{}:e).forceUpdate){var i=H.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass&&(i=H.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex!==K.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex,i),this.setAriaForSingleSelectionAtIndex(t),this.setTabindexAtIndex(t),t!==K.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,i),this.selectedIndex=t}},e.prototype.setAriaForSingleSelectionAtIndex=function(t){this.selectedIndex===K.UNSET_INDEX&&(this.ariaCurrentAttrValue=this.adapter.getAttributeForElementIndex(t,W.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue,i=e?W.ARIA_CURRENT:W.ARIA_SELECTED;this.selectedIndex!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,i,"false"),t!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,i,e?this.ariaCurrentAttrValue:"true")},e.prototype.getSelectionAttribute=function(){return this.useSelectedAttr?W.ARIA_SELECTED:W.ARIA_CHECKED},e.prototype.setRadioAtIndex=function(t){var e=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex,e,"false"),this.adapter.setAttributeForElementIndex(t,e,"true"),this.selectedIndex=t},e.prototype.setCheckboxAtIndex=function(t){for(var e=this.getSelectionAttribute(),i=0;i<this.adapter.getListItemCount();i++){var l=!1;t.indexOf(i)>=0&&(l=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(i,l),this.adapter.setAttributeForElementIndex(i,e,l?"true":"false")}this.selectedIndex=t},e.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===K.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex instanceof Array||this.selectedIndex===t||this.adapter.setAttributeForElementIndex(this.selectedIndex,"tabindex","-1"),t!==K.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},e.prototype.isSelectableList=function(){return this.isSingleSelectionList||this.isCheckboxList||this.isRadioList},e.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},e.prototype.getFirstSelectedOrFocusedItemIndex=function(){return this.isSelectableList()?"number"==typeof this.selectedIndex&&this.selectedIndex!==K.UNSET_INDEX?this.selectedIndex:this.selectedIndex instanceof Array&&this.selectedIndex.length>0?this.selectedIndex.reduce((function(t,e){return Math.min(t,e)})):0:Math.max(this.focusedItemIndex,0)},e.prototype.isIndexValid=function(t){var e=this;if(t instanceof Array){if(!this.isCheckboxList)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some((function(t){return e.isIndexInRange(t)}))}if("number"==typeof t){if(this.isCheckboxList)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange(t)||this.isSingleSelectionList&&t===K.UNSET_INDEX}return!1},e.prototype.isIndexInRange=function(t){var e=this.adapter.getListItemCount();return t>=0&&t<e},e.prototype.setSelectedIndexOnAction=function(t,e){void 0===e&&(e=!0),this.isCheckboxList?this.toggleCheckboxAtIndex(t,e):this.setSelectedIndex(t)},e.prototype.toggleCheckboxAtIndex=function(t,e){var i=this.getSelectionAttribute(),l=this.adapter.isCheckboxCheckedAtIndex(t);e&&this.adapter.setCheckedCheckboxOrRadioAtIndex(t,l=!l),this.adapter.setAttributeForElementIndex(t,i,l?"true":"false");var n=this.selectedIndex===K.UNSET_INDEX?[]:this.selectedIndex.slice();l?n.push(t):n=n.filter((function(e){return e!==t})),this.selectedIndex=n},e.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},e.prototype.toggleAll=function(t){var e=this.adapter.getListItemCount();if(t.length===e)this.setCheckboxAtIndex([]);else{for(var i=[],l=0;l<e;l++)(!this.adapter.listItemAtIndexHasClass(l,H.LIST_ITEM_DISABLED_CLASS)||t.indexOf(l)>-1)&&i.push(l);this.setCheckboxAtIndex(i)}},e.prototype.typeaheadMatchItem=function(t,e,i){var l=this;return void 0===i&&(i=!1),ft({focusItemAtIndex:function(t){l.focusItemAtIndex(t)},focusedItemIndex:e||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:i,isItemAtIndexDisabled:function(t){return l.adapter.listItemAtIndexHasClass(t,H.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},e.prototype.typeaheadInitSortedIndex=function(){return function(t,e){for(var i=new Map,l=0;l<t;l++){var n=e(l).trim();if(n){var r=n[0].toLowerCase();i.has(r)||i.set(r,[]),i.get(r).push({text:n.toLowerCase(),index:l})}}return i.forEach((function(t){t.sort((function(t,e){return t.index-e.index}))})),i}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},e.prototype.clearTypeaheadBuffer=function(){xt(this.typeaheadState)},e}(E),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),Object.defineProperty(e.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[H.LIST_ITEM_CLASS]))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!1,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled="evolution"in this.root.dataset,this.classNameMap=this.isEvolutionEnabled?P:A(this.root,W.DEPRECATED_SELECTOR)?G:Object.values(H).reduce((function(t,e){return t[e]=e,t}),{}),this.handleClick=this.handleClickEvent.bind(this),this.handleKeydown=this.handleKeydownEvent.bind(this),this.focusInEventListener=this.handleFocusInEvent.bind(this),this.focusOutEventListener=this.handleFocusOutEvent.bind(this),this.listen("keydown",this.handleKeydown),this.listen("click",this.handleClick),this.listen("focusin",this.focusInEventListener),this.listen("focusout",this.focusOutEventListener),this.layout(),this.initializeListType(),this.ensureFocusable()},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.focusInEventListener),this.unlisten("focusout",this.focusOutEventListener)},e.prototype.layout=function(){var t=this.root.getAttribute(W.ARIA_ORIENTATION);this.vertical=t!==W.ARIA_ORIENTATION_HORIZONTAL;var e=W.FOCUSABLE_CHILD_ELEMENTS,i=this.root.querySelectorAll("."+this.classNameMap[H.LIST_ITEM_CLASS]+":not([tabindex])");i.length&&Array.prototype.forEach.call(i,(function(t){t.setAttribute("tabindex","-1")}));var l=this.root.querySelectorAll(e);l.length&&Array.prototype.forEach.call(l,(function(t){t.setAttribute("tabindex","-1")})),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},e.prototype.getPrimaryText=function(t){var e,i=t.querySelector("."+this.classNameMap[H.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||i)return null!==(e=null==i?void 0:i.textContent)&&void 0!==e?e:"";var l=t.querySelector("."+this.classNameMap[H.LIST_ITEM_TEXT_CLASS]);return l&&l.textContent||""},e.prototype.initializeListType=function(){var t=this;if(this.isInteractive=A(this.root,W.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var e=Array.from(this.root.querySelectorAll(W.SELECTED_ITEM_SELECTOR),(function(e){return t.listElements.indexOf(e)}));A(this.root,W.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=e:e.length>0&&(this.selectedIndex=e[0])}else{var i=this.root.querySelectorAll(W.ARIA_ROLE_CHECKBOX_SELECTOR),l=this.root.querySelector(W.ARIA_CHECKED_RADIO_SELECTOR);if(i.length){var n=this.root.querySelectorAll(W.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(n,(function(e){return t.listElements.indexOf(e)}))}else l&&(this.selectedIndex=this.listElements.indexOf(l))}},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.typeaheadMatchItem=function(t,e){return this.foundation.typeaheadMatchItem(t,e,!0)},e.prototype.getDefaultFoundation=function(){var t=this;return new bt({addClassForElementIndex:function(e,i){var l=t.listElements[e];l&&l.classList.add(t.classNameMap[i])},focusItemAtIndex:function(e){var i=t.listElements[e];i&&i.focus()},getAttributeForElementIndex:function(e,i){return t.listElements[e].getAttribute(i)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(e){return t.getPrimaryText(t.listElements[e])},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(W.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(W.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(W.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(e,i){return t.listElements[e].classList.contains(t.classNameMap[i])},notifyAction:function(e){t.emit(W.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,i){var l=t.listElements[e];l&&l.classList.remove(t.classNameMap[i])},setAttributeForElementIndex:function(e,i,l){var n=t.listElements[e];n&&n.setAttribute(i,l)},setCheckedCheckboxOrRadioAtIndex:function(e,i){var l=t.listElements[e].querySelector(W.CHECKBOX_RADIO_SELECTOR);l.checked=i;var n=document.createEvent("Event");n.initEvent("change",!0,!0),l.dispatchEvent(n)},setTabIndexForListItemChildren:function(e,i){Array.prototype.forEach.call(t.listElements[e].querySelectorAll(W.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX),(function(t){t.setAttribute("tabindex",i)}))}})},e.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[H.LIST_ITEM_CLASS]+'[tabindex="0"]')){var t=this.initialFocusIndex();-1!==t&&(this.listElements[t].tabIndex=0)}},e.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&this.selectedIndex.length>0)return this.selectedIndex[0];if("number"==typeof this.selectedIndex&&this.selectedIndex!==K.UNSET_INDEX)return this.selectedIndex;var t=this.root.querySelector("."+this.classNameMap[H.LIST_ITEM_CLASS]+":not(."+this.classNameMap[H.LIST_ITEM_DISABLED_CLASS]+")");return null===t?-1:this.getListItemIndex(t)},e.prototype.getListItemIndex=function(t){var e=C(t,"."+this.classNameMap[H.LIST_ITEM_CLASS]+", ."+this.classNameMap[H.ROOT]);return e&&A(e,"."+this.classNameMap[H.LIST_ITEM_CLASS])?this.listElements.indexOf(e):-1},e.prototype.handleFocusInEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusIn(e)},e.prototype.handleFocusOutEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusOut(e)},e.prototype.handleKeydownEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleKeydown(t,t.target.classList.contains(this.classNameMap[H.LIST_ITEM_CLASS]),e)},e.prototype.handleClickEvent=function(t){var e=this.getListItemIndex(t.target),i=!A(t.target,W.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(e,i)},e}(O);
|
|
69
69
|
/**
|
|
70
70
|
* @license
|
|
71
71
|
* Copyright 2018 Google Inc.
|
|
@@ -110,7 +110,7 @@ var X,U;Y.style='@charset "UTF-8";:host([type=url]) .mdc-text-field--with-traili
|
|
|
110
110
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
111
111
|
* THE SOFTWARE.
|
|
112
112
|
*/
|
|
113
|
-
var It,Tt,Et={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},
|
|
113
|
+
var It,Tt,Et={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},At={CLOSED_EVENT:"MDCMenuSurface:closed",CLOSING_EVENT:"MDCMenuSurface:closing",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")},Ct={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67,TOUCH_EVENT_WAIT_MS:30};!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(It||(It={})),function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(Tt||(Tt={}));
|
|
114
114
|
/**
|
|
115
115
|
* @license
|
|
116
116
|
* Copyright 2018 Google Inc.
|
|
@@ -133,7 +133,7 @@ var It,Tt,Et={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surfa
|
|
|
133
133
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
134
134
|
* THE SOFTWARE.
|
|
135
135
|
*/
|
|
136
|
-
var Ot=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.isSurfaceOpen=!1,l.isQuickOpen=!1,l.isHoistedElement=!1,l.isFixedPosition=!1,l.isHorizontallyCenteredOnViewport=!1,l.maxHeight=0,l.openAnimationEndTimerId=0,l.closeAnimationEndTimerId=0,l.animationRequestId=0,l.anchorCorner=Tt.TOP_START,l.originCorner=Tt.TOP_START,l.anchorMargin={top:0,right:0,bottom:0,left:0},l.position={x:0,y:0},l}return I(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return Et},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return
|
|
136
|
+
var Ot=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.isSurfaceOpen=!1,l.isQuickOpen=!1,l.isHoistedElement=!1,l.isFixedPosition=!1,l.isHorizontallyCenteredOnViewport=!1,l.maxHeight=0,l.openAnimationEndTimerId=0,l.closeAnimationEndTimerId=0,l.animationRequestId=0,l.anchorCorner=Tt.TOP_START,l.originCorner=Tt.TOP_START,l.anchorMargin={top:0,right:0,bottom:0,left:0},l.position={x:0,y:0},l}return I(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return Et},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return At},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return Ct},enumerable:!1,configurable:!0}),Object.defineProperty(e,"Corner",{get:function(){return Tt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){},notifyClosing:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){var t=e.cssClasses,i=t.ROOT,l=t.OPEN;if(!this.adapter.hasClass(i))throw new Error(i+" class required in root element.");this.adapter.hasClass(l)&&(this.isSurfaceOpen=!0)},e.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},e.prototype.setAnchorCorner=function(t){this.anchorCorner=t},e.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^It.RIGHT},e.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},e.prototype.setIsHoisted=function(t){this.isHoistedElement=t},e.prototype.setFixedPosition=function(t){this.isFixedPosition=t},e.prototype.isFixed=function(){return this.isFixedPosition},e.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},e.prototype.setIsHorizontallyCenteredOnViewport=function(t){this.isHorizontallyCenteredOnViewport=t},e.prototype.setQuickOpen=function(t){this.isQuickOpen=t},e.prototype.setMaxHeight=function(t){this.maxHeight=t},e.prototype.isOpen=function(){return this.isSurfaceOpen},e.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(e.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(e.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame((function(){t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.adapter.addClass(e.cssClasses.OPEN),t.openAnimationEndTimerId=setTimeout((function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(e.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()}),Ct.TRANSITION_OPEN_DURATION)})),this.isSurfaceOpen=!0))},e.prototype.close=function(t){var i=this;if(void 0===t&&(t=!1),this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen)return this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(e.cssClasses.OPEN),this.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),void this.adapter.notifyClose();this.adapter.addClass(e.cssClasses.ANIMATING_CLOSED),requestAnimationFrame((function(){i.adapter.removeClass(e.cssClasses.OPEN),i.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),i.closeAnimationEndTimerId=setTimeout((function(){i.closeAnimationEndTimerId=0,i.adapter.removeClass(e.cssClasses.ANIMATING_CLOSED),i.adapter.notifyClose()}),Ct.TRANSITION_CLOSE_DURATION)})),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()}},e.prototype.handleBodyClick=function(t){this.adapter.isElementInContainer(t.target)||this.close()},e.prototype.handleKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&this.close()},e.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var i=this.getoriginCorner(),l=this.getMenuSurfaceMaxHeight(i),n=this.hasBit(i,It.BOTTOM)?"bottom":"top",r=this.hasBit(i,It.RIGHT)?"right":"left",o=this.getHorizontalOriginOffset(i),d=this.getVerticalOriginOffset(i),a=this.measurements,s=a.anchorSize,c=a.surfaceSize,m=((t={})[r]=o,t[n]=d,t);s.width/c.width>Ct.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(r="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(m),this.adapter.setTransformOrigin(r+" "+n),this.adapter.setPosition(m),this.adapter.setMaxHeight(l?l+"px":""),this.hasBit(i,It.BOTTOM)||this.adapter.addClass(e.cssClasses.IS_OPEN_BELOW)},e.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),e=this.adapter.getBodyDimensions(),i=this.adapter.getWindowDimensions(),l=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:i.width-t.right,bottom:i.height-t.bottom,left:t.left},viewportSize:i,windowScroll:l}},e.prototype.getoriginCorner=function(){var t,i,l=this.originCorner,n=this.measurements,r=n.viewportDistance,o=n.anchorSize,d=n.surfaceSize,a=e.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,It.BOTTOM)?(t=r.top-a+this.anchorMargin.bottom,i=r.bottom-a-this.anchorMargin.bottom):(t=r.top-a+this.anchorMargin.top,i=r.bottom-a+o.height-this.anchorMargin.top),!(i-d.height>0)&&t>i&&(l=this.setBit(l,It.BOTTOM));var s,c,m,h=this.adapter.isRtl(),f=this.hasBit(this.anchorCorner,It.FLIP_RTL),u=this.hasBit(this.anchorCorner,It.RIGHT)||this.hasBit(l,It.RIGHT);(m=h&&f?!u:u)?(s=r.left+o.width+this.anchorMargin.right,c=r.right-this.anchorMargin.right):(s=r.left+this.anchorMargin.left,c=r.right+o.width-this.anchorMargin.left);var x=s-d.width>0,p=c-d.width>0,b=this.hasBit(l,It.FLIP_RTL)&&this.hasBit(l,It.RIGHT);return p&&b&&h||!x&&b?l=this.unsetBit(l,It.RIGHT):(x&&m&&h||x&&!m&&u||!p&&s>=c)&&(l=this.setBit(l,It.RIGHT)),l},e.prototype.getMenuSurfaceMaxHeight=function(t){if(this.maxHeight>0)return this.maxHeight;var i=this.measurements.viewportDistance,l=0,n=this.hasBit(t,It.BOTTOM),r=this.hasBit(this.anchorCorner,It.BOTTOM),o=e.numbers.MARGIN_TO_EDGE;return n?(l=i.top+this.anchorMargin.top-o,r||(l+=this.measurements.anchorSize.height)):(l=i.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-o,r&&(l-=this.measurements.anchorSize.height)),l},e.prototype.getHorizontalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,It.RIGHT),l=this.hasBit(this.anchorCorner,It.RIGHT);if(i){var n=l?e.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?n-(this.measurements.viewportSize.width-this.measurements.bodySize.width):n}return l?e.width-this.anchorMargin.right:this.anchorMargin.left},e.prototype.getVerticalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,It.BOTTOM),l=this.hasBit(this.anchorCorner,It.BOTTOM);return i?l?e.height-this.anchorMargin.top:-this.anchorMargin.bottom:l?e.height+this.anchorMargin.bottom:this.anchorMargin.top},e.prototype.adjustPositionForHoistedElement=function(t){var e,i,l=this.measurements,n=l.windowScroll,r=l.viewportDistance,o=l.surfaceSize,d=l.viewportSize,a=Object.keys(t);try{for(var s=z(a),c=s.next();!c.done;c=s.next()){var m=c.value,h=t[m]||0;!this.isHorizontallyCenteredOnViewport||"left"!==m&&"right"!==m?(h+=r[m],this.isFixedPosition||("top"===m?h+=n.y:"bottom"===m?h-=n.y:"left"===m?h+=n.x:h-=n.x),t[m]=h):t[m]=(d.width-o.width)/2}}catch(t){e={error:t}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}},e.prototype.maybeRestoreFocus=function(){var t=this,e=this.adapter.isFocused(),i=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(e||i)&&setTimeout((function(){t.adapter.restoreFocus()}),Ct.TOUCH_EVENT_WAIT_MS)},e.prototype.hasBit=function(t,e){return Boolean(t&e)},e.prototype.setBit=function(t,e){return t|e},e.prototype.unsetBit=function(t,e){return t^e},e.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},e}(E),zt={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}};
|
|
137
137
|
/**
|
|
138
138
|
* @license
|
|
139
139
|
* Copyright 2016 Google Inc.
|
|
@@ -178,7 +178,7 @@ var Ot=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))|
|
|
|
178
178
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
179
179
|
* THE SOFTWARE.
|
|
180
180
|
*/
|
|
181
|
-
var St,Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root.parentElement;this.anchorElement=e&&e.classList.contains(Et.ANCHOR)?e:null,this.root.classList.contains(Et.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleBodyClick=function(e){t.foundation.handleBodyClick(e)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(
|
|
181
|
+
var St,Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root.parentElement;this.anchorElement=e&&e.classList.contains(Et.ANCHOR)?e:null,this.root.classList.contains(Et.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleBodyClick=function(e){t.foundation.handleBodyClick(e)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(At.OPENED_EVENT,this.registerBodyClickListener),this.listen(At.CLOSED_EVENT,this.deregisterBodyClickListener)},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(At.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(At.CLOSED_EVENT,this.deregisterBodyClickListener),t.prototype.destroy.call(this)},e.prototype.isOpen=function(){return this.foundation.isOpen()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!1,configurable:!0}),e.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},e.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},e.prototype.setFixedPosition=function(t){t?this.root.classList.add(Et.FIXED):this.root.classList.remove(Et.FIXED),this.foundation.setFixedPosition(t)},e.prototype.setAbsolutePosition=function(t,e){this.foundation.setAbsolutePosition(t,e),this.setIsHoisted(!0)},e.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new Ot({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(Ot.strings.CLOSED_EVENT,{})},notifyClosing:function(){t.emit(Ot.strings.CLOSING_EVENT,{})},notifyOpen:function(){return t.emit(Ot.strings.OPENED_EVENT,{})},isElementInContainer:function(e){return t.root.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root).getPropertyValue("direction")},setTransformOrigin:function(e){var i=function(t,e){if(function(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}(t)&&e in zt){var i=t.document.createElement("div"),l=zt[e],n=l.standard;return n in i.style?n:l.prefixed}return e}(window,"transform")+"-origin";t.root.style.setProperty(i,e)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){t.root.contains(document.activeElement)&&t.previousFocus&&t.previousFocus.focus&&t.previousFocus.focus()},getInnerDimensions:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){var i=t.root;i.style.left="left"in e?e.left+"px":"",i.style.right="right"in e?e.right+"px":"",i.style.top="top"in e?e.top+"px":"",i.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root.style.maxHeight=e}})},e}(O),Lt={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},Dt={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list,.mdc-deprecated-list",SELECTED_EVENT:"MDCMenu:selected",SKIP_RESTORE_FOCUS:"data-menu-item-skip-restore-focus"},jt={FOCUS_ROOT_INDEX:-1};
|
|
182
182
|
/**
|
|
183
183
|
* @license
|
|
184
184
|
* Copyright 2018 Google Inc.
|
|
@@ -223,7 +223,7 @@ var St,Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||thi
|
|
|
223
223
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
224
224
|
* THE SOFTWARE.
|
|
225
225
|
*/
|
|
226
|
-
var Ft=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.closeAnimationEndTimerId=0,l.defaultFocusState=St.LIST_ROOT,l.selectedIndex=-1,l}return I(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return Lt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return Dt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return jt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},getAttributeFromElementAtIndex:function(){return null},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},e.prototype.handleKeydown=function(t){("Tab"===t.key||9===t.keyCode)&&this.adapter.closeSurface(!0)},e.prototype.handleItemAction=function(t){var e=this,i=this.adapter.getElementIndex(t);if(!(i<0)){this.adapter.notifySelected({index:i});var l="true"===this.adapter.getAttributeFromElementAtIndex(i,Dt.SKIP_RESTORE_FOCUS);this.adapter.closeSurface(l),this.closeAnimationEndTimerId=setTimeout((function(){var i=e.adapter.getElementIndex(t);i>=0&&e.adapter.isSelectableItemAtIndex(i)&&e.setSelectedIndex(i)}),Ot.numbers.TRANSITION_CLOSE_DURATION)}},e.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case St.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case St.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case St.NONE:break;default:this.adapter.focusListRoot()}},e.prototype.setDefaultFocusState=function(t){this.defaultFocusState=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.setSelectedIndex=function(t){if(this.validatedIndex(t),!this.adapter.isSelectableItemAtIndex(t))throw new Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,Dt.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,Lt.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,Lt.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=t},e.prototype.setEnabled=function(t,e){this.validatedIndex(t),e?(this.adapter.removeClassFromElementAtIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_DISABLED_ATTR,"true"))},e.prototype.validatedIndex=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw new Error("MDCMenuFoundation: No list item at specified index.")},e}(E),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e){void 0===t&&(t=function(t){return new Rt(t)}),void 0===e&&(e=function(t){return new gt(t)}),this.menuSurfaceFactory=t,this.listFactory=e},e.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface=this.menuSurfaceFactory(this.root);var e=this.root.querySelector(Dt.LIST_SELECTOR);e?(this.list=this.listFactory(e),this.list.wrapFocus=!0):this.list=null,this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleItemAction=function(e){t.foundation.handleItemAction(t.items[e.detail.index])},this.handleMenuSurfaceOpened=function(){t.foundation.handleMenuSurfaceOpened()},this.menuSurface.listen(Ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.listen("keydown",this.handleKeydown),this.listen(bt.strings.ACTION_EVENT,this.handleItemAction)},e.prototype.destroy=function(){this.list&&this.list.destroy(),this.menuSurface.destroy(),this.menuSurface.unlisten(Ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.unlisten("keydown",this.handleKeydown),this.unlisten(bt.strings.ACTION_EVENT,this.handleItemAction),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"open",{get:function(){return this.menuSurface.isOpen()},set:function(t){t?this.menuSurface.open():this.menuSurface.close()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{get:function(){return!!this.list&&this.list.wrapFocus},set:function(t){this.list&&(this.list.wrapFocus=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.list&&(this.list.hasTypeahead=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return!!this.list&&this.list.typeaheadInProgress},enumerable:!1,configurable:!0}),e.prototype.typeaheadMatchItem=function(t,e){return this.list?this.list.typeaheadMatchItem(t,e):-1},e.prototype.layout=function(){this.list&&this.list.layout()},Object.defineProperty(e.prototype,"items",{get:function(){return this.list?this.list.listElements:[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.list&&(this.list.singleSelection=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.list?this.list.selectedIndex:K.UNSET_INDEX},set:function(t){this.list&&(this.list.selectedIndex=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.menuSurface.quickOpen=t},enumerable:!1,configurable:!0}),e.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},e.prototype.setAnchorCorner=function(t){this.menuSurface.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.menuSurface.setAnchorMargin(t)},e.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},e.prototype.getPrimaryTextAtIndex=function(t){var e=this.getOptionByIndex(t);return e&&this.list&&this.list.getPrimaryText(e)||""},e.prototype.setFixedPosition=function(t){this.menuSurface.setFixedPosition(t)},e.prototype.setIsHoisted=function(t){this.menuSurface.setIsHoisted(t)},e.prototype.setAbsolutePosition=function(t,e){this.menuSurface.setAbsolutePosition(t,e)},e.prototype.setAnchorElement=function(t){this.menuSurface.anchorElement=t},e.prototype.getDefaultFoundation=function(){var t=this;return new Ft({addClassToElementAtIndex:function(e,i){t.items[e].classList.add(i)},removeClassFromElementAtIndex:function(e,i){t.items[e].classList.remove(i)},addAttributeToElementAtIndex:function(e,i,l){t.items[e].setAttribute(i,l)},removeAttributeFromElementAtIndex:function(e,i){t.items[e].removeAttribute(i)},getAttributeFromElementAtIndex:function(e,i){return t.items[e].getAttribute(i)},elementContainsClass:function(t,e){return t.classList.contains(e)},closeSurface:function(e){t.menuSurface.close(e)},getElementIndex:function(e){return t.items.indexOf(e)},notifySelected:function(e){t.emit(Dt.SELECTED_EVENT,{index:e.index,item:t.items[e.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(e){t.items[e].focus()},focusListRoot:function(){t.root.querySelector(Dt.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(e){return!!
|
|
226
|
+
var Ft=function(t){function e(i){var l=t.call(this,T(T({},e.defaultAdapter),i))||this;return l.closeAnimationEndTimerId=0,l.defaultFocusState=St.LIST_ROOT,l.selectedIndex=-1,l}return I(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return Lt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return Dt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return jt},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},getAttributeFromElementAtIndex:function(){return null},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){this.closeAnimationEndTimerId&&clearTimeout(this.closeAnimationEndTimerId),this.adapter.closeSurface()},e.prototype.handleKeydown=function(t){("Tab"===t.key||9===t.keyCode)&&this.adapter.closeSurface(!0)},e.prototype.handleItemAction=function(t){var e=this,i=this.adapter.getElementIndex(t);if(!(i<0)){this.adapter.notifySelected({index:i});var l="true"===this.adapter.getAttributeFromElementAtIndex(i,Dt.SKIP_RESTORE_FOCUS);this.adapter.closeSurface(l),this.closeAnimationEndTimerId=setTimeout((function(){var i=e.adapter.getElementIndex(t);i>=0&&e.adapter.isSelectableItemAtIndex(i)&&e.setSelectedIndex(i)}),Ot.numbers.TRANSITION_CLOSE_DURATION)}},e.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState){case St.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case St.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case St.NONE:break;default:this.adapter.focusListRoot()}},e.prototype.setDefaultFocusState=function(t){this.defaultFocusState=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.setSelectedIndex=function(t){if(this.validatedIndex(t),!this.adapter.isSelectableItemAtIndex(t))throw new Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,Dt.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,Lt.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,Lt.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_CHECKED_ATTR,"true"),this.selectedIndex=t},e.prototype.setEnabled=function(t,e){this.validatedIndex(t),e?(this.adapter.removeClassFromElementAtIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,H.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,Dt.ARIA_DISABLED_ATTR,"true"))},e.prototype.validatedIndex=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw new Error("MDCMenuFoundation: No list item at specified index.")},e}(E),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e){void 0===t&&(t=function(t){return new Rt(t)}),void 0===e&&(e=function(t){return new gt(t)}),this.menuSurfaceFactory=t,this.listFactory=e},e.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface=this.menuSurfaceFactory(this.root);var e=this.root.querySelector(Dt.LIST_SELECTOR);e?(this.list=this.listFactory(e),this.list.wrapFocus=!0):this.list=null,this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleItemAction=function(e){t.foundation.handleItemAction(t.items[e.detail.index])},this.handleMenuSurfaceOpened=function(){t.foundation.handleMenuSurfaceOpened()},this.menuSurface.listen(Ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.listen("keydown",this.handleKeydown),this.listen(bt.strings.ACTION_EVENT,this.handleItemAction)},e.prototype.destroy=function(){this.list&&this.list.destroy(),this.menuSurface.destroy(),this.menuSurface.unlisten(Ot.strings.OPENED_EVENT,this.handleMenuSurfaceOpened),this.unlisten("keydown",this.handleKeydown),this.unlisten(bt.strings.ACTION_EVENT,this.handleItemAction),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"open",{get:function(){return this.menuSurface.isOpen()},set:function(t){t?this.menuSurface.open():this.menuSurface.close()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{get:function(){return!!this.list&&this.list.wrapFocus},set:function(t){this.list&&(this.list.wrapFocus=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.list&&(this.list.hasTypeahead=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return!!this.list&&this.list.typeaheadInProgress},enumerable:!1,configurable:!0}),e.prototype.typeaheadMatchItem=function(t,e){return this.list?this.list.typeaheadMatchItem(t,e):-1},e.prototype.layout=function(){this.list&&this.list.layout()},Object.defineProperty(e.prototype,"items",{get:function(){return this.list?this.list.listElements:[]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.list&&(this.list.singleSelection=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.list?this.list.selectedIndex:K.UNSET_INDEX},set:function(t){this.list&&(this.list.selectedIndex=t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.menuSurface.quickOpen=t},enumerable:!1,configurable:!0}),e.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},e.prototype.setAnchorCorner=function(t){this.menuSurface.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.menuSurface.setAnchorMargin(t)},e.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},e.prototype.getPrimaryTextAtIndex=function(t){var e=this.getOptionByIndex(t);return e&&this.list&&this.list.getPrimaryText(e)||""},e.prototype.setFixedPosition=function(t){this.menuSurface.setFixedPosition(t)},e.prototype.setIsHoisted=function(t){this.menuSurface.setIsHoisted(t)},e.prototype.setAbsolutePosition=function(t,e){this.menuSurface.setAbsolutePosition(t,e)},e.prototype.setAnchorElement=function(t){this.menuSurface.anchorElement=t},e.prototype.getDefaultFoundation=function(){var t=this;return new Ft({addClassToElementAtIndex:function(e,i){t.items[e].classList.add(i)},removeClassFromElementAtIndex:function(e,i){t.items[e].classList.remove(i)},addAttributeToElementAtIndex:function(e,i,l){t.items[e].setAttribute(i,l)},removeAttributeFromElementAtIndex:function(e,i){t.items[e].removeAttribute(i)},getAttributeFromElementAtIndex:function(e,i){return t.items[e].getAttribute(i)},elementContainsClass:function(t,e){return t.classList.contains(e)},closeSurface:function(e){t.menuSurface.close(e)},getElementIndex:function(e){return t.items.indexOf(e)},notifySelected:function(e){t.emit(Dt.SELECTED_EVENT,{index:e.index,item:t.items[e.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(e){t.items[e].focus()},focusListRoot:function(){t.root.querySelector(Dt.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(e){return!!C(t.items[e],"."+Lt.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(e){var i=C(t.items[e],"."+Lt.MENU_SELECTION_GROUP).querySelector("."+Lt.MENU_SELECTED_LIST_ITEM);return i?t.items.indexOf(i):-1}})},e}(O);
|
|
227
227
|
/**
|
|
228
228
|
* @license
|
|
229
229
|
* Copyright 2018 Google Inc.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i}from"./p-BGxJfR2f.js";import{t as s}from"./p-EPnIW0K5.js";import{a,E as n}from"./p-rI0IeKpx.js";const l=class{constructor(i){t(this,i),this.cancel=e(this,"cancel"),this.save=e(this,"save"),this.linkChange=e(this,"linkChange"),this.language="en",this.isOpen=!1,this.getTranslation=t=>s.get(t,this.language),this.isValid=t=>{try{new URL(t)}catch(t){return!1}return!0},this.handleKeyDown=t=>{var e;t.key===a&&(this.saveButton&&this.saveButton.focus(),t.preventDefault(),this.isValid(null===(e=this.link)||void 0===e?void 0:e.href)&&this.handleSave(t))},this.handleCancel=t=>{t instanceof KeyboardEvent&&t.key!==n||(t.stopPropagation(),t.preventDefault(),this.cancel.emit())},this.handleSave=t=>{t.stopPropagation(),this.save.emit()},this.handleLinkInputAction=t=>{window.open(this.link.href,"_blank"),t.stopPropagation()},this.handleLinkTitleChange=t=>{var e;this.emitLinkChange(t.detail,null===(e=this.link)||void 0===e?void 0:e.href)},this.handleLinkValueChange=t=>{var e;this.emitLinkChange(null===(e=this.link)||void 0===e?void 0:e.text,t.detail)},this.emitLinkChange=(t,e)=>{this.linkChange.emit({text:t,href:e})}}connectedCallback(){this.setupGlobalHandlers()}disconnectedCallback(){this.teardownGlobalHandlers()}setupGlobalHandlers(){this.isOpen&&document.addEventListener("keyup",this.handleCancel)}teardownGlobalHandlers(){document.removeEventListener("keyup",this.handleCancel)}componentDidLoad(){this.focusOnTextInput()}focusOnTextInput(){if(this.textInput){const t=this.textInput.shadowRoot.querySelector("input");t&&requestAnimationFrame((()=>{t.focus()}))}}render(){var t,e;const s=this.isValid(this.link.href);return[i("limel-input-field",{key:"0416f2d94ec54c569455938babfebee34bc1b17c",label:this.getTranslation("editor-link-menu.text"),value:(null===(t=this.link)||void 0===t?void 0:t.text)||"",leadingIcon:"text_cursor",onChange:this.handleLinkTitleChange,onKeyDown:this.handleKeyDown,ref:t=>this.textInput=t}),i("limel-input-field",{key:"6dfb8808eee203e9aa9e87e3bf3720aae217c5e0",label:this.getTranslation("editor-link-menu.link"),value:(null===(e=this.link)||void 0===e?void 0:e.href)||"",type:"text",leadingIcon:"-lime-text-link",trailingIcon:"external_link",invalid:!s,onChange:this.handleLinkValueChange,onAction:this.handleLinkInputAction,onKeyDown:this.handleKeyDown}),i("div",{key:"ee392b700a4293eb2b2121d08bfef852f8b4404e",class:"actions"},i("limel-button",{key:"be9f4711edf45a69f8087341e61fc4183c59ba2d",label:this.getTranslation("cancel"),onClick:this.handleCancel}),i("limel-button",{key:"b958cae7915cc42133e5143589d4f454f8bb2ffa",primary:!0,label:this.getTranslation("save"),disabled:!s,onClick:this.handleSave,ref:t=>this.saveButton=t,slot:"button"}))]}};l.style=":host(limel-text-editor-link-menu){animation:fade 0.2s ease forwards;animation-delay:0.1s;opacity:0;display:flex;flex-direction:column;gap:0.5rem;padding:0.5rem;max-width:calc(100vw - 2rem);border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-16)}.actions{display:flex;justify-content:end;gap:0.5rem}@keyframes fade{0%{scale:0.86;opacity:0}100%{scale:1;opacity:1}}";export{l as limel_text_editor_link_menu}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as n}from"./p-
|
|
1
|
+
import{r as e,h as n}from"./p-BGxJfR2f.js";const a=class{constructor(n){e(this,n),this.isOpen=!1}async open(){this.isOpen=!0}async close(){this.isOpen=!1}render(){return n("div",{key:"cfe24857508935ebcb48b1526b5965060e71633d",class:"lime-banner "+(this.isOpen?"lime-banner--open":"")},n("div",{key:"4fca5a056900b92828e37674d792b3dc4f60b26c",class:"lime-banner__surface"},n("div",{key:"09795c599464163cfea5e5a9dc8e07dfa6323b56",class:"lime-banner__content"},n("div",{key:"2eac37ebc84b55e076af6e371121cafdc46e3fc3",class:"icon-message"},this.renderIcon(),n("div",{key:"e9f5f088e31e989663414e65405870189c5a7d07"},this.message)),n("div",{key:"abcf0c660e2f56522c67e93cdcd8222422d717a6",class:"lime-banner__actions"},n("slot",{key:"9df13ed8e33895f9a7d2b2c339b8dca083b4b67b",name:"buttons"})))))}renderIcon(){if(this.icon)return n("div",{class:"lime-banner__icon"},n("limel-icon",{name:this.icon,badge:!0,size:"large"}))}};a.style=".lime-banner{min-height:3.25rem;display:none;background-color:rgba(var(--contrast-100), 0.7);backdrop-filter:blur(0.3125rem);box-shadow:var(--shadow-depth-16)}.lime-banner.lime-banner--open{display:block}.lime-banner.lime-banner--open .lime-banner__surface{opacity:1}.lime-banner .lime-banner__surface{display:flex;justify-content:center;box-sizing:border-box;opacity:0}.lime-banner .lime-banner__content{display:flex;align-items:center;align-content:stretch;padding:1rem;flex-wrap:wrap}.lime-banner .icon-message{display:flex;align-items:center}.lime-banner div[class^=mdc-typography]{color:rgb(var(--contrast-1200))}.lime-banner .lime-banner__icon{margin:0 0.625rem;align-self:flex-start}.lime-banner .lime-banner__actions{margin-left:3.125rem;display:flex;justify-content:flex-end}.lime-banner limel-icon{color:var(--banner-icon-fill-color, rgb(var(--contrast-100)));background-color:var(--banner-icon-background-color, rgb(var(--contrast-800)))}@media screen and (max-width: 760px){.lime-banner__content{flex-direction:column;gap:0.5rem}.icon-message{display:flex;align-items:center}.lime-banner__actions{margin-left:0}}";export{a as limel_banner}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as o,h as i,a as t}from"./p-
|
|
1
|
+
import{r as e,c as o,h as i,a as t}from"./p-BGxJfR2f.js";import{c as l}from"./p-JbKhhoXs.js";import{C as a}from"./p-CYivp4-w.js";const r=class{constructor(i){e(this,i),this.change=o(this,"change"),this.disabled=!1,this.readonly=!1,this.checked=!1,this.indeterminate=!1,this.required=!1,this.readonlyLabels=[],this.modified=!1,this.shouldReinitialize=!1,this.id=l(),this.helperTextId=l(),this.destroyMDCInstances=()=>{const e=this.getCheckboxElement();e&&(delete e.dataset.indeterminate,e.indeterminate=!1)},this.isInvalid=()=>!!this.invalid||!(!this.required||!this.modified||this.checked)||void 0,this.initialize=()=>{const e=this.getCheckboxElement();e&&(e.indeterminate=this.indeterminate,e.checked=this.checked||this.indeterminate)},this.getCheckboxElement=()=>{var e,o;return(null===(o=null===(e=this.limelCheckbox)||void 0===e?void 0:e.shadowRoot)||void 0===o?void 0:o.querySelector('input[type="checkbox"]'))||null},this.onChange=e=>{var o;e.stopPropagation();const i=e.currentTarget,t=null!==(o=null==i?void 0:i.checked)&&void 0!==o?o:this.checked;this.change.emit(t),this.modified=!0}}handleCheckedChange(e){const o=this.getCheckboxElement();o&&(o.checked=e||this.indeterminate)}handleIndeterminateChange(e){const o=this.getCheckboxElement();o&&(o.checked=this.checked||e,o.indeterminate=e)}handleReadonlyChange(){this.destroyMDCInstances(),this.shouldReinitialize=!0}componentDidRender(){this.shouldReinitialize&&(this.initialize(),this.shouldReinitialize=!1)}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}disconnectedCallback(){this.destroyMDCInstances()}render(){return i(a,{key:"f01c9a3786bfb88bbf4450fc4b96f48385e50cc2",disabled:this.disabled||this.readonly,label:this.label,readonlyLabels:this.readonlyLabels,helperText:this.helperText,helperTextId:this.helperTextId,checked:this.checked||this.indeterminate,indeterminate:this.indeterminate,required:this.required,readonly:this.readonly,invalid:this.isInvalid(),onChange:this.onChange,id:this.id})}get limelCheckbox(){return t(this)}static get watchers(){return{checked:[{handleCheckedChange:0}],indeterminate:[{handleIndeterminateChange:0}],readonly:[{handleReadonlyChange:0}]}}};r.style='@charset "UTF-8";*,*:before,*:after{box-sizing:border-box}.boolean-input{--limel-boolean-input-box-size:1.25rem;--limel-boolean-input-gap-size:0.5rem;position:relative;isolation:isolate;display:flex;align-items:center;min-height:var(--limel-checkbox-min-height, 2.5rem);width:100%}.boolean-input input[type=checkbox],.boolean-input input[type=radio]{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap;-webkit-appearance:none;-moz-appearance:none;appearance:none}label.boolean-input-label{min-width:var(--limel-boolean-input-box-size);min-height:var(--limel-boolean-input-box-size);padding-top:0.125rem;cursor:pointer;position:relative;width:100%;overflow-wrap:var(--limel-boolean-input-label-overflow-wrap, normal);font-size:var(--limel-theme-default-small-font-size);color:var(--limel-theme-text-primary-on-background-color);padding-left:calc(var(--limel-boolean-input-box-size) + var(--limel-boolean-input-gap-size))}.disabled:not([readonly]):not([readonly=true]) label.boolean-input-label{cursor:not-allowed;color:var(--limel-theme-text-disabled-color)}.required label.boolean-input-label:after{margin-left:0.0625rem;content:"*"}.invalid:not(.readonly) label.boolean-input-label{color:var(--limel-theme-error-text-color)}:host(limel-checkbox.hide-label) label.boolean-input-label,.hide-label label.boolean-input-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;opacity:0;width:var(--limel-boolean-input-box-size)}.box{position:absolute;pointer-events:none;transition:border-color 0.4s ease 0.2s, background-color 0.2s ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease;display:inline-block;vertical-align:middle;width:var(--limel-boolean-input-box-size);height:var(--limel-boolean-input-box-size);margin-right:var(--limel-boolean-input-gap-size);border-radius:var(--limel-boolean-input-box-border-radius);border:0.125rem solid;border-color:var(--checkbox-unchecked-border-color, rgb(var(--contrast-900)));background-color:var(--limel-checkbox-background-color, rgb(var(--contrast-300)));}.checked .box,.boolean-input>input[type=checkbox]:checked+.box,.boolean-input>input[type=radio]:checked+.box{background-color:var(--lime-primary-color, var(--limel-theme-primary-color));border-color:var(--lime-primary-color, var(--limel-theme-primary-color))}.disabled .box{opacity:0.4}.box{}.boolean-input:not(.disabled):hover .box{will-change:box-shadow;box-shadow:var(--button-shadow-hovered)}.boolean-input:not(.disabled):active .box{will-change:box-shadow;box-shadow:var(--button-shadow-pressed)}.box:before{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);content:"";position:absolute;inset:-0.1875rem;border-radius:inherit;}.boolean-input>input[type=checkbox]:focus-visible+.box:before,.boolean-input>input[type=radio]:focus-visible+.box:before{will-change:box-shadow;box-shadow:var(--shadow-depth-8-focused)}.box:after{transition:opacity 0.2s ease, width 0.4s ease, box-shadow 0.6s cubic-bezier(0.68, -0.55, 0, 1.87), transform 0.6s cubic-bezier(0.68, -0.55, 0, 1.87);content:"";position:absolute;inset:0;margin:auto;border-radius:1rem;opacity:0;background-color:rgb(var(--color-white));}.boolean-input:not(.disabled):hover .box:after{will-change:opacity, box-shadow, transform, width}:host(limel-checkbox){--limel-boolean-input-label-overflow-wrap:var( --checkbox-label-overflow-wrap, normal );min-height:var(--limel-checkbox-min-height, 2.5rem)}.box:after{height:0.125rem;width:0.25rem}.indeterminate .box:after{opacity:1;width:calc(var(--limel-boolean-input-box-size) - 0.5rem)}.checkbox{--limel-boolean-input-box-border-radius:0.25rem}.checkbox svg.check-mark{position:absolute;z-index:1;inset:0;transform:translate3d(-0.125rem, -0.125rem, 0);width:var(--limel-boolean-input-box-size);height:var(--limel-boolean-input-box-size);padding:0.25rem;color:rgb(var(--color-white));opacity:0;stroke-width:0.1875rem;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}.checkbox svg.check-mark path{stroke-dashoffset:29.7833;stroke-dasharray:29.7833;transition:stroke-dashoffset 180ms cubic-bezier(0.4, 0, 0.6, 1)}.checkbox{}.checkbox:not(.indeterminate)>input[type=checkbox]:checked+.box svg.check-mark{opacity:1}.checkbox:not(.indeterminate)>input[type=checkbox]:checked+.box svg.check-mark path{stroke-dashoffset:0}limel-dynamic-label{margin-top:0.375rem;margin-left:-0.25rem}:host(limel-checkbox:focus),:host(limel-checkbox:focus-visible),:host(limel-checkbox:focus-within){--limel-h-l-grid-template-rows-transition-speed:0.46s;--limel-h-l-grid-template-rows:1fr}:host(limel-checkbox){--limel-h-l-grid-template-rows-transition-speed:0.3s;--limel-h-l-grid-template-rows:0fr}:host(limel-checkbox:focus) limel-helper-line,:host(limel-checkbox:focus-visible) limel-helper-line,:host(limel-checkbox:focus-within) limel-helper-line,:host(limel-checkbox:hover) limel-helper-line{will-change:grid-template-rows}';export{r as limel_checkbox}
|
|
@@ -18,5 +18,13 @@ export interface Image {
|
|
|
18
18
|
* - `eager` means that the image will be loaded as soon as possible.
|
|
19
19
|
*/
|
|
20
20
|
loading?: 'lazy' | 'eager';
|
|
21
|
+
/**
|
|
22
|
+
* The `referrerpolicy` attribute of the image. Set to `'no-referrer'`
|
|
23
|
+
* when `src` points to a third-party service that should not receive
|
|
24
|
+
* the originating page URL in the `Referer` header (e.g. external
|
|
25
|
+
* favicon or avatar services). When omitted, the attribute is not
|
|
26
|
+
* emitted and the browser's default referrer policy applies.
|
|
27
|
+
*/
|
|
28
|
+
referrerpolicy?: ReferrerPolicy;
|
|
21
29
|
}
|
|
22
30
|
//# sourceMappingURL=image.types.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FunctionalComponent } from '../stencil-public-runtime';
|
|
2
|
+
import { Image } from '../global/shared-types/image.types';
|
|
3
|
+
interface ImageTemplateProps {
|
|
4
|
+
image: Image;
|
|
5
|
+
/**
|
|
6
|
+
* Inline styles to set on the rendered `<img>`, e.g. to drive
|
|
7
|
+
* `object-fit` through a custom property.
|
|
8
|
+
*/
|
|
9
|
+
style?: {
|
|
10
|
+
[key: string]: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Handler invoked when the image fails to load (the `<img>`
|
|
14
|
+
* `error` event), letting the host react to a broken or blocked
|
|
15
|
+
* source.
|
|
16
|
+
*/
|
|
17
|
+
onError?: (event: Event) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders an `Image` as a plain `<img>` element. Centralises the
|
|
21
|
+
* attribute forwarding so consumer components do not have to
|
|
22
|
+
* reimplement it. Optional `style` and `onError` are
|
|
23
|
+
* forwarded to the element for consumers that also need to control
|
|
24
|
+
* its presentation or react to load failures. Intended for internal
|
|
25
|
+
* use by lime-elements components that accept an `Image`-shaped prop.
|
|
26
|
+
*
|
|
27
|
+
* @param props
|
|
28
|
+
* @param props.image - the image to render
|
|
29
|
+
* @param props.style - inline styles for the `<img>`
|
|
30
|
+
* @param props.onError - handler for the `<img>` `error` event
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare const ImageTemplate: FunctionalComponent<ImageTemplateProps>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=image.template.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limetech/lime-elements",
|
|
3
|
-
"version": "39.
|
|
3
|
+
"version": "39.35.0",
|
|
4
4
|
"description": "Lime Elements",
|
|
5
5
|
"author": "Lime Technologies",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"html-escaper": "^3.0.3",
|
|
79
79
|
"jsonlint-mod": "^1.7.6",
|
|
80
80
|
"jsx-dom": "^8.1.6",
|
|
81
|
-
"kompendium": "npm:@limetech/kompendium@^1.
|
|
81
|
+
"kompendium": "npm:@limetech/kompendium@^1.3.0",
|
|
82
82
|
"lodash-es": "^4.17.23",
|
|
83
83
|
"material-components-web": "^13.0.0",
|
|
84
84
|
"moment": "^2.30.1",
|