TYPO3 v15 dev-main snapshot ()
This commit is contained in:
commit
f9941541b7
1178 files changed
+135377
No files matched your search
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{property as r,customElement as b}from"lit/decorators.js";import{LitElement as v,html as p,nothing as h}from"lit";import{classMap as y}from"lit/directives/class-map.js";import{SeverityEnum as n}from"@typo3/backend/enum/severity.js";import g from"@typo3/backend/severity.js";import"@typo3/backend/element/icon-element.js";import u from"~labels/core.mod_web_list";var s=function(a,t,o,l){var c=arguments.length,i=c<3?t:l===null?l=Object.getOwnPropertyDescriptor(t,o):l,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(a,t,o,l);else for(var m=a.length-1;m>=0;m--)(d=a[m])&&(i=(c<3?d(i):c>3?d(t,o,i):d(t,o))||i);return c>3&&i&&Object.defineProperty(t,o,i),i},f;let e=f=class extends v{constructor(){super(...arguments),this.severity=n.info,this.dismissible=!1,this.visible=!0,this.heading=null,this.message=null,this.showIcon=!1,this.randomSuffix=Math.random().toString(36).substring(7)}static getIconIdentifier(t){return{[n.notice]:"actions-lightbulb",[n.ok]:"actions-check",[n.warning]:"actions-exclamation",[n.error]:"actions-close",[n.info]:"actions-info"}[t]||"actions-info"}createRenderRoot(){return this}render(){return p`<div id=alert-${this.randomSuffix} class=${y(this.getClasses())} role=alert aria-labelledby=alert-title-${this.randomSuffix} aria-describedby=alert-message-${this.randomSuffix} @closed.bs.alert=${this.remove}><div class=alert-inner>${this.showIcon?p`<div class=alert-icon><span class=icon-emphasized> <typo3-backend-icon identifier=${f.getIconIdentifier(this.severity)} size=small></typo3-backend-icon> </span></div>`:h}<div class=alert-content>${this.heading?p`<h4 class=alert-title id=alert-title-${this.randomSuffix}>${this.heading}</h4>`:h}<p class=alert-body id=alert-message-${this.randomSuffix}>${this.message}</p></div></div>${this.dismissible?this.renderDismissButton():h}</div>`}getClasses(){return{alert:!0,["alert-"+g.getCssClass(this.severity)]:!0,"alert-dismissible":this.dismissible,fade:!0,show:this.visible,hidden:!this.visible}}renderDismissButton(){return p`<button type=button class=close data-bs-dismiss=alert aria-label=${u.get("button.close")}><span aria-hidden=true><typo3-backend-icon identifier=actions-close size=small></typo3-backend-icon></span> <span class=visually-hidden>${u.get("button.close")}</span></button>`}};s([r({type:Number})],e.prototype,"severity",void 0),s([r({type:Boolean})],e.prototype,"dismissible",void 0),s([r({type:Boolean})],e.prototype,"visible",void 0),s([r({type:String})],e.prototype,"heading",void 0),s([r({type:String})],e.prototype,"message",void 0),s([r({type:Boolean,attribute:"show-icon"})],e.prototype,"showIcon",void 0),e=f=s([b("typo3-backend-alert")],e);export{e as AlertElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as v,html as n,nothing as l,render as m}from"lit";import{property as b,customElement as C}from"lit/decorators.js";import{classMap as f}from"lit/directives/class-map.js";import"@typo3/backend/element/icon-element.js";import"@typo3/backend/dropdown.js";var p=function(d,e,t,i){var s=arguments.length,r=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(d,e,t,i);else for(var c=d.length-1;c>=0;c--)(o=d[c])&&(r=(s<3?o(r):s>3?o(e,t,r):o(e,t))||r);return s>3&&r&&Object.defineProperty(e,t,r),r},a;(function(d){d.FULL="full",d.PATH="path"})(a||(a={}));let u=class extends v{constructor(){super(...arguments),this.nodes=[],this.alignRight=!1,this.label="Breadcrumb",this.mode=a.FULL,this.collapsedNodes=[],this.adjustRafId=null,this.dropdownButtonWidth=null,this.ellipsisWidth=null,this.measurementContainer=null}connectedCallback(){super.connectedCallback(),this.identifier=Date.now().toString(36)+Math.random().toString(36).slice(2),this.resizeObserver=new ResizeObserver(()=>this.scheduleAdjust()),this.resizeObserver.observe(this),this.intersectionObserver=new IntersectionObserver(e=>{e.some(t=>t.isIntersecting)&&this.scheduleAdjust()}),this.intersectionObserver.observe(this)}disconnectedCallback(){this.resizeObserver.disconnect(),this.intersectionObserver.disconnect(),this.adjustRafId!==null&&(cancelAnimationFrame(this.adjustRafId),this.adjustRafId=null),super.disconnectedCallback()}createRenderRoot(){return this}willUpdate(e){e.has("nodes")&&(this.createMeasurementContainer(),this.measureEllipsis(),this.measureDropdownToggle(),this.measureNodeWidths())}render(){const e=this.nodes.filter(s=>!this.collapsedNodes.includes(s)),t=f({breadcrumb:!0,"breadcrumb-collapsible":!0,"breadcrumb-right":this.alignRight,"breadcrumb-condensed":this.mode===a.PATH}),i=n`${this.renderCollapsedNodesIndicator()} ${e.map(s=>{const r=f({"breadcrumb-item":!0,"breadcrumb-item-first":this.isFirstNode(s),"breadcrumb-item-last":this.isLastNode(s)});return n`<div class=${r} role=presentation>${this.renderBreadcrumbElement(s)}</div>`})}`;return this.mode===a.FULL?n`<nav class=${t} aria-label=${this.label}>${i}</nav>`:n`<span class=visually-hidden> ${this.label?`${this.label}: `:l}${this.nodes.map(s=>s.label).join(" / ")} </span><div class=${t} aria-hidden=true>${i}</div>`}scheduleAdjust(){this.adjustRafId===null&&(this.adjustRafId=requestAnimationFrame(()=>{this.adjustRafId=null,this.adjustBreadcrumb()}))}createMeasurementContainer(){this.measurementContainer===null&&(this.measurementContainer=document.createElement("div"),this.measurementContainer.classList.add("breadcrumb-measurement"),this.measurementContainer.ariaHidden="true",this.measurementContainer.style.position="absolute",this.measurementContainer.style.visibility="hidden",this.measurementContainer.style.pointerEvents="none",this.measurementContainer.style.width="auto",this.measurementContainer.style.whiteSpace="nowrap",this.renderRoot.appendChild(this.measurementContainer)),this.measurementContainer.classList.toggle("breadcrumb-condensed",this.mode===a.PATH)}measureDropdownToggle(){if(this.dropdownButtonWidth===null){const e=n`<div class="breadcrumb-item dropdown">${this.renderDropdownToggle()}</div>`;m(e,this.measurementContainer);const t=this.measurementContainer.querySelector("div");this.dropdownButtonWidth=t?.offsetWidth??0,m(l,this.measurementContainer)}}measureEllipsis(){if(this.ellipsisWidth===null){m(this.renderEllipsis(),this.measurementContainer);const e=this.measurementContainer.querySelector("div");this.ellipsisWidth=e?.offsetWidth??0,m(l,this.measurementContainer)}}measureNodeWidths(){const e=this.nodes,t=this.nodes.map(s=>{if(s.__width)return s;const r=n`<div class=${f({"breadcrumb-item":!0,"breadcrumb-item-first":this.isFirstNode(s),"breadcrumb-item-last":this.isLastNode(s)})} role=presentation>${this.renderBreadcrumbElement(s)}</div>`;m(r,this.measurementContainer);const c=this.measurementContainer.querySelector("div")?.offsetWidth??0;return m(l,this.measurementContainer),{...s,__width:c}});!this.areNodeCollectionsEqual(e,t)&&(this.nodes=t)}adjustBreadcrumb(){const e=this.renderRoot?.querySelector(".breadcrumb");if(!e)return;this.ellipsisWidth||(this.ellipsisWidth=null,this.measureEllipsis()),this.dropdownButtonWidth||(this.dropdownButtonWidth=null,this.measureDropdownToggle()),this.nodes.some(h=>!h.__width)&&this.measureNodeWidths();const t=this.mode===a.PATH?this.ellipsisWidth:this.dropdownButtonWidth;let s=this.nodes[this.nodes.length-1]?.__width||0,r=!1;const o=[];for(const h of this.nodes.slice(0,-1).reverse())!r&&e.clientWidth>s+t+h.__width?s+=h.__width:(r=!0,o.push(h));o.reverse(),(o.length!==this.collapsedNodes.length||o.some((h,g)=>h!==this.collapsedNodes[g]))&&(this.collapsedNodes=o,this.requestUpdate())}renderCollapsedNodesIndicator(){return this.collapsedNodes.length===0?l:this.mode===a.PATH?this.renderEllipsis():this.renderCollapsedNodesDropdown()}renderElliLine truncated
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as y,css as v,html as r}from"lit";import{property as g,state as b,customElement as C}from"lit/decorators.js";import"@typo3/backend/element/icon-element.js";var o=function(u,t,e,i){var s=arguments.length,n=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(u,t,e,i);else for(var h=u.length-1;h>=0;h--)(l=u[h])&&(n=(s<3?l(n):s>3?l(t,e,n):l(t,e))||n);return s>3&&n&&Object.defineProperty(t,e,n),n};const d={INPUT:"input",NAVIGATION:"navigation"},f={NONE:"none",CURRENT:"current"};let E=0,a=class extends y{constructor(){super(...arguments),this.value="",this.icon="",this.disabled=!1,this.isSelected=!1}static{this.styles=v`*,:after,:before{box-sizing:border-box}:host{display:flex;align-items:center;width:100%;user-select:none}`}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false"),!this.value&&this.textContent&&(this.value=this.textContent.trim()),this.updateAriaLabel()}setSelected(t){this.isSelected=t}updated(t){t.has("value")&&this.updateAriaLabel()}render(){const t=this.getLabel(),e=this.value&&this.value!==t;return r`<span class=indicator part=indicator> <typo3-backend-icon identifier=${this.isSelected?"actions-check":"miscellaneous-placeholder"} size=small aria-hidden=true></typo3-backend-icon> </span> ${this.icon?r`<typo3-backend-icon identifier=${this.icon} size=small part=icon></typo3-backend-icon>`:""} <span class=content part=content>${t} ${e?r`<span class=value part=value>(${this.value})</span>`:""} </span>`}getLabel(){return this.textContent?.trim()||this.value}updateAriaLabel(){const t=this.getLabel(),e=this.value&&this.value!==t?` (${this.value})`:"";this.setAttribute("aria-label",`${t}${e}`)}};o([g({type:String})],a.prototype,"value",void 0),o([g({type:String})],a.prototype,"icon",void 0),o([g({type:Boolean})],a.prototype,"disabled",void 0),o([b()],a.prototype,"isSelected",void 0),a=o([C("typo3-backend-combobox-choice")],a);let c=class extends y{static{this.styles=v`*,:after,:before{box-sizing:border-box}:host{position:relative;display:block;width:100%}.controls{position:absolute;top:50%;inset-inline-end:0;transform:translateY(-50%);gap:.25rem;padding-inline-end:var(--typo3-form-combobox-padding-x,.75rem)}.clear-button,.controls{display:flex;align-items:center}.clear-button{justify-content:center;cursor:pointer;color:inherit;opacity:.3;transition:opacity .2s ease}.clear-button:hover{opacity:.5}.separator{width:1px;height:1.25rem;background-color:var(--typo3-input-border-color,currentColor)}.indicator{display:flex;align-items:center;justify-content:center}.listbox{position:absolute;top:100%;left:0;width:100%;z-index:1000}`}constructor(){super(),this.isOpen=!1,this.inputHasValue=!1,this.highlightedIndex=-1,this.inputIsDisabledOrReadonly=!1,this.choiceIdCounter=0,this.delayedCloseTimeout=null,this.internalId=null,this.lastAction=null,this.lastHighlightedIndex=null,this.userSelectionIntent=null,this.handleChoiceMouseEnter=t=>{const e=t.currentTarget,s=this.getChoiceElements().indexOf(e);s>=0&&this.setHighlightedIndex(s)},this.handleInputInit=()=>{this.updateInputHasValue(),this.updateSelectedState()},this.handleInputInput=()=>{this.lastAction=d.INPUT,this.highlightedIndex!==-1&&(this.lastHighlightedIndex=this.highlightedIndex,this.setHighlightedIndex(-1)),this.updateInputHasValue(),this.updateSelectedState()},this.handleInputPointerdown=t=>{t.button===0&&this.setOpen()},this.handleInputBlur=t=>{this.contains(t.relatedTarget)?this.getInput()?.focus():this.dispatchClose()},this.handleInputKeydown=t=>{const e=this.getInput();if(e?.disabled||e?.readOnly)return;const s=this.getChoiceElements().length;switch(t.key){case"ArrowDown":t.preventDefault(),t.stopPropagation(),t.altKey&&!this.isOpen?this.userSelectionIntent=f.NONE:(this.lastAction=d.NAVIGATION,this.setHighlightedIndex(this.getNextHighlightIndex(1,s))),this.setOpen();break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),t.altKey&&!this.isOpen?this.userSelectionIntent=f.NONE:(this.lastAction=d.NAVIGATION,this.setHighlightedIndex(this.getNextHighlightIndex(-1,s))),this.setOpen();break;case"Enter":this.isOpen&&(this.highlightedIndex>=0&&this.lastAction===d.NAVIGATION&&(t.preventDefault(),this.selectChoiceOption(this.highlightedIndex)),this.immediateClose());break;case"Tab":this.isOpen&&(this.highlightedIndex>=0&&this.lastAction===d.NAVIGATION&&this.selectChoiceOption(this.highlightedIndex),this.immediateClose(),t.shiftKey||t.preventDefault());break;case"Escape":if(this.lastAction=d.NAVIGATION,this.isOpen)this.isOpen=!1,t.preventDefault(),t.stopPropagation();else{const n=this.getInput();n&&n.value&&!n.readOnly&&!n.disabled&&(this.clearInput(),this.isOpen=!1,t.preventDefault(),t.stopPropagation())}break;default:break}},this.handleClearClick=t=>{t.stopPropagation(),this.clearInput(),this.getInput()?.focus()},this.handleIndicatorClick=t=>{t.stopPropagation(),this.isOpen?this.immeLine truncated
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{property as l,customElement as m}from"lit/decorators.js";import{PseudoButtonLitElement as u}from"@typo3/backend/element/pseudo-button.js";import g,{Positions as y,Sizes as h,Types as v}from"@typo3/backend/modal.js";import E from"@typo3/backend/notification.js";import p from"@typo3/backend/storage/persistent.js";import f from"~labels/backend.alt_doc";var c=function(s,e,i,n){var r=arguments.length,t=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,i):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(s,e,i,n);else for(var o=s.length-1;o>=0;o--)(a=s[o])&&(t=(r<3?a(t):r>3?a(e,i,t):a(e,i))||t);return r>3&&t&&Object.defineProperty(e,i,t),t};let d=class extends u{async buttonActivated(){if(p.isset("contextualRecordEdit")&&p.get("contextualRecordEdit")==0){top?.TYPO3?.Backend?.ContentContainer&&top.TYPO3.Backend.ContentContainer.setUrl(this.editUrl);return}const e=g.advanced({type:v.iframe,title:"",content:this.url,size:h.expand,position:y.sheet,hideHeader:!0});this.setupMessageHandling(e)}setupMessageHandling(e){const i=top;let n="",r=!1,t=!1;const a=o=>{o.origin===window.location.origin&&(o.data?.actionName==="typo3:editform:saved"&&(r=!0,n=o.data.recordTitle??""),o.data?.actionName==="typo3:editform:closed"&&(t=!0,e.hideModal()),o.data?.actionName==="typo3:editform:navigate"&&(t=!0,e.hideModal()))};i.addEventListener("message",a),e.addEventListener("typo3-modal-hide",o=>{if(t)return;o.preventDefault(),e.querySelector("iframe")?.contentWindow?.postMessage({actionName:"typo3:editform:requestclose"},window.location.origin)}),e.addEventListener("typo3-modal-hidden",()=>{i.removeEventListener("message",a),r?(top.document.dispatchEvent(new CustomEvent("typo3:pagetree:refresh")),top.TYPO3?.Backend?.ContentContainer&&top.TYPO3.Backend.ContentContainer.refresh(),E.success(f.get("notification.record_updated.title"),n!==""?f.get("notification.record_updated.message",[n]):void 0)):this.focus()})}};c([l({type:String})],d.prototype,"url",void 0),c([l({type:String,attribute:"edit-url"})],d.prototype,"editUrl",void 0),d=c([m("typo3-backend-contextual-record-edit-trigger")],d);export{d as ContextualRecordEditTriggerElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as h,html as p,nothing as f}from"lit";import{property as c,state as T,customElement as D}from"lit/decorators.js";import{DateTime as u}from"luxon";var m=function(n,t,e,i){var o=arguments.length,a=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(n,t,e,i);else for(var l=n.length-1;l>=0;l--)(r=n[l])&&(a=(o<3?r(a):o>3?r(t,e,a):r(t,e))||a);return o>3&&a&&Object.defineProperty(t,e,a),a},d;(function(n){n.Relative="relative",n.Absolute="absolute"})(d||(d={}));let s=class extends h{constructor(){super(...arguments),this.datetime="",this.mode=d.Absolute,this.format="date",this.thresholdDays=0,this.relativeShowSeconds=!1,this.displayTime="",this.updateTimeoutId=null}disconnectedCallback(){super.disconnectedCallback(),this.clearUpdateTimeout()}willUpdate(t){(t.has("datetime")||t.has("mode")||t.has("format")||t.has("relativeShowSeconds"))&&(this.updateDisplayTime(),this.clearUpdateTimeout(),this.startUpdateTimeout())}createRenderRoot(){return this}render(){const t=this.parseDateTime(this.datetime),e=t?.toISO()||this.datetime,i=t&&this.mode===d.Relative?this.formatAbsoluteDateTime(this.getLocalizedDateTime(t)):"",o=i?`${this.displayTime||this.datetime}. ${i}`:null;return p`<time datetime=${e} title=${i||f} aria-label=${o||f}>${this.displayTime||this.datetime}</time>`}clearUpdateTimeout(){this.updateTimeoutId!==null&&(window.clearTimeout(this.updateTimeoutId),this.updateTimeoutId=null)}startUpdateTimeout(){if(this.mode===d.Relative){const t=this.parseDateTime(this.datetime),e=t?this.calculateNextStateChange(t):null,i=e?Math.abs(e.diffNow("milliseconds").milliseconds):1e3;this.updateTimeoutId=window.setTimeout(()=>{this.updateTimeoutId=null,this.updateDisplayTime(),this.startUpdateTimeout()},i)}}calculateNextStateChange(t){const e=["years","months","days","hours","minutes","seconds"],i=t.diffNow(e);for(const o of e){const a=i.get(o);if(a!==0){const r=a<0?-1:1;return t.minus({[o]:a+r})}}return t.plus({seconds:1})}updateDisplayTime(){const t=this.parseDateTime(this.datetime);t?this.displayTime=this.mode===d.Absolute?this.formatAbsoluteTime(t):this.formatRelativeTime(t):this.displayTime=this.datetime}formatAbsoluteTime(t){const e=this.getLocalizedDateTime(t),i=this.getConfiguredDateFormats();return this.format==="date"&&i?e.toFormat(i.formats.date):this.format==="datetime"&&i?e.toFormat(i.formats.datetime):this.format?e.toFormat(this.format):i?e.toFormat(i.formats.date):e.toLocaleString(u.DATE_SHORT)}parseDateTime(t){if(!t)return null;const i=this.getConfiguredDateFormats()?.timezone,o=Number(t);if(!isNaN(o)&&o>0){const r=i?{zone:i}:{},l=u.fromSeconds(o,r);if(l.isValid)return l}const a=u.fromISO(t);return a.isValid?a:null}getLocalizedDateTime(t){let e=document.documentElement.lang||"en";e==="ch"&&(e="zh");const o=this.getConfiguredDateFormats()?.timezone;let a=t.setLocale(e);return o&&(a=a.setZone(o)),a}formatRelativeTime(t){const e=this.getLocalizedDateTime(t);if(this.thresholdDays>0&&Math.abs(u.now().diff(e,"days").days)>this.thresholdDays)return this.formatAbsoluteDate(e);if(!this.relativeShowSeconds){const o=e.diffNow("seconds").seconds;if(Math.abs(o)<60)return e.toRelative({unit:"minutes",rounding:"expand"})||this.formatAbsoluteDateTime(e)}return e.toRelative()||this.formatAbsoluteDateTime(e)}formatAbsoluteDate(t){const e=this.getLocalizedDateTime(t),i=this.getConfiguredDateFormats();return i?e.toFormat(i.formats.date):e.toLocaleString(u.DATE_SHORT)}formatAbsoluteDateTime(t){const e=this.getLocalizedDateTime(t),i=this.getConfiguredDateFormats();return i?e.toFormat(i.formats.datetime):e.toLocaleString(u.DATETIME_SHORT)}getConfiguredDateFormats(){try{return(typeof opener?.top?.TYPO3<"u"?opener.top:top).TYPO3.settings.DateConfiguration}catch{return null}}};m([c({type:String})],s.prototype,"datetime",void 0),m([c()],s.prototype,"mode",void 0),m([c()],s.prototype,"format",void 0),m([c({type:Number,attribute:"threshold-days"})],s.prototype,"thresholdDays",void 0),m([c({type:Boolean,attribute:"relative-show-seconds"})],s.prototype,"relativeShowSeconds",void 0),m([T()],s.prototype,"displayTime",void 0),s=m([D("typo3-backend-datetime")],s);export{d as DateTimeDisplayMode,s as DateTimeElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{property as s,customElement as m}from"lit/decorators.js";import{PseudoButtonLitElement as a}from"@typo3/backend/element/pseudo-button.js";import u from"@typo3/backend/modal.js";import{SeverityEnum as d}from"@typo3/backend/enum/severity.js";var f=function(i,e,o,n){var p=arguments.length,t=p<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(i,e,o,n);else for(var c=i.length-1;c>=0;c--)(l=i[c])&&(t=(p<3?l(t):p>3?l(e,o,t):l(e,o))||t);return p>3&&t&&Object.defineProperty(e,o,t),t};let r=class extends a{buttonActivated(){this.url&&u.advanced({content:this.url,title:this.subject,severity:d.notice,size:u.sizes.large,type:u.types.iframe})}};f([s({type:String})],r.prototype,"url",void 0),f([s({type:String})],r.prototype,"subject",void 0),r=f([m("typo3-backend-dispatch-modal-button")],r);export{r as DispatchModalButton};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as u,html as f}from"lit";import{property as c,state as p,customElement as z}from"lit/decorators.js";import{Offset as v}from"@typo3/backend/offset.js";var l=function(n,e,t,r){var o=arguments.length,i=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(n,e,t,r);else for(var d=n.length-1;d>=0;d--)(a=n[d])&&(i=(o<3?a(i):o>3?a(e,t,i):a(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},s;(function(n){n.move="move",n.resizeN="resizeN",n.resizeE="resizeE",n.resizeS="resizeS",n.resizeW="resizeW",n.resizeSE="resizeSE",n.resizeSW="resizeSW",n.resizeNE="resizeNE",n.resizeNW="resizeNW"})(s||(s={}));const g=[s.resizeNW,s.resizeN,s.resizeNE],m=[s.resizeNE,s.resizeE,s.resizeSE],b=[s.resizeSE,s.resizeS,s.resizeSW],E=[s.resizeSW,s.resizeW,s.resizeNW];let h=class extends u{constructor(){super(...arguments),this.reverting=!1,this.action=null,this.originOffset=null,this.originPosition=null,this.handleStart=e=>{const t=e.target;if(!(e.buttons!==1||!this.contains(t))){if(t.dataset.resize){const r="resize"+t.dataset.resize.toUpperCase();this.action=s[r]}else this.action=s.move;this.reverting=!1,this.originOffset=this.offset.clone(),this.originPosition={x:e.clientX,y:e.clientY},this.dispatchEvent(this.createEvent("draggable-resizable-started",{action:this.action,originOffset:this.originOffset}))}},this.handleUpdate=e=>{if(!this.action)return;const t={x:e.clientX-this.originPosition.x,y:e.clientY-this.originPosition.y};this.offset=this.adjustOffset(this.originOffset,t),this.dispatchEvent(this.createEvent("draggable-resizable-updated",{action:this.action,originOffset:this.originOffset}))},this.handleFinish=()=>{this.action&&(this.dispatchEvent(this.createEvent("draggable-resizable-finished",{action:this.action,originOffset:this.originOffset})),this.action=null,this.originOffset=null,this.originPosition=null)}}revert(e){this.reverting=!0,this.offset=e,setTimeout(()=>this.reverting=!1,500)}connectedCallback(){super.connectedCallback(),this.pointerEventNames.pointerDown.forEach(e=>document.addEventListener(e,this.handleStart,!0)),this.pointerEventNames.pointerMove.forEach(e=>document.addEventListener(e,this.handleUpdate,!0)),this.pointerEventNames.pointerUp.forEach(e=>document.addEventListener(e,this.handleFinish,!0))}disconnectedCallback(){super.disconnectedCallback(),this.pointerEventNames.pointerDown.forEach(e=>document.removeEventListener(e,this.handleStart,!0)),this.pointerEventNames.pointerMove.forEach(e=>document.removeEventListener(e,this.handleUpdate,!0)),this.pointerEventNames.pointerUp.forEach(e=>document.removeEventListener(e,this.handleFinish,!0))}render(){return f`<div class="cropper-focus-area ui-draggable ui-draggable-handle ui-resizable"><div class="ui-resizable-handle ui-resizable-n" data-resize=n></div><div class="ui-resizable-handle ui-resizable-e" data-resize=e></div><div class="ui-resizable-handle ui-resizable-s" data-resize=s></div><div class="ui-resizable-handle ui-resizable-w" data-resize=w></div><div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" data-resize=se></div><div class="ui-resizable-handle ui-resizable-sw" data-resize=sw></div><div class="ui-resizable-handle ui-resizable-ne" data-resize=ne></div><div class="ui-resizable-handle ui-resizable-nw" data-resize=nw></div></div>`}update(e){super.update(e),Object.assign(this.style,this.getOffsetStyles(this.offset))}createRenderRoot(){return this}adjustOffset(e,t){const o=this.parentElement.getBoundingClientRect(),i=e.clone();if(this.action===s.move&&(i.left=this.minMax(i.left+t.x,0,o.width-i.width),i.top=this.minMax(i.top+t.y,0,o.height-i.height)),g.includes(this.action)){const a=this.minMax(t.y,-i.top,i.height-2);i.top+=a,i.height-=a}else b.includes(this.action)&&(i.height=this.minMax(i.height+t.y,2,o.height-i.top));if(E.includes(this.action)){const a=this.minMax(t.x,-i.left,i.width-2);i.left+=a,i.width-=a}else m.includes(this.action)&&(i.width+=t.x);return i}minMax(e,t,r){return e<t?t:e>r?r:e}createEvent(e,t){return new CustomEvent(e,{detail:t,bubbles:!0,composed:!0})}getOffsetStyles(e){return{left:`${e.left}px`,top:`${e.top}px`,width:`${e.width}px`,height:`${e.height}px`}}};l([c({type:Object,converter:n=>v.fromObject(JSON.parse(n)),reflect:!0})],h.prototype,"offset",void 0),l([c({type:Object})],h.prototype,"pointerEventNames",void 0),l([c({type:Boolean,reflect:!0})],h.prototype,"reverting",void 0),l([p()],h.prototype,"action",void 0),h=l([z("typo3-backend-draggable-resizable")],h);export{h as DraggableResizableElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as f,css as m,nothing as c,html as d}from"lit";import{property as p,state as u,customElement as v}from"lit/decorators.js";import"@typo3/backend/element/icon-element.js";import y from"@typo3/backend/ajax-data-handler.js";import h from"~labels/core.common";import g from"~labels/backend.layout";var r=function(l,t,n,s){var o=arguments.length,e=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(l,t,n,s);else for(var b=l.length-1;b>=0;b--)(a=l[b])&&(e=(o<3?a(e):o>3?a(t,n,e):a(t,n))||e);return o>3&&e&&Object.defineProperty(t,n,e),e};let i=class extends f{constructor(){super(...arguments),this.pageTitle="",this.pageId=0,this.localizedPageId=0,this.editable=!1,this._isEditing=!1,this._isSubmitting=!1,this.labels={input:g.get("editPageTitle.input.field.label"),edit:g.get("editPageTitle"),save:h.get("save"),cancel:h.get("cancel")}}static{this.styles=m`:host{display:block;--input-border-color:#bebebe;--input-hover-border-color:#bebebe;--input-focus-border-color:#bebebe;--button-border-radius:var(--typo3-input-border-radius);--button-color:inherit;--button-bg:transparent;--button-border-color:transparent;--button-hover-color:inherit;--button-hover-bg:#cacaca;--button-hover-border-color:#bebebe;--button-focus-color:inherit;--button-focus-bg:#cacaca;--button-focus-border-color:#bebebe;--button-padding-x:var(--typo3-input-padding-x);--button-padding-y:var(--typo3-input-padding-y)}h1{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;padding:1px 0}h1,input{font-weight:inherit;font-size:inherit;font-family:inherit;line-height:inherit;margin:0}input{outline:none;background:transparent;padding:0;border:0;border-top:1px solid transparent;border-bottom:1px dashed var(--input-border-color);width:100%;outline-offset:0}input:hover{--input-border-color:var(--input-hover-border-color)}input:focus{--input-border-color:var(--input-focus-border-color)}input:focus-visible{outline:.25rem solid color-mix(in srgb,var(--input-border-color),transparent 25%)}.wrapper{position:relative;margin:-1px 0;padding-inline-end:1.5em}.wrapper:has(>form) .page-title{visibility:hidden;pointer-events:none}.wrapper>form{left:0;right:0;padding-inline-end:2.5em}.wrapper>form,button{position:absolute;top:0}button{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-size:inherit;line-height:inherit;padding:var(--button-padding-y) var(--button-padding-x);height:100%;width:1em;border-radius:var(--button-border-radius);overflow:hidden;outline:none;color:var(--button-color);background:var(--button-bg);border:1px solid var(--button-border-color);opacity:.8;outline-offset:0;transition:all .2s ease-in-out}button:hover{opacity:1;--button-color:var(--button-hover-color);--button-bg:var(--button-hover-bg);--button-border-color:var(--button-hover-border-color)}button:focus{opacity:1;--button-color:var(--button-focus-color);--button-bg:var(--button-focus-bg);--button-border-color:var(--button-focus-border-color)}button:focus-visible{outline:.25rem solid color-mix(in srgb,var(--button-border-color),transparent 25%)}button[data-action=edit]{inset-inline-end:0}button[data-action=save]{inset-inline-end:calc(1em + 2px)}button[data-action=close]{inset-inline-end:0}.screen-reader{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}`}async startEditing(){if(this.isEditable()){this._isEditing=!0,await this.updateComplete;const t=this.shadowRoot.querySelector("input");t?.focus(),t?.setSelectionRange(t.value.length,t.value.length)}}render(){return this.pageTitle===""?c:this.isEditable()?d`<div class=wrapper><div class=page-title><h1 @dblclick=${()=>{this.startEditing()}}>${this.pageTitle}</h1>${this.composeEditButton()}</div>${this._isEditing?this.composeEditForm():c}</div>`:d`<div class=wrapper><h1>${this.pageTitle}</h1></div>`}isEditable(){return this.editable&&this.pageId>0}async endEditing(){this.isEditable()&&(this._isEditing=!1,await new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(()=>t()))),this.shadowRoot.querySelector('button[data-action="edit"]')?.focus())}updatePageTitle(t){t.preventDefault();const n=new FormData(t.target),o=Object.fromEntries(n).newPageTitle.toString();if(this.pageTitle===o){this.endEditing();return}this._isSubmitting=!0;let e=this.pageId;this.localizedPageId>0&&(e=this.localizedPageId);const a={data:{pages:{[e]:{title:o}}}};y.process(a).then(()=>{this.pageTitle=o,top.document.dispatchEvent(new CustomEvent("typo3:pagetree:refresh"))}).finally(()=>{this.endEditing(),this._isSubmitting=!1})}composeEditButton(){return d`<button data-action=edit type=button title=${this.labels.edit} @click=${()=>{this.startEditing()}}><typo3-backend-icon identifier=actions-open size=small></typo3-backend-icon><span class=screen-reader>${this.labels.edit}</span></button>`}composeEditForm(){return d`<form @submit=${this.updatePageTitle}Line truncated
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as d,html as c,nothing as m}from"lit";import{Task as u}from"@lit/task";import{property as a,customElement as y}from"lit/decorators.js";import{unsafeHTML as h}from"lit/directives/unsafe-html.js";import{Sizes as v,States as g,MarkupIdentifiers as z}from"@typo3/backend/enum/icon-types.js";import w,{IconStyles as S}from"@typo3/backend/icons.js";import"@typo3/backend/element/spinner-element.js";var n=function(l,t,r,o){var s=arguments.length,e=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(l,t,r,o);else for(var f=l.length-1;f>=0;f--)(p=l[f])&&(e=(s<3?p(e):s>3?p(t,r,e):p(t,r))||e);return s>3&&e&&Object.defineProperty(t,r,e),e};let i=class extends d{constructor(){super(...arguments),this.size=v.default,this.state=g.default,this.overlay=null,this.markup=z.inline,this.raw=null,this.iconTask=new u(this,{task:async([t,r,o,s,e],{signal:p})=>await w.getIcon(t,r,o,s,e,p),args:()=>[this.identifier,this.size,this.overlay,this.state,this.markup]})}static{this.styles=S.getStyles()}render(){return this.raw?c`${h(this.raw)}`:this.identifier?this.iconTask.render({pending:()=>c`<typo3-backend-spinner size=${this.size}></typo3-backend-spinner>`,complete:t=>c`${h(t)}`,error:()=>c`<span class="t3js-icon icon icon-size-${this.size} icon-state-${this.state} icon-default-not-found" data-identifier=default-not-found aria-hidden=true> <span class=icon-markup><svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><g><path fill="#CD201F" d="m11 12 3-2v6H2v-6l3 2 3-2z"/><path fill="#212121" d="m8 10.3 2.86 1.91.14.09.14-.09 2.61-1.74v5.28H2.25v-5.28l2.61 1.74.14.09.14-.09zm6-.3-3 2-3-2-3 2-3-2v6h12z" opacity=".2"/><path fill="#CD201F" d="M14 4v4l-3 2-3-2-3 2-3-2V0h8z"/><path fill="#212121" d="M13.75 7.87 11 9.7 8.14 7.79 8 7.7l-.14.09L5 9.7 2.25 7.87V.25H10V0H2v8l3 2 3-2 3 2 3-2V4h-.25z" opacity=".2"/><path fill="#FFF" d="M14 4h-4V0z" opacity=".3"/><path fill="#212121" d="m14 8-4-4h4z" opacity=".3"/></g></svg> </span> </span>`}):m}};n([a({type:String,reflect:!0})],i.prototype,"identifier",void 0),n([a({type:String,reflect:!0})],i.prototype,"size",void 0),n([a({type:String})],i.prototype,"state",void 0),n([a({type:String})],i.prototype,"overlay",void 0),n([a({type:String})],i.prototype,"markup",void 0),n([a({type:String})],i.prototype,"raw",void 0),i=n([y("typo3-backend-icon")],i);export{i as IconElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import n from"@typo3/backend/utility.js";import{EventDispatcher as i}from"@typo3/backend/event/event-dispatcher.js";class r extends HTMLElement{constructor(){super(...arguments),this.args=[]}static get observedAttributes(){return["action","args","args-list"]}static async getDelegate(t){switch(t){case"TYPO3.ModuleMenu.App.refreshMenu":const{default:s}=await import("@typo3/backend/module-menu.js");return s.App.refreshMenu.bind(s.App);case"TYPO3.Backend.Topbar.refresh":const{default:e}=await import("@typo3/backend/viewport.js");return e.Topbar.refresh.bind(e.Topbar);case"TYPO3.WindowManager.localOpen":const{default:a}=await import("@typo3/backend/window-manager.js");return a.localOpen.bind(a);case"TYPO3.Backend.Storage.ModuleStateStorage.update":return(await import("@typo3/backend/storage/module-state-storage.js")).ModuleStateStorage.update;case"TYPO3.Backend.Storage.ModuleStateStorage.updateWithCurrentMount":return(await import("@typo3/backend/storage/module-state-storage.js")).ModuleStateStorage.updateWithCurrentMount;case"TYPO3.Backend.Event.EventDispatcher.dispatchCustomEvent":return i.dispatchCustomEvent;default:throw Error('Unknown action "'+t+'"')}}attributeChangedCallback(t,s,e){if(t==="action")this.action=e;else if(t==="args"){const a=e.replace(/"/g,'"'),o=JSON.parse(a);this.args=o instanceof Array?n.trimItems(o):[]}else if(t==="args-list"){const a=e.split(",");this.args=n.trimItems(a)}}connectedCallback(){if(!this.action)throw new Error("Missing mandatory action attribute");r.getDelegate(this.action).then(t=>t(...this.args))}}window.customElements.define("typo3-immediate-action",r);export{r as ImmediateActionElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as u,html as d,nothing as m}from"lit";import{property as f,state as s,customElement as p}from"lit/decorators.js";var r=function(o,e,n,a){var i=arguments.length,t=i<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,n):a,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,e,n,a);else for(var h=o.length-1;h>=0;h--)(c=o[h])&&(t=(i<3?c(t):i>3?c(e,n,t):c(e,n))||t);return i>3&&t&&Object.defineProperty(e,n,t),t};let l=class extends u{constructor(){super(...arguments),this.value="",this.checked=!1,this.filename=""}connectedCallback(){super.connectedCallback(),this.checked=this.value!=="",this.filename=this.value!==""&&this.value!=="true"?this.value:""}createRenderRoot(){return this}render(){return d`<input type=hidden name=ldownload .value=${this.computeValue()}><div class=form-check><input type=checkbox class=form-check-input id=ldownload-checkbox .checked=${this.checked} @change=${this.handleCheckboxChange}> <label class=form-check-label for=ldownload-checkbox>${this.getAttribute("label-download")??"Force download"}</label></div>${this.checked?d`<div class=mt-2><label for=ldownload-filename class=form-label>${this.getAttribute("label-filename")??"Custom filename"}</label> <input id=ldownload-filename type=text class=form-control .value=${this.filename} @input=${this.handleFilenameInput}></div>`:m}`}computeValue(){return this.checked?this.filename!==""?this.filename:"true":""}handleCheckboxChange(e){this.checked=e.target.checked}handleFilenameInput(e){this.filename=e.target.value}};r([f({type:String})],l.prototype,"value",void 0),r([s()],l.prototype,"checked",void 0),r([s()],l.prototype,"filename",void 0),l=r([p("typo3-backend-link-browser-download")],l);export{l as LinkBrowserDownloadElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{property as u,customElement as m}from"lit/decorators.js";import{LitElement as d,html as g}from"lit";import{range as b}from"lit/directives/range.js";import{map as f}from"lit/directives/map.js";import{classMap as l}from"lit/directives/class-map.js";var c=function(i,t,n,a){var o=arguments.length,e=o<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,n):a,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(i,t,n,a);else for(var s=i.length-1;s>=0;s--)(r=i[s])&&(e=(o<3?r(e):o>3?r(t,n,e):r(t,n))||e);return o>3&&e&&Object.defineProperty(t,n,e),e};let p=class extends d{constructor(){super(...arguments),this.paging=null}createRenderRoot(){return this}render(){return g`<ul class=pagination><li class=${l({"page-item":!0,disabled:this.paging.currentPage===1})}><button type=button class=page-link data-action=previous ?disabled=${this.paging.currentPage===1}><typo3-backend-icon identifier=actions-view-paging-previous size=small></typo3-backend-icon></button></li>${f(b(1,this.paging.totalPages+1),t=>g`<li class=${l({"page-item":!0,active:this.paging.currentPage===t})}><button type=button class=page-link data-action=page data-page=${t}><span>${t}</span></button></li>`)}<li class=${l({"page-item":!0,disabled:this.paging.currentPage===this.paging.totalPages})}><button type=button class=page-link data-action=next ?disabled=${this.paging.currentPage===this.paging.totalPages}><typo3-backend-icon identifier=actions-view-paging-next size=small></typo3-backend-icon></button></li></ul>`}};c([u({type:Object})],p.prototype,"paging",void 0),p=c([m("typo3-backend-pagination")],p);export{p as PaginationElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as h,css as b,nothing as l,html as u}from"lit";import{property as n,customElement as g}from"lit/decorators.js";import{classMap as m}from"lit/directives/class-map.js";import{styleMap as v}from"lit/directives/style-map.js";import f from"@typo3/backend/severity.js";import"@typo3/backend/enum/severity.js";var o=function(d,r,e,t){var s=arguments.length,a=s<3?r:t===null?t=Object.getOwnPropertyDescriptor(r,e):t,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(d,r,e,t);else for(var c=d.length-1;c>=0;c--)(p=d[c])&&(a=(s<3?p(a):s>3?p(r,e,a):p(r,e))||a);return s>3&&a&&Object.defineProperty(r,e,a),a};let i=class extends h{constructor(){super(...arguments),this.value=void 0,this.max=100,this.severity=void 0,this.isHidden=!1,this.isHiding=!1,this.abortController=new AbortController}static{this.styles=b`@keyframes progress-indeterminate{0%{inset-inline-start:-33%}to{inset-inline-start:100%}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}:host{--progress-bar-height:4px;--progress-bar-color-primary:var(--typo3-state-primary-border-color);--progress-bar-color-success:var(--typo3-state-success-border-color);--progress-bar-color-warning:var(--typo3-state-warning-border-color);--progress-bar-color-danger:var(--typo3-state-danger-border-color);--progress-bar-color-info:var(--typo3-state-info-border-color);--progress-bar-color:var(--progress-bar-color-primary);--progress-track-color:light-dark(var(--token-color-neutral-20),var(--token-color-neutral-80));--progress-border-radius:var(--typo3-component-border-radius);display:block;width:100%;border-radius:var(--progress-border-radius)}:host([hidden]){display:none}:host([is-hiding]){animation:fade-out .3s ease-out forwards}.progress{position:relative;overflow:hidden;height:var(--progress-bar-height);border-radius:var(--progress-border-radius)}.value{display:block;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}.track{background:var(--progress-track-color);inset:0}.bar{background:var(--progress-bar-color);transition:width .5s ease-in-out;&.bar-success{--progress-bar-color:var(--progress-bar-color-success)}&.bar-warning{--progress-bar-color:var(--progress-bar-color-warning)}&.bar-danger{--progress-bar-color:var(--progress-bar-color-danger)}&.bar-info{--progress-bar-color:var(--progress-bar-color-info)}&.indeterminate{animation-name:progress-indeterminate;animation-duration:3s;animation-iteration-count:infinite;animation-timing-function:linear;width:33%;background-image:linear-gradient(to right,var(--progress-track-color) 0,transparent 50%,var(--progress-track-color) 100%)}}.bar,.track{position:absolute;height:var(--progress-bar-height)}.label{margin-top:.5rem}`}isRunning(){return!this.abortController.signal.aborted}start(r=!1){this.abortController.abort(),this.abortController=new AbortController,this.isHiding=!1,this.isHidden=!1,this.value=r?void 0:0}inc(r=5){let e=this.value??0;e=this.clamp(e+r,0,this.max),this.value=e>=this.max?this.max:e}async done(){const r=this.abortController.signal;if((this.value??0)>=this.max){this.hide();return}if(isNaN(this.value)&&(this.value=0),await this.updateComplete,r.aborted||(await new Promise(s=>requestAnimationFrame(()=>requestAnimationFrame(s))),r.aborted)||(this.value=this.max,await this.updateComplete,r.aborted))return;this.shadowRoot.querySelector(".bar").addEventListener("transitionend",()=>{this.hide()},{once:!0,signal:r})}hide(){this.isHiding=!0,this.addEventListener("animationend",()=>{this.remove()},{once:!0,signal:this.abortController.signal})}connectedCallback(){super.connectedCallback(),this.updateHostClass()}disconnectedCallback(){super.disconnectedCallback()}render(){const r="progress-label-"+(Math.random()+1).toString(36).substring(2),e=this.label!==void 0&&this.label,t=isNaN(this.value),s=m({bar:!0,["bar-"+f.getCssClass(this.severity)]:!t&&this.severity!==void 0,indeterminate:t}),a=t?l:v({width:(this.clamp(this.value,0,this.max)/this.max*100).toString()+"%"});return u`<div class=progress-wrapper><div role=progressbar class=progress aria-valuenow=${t?l:this.value} aria-valuemin=0 aria-valuemax=${this.max} aria-describedby=${e?r:l}><div class=track></div><div class=${s} style=${a}>${t?l:u`<span class=value>${this.value}%</span>`}</div></div>${e?u`<div class=label id=${r}>${this.label}</div>`:l}</div>`}updated(r){super.updated(r),r.has("isHiding")&&this.updateHostClass()}updateHostClass(){this.isHiding?this.setAttribute("is-hiding",""):this.removeAttribute("is-hiding")}clamp(r,e,t){return Math.min(t,Math.max(e,r))}};o([n({type:Number,reflect:!0})],i.prototype,"value",void 0),o([n({type:Number,reflect:!0})],i.prototype,"max",void 0),o([n({type:Number,reflect:!0})],i.prototype,"severity",void 0),o([n({type:String,reflect:!0})],i.prototype,"label",void 0),o([n({type:Boolean,reflect:!0,attribute:"hidden"})],i.prototype,"isHidden",void 0),o([n({type:BLine truncated
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as l,css as d,nothing as h,html as b}from"lit";import{property as n,customElement as k}from"lit/decorators.js";import{styleMap as v}from"lit/directives/style-map.js";import m from"~labels/backend.layout";var p=function(s,r,t,i){var o=arguments.length,e=o<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,t):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(s,r,t,i);else for(var g=s.length-1;g>=0;g--)(c=s[g])&&(e=(o<3?c(e):o>3?c(r,t,e):c(r,t))||e);return o>3&&e&&Object.defineProperty(r,t,e),e};let a=class extends l{constructor(){super(...arguments),this.stages=[],this.activeStage=0}static{this.styles=d`:host{--progress-tracker-margin:var(--typo3-spacing);--progress-tracker-stage:0;--progress-tracker-stages:0;--progress-tracker-gap:.25rem;--progress-tracker-bar-height:6px;--progress-tracker-bar-border-radius:3px;--progress-tracker-bar-bg:light-dark(var(--token-color-neutral-20),var(--token-color-neutral-80));--progress-tracker-bar-progress-bg:var(--typo3-state-primary-border-color);display:block;width:100%;margin-bottom:var(--progress-tracker-margin)}.tracker{position:relative;display:grid;gap:var(--progress-tracker-gap);grid-template-columns:auto min-content;grid-template-areas:"stage step" "bar bar"}.tracker-stage{grid-area:stage}.tracker-step{grid-area:step;white-space:nowrap}.tracker-bar{grid-area:bar;position:relative;width:100%;height:var(--progress-tracker-bar-height);border-radius:var(--progress-tracker-bar-border-radius);background-color:var(--progress-tracker-bar-bg)}.tracker-bar:after{content:"";height:100%;width:calc(100%/var(--progress-tracker-stages)*var(--progress-tracker-stage));display:block;border-radius:inherit;background-color:var(--progress-tracker-bar-progress-bg)}@media (prefers-reduced-motion:no-preference){.tracker-bar:after{transition:width .5s ease-in-out}}`}render(){if(this.stages.length<2)return h;this.activeStage=Math.min(Math.max(this.activeStage,this.stages.length>0?1:0),this.stages.length);const r=this.stages[this.activeStage-1],t=v({"--progress-tracker-stage":`${this.activeStage}`,"--progress-tracker-stages":`${this.stages.length}`});return b`<div class=tracker role=group aria-describedby=tracker-details style=${t}><div class=tracker-stage id=tracker-stage aria-live=polite>${r}</div><div class=tracker-step id=tracker-details>${m.get("progressTracker.steps",[this.activeStage,this.stages.length])||`Step ${this.activeStage} of ${this.stages.length}`}</div><div class=tracker-bar id=tracker-bar aria-hidden=true></div></div>`}};p([n({attribute:"stages",type:Array})],a.prototype,"stages",void 0),p([n({attribute:"active",type:Number,reflect:!0})],a.prototype,"activeStage",void 0),a=p([k("typo3-backend-progress-tracker")],a);export{a as ProgressTrackerElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{property as f}from"lit/decorators.js";import{LitElement as a,css as d,html as v}from"lit";import{KeyTypesEnum as l}from"@typo3/backend/enum/key-types.js";var c=function(n,t,r,o){var i=arguments.length,e=i<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(n,t,r,o);else for(var s=n.length-1;s>=0;s--)(p=n[s])&&(e=(i<3?p(e):i>3?p(t,r,e):p(t,r))||e);return i>3&&e&&Object.defineProperty(t,r,e),e};class u extends a{static{this.styles=[d`:host{cursor:pointer;appearance:button}`]}constructor(){super(),this.role="button",this.tabIndex=0,this.addEventListener("click",t=>{t.preventDefault(),this.buttonActivated(t)}),this.addEventListener("keydown",t=>{t.key===l.SPACE&&t.preventDefault(),t.key===l.ENTER&&(t.preventDefault(),this.buttonActivated(t))}),this.addEventListener("keyup",t=>{t.key===l.SPACE&&(t.preventDefault(),this.buttonActivated(t))})}render(){return v`<slot></slot>`}}c([f({type:String,reflect:!0})],u.prototype,"role",void 0),c([f({type:String,reflect:!0})],u.prototype,"tabIndex",void 0);export{u as PseudoButtonLitElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{property as d,state as h,customElement as b}from"lit/decorators.js";import{LitElement as y,html as s,nothing as f}from"lit";import v from"@typo3/core/ajax/ajax-request.js";import"@typo3/backend/element/spinner-element.js";import"@typo3/backend/element/icon-element.js";import"@typo3/backend/copy-to-clipboard.js";import{unsafeHTML as g}from"lit/directives/unsafe-html.js";import i from"~labels/backend.qrcode";var a=function(t,e,o,l){var c=arguments.length,r=c<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,o):l,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(t,e,o,l);else for(var m=t.length-1;m>=0;m--)(p=t[m])&&(r=(c<3?p(r):c>3?p(e,o,r):p(e,o))||r);return c>3&&r&&Object.defineProperty(e,o,r),r},u;(function(t){t[t.small=64]="small",t[t.medium=128]="medium",t[t.large=256]="large",t[t.mega=512]="mega"})(u||(u={}));let n=class extends y{constructor(){super(),this.content="",this.showDownload=!1,this.showUrl=!1,this.size=u.small,this.qrcodePreview=s`<typo3-backend-spinner size=large></typo3-backend-spinner>`,document.addEventListener("copy-to-clipboard-success",this.showCopySuccess.bind(this)),document.addEventListener("copy-to-clipboard-error",this.showCopyError.bind(this))}connectedCallback(){super.connectedCallback(),this.loadQrCode()}render(){return s`<div class=preview>${this.qrcodePreview}</div>${this.getUrlSection()} ${this.getControls()}`}createRenderRoot(){return this}getUrlSection(){if(!this.showUrl)return f;const e=i.get("qrcode.url"),o=i.get("qrcode.copyUrl");return s`<div class="form-group url-info-section"><label class=form-label>${e}</label><div class=input-group><input type=text class=form-control readonly .value=${this.content}><typo3-copy-to-clipboard text=${this.content} class="btn btn-default" silent><typo3-backend-icon identifier=actions-clipboard size=small></typo3-backend-icon>${o}</typo3-copy-to-clipboard></div></div>`}getControls(){if(!this.showDownload)return s`${f}`;const e=i.get("qrcode.format.png"),o=i.get("qrcode.format.svg"),l=i.get("qrcode.format"),c=i.get("qrcode.size"),r=i.get("qrcode.download");return s`<form name=qrcode-download method=POST action=${TYPO3.settings.ajaxUrls.qrcode_download}><div class=form-row><div class=form-group><input name=content type=hidden value=${this.content}> <label class=form-label>${l}</label> <select name=format class=form-select><option value=svg>${o}</option><option value=png>${e}</option></select></div><div class=form-group><label class=form-label>${c}</label> <select name=size class=form-select>${this.getSizeOptions()}</select></div><div class=form-group><button type=submit class="btn btn-primary">${r}</button></div></div></form>`}getSizeOptions(){return Object.entries(u).filter(([,e])=>typeof e=="number").map(([e,o])=>s`<option value=${e}>${o}x${o}</option>`)}async loadQrCode(){if(this.content===""){this.qrcodePreview=s`<typo3-backend-icon identifier=default-not-found size=small></typo3-backend-icon>`;return}await new v(TYPO3.settings.ajaxUrls.qrcode_generator).withQueryArguments({content:this.content,size:this.size}).get({cache:"no-cache"}).then(async e=>{this.qrcodePreview=s`${g(await e.resolve())}`})}showCopySuccess(){const e=this.querySelector(".url-info-section");e!==null&&(e.classList.add("copy-success"),setTimeout(()=>e.classList.remove("copy-success"),500))}showCopyError(){const e=this.querySelector(".url-info-section");e!==null&&(e.classList.add("copy-error"),setTimeout(()=>e.classList.remove("copy-error"),750))}};a([d({type:String,reflect:!0})],n.prototype,"content",void 0),a([d({type:Boolean,reflect:!0,attribute:"show-download"})],n.prototype,"showDownload",void 0),a([d({type:Boolean,reflect:!0,attribute:"show-url"})],n.prototype,"showUrl",void 0),a([d({type:String,reflect:!0})],n.prototype,"size",void 0),a([h()],n.prototype,"qrcodePreview",void 0),n=a([b("typo3-qrcode")],n);export{n as QrCodeElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{property as d,customElement as m}from"lit/decorators.js";import{PseudoButtonLitElement as u}from"@typo3/backend/element/pseudo-button.js";import c from"@typo3/backend/modal.js";import{html as f}from"lit";import{topLevelModuleImport as w}from"@typo3/backend/utility/top-level-module-import.js";import h from"~labels/core.mod_web_list";var l=function(r,t,o,i){var a=arguments.length,e=a<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(r,t,o,i);else for(var p=r.length-1;p>=0;p--)(s=r[p])&&(e=(a<3?s(e):a>3?s(t,o,e):s(t,o))||e);return a>3&&e&&Object.defineProperty(t,o,e),e};let n=class extends u{constructor(){super(...arguments),this.showUrl=!1,this.showDownload=!1}buttonActivated(){this.modalOpen()}async loadModuleFrameAgnostic(t){window.location!==window.parent.location?await w(t):await import(t)}async modalOpen(){await this.loadModuleFrameAgnostic("@typo3/backend/element/qrcode-element.js"),c.advanced({title:this.modalTitle||"QR Code",size:c.sizes.small,content:f`<div class=text-center><typo3-qrcode class=text-start content=${this.content} size=large ?show-download=${this.showDownload} ?show-url=${this.showUrl}></typo3-qrcode></div>`,buttons:[{text:h.get("button.close"),name:"close",trigger:function(t,o){o.hideModal()}}]})}};l([d({type:String,attribute:"modal-title"})],n.prototype,"modalTitle",void 0),l([d({type:String})],n.prototype,"content",void 0),l([d({type:Boolean,attribute:"show-url"})],n.prototype,"showUrl",void 0),l([d({type:Boolean,attribute:"show-download"})],n.prototype,"showDownload",void 0),n=l([m("typo3-qrcode-modal-button")],n);export{n as QrCodeModalButton};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{css as h,html as f}from"lit";import{property as b,state as m,customElement as g}from"lit/decorators.js";import{PseudoButtonLitElement as c}from"@typo3/backend/element/pseudo-button.js";import{ScaffoldState as r,ScaffoldSidebarToggleEvent as u}from"@typo3/backend/viewport/scaffold-state.js";import"@typo3/backend/element/icon-element.js";var l=function(d,e,a,s){var n=arguments.length,t=n<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,a):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(d,e,a,s);else for(var p=d.length-1;p>=0;p--)(o=d[p])&&(t=(n<3?o(t):n>3?o(e,a,t):o(e,a))||t);return n>3&&t&&Object.defineProperty(e,a,t),t};let i=class extends c{constructor(){super(...arguments),this.labelCollapse="Collapse sidebar",this.labelExpand="Expand sidebar",this.disabled=!1,this.expanded=!1,this.handleSidebarToggle=e=>{this.expanded=e.detail.expanded}}static{this.styles=[...c.styles,h`:host{display:inline-flex;align-items:center;justify-content:center;user-select:none}:host([disabled]){pointer-events:none;opacity:.5;cursor:default}`]}connectedCallback(){super.connectedCallback(),this.expanded=r.isLargeScreen()?r.isSidebarExpanded():r.isSidebarVisible(),this.updateLabels(),document.addEventListener(u.eventName,this.handleSidebarToggle)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(u.eventName,this.handleSidebarToggle)}updated(){this.updateLabels(),this.updateDisabledState()}render(){const e=this.expanded?"actions-menu-sidebar-collapsed":"actions-menu-sidebar-expanded",a=this.disabled?"overlay-readonly":null;return f`<typo3-backend-icon identifier=${e} size=small overlay=${a}></typo3-backend-icon>`}buttonActivated(){this.disabled||r.toggleSidebar()}updateLabels(){const e=this.expanded?this.labelCollapse:this.labelExpand;this.title=e,this.setAttribute("aria-label",e)}updateDisabledState(){this.disabled?(this.setAttribute("aria-disabled","true"),this.tabIndex=-1):(this.removeAttribute("aria-disabled"),this.tabIndex=0)}};l([b({type:String,attribute:"label-collapse"})],i.prototype,"labelCollapse",void 0),l([b({type:String,attribute:"label-expand"})],i.prototype,"labelExpand",void 0),l([b({type:Boolean,reflect:!0})],i.prototype,"disabled",void 0),l([m()],i.prototype,"expanded",void 0),i=l([g("typo3-backend-sidebar-toggle")],i);export{i as SidebarToggleElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{LitElement as a,html as m}from"lit";import{property as f,customElement as u}from"lit/decorators.js";import{Sizes as h}from"@typo3/backend/enum/icon-types.js";import{IconStyles as v}from"@typo3/backend/icons.js";var l=function(r,t,n,s){var o=arguments.length,e=o<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(r,t,n,s);else for(var c=r.length-1;c>=0;c--)(i=r[c])&&(e=(o<3?i(e):o>3?i(t,n,e):i(t,n))||e);return o>3&&e&&Object.defineProperty(t,n,e),e};let p=class extends a{constructor(){super(...arguments),this.size=h.default}static{this.styles=v.getStyles()}render(){return m`<span class="icon icon-size-${this.size} icon-state-default icon-spin"> <span class=icon-markup><svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><g fill="currentColor"><path d="M8 15c-3.86 0-7-3.141-7-7s3.14-7 7-7 7 3.14 7 7-3.141 7-7 7M8 3C5.243 3 3 5.243 3 8s2.243 5 5 5 5-2.243 5-5-2.243-5-5-5" opacity=".3"/><path d="M14 9a1 1 0 0 1-1-1c0-2.757-2.243-5-5-5a1 1 0 0 1 0-2c3.859 0 7 3.14 7 7a1 1 0 0 1-1 1"/></g></svg> </span> </span>`}};l([f({type:String})],p.prototype,"size",void 0),p=l([u("typo3-backend-spinner")],p);export{p as SpinnerElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{property as p,customElement as d}from"lit/decorators.js";import{LitElement as h,html as f,nothing as c}from"lit";import{classMap as m}from"lit/directives/class-map.js";var l=function(n,t,o,a){var s=arguments.length,e=s<3?t:a===null?a=Object.getOwnPropertyDescriptor(t,o):a,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(n,t,o,a);else for(var u=n.length-1;u>=0;u--)(r=n[u])&&(e=(s<3?r(e):s>3?r(t,o,e):r(t,o))||e);return s>3&&e&&Object.defineProperty(t,o,e),e};const g={online:"live",running:"loading"};let i=class extends h{constructor(){super(...arguments),this.state="default",this.live=!1,this.loading=!1,this.label=null}createRenderRoot(){return this}render(){const t=this.label!==null&&this.label!=="";return f`<span class=${m(this.getClasses())} title=${t?this.label:c} role=${t?"img":c} aria-label=${t?this.label:c} aria-hidden=${t?c:"true"}></span>`}getClasses(){const t=g[this.state];return{"status-indicator":!0,["status-indicator-"+this.state]:!0,"status-indicator-live":this.live||t==="live","status-indicator-loading":this.loading||t==="loading"}}};l([p({type:String})],i.prototype,"state",void 0),l([p({type:Boolean})],i.prototype,"live",void 0),l([p({type:Boolean})],i.prototype,"loading",void 0),l([p({type:String})],i.prototype,"label",void 0),i=l([d("typo3-backend-status-indicator")],i);export{i as StatusIndicatorElement};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import{property as p,customElement as d}from"lit/decorators.js";import{LitElement as b,html as c}from"lit";import{Task as y}from"@lit/task";import"@typo3/backend/element/spinner-element.js";import"@typo3/backend/element/icon-element.js";var l=function(m,t,n,s){var a=arguments.length,e=a<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(m,t,n,s);else for(var r=m.length-1;r>=0;r--)(i=m[r])&&(e=(a<3?i(e):a>3?i(t,n,e):i(t,n))||e);return a>3&&e&&Object.defineProperty(t,n,e),e};const u={default:"default",small:"small",medium:"medium",large:"large"};let o=class extends b{constructor(){super(...arguments),this.size=u.default,this.keepAspectRatio=!1,this.thumbnailTask=new y(this,{task:async([t,n,s,a,e])=>{const i=new URL(t,window.origin);i.searchParams.set("size",n),i.searchParams.set("keepAspectRatio",s?"1":"0"),i.searchParams.set("bust",Date.now().toString(10));const r=new Image;return r.src=i.toString(),a>0&&(r.width=a),e>0&&!s&&(r.height=e),await new Promise((h,f)=>{r.onload=()=>h(),r.onerror=()=>f()}),c`${r}`},args:()=>[this.url,this.size,this.keepAspectRatio,this.width,this.height]})}createRenderRoot(){return this}render(){return this.thumbnailTask.render({pending:()=>c`<typo3-backend-spinner size=${this.size}></typo3-backend-spinner>`,complete:t=>c`${t}`,error:()=>c`<typo3-backend-icon identifier=default-not-found size=small></typo3-backend-icon>`})}};l([p({type:String,reflect:!0})],o.prototype,"url",void 0),l([p({type:String,reflect:!0})],o.prototype,"size",void 0),l([p({type:Boolean,reflect:!0})],o.prototype,"keepAspectRatio",void 0),l([p({type:Number,reflect:!0})],o.prototype,"width",void 0),l([p({type:Number,reflect:!0})],o.prototype,"height",void 0),o=l([d("typo3-backend-thumbnail")],o);export{o as ThumbnailElement,u as ThumbnailSize};
|
||||
Reference in new issue
Block a user