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{property as c,state as m,customElement as u}from"lit/decorators.js";import{LitElement as g,html as d}from"lit";import f from"~labels/core.core";var o=function(a,e,t,n){var i=arguments.length,r=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(a,e,t,n);else for(var l=a.length-1;l>=0;l--)(h=a[l])&&(r=(i<3?h(r):i>3?h(e,t,r):h(e,t))||r);return i>3&&r&&Object.defineProperty(e,t,r),r};let s=class extends g{constructor(){super(...arguments),this.remainingCharacters=0,this.targetElement=null,this.threshold=15,this.onInput=e=>{this.determineRemainingCharacters(e.target)},this.onFocus=e=>{this.determineRemainingCharacters(e.target),this.hidden=!1},this.onBlur=()=>{this.hidden=!0}}connectedCallback(){super.connectedCallback(),this.registerCallbacks(),this.hidden=!0}disconnectedCallback(){super.disconnectedCallback(),this.removeCallbacks()}createRenderRoot(){return this}updated(e){e.has("target")&&(this.removeCallbacks(),this.targetElement=document.querySelector(this.target),this.registerCallbacks())}render(){return d`<span class="form-hint form-hint--${this.determineCounterClass()}"> ${f.get("labels.remainingCharacters",{0:this.remainingCharacters.toString(10)})} </span>`}registerCallbacks(){this.targetElement!==null&&(this.targetElement.addEventListener("input",this.onInput),this.targetElement.addEventListener("focus",this.onFocus),this.targetElement.addEventListener("blur",this.onBlur))}removeCallbacks(){this.targetElement!==null&&(this.targetElement.removeEventListener("input",this.onInput),this.targetElement.removeEventListener("focus",this.onFocus),this.targetElement.removeEventListener("blur",this.onBlur))}determineRemainingCharacters(e){const t=e.value,n=t.length,i=(t.match(/\n/g)||[]).length;this.remainingCharacters=this.targetElement.maxLength-n-i}determineCounterClass(){return this.remainingCharacters<this.threshold?"danger":this.remainingCharacters<this.threshold*2?"warning":"info"}};o([c()],s.prototype,"target",void 0),o([m()],s.prototype,"remainingCharacters",void 0),s=o([u("typo3-backend-formengine-char-counter")],s);export{s as CharCounter};
@@ -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 r from"@typo3/core/event/regular-event.js";var l;(function(i){i.fieldContainerSelector=".t3js-formengine-field-group",i.filterTextFieldSelector=".t3js-formengine-multiselect-filter-textfield",i.filterSelectFieldSelector=".t3js-formengine-multiselect-filter-dropdown"})(l||(l={}));class s{constructor(t){this.selectElement=null,this.availableOptions=null,this.selectElement=t,this.initializeEvents()}static toggleOptGroup(t){const e=t.parentElement;e instanceof HTMLOptGroupElement&&(e.querySelectorAll("option:not([hidden]):not([disabled]):not(.hidden)").length===0?e.hidden=!0:(e.hidden=!1,e.disabled=!1,e.classList.remove("hidden")))}initializeEvents(){const t=this.selectElement.closest(".form-wizards-wrap");t!==null&&(new r("input",e=>{this.filter(e.target.value)}).delegateTo(t,l.filterTextFieldSelector),new r("search",e=>{this.filter(e.target.value)}).delegateTo(t,l.filterTextFieldSelector),new r("change",e=>{this.filter(e.target.value)}).delegateTo(t,l.filterSelectFieldSelector))}filter(t){this.availableOptions===null&&(this.availableOptions=this.selectElement.querySelectorAll("option"));const e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(e,"i");this.availableOptions.forEach(n=>{n.hidden=t.length>0&&n.textContent.match(a)===null,s.toggleOptGroup(n)})}}export{s as default};