TYPO3 v15 dev-main snapshot ()

This commit is contained in:
2026-08-10 22:31:00 +02:00
commit f9941541b7
1178 changed files with 135377 additions and 0 deletions
@@ -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 p from"@typo3/core/document-service.js";import{property as v,customElement as d}from"lit/decorators.js";import{LitElement as h,html as a,css as y}from"lit";import"@typo3/backend/live-search/element/result/item/action/action.js";var u=function(r,e,t,i){var o=arguments.length,n=o<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(n=(o<3?s(n):o>3?s(e,t,n):s(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};const f="typo3-backend-live-search-result-item-action-container";let c=class extends h{constructor(){super(...arguments),this.resultItem=null}createRenderRoot(){return this}render(){return a`<typo3-backend-live-search-result-action-list>${this.resultItem.actions.map(e=>this.renderActionItem(this.resultItem,e))}</typo3-backend-live-search-result-action-list>`}renderActionItem(e,t){return a`<typo3-backend-live-search-result-item-action .resultItem=${e} .resultItemAction=${t} @click=${()=>this.invokeAction(this.resultItem,t)}></typo3-backend-live-search-result-item-action>`}invokeAction(e,t){this.closest("typo3-backend-live-search-result-container").dispatchEvent(new CustomEvent("livesearch:invoke-action",{detail:{resultItem:e,action:t}}))}};u([v({type:Object,attribute:!1})],c.prototype,"resultItem",void 0),c=u([d("typo3-backend-live-search-result-item-action-container")],c);let m=class extends h{static{this.styles=y`:host{display:block}`}async connectedCallback(){await p.ready(),this.parentContainer=this.closest("typo3-backend-live-search-result-container"),this.resultItemContainer=this.parentContainer.querySelector("typo3-backend-live-search-result-item-container"),super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("keyup",this.handleKeyUp)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("keyup",this.handleKeyUp),super.disconnectedCallback()}render(){return a`<slot></slot>`}handleKeyDown(e){if(!["ArrowDown","ArrowUp","ArrowLeft"].includes(e.key)||document.activeElement.tagName.toLowerCase()!=="typo3-backend-live-search-result-item-action")return;e.preventDefault();let t;e.key==="ArrowDown"?t=document.activeElement.nextElementSibling:e.key==="ArrowUp"?t=document.activeElement.previousElementSibling:e.key==="ArrowLeft"&&(t=this.resultItemContainer.querySelector("typo3-backend-live-search-result-item.active")),t!==null&&t.focus()}handleKeyUp(e){if(!["Enter"," "].includes(e.key))return;e.preventDefault();const t=e.target;this.parentContainer.dispatchEvent(new CustomEvent("livesearch:invoke-action",{detail:{resultItem:t.resultItem,action:t.resultItemAction}}))}};m=u([d("typo3-backend-live-search-result-action-list")],m);export{c as ActionContainer,m as ActionList,f as componentName};
@@ -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{ifDefined as f}from"lit/directives/if-defined.js";import{LitElement as m,html as u}from"lit";import"@typo3/backend/element/icon-element.js";var a=function(o,e,i,n){var c=arguments.length,t=c<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,i):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,e,i,n);else for(var s=o.length-1;s>=0;s--)(l=o[s])&&(t=(c<3?l(t):c>3?l(e,i,t):l(e,i))||t);return c>3&&t&&Object.defineProperty(e,i,t),t};let r=class extends m{connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}createRenderRoot(){return this}render(){return u`<div><div class=livesearch-result-item-icon><typo3-backend-icon identifier=${f(this.resultItemAction.icon.identifier||"actions-arrow-right")} overlay=${this.resultItemAction.icon.overlay} size=small></typo3-backend-icon></div><div class=livesearch-result-item-title>${this.resultItemAction.label}</div></div>`}};a([p({type:Object,attribute:!1})],r.prototype,"resultItem",void 0),a([p({type:Object,attribute:!1})],r.prototype,"resultItemAction",void 0),r=a([d("typo3-backend-live-search-result-item-action")],r);export{r as Action};
@@ -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"@typo3/backend/element/spinner-element.js";import m from"@typo3/backend/live-search/live-search-configurator.js";import{LitElement as p,html as l,css as v}from"lit";import{property as y,customElement as h}from"lit/decorators.js";import{until as b}from"lit/directives/until.js";import"@typo3/backend/live-search/element/provider/default-result-item.js";import"@typo3/backend/live-search/element/result/item/item.js";var u=function(o,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(o,e,t,n);else for(var c=o.length-1;c>=0;c--)(s=o[c])&&(r=(i<3?s(r):i>3?s(e,t,r):s(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r};const f="typo3-backend-live-search-result-item-container";let a=class extends p{constructor(){super(...arguments),this.results=null}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",this.onScroll)}disconnectedCallback(){this.removeEventListener("scroll",this.onScroll),super.disconnectedCallback()}createRenderRoot(){return this}render(){const e={},t=this.results.filter(n=>n!==null);return t.length!==this.results.length&&console.warn('The result set contained "null" values, indicating something went wrong while building the search results. Affected values were removed to no break the user interface.'),t.forEach(n=>{n.typeLabel in e?e[n.typeLabel].push(n):e[n.typeLabel]=[n]}),l`<typo3-backend-live-search-result-list>${this.renderGroupedResults(e)}</typo3-backend-live-search-result-list>`}renderGroupedResults(e){const t=[];for(const[n,i]of Object.entries(e)){const r=i.length;t.push(l`<h6 class=livesearch-result-item-group-label>${n} (${r})</h6>`),t.push(...i.map(s=>l`${b(this.renderResultItem(s),l`<typo3-backend-spinner></typo3-backend-spinner>`)}`))}return l`${t}`}async renderResultItem(e){const t=m.getRenderers();let n;return t[e.provider]!==void 0?(await import(t[e.provider].module),n=t[e.provider].callback(e)):n=l`<typo3-backend-live-search-result-item-default title="${e.typeLabel}: ${e.itemTitle}" .icon=${e.icon} .language=${e.language} .itemTitle=${e.itemTitle} .typeLabel=${e.typeLabel} .extraData=${e.extraData}></typo3-backend-live-search-result-item-default>`,l`<typo3-backend-live-search-result-item .resultItem=${e} @click=${()=>this.invokeAction(e,e.defaultAction)} @focus=${()=>this.requestActions(e)}>${n}</typo3-backend-live-search-result-item>`}requestActions(e){this.parentElement.dispatchEvent(new CustomEvent("livesearch:request-actions",{detail:{resultItem:e}}))}invokeAction(e,t){this.parentElement.dispatchEvent(new CustomEvent("livesearch:invoke-action",{detail:{resultItem:e,action:t}}))}onScroll(e){this.querySelectorAll(".livesearch-result-item-group-label").forEach(t=>{t.classList.toggle("sticky",t.offsetTop<=e.target.scrollTop)})}};u([y({type:Object,attribute:!1})],a.prototype,"results",void 0),a=u([h("typo3-backend-live-search-result-item-container")],a);let d=class extends p{static{this.styles=v`:host{display:block}`}connectedCallback(){this.parentContainer=this.closest("typo3-backend-live-search-result-container"),this.resultItemDetailContainer=this.parentContainer.querySelector("typo3-backend-live-search-result-item-detail-container"),super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("keyup",this.handleKeyUp)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("keyup",this.handleKeyUp),super.disconnectedCallback()}render(){return l`<slot></slot>`}handleKeyDown(e){if(!["ArrowDown","ArrowUp","ArrowRight"].includes(e.key))return;const t="typo3-backend-live-search-result-item";if(document.activeElement.tagName.toLowerCase()!==t)return;e.preventDefault();let n;if(e.key==="ArrowDown"){let i=document.activeElement.nextElementSibling;for(;i!==null&&i.tagName.toLowerCase()!==t;)i=i.nextElementSibling;n=i}else if(e.key==="ArrowUp"){let i=document.activeElement.previousElementSibling;for(;i!==null&&i.tagName.toLowerCase()!==t;)i=i.previousElementSibling;n=i,n===null&&(n=document.querySelector("typo3-backend-live-search").querySelector('input[type="search"]'))}else e.key==="ArrowRight"&&(n=this.resultItemDetailContainer.querySelector("typo3-backend-live-search-result-item-action"));n!==null&&n.focus()}handleKeyUp(e){if(!["Enter"," "].includes(e.key))return;e.preventDefault();const t=e.target.resultItem;this.invokeAction(t)}invokeAction(e){this.parentContainer.dispatchEvent(new CustomEvent("livesearch:invoke-action",{detail:{resultItem:e,action:e.actions[0]}}))}};d=u([h("typo3-backend-live-search-result-list")],d);export{a as ItemContainer,d as ResultList,f as componentName};
@@ -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 p}from"lit/decorators.js";import{LitElement as u,html as f}from"lit";import"@typo3/backend/element/icon-element.js";var l=function(n,e,t,o){var i=arguments.length,c=i<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(n,e,t,o);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(c=(i<3?r(c):i>3?r(e,t,c):r(e,t))||c);return i>3&&c&&Object.defineProperty(e,t,c),c};let s=class extends u{connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("focus",this.onFocus)}disconnectedCallback(){this.removeEventListener("focus",this.onFocus),super.disconnectedCallback()}createRenderRoot(){return this}render(){return f`<div class=livesearch-expand-action @click=${e=>{e.stopPropagation(),this.focus()}}><typo3-backend-icon identifier=actions-chevron-end size=small></typo3-backend-icon></div>`}onFocus(e){const t=e.target;t.parentElement.querySelector(".active")?.classList.remove("active"),t.classList.add("active")}};l([d({type:Object,attribute:!1})],s.prototype,"resultItem",void 0),s=l([p("typo3-backend-live-search-result-item")],s);export{s as Item};