@limetech/lime-elements 38.24.0 → 38.24.2
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 +18 -0
- package/dist/cjs/limel-action-bar_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
- package/dist/cjs/limel-callout.cjs.entry.js +1 -1
- package/dist/cjs/limel-chart.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
- package/dist/cjs/limel-file-viewer.cjs.entry.js +24 -11
- package/dist/cjs/limel-file-viewer.cjs.entry.js.map +1 -1
- 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-linear-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
- package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
- package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
- package/dist/cjs/limel-table.cjs.entry.js +1 -1
- package/dist/cjs/{translations-7499f391.js → translations-d2be6dd7.js} +17 -9
- package/dist/cjs/translations-d2be6dd7.js.map +1 -0
- package/dist/collection/components/file-viewer/file-viewer.css +4 -2
- package/dist/collection/components/file-viewer/file-viewer.js +22 -9
- package/dist/collection/components/file-viewer/file-viewer.js.map +1 -1
- package/dist/collection/translations/da.js +2 -1
- package/dist/collection/translations/da.js.map +1 -1
- package/dist/collection/translations/de.js +2 -1
- package/dist/collection/translations/de.js.map +1 -1
- package/dist/collection/translations/en.js +2 -1
- package/dist/collection/translations/en.js.map +1 -1
- package/dist/collection/translations/fi.js +2 -1
- package/dist/collection/translations/fi.js.map +1 -1
- package/dist/collection/translations/fr.js +2 -1
- package/dist/collection/translations/fr.js.map +1 -1
- package/dist/collection/translations/nl.js +2 -1
- package/dist/collection/translations/nl.js.map +1 -1
- package/dist/collection/translations/no.js +2 -1
- package/dist/collection/translations/no.js.map +1 -1
- package/dist/collection/translations/sv.js +2 -1
- package/dist/collection/translations/sv.js.map +1 -1
- package/dist/esm/limel-action-bar_2.entry.js +1 -1
- package/dist/esm/limel-ai-avatar.entry.js +1 -1
- package/dist/esm/limel-callout.entry.js +1 -1
- package/dist/esm/limel-chart.entry.js +1 -1
- package/dist/esm/limel-chip_2.entry.js +1 -1
- package/dist/esm/limel-collapsible-section.entry.js +1 -1
- package/dist/esm/limel-file-viewer.entry.js +24 -11
- package/dist/esm/limel-file-viewer.entry.js.map +1 -1
- package/dist/esm/limel-file.entry.js +1 -1
- package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
- package/dist/esm/limel-linear-progress.entry.js +1 -1
- package/dist/esm/limel-profile-picture.entry.js +1 -1
- package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
- package/dist/esm/limel-snackbar.entry.js +1 -1
- package/dist/esm/limel-table.entry.js +1 -1
- package/dist/esm/{translations-1d617679.js → translations-91c611da.js} +17 -9
- package/dist/esm/translations-91c611da.js.map +1 -0
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-3f698d18.entry.js → p-1b036add.entry.js} +2 -2
- package/dist/lime-elements/{p-441c1eab.entry.js → p-2e22d9a1.entry.js} +2 -2
- package/dist/lime-elements/p-4c88e5d3.js +2 -0
- package/dist/lime-elements/p-4c88e5d3.js.map +1 -0
- package/dist/lime-elements/{p-78abbc50.entry.js → p-6466167d.entry.js} +2 -2
- package/dist/lime-elements/{p-ce29c097.entry.js → p-8e3c4418.entry.js} +2 -2
- package/dist/lime-elements/{p-4558a60e.entry.js → p-aeba4aa4.entry.js} +2 -2
- package/dist/lime-elements/{p-20d1913a.entry.js → p-b5abf284.entry.js} +2 -2
- package/dist/lime-elements/{p-e7201ebd.entry.js → p-cc7f4c81.entry.js} +2 -2
- package/dist/lime-elements/p-d349e355.entry.js +2 -0
- package/dist/lime-elements/p-d349e355.entry.js.map +1 -0
- package/dist/lime-elements/{p-8ae75f4a.entry.js → p-e6bb4d1a.entry.js} +2 -2
- package/dist/lime-elements/{p-597e6f79.entry.js → p-e8520341.entry.js} +2 -2
- package/dist/lime-elements/{p-7e3a4f49.entry.js → p-ed04acfc.entry.js} +2 -2
- package/dist/lime-elements/{p-011f5d81.entry.js → p-ed8aa16c.entry.js} +2 -2
- package/dist/lime-elements/{p-bd619d56.entry.js → p-ee0ed7ba.entry.js} +2 -2
- package/dist/lime-elements/{p-99de518a.entry.js → p-f83ebd28.entry.js} +2 -2
- package/dist/types/translations/da.d.ts +1 -0
- package/dist/types/translations/de.d.ts +1 -0
- package/dist/types/translations/en.d.ts +1 -0
- package/dist/types/translations/fi.d.ts +1 -0
- package/dist/types/translations/fr.d.ts +1 -0
- package/dist/types/translations/nl.d.ts +1 -0
- package/dist/types/translations/no.d.ts +1 -0
- package/dist/types/translations/sv.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/translations-7499f391.js.map +0 -1
- package/dist/esm/translations-1d617679.js.map +0 -1
- package/dist/lime-elements/p-58777116.js +0 -2
- package/dist/lime-elements/p-58777116.js.map +0 -1
- package/dist/lime-elements/p-bd6878ee.entry.js +0 -2
- package/dist/lime-elements/p-bd6878ee.entry.js.map +0 -1
- /package/dist/lime-elements/{p-3f698d18.entry.js.map → p-1b036add.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-441c1eab.entry.js.map → p-2e22d9a1.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-78abbc50.entry.js.map → p-6466167d.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-ce29c097.entry.js.map → p-8e3c4418.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-4558a60e.entry.js.map → p-aeba4aa4.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-20d1913a.entry.js.map → p-b5abf284.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-e7201ebd.entry.js.map → p-cc7f4c81.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-8ae75f4a.entry.js.map → p-e6bb4d1a.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-597e6f79.entry.js.map → p-e8520341.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-7e3a4f49.entry.js.map → p-ed04acfc.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-011f5d81.entry.js.map → p-ed8aa16c.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-bd619d56.entry.js.map → p-ee0ed7ba.entry.js.map} +0 -0
- /package/dist/lime-elements/{p-99de518a.entry.js.map → p-f83ebd28.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as r}from"./p-288f0842.js";import{i as o}from"./p-b8c91b22.js";import{g as s}from"./p-d251f404.js";import{t as n}from"./p-58777116.js";import{c as a}from"./p-ad52787a.js";import"./p-89524e09.js";async function l(t,e){const{width:i,height:r,fit:o="cover",type:s="image/jpeg",quality:n=.85,rename:a=(t=>v(t,s))}=e;const l=await f(t);const{sx:c,sy:b,sw:p,sh:g,dx:w,dy:y,dw:k,dh:x}=m(l.width,l.height,i,r,o);const j=d(i,r);const z=h(j);z.clearRect(0,0,i,r);z.drawImage(l,c,b,p,g,w,y,k,x);const F=await u(j,s,n);const C=a(t.name);return new File([F],C,{type:s})}function c(){try{return typeof globalThis.OffscreenCanvas==="function"}catch(t){return false}}function d(t,e){if(c()){return new globalThis.OffscreenCanvas(t,e)}const i=document.createElement("canvas");i.width=t;i.height=e;return i}function h(t){const e=t.getContext("2d",{alpha:true});if(!e){throw new Error("2D canvas context not available")}return e}function u(t,e,i){if("convertToBlob"in t){return t.convertToBlob({type:e,quality:i})}return new Promise(((r,o)=>{t.toBlob((t=>{if(!t){o(new Error("Failed to create blob from canvas"));return}r(t)}),e,i)}))}async function f(t){var e,i;if(typeof globalThis.createImageBitmap==="function"){try{return await globalThis.createImageBitmap(t,{imageOrientation:"from-image"})}catch(t){const r=((i=(e=globalThis.process)===null||e===void 0?void 0:e.env)===null||i===void 0?void 0:i.NODE_ENV)!=="production";if(r&&typeof console!=="undefined"&&typeof console.debug==="function"){console.debug("createImageBitmap failed, falling back to HTMLImageElement:",t)}}}return await b(t)}async function b(t){var e;const i=URL.createObjectURL(t);try{const t=new Image;t.decoding="sync";t.src=i;await((e=t.decode)===null||e===void 0?void 0:e.call(t).catch((()=>undefined)));if(!t.complete){await new Promise(((e,i)=>{const r=()=>{t.removeEventListener("load",o);t.removeEventListener("error",s)};const o=()=>{r();e()};const s=t=>{r();i(t)};t.addEventListener("load",o);t.addEventListener("error",s)}))}return t}finally{URL.revokeObjectURL(i)}}function m(t,e,i,r,o){const s=t/e;const n=i/r;if(o==="cover"){let o;let a;if(s>n){a=e;o=e*n}else{o=t;a=t/n}const l=(t-o)/2;const c=(e-a)/2;return{sx:l,sy:c,sw:o,sh:a,dx:0,dy:0,dw:i,dh:r}}let a;let l;if(s>n){a=i;l=i/s}else{l=r;a=r*s}const c=(i-a)/2;const d=(r-l)/2;return{sx:0,sy:0,sw:t,sh:e,dx:c,dy:d,dw:a,dh:l}}function v(t,e){const i=e==="image/png"?"png":"jpg";const r=t.lastIndexOf(".");const o=r>0?t.slice(0,r):t;return`${o}.${i}`}const p="@charset \"UTF-8\";:host(limel-profile-picture){position:relative;display:inline-flex;min-width:1.5rem;min-height:1.5rem;border-radius:var(--profile-picture-border-radius, 100vw);background-color:rgb(var(--contrast-400))}*{box-sizing:border-box}limel-file-dropzone,limel-file-input,button.avatar{display:flex;align-items:center;justify-content:center;width:100%;height:100%}button{all:unset;display:block}button:focus{outline:none}button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button.avatar{overflow:hidden;border-radius:var(--profile-picture-border-radius, 100vw)}:host(:not([disabled]):not([disabled=true])) button.avatar{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:focus,:host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible{will-change:color, background-color, box-shadow, transform}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}:host(:not([disabled]):not([disabled=true])) button.avatar:hover{box-shadow:var(--button-shadow-hovered)}:host(:not([disabled]):not([disabled=true])) button.avatar:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host([invalid]:not([invalid=false])) button.avatar{box-shadow:var(--shadow-error-state)}button.remove{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:rgb(var(--contrast-900));cursor:pointer;height:1.25rem;width:1.25rem;border-radius:50%;background-repeat:no-repeat;background-position:center;background-size:0.75rem;background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>\");position:absolute;top:0;left:0;opacity:0}button.remove:hover,button.remove:focus,button.remove:focus-visible{will-change:color, background-color, box-shadow, transform}button.remove:hover,button.remove:focus-visible{transform:translate3d(0, 0.01rem, 0);color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}button.remove:hover{box-shadow:var(--button-shadow-hovered)}button.remove:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button.remove:hover,button.remove:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host(:hover) button.remove,:host(:focus) button.remove,:host(:focus-visible) button.remove,:host(:focus-within) button.remove,:host(:active) button.remove{animation:show 0.4s ease-in-out forwards}@keyframes show{0%{transform:scale(0.9);opacity:0}100%{transform:scale(1);opacity:1}}button.avatar,img,limel-icon{border-radius:var(--profile-picture-border-radius, 100vw)}limel-icon{width:calc(100% - 1rem);min-width:1rem;max-width:4rem;color:var(--limel-theme-text-secondary-on-background-color);margin:auto}img{object-fit:var(--limel-profile-picture-object-fit);width:100%;height:100%}:host(.has-image-error) img{border:1px dashed rgb(var(--contrast-600));background:url(\"data:image/svg+xml;charset=utf-8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' style='fill-rule:evenodd;'><path fill='rgba(186,186,192,0.16)' d='M0 0h4v4H0zM4 4h4v4H4z'/></svg>\");background-size:0.5rem}limel-spinner{position:absolute;inset:0;margin:auto}limel-popover{position:absolute;inset:auto 0 0 auto;display:block;width:2.25rem;height:2.25rem}";const g=class{constructor(r){t(this,r);this.change=e(this,"change",7);this.filesRejected=e(this,"filesRejected",7);this.removeButtonId=a();this.browseButtonId=a();this.renderHelperText=()=>{if(!this.helperText){return}return i("limel-tooltip",{elementId:this.browseButtonId,label:this.helperText})};this.handleNewFiles=async t=>{var e,i;t.stopPropagation();if(this.disabled){return}const r=(e=t.detail)===null||e===void 0?void 0:e[0];if(!r){return}if(!o(r,this.accept)){this.filesRejected.emit([r]);return}this.revokeObjectUrl();this.imageError=false;let s=r;if(this.resize&&r.fileContent instanceof File){try{const t=await l(r.fileContent,Object.assign(Object.assign({},this.resize),{fit:(i=this.resize.fit)!==null&&i!==void 0?i:this.imageFit}));s=Object.assign(Object.assign({},r),{filename:t.name,size:t.size,contentType:t.type,fileContent:t})}catch(t){s=r}}if(!s.href&&s.fileContent instanceof File){this.objectUrl=URL.createObjectURL(s.fileContent)}this.change.emit(s)};this.handleRejectedFiles=t=>{t.stopPropagation();this.filesRejected.emit(t.detail)};this.handleClear=t=>{t.stopPropagation();this.revokeObjectUrl();this.imageError=false;this.change.emit(undefined)};this.onImageError=()=>{this.imageError=true};this.openPopover=t=>{t.stopPropagation();this.isErrorMessagePopoverOpen=true};this.onPopoverClose=t=>{t.stopPropagation();this.isErrorMessagePopoverOpen=false};this.getTranslation=t=>n.get(t,this.language);this.language="en";this.label=undefined;this.icon="user";this.helperText=undefined;this.disabled=false;this.readonly=false;this.required=false;this.invalid=false;this.loading=false;this.value=undefined;this.imageFit="cover";this.accept="image/jpeg,image/png,image/heic,.jpg,.jpeg,.png,.heic";this.resize=undefined;this.objectUrl=undefined;this.imageError=false;this.isErrorMessagePopoverOpen=false}disconnectedCallback(){this.revokeObjectUrl()}handleValueChange(){this.revokeObjectUrl();this.imageError=false;const t=this.value;if(t&&typeof t!=="string"&&!t.href&&t.fileContent instanceof File){this.objectUrl=URL.createObjectURL(t.fileContent)}}render(){const t={"has-image-error":this.imageError};if(this.readonly){return i(r,{class:t},this.renderAvatar())}return i(r,{class:t},i("limel-file-dropzone",{disabled:this.disabled,accept:this.accept,onFilesSelected:this.handleNewFiles,onFilesRejected:this.handleRejectedFiles},i("limel-file-input",{accept:this.accept,disabled:this.disabled,"aria-required":this.required?"true":undefined,"aria-invalid":this.invalid?"true":undefined},this.renderBrowseButton())),this.renderClearButton(),this.renderSpinner(),this.renderErrorMessage(),this.renderHelperText())}get hasValue(){if(typeof this.value==="string"){return!!this.value}if(this.value&&(this.value.href||this.value.fileContent)){return true}return!!this.objectUrl}renderBrowseButton(){return i("button",{id:this.browseButtonId,type:"button",class:"avatar",disabled:this.disabled,"aria-label":this.label,"aria-busy":this.loading?"true":"false","aria-live":"polite"},this.renderAvatar())}renderAvatar(){const t=this.getImageSrc();if(t){return i("img",{src:t,alt:"",style:{"--limel-profile-picture-object-fit":this.imageFit},loading:"lazy",onError:this.onImageError})}return this.renderIcon()}renderIcon(){var t,e;const r=s(this.icon);return i("limel-icon",{name:r,style:{color:`${(t=this.icon)===null||t===void 0?void 0:t.color}`,"background-color":`${(e=this.icon)===null||e===void 0?void 0:e.backgroundColor}`}})}renderClearButton(){if(!this.hasValue||this.disabled){return}return[i("button",{class:"remove",type:"button",id:this.removeButtonId,onClick:this.handleClear}),i("limel-tooltip",{label:this.getTranslation("profile-picture.remove"),elementId:this.removeButtonId})]}renderSpinner(){if(!this.loading){return}return i("limel-spinner",null)}getUnsupportedPreviewContext(){const t=this.value;const e=!this.getImageSrc();const i=!!(t&&typeof t!=="string"&&t.fileContent instanceof File&&!t.href);const r=!!this.resize;return{hasNoSrc:e,hasLocalFile:i,isResizeConfigured:r}}shouldShowErrorMessage(){const{hasNoSrc:t,hasLocalFile:e,isResizeConfigured:i}=this.getUnsupportedPreviewContext();return(t||this.imageError)&&e&&i}renderErrorMessage(){if(!this.shouldShowErrorMessage()){return}const t={name:"error",color:"rgb(var(--color-orange-dark))"};const e={maxWidth:"20rem",borderRadius:"0.75rem"};return i("limel-popover",{open:this.isErrorMessagePopoverOpen,onClick:this.openPopover,onClose:this.onPopoverClose},i("limel-icon-button",{slot:"trigger",elevated:true,icon:t,"aria-live":"polite",label:this.getTranslation("profile-picture.unsupported-preview.title")}),i("limel-callout",{type:"warning",style:e,heading:this.getTranslation("profile-picture.unsupported-preview.title")},this.getTranslation("profile-picture.unsupported-preview.description")))}getImageSrc(){if(!this.value){return this.objectUrl}if(typeof this.value==="string"){return this.value}if(this.value.href){return this.value.href}if(this.value.fileContent instanceof File){return this.objectUrl}return undefined}revokeObjectUrl(){if(this.objectUrl){URL.revokeObjectURL(this.objectUrl);this.objectUrl=undefined}}static get watchers(){return{value:["handleValueChange"]}}};g.style=p;export{g as limel_profile_picture};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as t,c as e,h as i,H as r}from"./p-288f0842.js";import{i as o}from"./p-b8c91b22.js";import{g as s}from"./p-d251f404.js";import{t as n}from"./p-4c88e5d3.js";import{c as a}from"./p-ad52787a.js";import"./p-89524e09.js";async function l(t,e){const{width:i,height:r,fit:o="cover",type:s="image/jpeg",quality:n=.85,rename:a=(t=>v(t,s))}=e;const l=await f(t);const{sx:c,sy:b,sw:p,sh:g,dx:w,dy:y,dw:k,dh:x}=m(l.width,l.height,i,r,o);const j=d(i,r);const z=h(j);z.clearRect(0,0,i,r);z.drawImage(l,c,b,p,g,w,y,k,x);const F=await u(j,s,n);const C=a(t.name);return new File([F],C,{type:s})}function c(){try{return typeof globalThis.OffscreenCanvas==="function"}catch(t){return false}}function d(t,e){if(c()){return new globalThis.OffscreenCanvas(t,e)}const i=document.createElement("canvas");i.width=t;i.height=e;return i}function h(t){const e=t.getContext("2d",{alpha:true});if(!e){throw new Error("2D canvas context not available")}return e}function u(t,e,i){if("convertToBlob"in t){return t.convertToBlob({type:e,quality:i})}return new Promise(((r,o)=>{t.toBlob((t=>{if(!t){o(new Error("Failed to create blob from canvas"));return}r(t)}),e,i)}))}async function f(t){var e,i;if(typeof globalThis.createImageBitmap==="function"){try{return await globalThis.createImageBitmap(t,{imageOrientation:"from-image"})}catch(t){const r=((i=(e=globalThis.process)===null||e===void 0?void 0:e.env)===null||i===void 0?void 0:i.NODE_ENV)!=="production";if(r&&typeof console!=="undefined"&&typeof console.debug==="function"){console.debug("createImageBitmap failed, falling back to HTMLImageElement:",t)}}}return await b(t)}async function b(t){var e;const i=URL.createObjectURL(t);try{const t=new Image;t.decoding="sync";t.src=i;await((e=t.decode)===null||e===void 0?void 0:e.call(t).catch((()=>undefined)));if(!t.complete){await new Promise(((e,i)=>{const r=()=>{t.removeEventListener("load",o);t.removeEventListener("error",s)};const o=()=>{r();e()};const s=t=>{r();i(t)};t.addEventListener("load",o);t.addEventListener("error",s)}))}return t}finally{URL.revokeObjectURL(i)}}function m(t,e,i,r,o){const s=t/e;const n=i/r;if(o==="cover"){let o;let a;if(s>n){a=e;o=e*n}else{o=t;a=t/n}const l=(t-o)/2;const c=(e-a)/2;return{sx:l,sy:c,sw:o,sh:a,dx:0,dy:0,dw:i,dh:r}}let a;let l;if(s>n){a=i;l=i/s}else{l=r;a=r*s}const c=(i-a)/2;const d=(r-l)/2;return{sx:0,sy:0,sw:t,sh:e,dx:c,dy:d,dw:a,dh:l}}function v(t,e){const i=e==="image/png"?"png":"jpg";const r=t.lastIndexOf(".");const o=r>0?t.slice(0,r):t;return`${o}.${i}`}const p="@charset \"UTF-8\";:host(limel-profile-picture){position:relative;display:inline-flex;min-width:1.5rem;min-height:1.5rem;border-radius:var(--profile-picture-border-radius, 100vw);background-color:rgb(var(--contrast-400))}*{box-sizing:border-box}limel-file-dropzone,limel-file-input,button.avatar{display:flex;align-items:center;justify-content:center;width:100%;height:100%}button{all:unset;display:block}button:focus{outline:none}button:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}button.avatar{overflow:hidden;border-radius:var(--profile-picture-border-radius, 100vw)}:host(:not([disabled]):not([disabled=true])) button.avatar{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:transparent}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:focus,:host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible{will-change:color, background-color, box-shadow, transform}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}:host(:not([disabled]):not([disabled=true])) button.avatar:hover{box-shadow:var(--button-shadow-hovered)}:host(:not([disabled]):not([disabled=true])) button.avatar:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}:host(:not([disabled]):not([disabled=true])) button.avatar:hover,:host(:not([disabled]):not([disabled=true])) button.avatar:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host([invalid]:not([invalid=false])) button.avatar{box-shadow:var(--shadow-error-state)}button.remove{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--limel-theme-on-surface-color);background-color:rgb(var(--contrast-900));cursor:pointer;height:1.25rem;width:1.25rem;border-radius:50%;background-repeat:no-repeat;background-position:center;background-size:0.75rem;background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>\");position:absolute;top:0;left:0;opacity:0}button.remove:hover,button.remove:focus,button.remove:focus-visible{will-change:color, background-color, box-shadow, transform}button.remove:hover,button.remove:focus-visible{transform:translate3d(0, 0.01rem, 0);color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}button.remove:hover{box-shadow:var(--button-shadow-hovered)}button.remove:active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}button.remove:hover,button.remove:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}:host(:hover) button.remove,:host(:focus) button.remove,:host(:focus-visible) button.remove,:host(:focus-within) button.remove,:host(:active) button.remove{animation:show 0.4s ease-in-out forwards}@keyframes show{0%{transform:scale(0.9);opacity:0}100%{transform:scale(1);opacity:1}}button.avatar,img,limel-icon{border-radius:var(--profile-picture-border-radius, 100vw)}limel-icon{width:calc(100% - 1rem);min-width:1rem;max-width:4rem;color:var(--limel-theme-text-secondary-on-background-color);margin:auto}img{object-fit:var(--limel-profile-picture-object-fit);width:100%;height:100%}:host(.has-image-error) img{border:1px dashed rgb(var(--contrast-600));background:url(\"data:image/svg+xml;charset=utf-8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' style='fill-rule:evenodd;'><path fill='rgba(186,186,192,0.16)' d='M0 0h4v4H0zM4 4h4v4H4z'/></svg>\");background-size:0.5rem}limel-spinner{position:absolute;inset:0;margin:auto}limel-popover{position:absolute;inset:auto 0 0 auto;display:block;width:2.25rem;height:2.25rem}";const g=class{constructor(r){t(this,r);this.change=e(this,"change",7);this.filesRejected=e(this,"filesRejected",7);this.removeButtonId=a();this.browseButtonId=a();this.renderHelperText=()=>{if(!this.helperText){return}return i("limel-tooltip",{elementId:this.browseButtonId,label:this.helperText})};this.handleNewFiles=async t=>{var e,i;t.stopPropagation();if(this.disabled){return}const r=(e=t.detail)===null||e===void 0?void 0:e[0];if(!r){return}if(!o(r,this.accept)){this.filesRejected.emit([r]);return}this.revokeObjectUrl();this.imageError=false;let s=r;if(this.resize&&r.fileContent instanceof File){try{const t=await l(r.fileContent,Object.assign(Object.assign({},this.resize),{fit:(i=this.resize.fit)!==null&&i!==void 0?i:this.imageFit}));s=Object.assign(Object.assign({},r),{filename:t.name,size:t.size,contentType:t.type,fileContent:t})}catch(t){s=r}}if(!s.href&&s.fileContent instanceof File){this.objectUrl=URL.createObjectURL(s.fileContent)}this.change.emit(s)};this.handleRejectedFiles=t=>{t.stopPropagation();this.filesRejected.emit(t.detail)};this.handleClear=t=>{t.stopPropagation();this.revokeObjectUrl();this.imageError=false;this.change.emit(undefined)};this.onImageError=()=>{this.imageError=true};this.openPopover=t=>{t.stopPropagation();this.isErrorMessagePopoverOpen=true};this.onPopoverClose=t=>{t.stopPropagation();this.isErrorMessagePopoverOpen=false};this.getTranslation=t=>n.get(t,this.language);this.language="en";this.label=undefined;this.icon="user";this.helperText=undefined;this.disabled=false;this.readonly=false;this.required=false;this.invalid=false;this.loading=false;this.value=undefined;this.imageFit="cover";this.accept="image/jpeg,image/png,image/heic,.jpg,.jpeg,.png,.heic";this.resize=undefined;this.objectUrl=undefined;this.imageError=false;this.isErrorMessagePopoverOpen=false}disconnectedCallback(){this.revokeObjectUrl()}handleValueChange(){this.revokeObjectUrl();this.imageError=false;const t=this.value;if(t&&typeof t!=="string"&&!t.href&&t.fileContent instanceof File){this.objectUrl=URL.createObjectURL(t.fileContent)}}render(){const t={"has-image-error":this.imageError};if(this.readonly){return i(r,{class:t},this.renderAvatar())}return i(r,{class:t},i("limel-file-dropzone",{disabled:this.disabled,accept:this.accept,onFilesSelected:this.handleNewFiles,onFilesRejected:this.handleRejectedFiles},i("limel-file-input",{accept:this.accept,disabled:this.disabled,"aria-required":this.required?"true":undefined,"aria-invalid":this.invalid?"true":undefined},this.renderBrowseButton())),this.renderClearButton(),this.renderSpinner(),this.renderErrorMessage(),this.renderHelperText())}get hasValue(){if(typeof this.value==="string"){return!!this.value}if(this.value&&(this.value.href||this.value.fileContent)){return true}return!!this.objectUrl}renderBrowseButton(){return i("button",{id:this.browseButtonId,type:"button",class:"avatar",disabled:this.disabled,"aria-label":this.label,"aria-busy":this.loading?"true":"false","aria-live":"polite"},this.renderAvatar())}renderAvatar(){const t=this.getImageSrc();if(t){return i("img",{src:t,alt:"",style:{"--limel-profile-picture-object-fit":this.imageFit},loading:"lazy",onError:this.onImageError})}return this.renderIcon()}renderIcon(){var t,e;const r=s(this.icon);return i("limel-icon",{name:r,style:{color:`${(t=this.icon)===null||t===void 0?void 0:t.color}`,"background-color":`${(e=this.icon)===null||e===void 0?void 0:e.backgroundColor}`}})}renderClearButton(){if(!this.hasValue||this.disabled){return}return[i("button",{class:"remove",type:"button",id:this.removeButtonId,onClick:this.handleClear}),i("limel-tooltip",{label:this.getTranslation("profile-picture.remove"),elementId:this.removeButtonId})]}renderSpinner(){if(!this.loading){return}return i("limel-spinner",null)}getUnsupportedPreviewContext(){const t=this.value;const e=!this.getImageSrc();const i=!!(t&&typeof t!=="string"&&t.fileContent instanceof File&&!t.href);const r=!!this.resize;return{hasNoSrc:e,hasLocalFile:i,isResizeConfigured:r}}shouldShowErrorMessage(){const{hasNoSrc:t,hasLocalFile:e,isResizeConfigured:i}=this.getUnsupportedPreviewContext();return(t||this.imageError)&&e&&i}renderErrorMessage(){if(!this.shouldShowErrorMessage()){return}const t={name:"error",color:"rgb(var(--color-orange-dark))"};const e={maxWidth:"20rem",borderRadius:"0.75rem"};return i("limel-popover",{open:this.isErrorMessagePopoverOpen,onClick:this.openPopover,onClose:this.onPopoverClose},i("limel-icon-button",{slot:"trigger",elevated:true,icon:t,"aria-live":"polite",label:this.getTranslation("profile-picture.unsupported-preview.title")}),i("limel-callout",{type:"warning",style:e,heading:this.getTranslation("profile-picture.unsupported-preview.title")},this.getTranslation("profile-picture.unsupported-preview.description")))}getImageSrc(){if(!this.value){return this.objectUrl}if(typeof this.value==="string"){return this.value}if(this.value.href){return this.value.href}if(this.value.fileContent instanceof File){return this.objectUrl}return undefined}revokeObjectUrl(){if(this.objectUrl){URL.revokeObjectURL(this.objectUrl);this.objectUrl=undefined}}static get watchers(){return{value:["handleValueChange"]}}};g.style=p;export{g as limel_profile_picture};
|
|
2
|
+
//# sourceMappingURL=p-ed04acfc.entry.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e,c as o,h as t,g as i}from"./p-288f0842.js";import{d as n}from"./p-c70b1ea3.js";import{m as s,r}from"./p-e127eaaa.js";import{c as a}from"./p-ad52787a.js";import{g as l,a as c,b as d}from"./p-d251f404.js";import{t as p}from"./p-58777116.js";const h='@charset "UTF-8";:host(limel-collapsible-section){--border-radius-of-header:0.75rem;display:block}:host([hidden]){display:none}.open-close-toggle{all:unset;position:absolute;inset:0;width:100%;transition:background-color 0.4s ease, border-radius 0.1s ease;cursor:pointer;z-index:-1;background-color:var(--closed-header-background-color, rgb(var(--contrast-200)));border-radius:var(--border-radius-of-header)}.open-close-toggle:focus{outline:none}.open-close-toggle:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.open-close-toggle:hover,.open-close-toggle:focus-visible{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}section.open .open-close-toggle{background-color:var(--open-header-background-color, rgb(var(--contrast-100)));border-radius:var(--border-radius-of-header) var(--border-radius-of-header) 0 0}section.open .open-close-toggle:hover,section.open .open-close-toggle:focus-visible{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}.title,.divider-line,.expand-icon{pointer-events:none}section{transition:box-shadow 0.4s ease;border-radius:var(--border-radius-of-header)}section[aria-invalid]:not([aria-invalid=false]){--header-stroke-color:rgb(var(--color-red-default)) !important}section[aria-invalid]:not([aria-invalid=false]):not(.open){box-shadow:0 0 0 1px rgb(var(--color-red-default))}header{isolation:isolate;position:relative;align-items:center;display:flex;justify-content:space-between;gap:0.5rem;padding-left:0.5rem;height:2.5rem}limel-icon{width:1.5rem}.title{font-size:1rem;font-weight:300;color:var(--limel-theme-on-surface-color);justify-self:flex-start;user-select:none;height:auto;max-height:3rem;line-height:1.2rem;display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.divider-line{transition:opacity 0.3s ease 0.3s;flex-grow:1;height:0.125rem;border-radius:1rem;background-color:var(--header-stroke-color, rgb(var(--contrast-900)));opacity:0;margin-right:0.5rem}section.open .divider-line{opacity:0.16}.actions{justify-self:flex-end;flex-shrink:0}::slotted([slot=header]){margin-right:0.5rem}.body{background-color:var(--body-background-color, var(--contrast-100));padding-left:var(--body-padding, 1.25rem);padding-right:var(--body-padding, 1.25rem);border-radius:0 0 var(--border-radius-of-header) var(--border-radius-of-header)}.body{--limel-cs-opacity-transition-speed:0.1s;--limel-cs-opacity-transition-delay:0s;--limel-cs-grid-template-rows-transition-speed:0.3s;transition:grid-template-rows var(--limel-cs-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89);display:grid;grid-template-rows:0fr}.body slot{transition:opacity var(--limel-cs-opacity-transition-speed) ease var(--limel-cs-opacity-transition-delay);display:block;overflow:hidden;opacity:0}section.open .body{--limel-cs-opacity-transition-speed:0.4s;--limel-cs-opacity-transition-delay:0.3s;--limel-cs-grid-template-rows-transition-speed:0.46s;grid-template-rows:1fr}section.open .body slot{opacity:1}header:hover+.body,header:has(.open-close-toggle:hover)+.body,header:has(.open-close-toggle:focus-visible)+.body{will-change:grid-template-rows}header:hover+.body slot,header:has(.open-close-toggle:hover)+.body slot,header:has(.open-close-toggle:focus-visible)+.body slot{will-change:opacity}.expand-icon{position:relative;display:flex;align-items:center;justify-content:center;height:1.875rem;margin:0 0 0 0.5rem;width:0.75rem;flex-shrink:0}.line{position:absolute;inset:auto;margin:auto;width:100%;border-radius:1rem;height:0.125rem}.line:first-of-type,.line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s;opacity:0;background-color:var(--header-stroke-color, rgb(var(--contrast-900)))}.line:nth-of-type(2){transform:translate3d(0, 0.25rem, 0) rotate(90deg)}.line:nth-of-type(3){transform:translate3d(0, -0.25rem, 0) rotate(-90deg)}.line:nth-of-type(2),.line:nth-of-type(3){transition:opacity 0.2s ease, transform 0.18s ease}.line:nth-of-type(2):before,.line:nth-of-type(2):after,.line:nth-of-type(3):before,.line:nth-of-type(3):after{content:"";position:absolute;inset:0;margin:auto;width:50%;height:100%;border-radius:inherit;background-color:var(--header-stroke-color, rgb(var(--contrast-900)))}.line:nth-of-type(2):before,.line:nth-of-type(3):before{transform:translate3d(0, -0.1rem, 0) rotate(45deg)}.line:nth-of-type(2):after,.line:nth-of-type(3):after{transform:translate3d(0, 0.1rem, 0) rotate(-45deg)}.open-close-toggle:hover+.expand-icon .line:first-of-type,.open-close-toggle:hover+.expand-icon .line:last-of-type,.open-close-toggle:focus-visible+.expand-icon .line:first-of-type,.open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transition:opacity 0.8s ease 0.4s, transform 0.4s ease 0.3s;opacity:1}.open-close-toggle:hover+.expand-icon .line:first-of-type,.open-close-toggle:focus-visible+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:last-of-type,.open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2),.open-close-toggle:hover+.expand-icon .line:nth-of-type(3),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transition:opacity 0.5s ease 0.4s, transform 0.7s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2){transform:translate3d(0, 0.5rem, 0) rotate(90deg);opacity:0.4}.open-close-toggle:hover+.expand-icon .line:nth-of-type(3),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transform:translate3d(0, -0.5rem, 0) rotate(-90deg);opacity:0.4}section.open .line:first-of-type,section.open .line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s;opacity:1}section.open .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:nth-of-type(2),section.open .line:nth-of-type(3){transition:opacity 1s ease, transform 0.4s ease}section.open .line:nth-of-type(2){transform:translate3d(0, 1rem, 0) rotate(90deg);opacity:0}section.open .line:nth-of-type(3){transform:translate3d(0, -1rem, 0) rotate(-90deg);opacity:0}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type,section.open .open-close-toggle:hover+.expand-icon .line:last-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:first-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transition:opacity 0.2s ease 0.4s, transform 0.4s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 45deg)}section.open .open-close-toggle:hover+.expand-icon .line:last-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, -45deg)}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(2),section.open .open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2){transform:translate3d(0, 1rem, 0) rotate(90deg);opacity:0}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(3),section.open .open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transform:translate3d(0, -1rem, 0) rotate(-90deg);opacity:0}';const g=class{constructor(i){e(this,i);this.open=o(this,"open",7);this.close=o(this,"close",7);this.action=o(this,"action",7);this.bodyId=a();this.headingId=a();this.onClick=()=>{this.handleInteraction()};this.handleInteraction=()=>{this.isOpen=!this.isOpen;if(this.isOpen){this.open.emit();const e=100;setTimeout(n,e)}else{this.close.emit()}};this.renderExpandCollapseSign=()=>t("div",{class:"expand-icon",role:"presentation","aria-hidden":"true"},t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"}));this.renderIcon=()=>{if(!this.icon){return}const e=l(this.icon);const o=c(this.icon);const i=d(this.icon);return t("limel-icon",{name:e,"aria-label":i,"aria-hidden":i?null:"true",style:{color:`${o}`}})};this.renderHeading=()=>{if(!this.header){return}return t("h2",{class:"title mdc-typography mdc-typography--headline2",id:this.headingId},this.header)};this.renderActions=()=>{if(!this.actions){return}return t("div",{class:"actions"},this.actions.map(this.renderActionButton))};this.renderActionButton=e=>t("limel-icon-button",{icon:e.icon,label:e.label,disabled:e.disabled,onClick:this.handleActionClick(e)});this.handleActionClick=e=>o=>{o.stopPropagation();this.action.emit(e)};this.getCollapsibleSectionAriaLabel=()=>{const e=this.header?`"${this.header}"`:" ";if(!this.isOpen){return p.get("collapsible-section.open",this.language,{header:e})}return p.get("collapsible-section.close",this.language,{header:e})};this.isOpen=false;this.header=undefined;this.icon=undefined;this.invalid=false;this.actions=undefined;this.language="en"}componentDidRender(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");s(e)}disconnectedCallback(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");r(e)}render(){return t("section",{class:`${this.isOpen?"open":""}`,"aria-invalid":this.invalid,"aria-labelledby":this.header?this.headingId:null},t("header",null,t("button",{class:"open-close-toggle",onClick:this.onClick,"aria-controls":this.bodyId,"aria-expanded":this.isOpen?"true":"false","aria-label":this.getCollapsibleSectionAriaLabel(),type:"button"}),this.renderExpandCollapseSign(),this.renderIcon(),this.renderHeading(),t("div",{class:"divider-line",role:"presentation"}),this.renderHeaderSlot(),this.renderActions()),t("div",{class:"body","aria-hidden":String(!this.isOpen),id:this.bodyId,role:"region"},t("slot",null)))}renderHeaderSlot(){return t("slot",{name:"header"})}get host(){return i(this)}};g.style=h;export{g as limel_collapsible_section};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{r as e,c as o,h as t,g as i}from"./p-288f0842.js";import{d as n}from"./p-c70b1ea3.js";import{m as s,r}from"./p-e127eaaa.js";import{c as a}from"./p-ad52787a.js";import{g as l,a as c,b as d}from"./p-d251f404.js";import{t as p}from"./p-4c88e5d3.js";const h='@charset "UTF-8";:host(limel-collapsible-section){--border-radius-of-header:0.75rem;display:block}:host([hidden]){display:none}.open-close-toggle{all:unset;position:absolute;inset:0;width:100%;transition:background-color 0.4s ease, border-radius 0.1s ease;cursor:pointer;z-index:-1;background-color:var(--closed-header-background-color, rgb(var(--contrast-200)));border-radius:var(--border-radius-of-header)}.open-close-toggle:focus{outline:none}.open-close-toggle:focus-visible{outline:none;box-shadow:var(--shadow-depth-8-focused)}.open-close-toggle:hover,.open-close-toggle:focus-visible{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}section.open .open-close-toggle{background-color:var(--open-header-background-color, rgb(var(--contrast-100)));border-radius:var(--border-radius-of-header) var(--border-radius-of-header) 0 0}section.open .open-close-toggle:hover,section.open .open-close-toggle:focus-visible{background-color:var(--open-header-background-color, rgb(var(--contrast-300)))}.title,.divider-line,.expand-icon{pointer-events:none}section{transition:box-shadow 0.4s ease;border-radius:var(--border-radius-of-header)}section[aria-invalid]:not([aria-invalid=false]){--header-stroke-color:rgb(var(--color-red-default)) !important}section[aria-invalid]:not([aria-invalid=false]):not(.open){box-shadow:0 0 0 1px rgb(var(--color-red-default))}header{isolation:isolate;position:relative;align-items:center;display:flex;justify-content:space-between;gap:0.5rem;padding-left:0.5rem;height:2.5rem}limel-icon{width:1.5rem}.title{font-size:1rem;font-weight:300;color:var(--limel-theme-on-surface-color);justify-self:flex-start;user-select:none;height:auto;max-height:3rem;line-height:1.2rem;display:-webkit-box;overflow:hidden;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:2}.divider-line{transition:opacity 0.3s ease 0.3s;flex-grow:1;height:0.125rem;border-radius:1rem;background-color:var(--header-stroke-color, rgb(var(--contrast-900)));opacity:0;margin-right:0.5rem}section.open .divider-line{opacity:0.16}.actions{justify-self:flex-end;flex-shrink:0}::slotted([slot=header]){margin-right:0.5rem}.body{background-color:var(--body-background-color, var(--contrast-100));padding-left:var(--body-padding, 1.25rem);padding-right:var(--body-padding, 1.25rem);border-radius:0 0 var(--border-radius-of-header) var(--border-radius-of-header)}.body{--limel-cs-opacity-transition-speed:0.1s;--limel-cs-opacity-transition-delay:0s;--limel-cs-grid-template-rows-transition-speed:0.3s;transition:grid-template-rows var(--limel-cs-grid-template-rows-transition-speed) cubic-bezier(1, 0.09, 0, 0.89);display:grid;grid-template-rows:0fr}.body slot{transition:opacity var(--limel-cs-opacity-transition-speed) ease var(--limel-cs-opacity-transition-delay);display:block;overflow:hidden;opacity:0}section.open .body{--limel-cs-opacity-transition-speed:0.4s;--limel-cs-opacity-transition-delay:0.3s;--limel-cs-grid-template-rows-transition-speed:0.46s;grid-template-rows:1fr}section.open .body slot{opacity:1}header:hover+.body,header:has(.open-close-toggle:hover)+.body,header:has(.open-close-toggle:focus-visible)+.body{will-change:grid-template-rows}header:hover+.body slot,header:has(.open-close-toggle:hover)+.body slot,header:has(.open-close-toggle:focus-visible)+.body slot{will-change:opacity}.expand-icon{position:relative;display:flex;align-items:center;justify-content:center;height:1.875rem;margin:0 0 0 0.5rem;width:0.75rem;flex-shrink:0}.line{position:absolute;inset:auto;margin:auto;width:100%;border-radius:1rem;height:0.125rem}.line:first-of-type,.line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s;opacity:0;background-color:var(--header-stroke-color, rgb(var(--contrast-900)))}.line:nth-of-type(2){transform:translate3d(0, 0.25rem, 0) rotate(90deg)}.line:nth-of-type(3){transform:translate3d(0, -0.25rem, 0) rotate(-90deg)}.line:nth-of-type(2),.line:nth-of-type(3){transition:opacity 0.2s ease, transform 0.18s ease}.line:nth-of-type(2):before,.line:nth-of-type(2):after,.line:nth-of-type(3):before,.line:nth-of-type(3):after{content:"";position:absolute;inset:0;margin:auto;width:50%;height:100%;border-radius:inherit;background-color:var(--header-stroke-color, rgb(var(--contrast-900)))}.line:nth-of-type(2):before,.line:nth-of-type(3):before{transform:translate3d(0, -0.1rem, 0) rotate(45deg)}.line:nth-of-type(2):after,.line:nth-of-type(3):after{transform:translate3d(0, 0.1rem, 0) rotate(-45deg)}.open-close-toggle:hover+.expand-icon .line:first-of-type,.open-close-toggle:hover+.expand-icon .line:last-of-type,.open-close-toggle:focus-visible+.expand-icon .line:first-of-type,.open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transition:opacity 0.8s ease 0.4s, transform 0.4s ease 0.3s;opacity:1}.open-close-toggle:hover+.expand-icon .line:first-of-type,.open-close-toggle:focus-visible+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:last-of-type,.open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2),.open-close-toggle:hover+.expand-icon .line:nth-of-type(3),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transition:opacity 0.5s ease 0.4s, transform 0.7s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}.open-close-toggle:hover+.expand-icon .line:nth-of-type(2),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2){transform:translate3d(0, 0.5rem, 0) rotate(90deg);opacity:0.4}.open-close-toggle:hover+.expand-icon .line:nth-of-type(3),.open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transform:translate3d(0, -0.5rem, 0) rotate(-90deg);opacity:0.4}section.open .line:first-of-type,section.open .line:last-of-type{transition:opacity 0.2s ease 0.1s, transform 0.4s ease 0.3s;opacity:1}section.open .line:first-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:last-of-type{transform:rotate3d(0, 0, 1, 0deg)}section.open .line:nth-of-type(2),section.open .line:nth-of-type(3){transition:opacity 1s ease, transform 0.4s ease}section.open .line:nth-of-type(2){transform:translate3d(0, 1rem, 0) rotate(90deg);opacity:0}section.open .line:nth-of-type(3){transform:translate3d(0, -1rem, 0) rotate(-90deg);opacity:0}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type,section.open .open-close-toggle:hover+.expand-icon .line:last-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:first-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transition:opacity 0.2s ease 0.4s, transform 0.4s cubic-bezier(0.85, 0.11, 0.14, 1.35) 0.2s}section.open .open-close-toggle:hover+.expand-icon .line:first-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:first-of-type{transform:rotate3d(0, 0, 1, 45deg)}section.open .open-close-toggle:hover+.expand-icon .line:last-of-type,section.open .open-close-toggle:focus-visible+.expand-icon .line:last-of-type{transform:rotate3d(0, 0, 1, -45deg)}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(2),section.open .open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(2){transform:translate3d(0, 1rem, 0) rotate(90deg);opacity:0}section.open .open-close-toggle:hover+.expand-icon .line:nth-of-type(3),section.open .open-close-toggle:focus-visible+.expand-icon .line:nth-of-type(3){transform:translate3d(0, -1rem, 0) rotate(-90deg);opacity:0}';const g=class{constructor(i){e(this,i);this.open=o(this,"open",7);this.close=o(this,"close",7);this.action=o(this,"action",7);this.bodyId=a();this.headingId=a();this.onClick=()=>{this.handleInteraction()};this.handleInteraction=()=>{this.isOpen=!this.isOpen;if(this.isOpen){this.open.emit();const e=100;setTimeout(n,e)}else{this.close.emit()}};this.renderExpandCollapseSign=()=>t("div",{class:"expand-icon",role:"presentation","aria-hidden":"true"},t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"}),t("div",{class:"line"}));this.renderIcon=()=>{if(!this.icon){return}const e=l(this.icon);const o=c(this.icon);const i=d(this.icon);return t("limel-icon",{name:e,"aria-label":i,"aria-hidden":i?null:"true",style:{color:`${o}`}})};this.renderHeading=()=>{if(!this.header){return}return t("h2",{class:"title mdc-typography mdc-typography--headline2",id:this.headingId},this.header)};this.renderActions=()=>{if(!this.actions){return}return t("div",{class:"actions"},this.actions.map(this.renderActionButton))};this.renderActionButton=e=>t("limel-icon-button",{icon:e.icon,label:e.label,disabled:e.disabled,onClick:this.handleActionClick(e)});this.handleActionClick=e=>o=>{o.stopPropagation();this.action.emit(e)};this.getCollapsibleSectionAriaLabel=()=>{const e=this.header?`"${this.header}"`:" ";if(!this.isOpen){return p.get("collapsible-section.open",this.language,{header:e})}return p.get("collapsible-section.close",this.language,{header:e})};this.isOpen=false;this.header=undefined;this.icon=undefined;this.invalid=false;this.actions=undefined;this.language="en"}componentDidRender(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");s(e)}disconnectedCallback(){const e=this.host.shadowRoot.querySelector(".open-close-toggle");r(e)}render(){return t("section",{class:`${this.isOpen?"open":""}`,"aria-invalid":this.invalid,"aria-labelledby":this.header?this.headingId:null},t("header",null,t("button",{class:"open-close-toggle",onClick:this.onClick,"aria-controls":this.bodyId,"aria-expanded":this.isOpen?"true":"false","aria-label":this.getCollapsibleSectionAriaLabel(),type:"button"}),this.renderExpandCollapseSign(),this.renderIcon(),this.renderHeading(),t("div",{class:"divider-line",role:"presentation"}),this.renderHeaderSlot(),this.renderActions()),t("div",{class:"body","aria-hidden":String(!this.isOpen),id:this.bodyId,role:"region"},t("slot",null)))}renderHeaderSlot(){return t("slot",{name:"header"})}get host(){return i(this)}};g.style=h;export{g as limel_collapsible_section};
|
|
2
|
+
//# sourceMappingURL=p-ed8aa16c.entry.js.map
|