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 a from"@typo3/backend/form-engine.js";import c from"@typo3/backend/form-engine-validation.js";import d from"@typo3/core/event/regular-event.js";import{selector as p}from"@typo3/core/literals.js";class i{constructor(){this.registerSortableEventHandler=o=>{this.registerKeyboardEventHandler(o);const t=o.closest(".form-wizards-wrap").querySelector(".form-wizards-item-aside");t!==null&&t.addEventListener("click",r=>{const n=r.target.closest(".t3js-btn-option");if(n===null)return;r.preventDefault();const e=n.dataset.fieldname,l=a.getFieldElement(e),s=a.getFieldElement(e,"_avail");l===null||s===null||(n.classList.contains("t3js-btn-moveoption-top")?i.moveOptionToTop(o):n.classList.contains("t3js-btn-moveoption-up")?i.moveOptionUp(o):n.classList.contains("t3js-btn-moveoption-down")?i.moveOptionDown(o):n.classList.contains("t3js-btn-moveoption-bottom")?i.moveOptionToBottom(o):n.classList.contains("t3js-btn-removeoption")&&i.removeOption(o,s),a.updateHiddenFieldValueFromSelect(o,l),a.markFieldAsChanged(s),c.validateField(s))})},this.registerKeyboardEventHandler=o=>{const t=o.dataset.formengineInputName,r=a.getFieldElement(t),n=a.getFieldElement(t,"_avail");r===null||n===null||new d("keydown",e=>{(e.code==="Delete"||e.code==="Backspace")&&(e.preventDefault(),i.removeOption(o,n)),e.code==="ArrowUp"&&e.altKey&&(e.preventDefault(),i.moveOptionUp(o)),e.code==="ArrowDown"&&e.altKey&&(e.preventDefault(),i.moveOptionDown(o)),e.code==="ArrowUp"&&e.altKey&&e.shiftKey&&(e.preventDefault(),i.moveOptionToTop(o)),e.code==="ArrowDown"&&e.altKey&&e.shiftKey&&(e.preventDefault(),i.moveOptionToBottom(o)),e.defaultPrevented&&(a.updateHiddenFieldValueFromSelect(o,r),a.markFieldAsChanged(n),c.validateField(n))}).bindTo(o)}}static moveOptionToTop(o){Array.from(o.querySelectorAll(":checked")).reverse().forEach(t=>{o.insertBefore(t,o.firstElementChild)})}static moveOptionToBottom(o){o.querySelectorAll(":checked").forEach(t=>{o.insertBefore(t,null)})}static moveOptionUp(o){const t=Array.from(o.children),r=Array.from(o.querySelectorAll(":checked"));for(const n of r){if(t.indexOf(n)===0&&n.previousElementSibling===null)break;o.insertBefore(n,n.previousElementSibling)}}static moveOptionDown(o){const t=Array.from(o.children).reverse(),r=Array.from(o.querySelectorAll(":checked")).reverse();for(const n of r){if(t.indexOf(n)===0&&n.nextElementSibling===null)break;o.insertBefore(n,n.nextElementSibling.nextElementSibling)}}static removeOption(o,t){const r=o.selectedIndex;o.querySelectorAll(":checked").forEach(n=>{const e=t.querySelector(p`option[value="${n.value}"]`);e!==null&&(e.classList.remove("hidden"),e.disabled=!1,a.enableOptGroup(e)),o.removeChild(n)}),o.selectedIndex=r>0?r-1:0}}export{i as AbstractSortableSelectItems};
@@ -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 d from"@typo3/core/document-service.js";import{selector as a}from"@typo3/core/literals.js";import"@typo3/backend/form-engine/element/select-tree.js";import"@typo3/backend/form-engine/element/select-tree-toolbar.js";import"@typo3/backend/element/icon-element.js";class s extends HTMLElement{constructor(){super(...arguments),this.recordField=null,this.treeWrapper=null,this.tree=null,this.selectNode=e=>{const t=e.detail.node;this.updateAncestorsIndeterminateState(t),this.calculateIndeterminate(this.tree.nodes),this.saveCheckboxes(),this.tree.setup.input.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},this.loadDataAfter=e=>{this.tree.nodes=e.detail.nodes.map(t=>(t.__indeterminate=!1,t)),this.calculateIndeterminate(this.tree.nodes)},this.saveCheckboxes=()=>{this.recordField.value=this.tree.getSelectedNodes().map(e=>e.identifier).join(",")}}async connectedCallback(){this.tree===null&&(await d.ready(),this.recordField=this.querySelector(a`#${this.getAttribute("recordFieldId")||""}`),this.treeWrapper=this.querySelector(a`#${this.getAttribute("treeWrapperId")||""}`),!(!this.recordField||!this.treeWrapper)&&(this.tree=document.createElement("typo3-backend-form-selecttree"),this.tree.setup={id:this.treeWrapper.id,dataUrl:this.generateDataUrl(),readOnlyMode:this.recordField.dataset.readOnly,input:this.recordField,exclusiveNodesIdentifiers:this.recordField.dataset.treeExclusiveKeys,validation:JSON.parse(this.recordField.dataset.formengineValidationRules)[0],expandUpToLevel:this.recordField.dataset.treeExpandUpToLevel,unselectableElements:[]},this.treeWrapper.append(this.tree),this.registerTreeEventListeners()))}registerTreeEventListeners(){this.tree.addEventListener("typo3:tree:nodes-prepared",this.loadDataAfter),this.tree.addEventListener("typo3:tree:node-selected",this.selectNode),this.tree.addEventListener("tree:initialized",()=>{if(this.recordField.dataset.treeShowToolbar){const e=document.createElement("typo3-backend-form-selecttree-toolbar");e.tree=this.tree,this.tree.prepend(e)}})}generateDataUrl(){return TYPO3.settings.ajaxUrls.record_tree_data+"&"+new URLSearchParams({uid:this.recordField.dataset.uid,command:this.recordField.dataset.command,tableName:this.recordField.dataset.tablename,fieldName:this.recordField.dataset.fieldname,defaultValues:this.recordField.dataset.defaultvalues,overrideValues:this.recordField.dataset.overridevalues,recordTypeValue:this.recordField.dataset.recordtypevalue,flexFormSheetName:this.recordField.dataset.flexformsheetname,flexFormFieldName:this.recordField.dataset.flexformfieldname,flexFormContainerName:this.recordField.dataset.flexformcontainername,dataStructureIdentifier:this.recordField.dataset.datastructureidentifier,flexFormContainerFieldName:this.recordField.dataset.flexformcontainerfieldname,flexFormContainerIdentifier:this.recordField.dataset.flexformcontaineridentifier,flexFormSectionContainerIsNew:this.recordField.dataset.flexformsectioncontainerisnew}).toString()}updateAncestorsIndeterminateState(e){let t=!1;e.__treeParents.forEach(i=>{const r=this.tree.getNodeByTreeIdentifier(i);r.__indeterminate=e.checked||e.__indeterminate||t,t=r.checked||r.__indeterminate||e.checked||e.__indeterminate})}calculateIndeterminate(e){e.forEach(t=>{(t.checked||t.__indeterminate)&&t.__treeParents&&t.__treeParents.length>0&&t.__treeParents.forEach(i=>{const r=this.tree.getNodeByTreeIdentifier(i);r.__indeterminate=!0})})}}window.customElements.define("typo3-formengine-element-category",s);
@@ -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 l from"@typo3/core/document-service.js";import n from"@typo3/core/event/regular-event.js";import i from"@typo3/backend/form-engine-validation.js";import{selector as r}from"@typo3/core/literals.js";import"@typo3/backend/color-picker.js";import o from"@typo3/backend/form-engine.js";class m extends HTMLElement{constructor(){super(...arguments),this.element=null}async connectedCallback(){if(this.element!==null)return;const e=this.getAttribute("recordFieldId");e!==null&&(await l.ready(),this.element=this.querySelector(r`#${e}`),this.element&&this.registerEventHandler())}registerEventHandler(){const e=document.querySelector(r`input[name="${this.element.dataset.formengineInputName}"]`);new n("blur",t=>{e.value=t.target.value,this.handleEvent(t)}).bindTo(this.element),new n("formengine.cp.change",t=>{this.handleEvent(t)}).bindTo(this.element)}handleEvent(e){i.validateField(e.target),o.markFieldAsChanged(e.target),document.querySelectorAll(".module-docheader-bar .btn").forEach(t=>{t.classList.remove("disabled"),t.disabled=!1})}}window.customElements.define("typo3-formengine-element-color",m);
@@ -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/core/document-service.js";import i from"@typo3/backend/form-engine-validation.js";import r from"@typo3/core/event/regular-event.js";import l from"@typo3/backend/form-engine.js";class m extends HTMLElement{constructor(){super(...arguments),this.element=null}async connectedCallback(){this.element===null&&(await n.ready(),this.element=document.getElementById(this.getAttribute("recordFieldId")||""),this.element&&(this.registerEventHandler(),import("@typo3/backend/date-time-picker.js").then(({default:e})=>{e.initialize(this.element,this)})))}registerEventHandler(){new r("formengine.dp.change",e=>{i.validateField(e.target),l.markFieldAsChanged(e.target),document.querySelectorAll(".module-docheader-bar .btn").forEach(t=>{t.classList.remove("disabled"),t.disabled=!1})}).bindTo(this.element)}}window.customElements.define("typo3-formengine-element-datetime",m);
@@ -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};
@@ -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 t from"@typo3/core/document-service.js";import{AbstractSortableSelectItems as l}from"@typo3/backend/form-engine/element/abstract-sortable-select-items.js";import{selector as n}from"@typo3/core/literals.js";class o extends l{registerEventHandler(e){this.registerSortableEventHandler(e)}}class s extends HTMLElement{constructor(){super(...arguments),this.recordField=null}async connectedCallback(){if(this.recordField!==null)return;const e=this.getAttribute("recordFieldId");e!==null&&(await t.ready(),this.recordField=this.querySelector(n`#${e}`),this.recordField&&this.registerEventHandler())}registerEventHandler(){new o().registerEventHandler(this.recordField)}}window.customElements.define("typo3-formengine-element-folder",s);
@@ -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{AbstractSortableSelectItems as t}from"@typo3/backend/form-engine/element/abstract-sortable-select-items.js";import r from"@typo3/core/document-service.js";import s from"@typo3/backend/form-engine-suggest.js";class n extends t{constructor(e){super(),this.element=null,r.ready().then(()=>{this.element=document.getElementById(e),this.element!==null&&(this.registerEventHandler(),this.registerSuggest())})}registerEventHandler(){this.registerSortableEventHandler(this.element)}registerSuggest(){let e;(e=this.element.closest(".t3js-formengine-field-item").querySelector(".t3-form-suggest"))!==null&&new s(e)}}export{n as default};
@@ -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 e from"@typo3/core/document-service.js";import{Resizable as t}from"@typo3/backend/form-engine/element/modifier/resizable.js";import{Tabbable as n}from"@typo3/backend/form-engine/element/modifier/tabbable.js";class l extends HTMLElement{constructor(){super(...arguments),this.element=null}async connectedCallback(){this.element===null&&(await e.ready(),this.element=document.getElementById(this.getAttribute("recordFieldId")||""),this.element&&(t.enable(this.element),n.enable(this.element)))}}window.customElements.define("typo3-formengine-element-json",l);
@@ -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{selector as r}from"@typo3/core/literals.js";var t;(function(i){i.toggleSelector=".t3js-form-field-link-explanation-toggle",i.inputFieldSelector=".t3js-form-field-link-input",i.explanationSelector=".t3js-form-field-link-explanation",i.iconSelector=".t3js-form-field-link-icon",i.containerSelector=".t3js-form-field-link"})(t||(t={}));class a extends HTMLElement{constructor(){super(),this.addEventListener("click",e=>this.handleClick(e)),this.addEventListener("change",e=>this.handleChange(e))}get element(){const e=this.getAttribute("recordFieldId");if(e===null)throw new Error("Missing recordFieldId attribute on <typo3-formengine-element-link>");const n=this.querySelector(r`#${e}`);if(n===null)throw new Error(`recordFieldId #${e} not found in <typo3-formengine-element-link>`);return n}get container(){return this.element.closest(t.containerSelector)}get toggleSelector(){return this.container.querySelector(t.toggleSelector)}get explanationField(){return this.container.querySelector(t.explanationSelector)}get icon(){return this.container.querySelector(t.iconSelector)}handleClick(e){e.target.closest(t.toggleSelector)!==null&&(e.preventDefault(),this.explanationField.hasAttribute("hidden")?this.showExplanation():this.hideExplanation())}handleChange(e){e.target.closest(t.inputFieldSelector)!==null&&(!this.explanationField.hasAttribute("hidden")&&this.hideExplanation(),this.disableToggle(),this.clearIcon())}showExplanation(){this.explanationField.removeAttribute("hidden"),this.element.setAttribute("hidden","")}hideExplanation(){this.explanationField.setAttribute("hidden",""),this.element.removeAttribute("hidden")}disableToggle(){this.toggleSelector.setAttribute("disabled","")}clearIcon(){this.icon.replaceChildren()}}window.customElements.define("typo3-formengine-element-link",a);
@@ -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 l from"@typo3/core/ajax/ajax-request.js";import u from"@typo3/core/document-service.js";import o from"@typo3/core/event/regular-event.js";import d from"@typo3/backend/notification.js";import c from"@typo3/backend/modal.js";import{SeverityEnum as f}from"@typo3/backend/enum/severity.js";import{selector as v}from"@typo3/core/literals.js";import{sudoModeInterceptor as m}from"@typo3/backend/security/sudo-mode-interceptor.js";var a;(function(s){s.deactivteProviderButton=".t3js-deactivate-provider-button",s.deactivteMfaButton=".t3js-deactivate-mfa-button",s.providerslist=".t3js-mfa-active-providers-list",s.mfaStatusLabel=".t3js-mfa-status-label"})(a||(a={}));class h{constructor(t,e){this.options=null,this.fullElement=null,this.deactivteProviderButtons=null,this.deactivteMfaButton=null,this.providersList=null,this.mfaStatusLabel=null,this.request=null,this.options=e,u.ready().then(i=>{this.fullElement=i.querySelector(t),this.deactivteProviderButtons=this.fullElement.querySelectorAll(a.deactivteProviderButton),this.deactivteMfaButton=this.fullElement.querySelector(a.deactivteMfaButton),this.providersList=this.fullElement.querySelector(a.providerslist),this.mfaStatusLabel=this.fullElement.parentElement.querySelector(a.mfaStatusLabel),this.registerEvents()})}registerEvents(){new o("click",t=>{t.preventDefault(),this.prepareDeactivateRequest(this.deactivteMfaButton)}).bindTo(this.deactivteMfaButton),this.deactivteProviderButtons.forEach(t=>{new o("click",e=>{e.preventDefault(),this.prepareDeactivateRequest(t)}).bindTo(t)})}prepareDeactivateRequest(t){const e=c.show(t.dataset.confirmationTitle||t.getAttribute("title")||"Deactivate provider(s)",t.dataset.confirmationContent||"Are you sure you want to continue? This action cannot be undone and will be applied immediately!",f.warning,[{text:t.dataset.confirmationCancelText||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:t.dataset.confirmationDeactivateText||"Deactivate",btnClass:"btn-warning",name:"deactivate",trigger:()=>{this.sendDeactivateRequest(t.dataset.provider)}}]);e.addEventListener("button.clicked",()=>{e.hideModal()})}sendDeactivateRequest(t){this.request instanceof l&&this.request.abort(),this.request=new l(TYPO3.settings.ajaxUrls.mfa).addMiddleware(m),this.request.post({action:"deactivate",provider:t,userId:this.options.userId,tableName:this.options.tableName}).then(async e=>{const i=await e.resolve();if(i.status.length>0&&i.status.forEach(r=>{i.success?d.success(r.title,r.message):d.error(r.title,r.message)}),!i.success)return;if(t===void 0||i.remaining===0){this.deactivateMfa();return}if(this.providersList===null)return;const n=this.providersList.querySelector(v`li#provider-${t}`);if(n===null)return;n.remove(),this.providersList.querySelectorAll("li").length===0&&this.deactivateMfa()}).finally(()=>{this.request=null})}deactivateMfa(){this.deactivteMfaButton.classList.add("disabled"),this.deactivteMfaButton.setAttribute("disabled","disabled"),this.providersList!==null&&this.providersList.remove(),this.mfaStatusLabel!==null&&(this.mfaStatusLabel.innerText=this.mfaStatusLabel.dataset.alternativeLabel,this.mfaStatusLabel.classList.remove("badge-success"),this.mfaStatusLabel.classList.add("badge-danger"))}}export{h as default};
@@ -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 a from"autosize";class s{static enable(e){a(e)}}export{s as Resizable};
@@ -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!
*/
class a{static enable(s){s.classList.contains("t3js-enable-tab")&&import("taboverride").then(({default:t})=>{t.set(s)})}}export{a as Tabbable};
@@ -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 c}from"lit/decorators.js";import{LitElement as f,html as m}from"lit";var s=function(i,e,n,o){var l=arguments.length,t=l<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,n):o,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(i,e,n,o);else for(var p=i.length-1;p>=0;p--)(a=i[p])&&(t=(l<3?a(t):l>3?a(e,n,t):a(e,n))||t);return l>3&&t&&Object.defineProperty(e,n,t),t};let r=class extends f{createRenderRoot(){return this}render(){return m`<form @submit=${this.dispatchSubmitEvent}><div class=form-control-wrap><input type=text class=form-control name=online-media-url placeholder=${this.placeholder} required><div class=form-text>${this.allowedExtensionsHelpText}<br><ul class=badge-list>${this.allowedExtensions.split(",").map(e=>m`<li><span class="badge badge-secondary">${e.trim().toUpperCase()}</span></li>`)}</ul></div></div></form>`}dispatchSubmitEvent(e){e.preventDefault();const n=new FormData(e.target),o=Object.fromEntries(n);this.dispatchEvent(new CustomEvent("typo3:formengine:online-media-added",{detail:o}))}};s([d({type:String})],r.prototype,"placeholder",void 0),s([d({type:String,attribute:"help-text"})],r.prototype,"allowedExtensionsHelpText",void 0),s([d({type:String,attribute:"extensions"})],r.prototype,"allowedExtensions",void 0),r=s([c("typo3-backend-formengine-online-media-form")],r);export{r as OnlineMediaFormElement};
@@ -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 s from"@typo3/core/document-service.js";import{selector as t}from"@typo3/core/literals.js";class i extends HTMLElement{constructor(){super(...arguments),this.element=null,this.passwordPolicyInfo=null,this.passwordPolicySet=!1}async connectedCallback(){if(this.element!==null)return;const e=this.getAttribute("recordFieldId");e!==null&&(await s.ready(),this.element=this.querySelector(t`#${e}`),this.element&&(this.passwordPolicyInfo=this.querySelector(t`#password-policy-info-${this.element.id}`),this.passwordPolicySet=(this.getAttribute("passwordPolicy")||"")!=="",this.registerEventHandler()))}registerEventHandler(){this.passwordPolicySet&&this.passwordPolicyInfo!==null&&(this.element.addEventListener("focusin",()=>{this.passwordPolicyInfo.classList.remove("hidden")}),this.element.addEventListener("focusout",()=>{this.passwordPolicyInfo.classList.add("hidden")}))}}window.customElements.define("typo3-formengine-element-password",i);
@@ -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 o from"@typo3/core/event/regular-event.js";import m from"@typo3/core/document-service.js";import d from"@typo3/backend/form-engine.js";import{selector as f}from"@typo3/core/literals.js";class u{constructor(){this.initialize=(c,t)=>{const n=document.querySelector(c);n!==null&&(t=t||{},new o("change",l=>{const e=l.target,i=e.parentElement.querySelector(".input-group-icon");i!==null&&(i.innerHTML=e.options[e.selectedIndex].dataset.icon);const s=e.closest(".t3js-formengine-field-item").querySelector(".t3js-forms-select-single-icons");if(s!==null){const r=s.querySelector(".form-wizard-icon-list-item a.active");r!==null&&r.classList.remove("active");const a=s.querySelector(f`[data-select-index="${e.selectedIndex.toString(10)}"]`);a!==null&&a.closest(".form-wizard-icon-list-item a").classList.add("active")}}).bindTo(n),t.onChange instanceof Array&&new o("change",()=>d.processOnFieldChange(t.onChange)).bindTo(n),new o("click",(l,e)=>{const i=e.closest(".t3js-forms-select-single-icons").querySelector(".form-wizard-icon-list-item a.active");i!==null&&i.classList.remove("active"),n.selectedIndex=parseInt(e.dataset.selectIndex,10),n.dispatchEvent(new Event("change")),e.closest(".form-wizard-icon-list-item a").classList.add("active")}).delegateTo(n.closest(".form-control-wrap"),".t3js-forms-select-single-icons .form-wizard-icon-list-item a:not(.active)"))}}initializeOnReady(c,t){m.ready().then(()=>{this.initialize(c,t)})}}var g=new u;export{g as default};
@@ -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{AbstractSortableSelectItems as r}from"@typo3/backend/form-engine/element/abstract-sortable-select-items.js";import s from"@typo3/core/document-service.js";import a from"@typo3/backend/form-engine.js";import o from"@typo3/backend/form-engine/element/extra/select-box-filter.js";import c from"@typo3/core/event/regular-event.js";import d from"@typo3/backend/utility.js";class m extends r{constructor(e,t){super(),this.selectedOptionsElement=null,this.availableOptionsElement=null,s.ready().then(l=>{this.selectedOptionsElement=l.getElementById(e),this.availableOptionsElement=l.getElementById(t),!(this.selectedOptionsElement===null||this.availableOptionsElement===null)&&this.registerEventHandler()})}registerEventHandler(){this.registerSortableEventHandler(this.selectedOptionsElement),this.registerKeyboardEvents(),this.availableOptionsElement.addEventListener("click",e=>{const t=e.currentTarget;this.handleOptionChecked(t)}),new o(this.availableOptionsElement)}handleOptionChecked(e){const t=e.dataset.relatedfieldname;if(t){const l=d.trimExplode(",",e.dataset?.exclusivevalues??""),n=e.querySelectorAll("option:checked");n.length>0&&n.forEach(i=>{a.setSelectOptionFromExternalSource(t,i.value,i.textContent,i.getAttribute("title"),l,i)})}}registerKeyboardEvents(){new c("keydown",e=>{const t=e.currentTarget;e.code==="Enter"&&(e.preventDefault(),this.handleOptionChecked(t))}).bindTo(this.availableOptionsElement)}}export{m as default};
@@ -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 s from"@typo3/core/event/regular-event.js";import m from"@typo3/core/document-service.js";import d from"@typo3/backend/form-engine.js";import{selector as f}from"@typo3/core/literals.js";class u{constructor(){this.initialize=(o,t)=>{const i=document.querySelector(o);i!==null&&(t=t||{},new s("change",l=>{const e=l.target,n=e.parentElement.querySelector(".input-group-icon");n!==null&&(n.innerHTML=e.options[e.selectedIndex].dataset.icon);const c=e.closest(".t3js-formengine-field-item").querySelector(".t3js-forms-select-single-icons");if(c!==null){const r=c.querySelector(".form-wizard-icon-list-item button.active, .form-wizard-icon-list-item a.active");r!==null&&r.classList.remove("active");const a=c.querySelector(f`[data-select-index="${e.selectedIndex.toString(10)}"]`);a!==null&&a.closest(".form-wizard-icon-list-item button, .form-wizard-icon-list-item a").classList.add("active")}}).bindTo(i),t.onChange instanceof Array&&new s("change",()=>d.processOnFieldChange(t.onChange)).bindTo(i),new s("click",(l,e)=>{const n=e.closest(".t3js-forms-select-single-icons").querySelector(".form-wizard-icon-list-item button.active, .form-wizard-icon-list-item a.active");n!==null&&n.classList.remove("active"),i.selectedIndex=parseInt(e.dataset.selectIndex,10),i.dispatchEvent(new Event("change")),e.closest(".form-wizard-icon-list-item button, .form-wizard-icon-list-item a").classList.add("active")}).delegateTo(i.closest(".form-control-wrap"),".t3js-forms-select-single-icons .form-wizard-icon-list-item button:not(.active), .t3js-forms-select-single-icons .form-wizard-icon-list-item a:not(.active)"))}}initializeOnReady(o,t){m.ready().then(()=>{this.initialize(o,t)})}}var g=new u;export{g as default};
@@ -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/form-engine/element/select-tree.js";import"@typo3/backend/form-engine/element/select-tree-toolbar.js";import"@typo3/backend/element/icon-element.js";import n from"@typo3/core/document-service.js";import s from"@typo3/backend/form-engine.js";class o{constructor(e,t,i,r){if(this.recordField=null,this.tree=null,this.selectNode=a=>{const d=a.detail.node;this.updateAncestorsIndeterminateState(d),this.calculateIndeterminate(this.tree.nodes),this.saveCheckboxes(),this.tree.setup.input.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},this.loadDataAfter=a=>{this.tree.nodes=a.detail.nodes.map(d=>(d.__indeterminate=!1,d)),this.calculateIndeterminate(this.tree.nodes)},this.saveCheckboxes=()=>{typeof this.recordField>"u"||(this.recordField.value=this.tree.getSelectedNodes().map(a=>a.identifier).join(","))},i instanceof Function)throw new Error("Function `callback` is not supported anymore since TYPO3 v12.0");n.ready().then(()=>{this.initialize(e,t,r)})}initialize(e,t,i){this.recordField=document.getElementById(t);const r=document.getElementById(e);this.tree=document.createElement("typo3-backend-form-selecttree"),this.tree.addEventListener("typo3:tree:nodes-prepared",this.loadDataAfter),this.tree.addEventListener("typo3:tree:node-selected",this.selectNode),i instanceof Array&&this.tree.addEventListener("typo3:tree:node-selected",()=>{s.processOnFieldChange(i)});const a={id:e,dataUrl:this.generateRequestUrl(),readOnlyMode:parseInt(this.recordField.dataset.readOnly,10)===1,input:this.recordField,exclusiveNodesIdentifiers:this.recordField.dataset.treeExclusiveKeys,validation:JSON.parse(this.recordField.dataset.formengineValidationRules)[0],expandUpToLevel:this.recordField.dataset.treeExpandUpToLevel,unselectableElements:[]};this.tree.addEventListener("tree:initialized",()=>{if(this.recordField.dataset.treeShowToolbar){const d=document.createElement("typo3-backend-form-selecttree-toolbar");d.tree=this.tree,this.tree.prepend(d)}}),this.tree.setup=a,r.append(this.tree)}generateRequestUrl(){const e={tableName:this.recordField.dataset.tablename,fieldName:this.recordField.dataset.fieldname,uid:this.recordField.dataset.uid,defaultValues:this.recordField.dataset.defaultvalues,overrideValues:this.recordField.dataset.overridevalues,recordTypeValue:this.recordField.dataset.recordtypevalue,dataStructureIdentifier:this.recordField.dataset.datastructureidentifier,flexFormSheetName:this.recordField.dataset.flexformsheetname,flexFormFieldName:this.recordField.dataset.flexformfieldname,flexFormContainerName:this.recordField.dataset.flexformcontainername,flexFormContainerIdentifier:this.recordField.dataset.flexformcontaineridentifier,flexFormContainerFieldName:this.recordField.dataset.flexformcontainerfieldname,flexFormSectionContainerIsNew:this.recordField.dataset.flexformsectioncontainerisnew,command:this.recordField.dataset.command};return TYPO3.settings.ajaxUrls.record_tree_data+"&"+new URLSearchParams(e).toString()}updateAncestorsIndeterminateState(e){let t=!1;e.__treeParents.forEach(i=>{const r=this.tree.getNodeByTreeIdentifier(i);r.__indeterminate=e.checked||e.__indeterminate||t,t=r.checked||r.__indeterminate||e.checked||e.__indeterminate})}calculateIndeterminate(e){e.forEach(t=>{(t.checked||t.__indeterminate)&&t.__treeParents&&t.__treeParents.length>0&&t.__treeParents.forEach(i=>{const r=this.tree.getNodeByTreeIdentifier(i);r.__indeterminate=!0})})}}export{o as SelectTreeElement};
@@ -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 p}from"lit";import{customElement as h}from"lit/decorators.js";import s from"~labels/backend.alt_doc";var f=function(n,e,t,c){var i=arguments.length,l=i<3?e:c===null?c=Object.getOwnPropertyDescriptor(e,t):c,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(n,e,t,c);else for(var o=n.length-1;o>=0;o--)(a=n[o])&&(l=(i<3?a(l):i>3?a(e,t,l):a(e,t))||l);return i>3&&l&&Object.defineProperty(e,t,l),l};let r=class extends d{constructor(){super(...arguments),this.settings={collapseAllBtn:"collapse-all-btn",expandAllBtn:"expand-all-btn",searchInput:"search-input",toggleHideUnchecked:"hide-unchecked-btn"},this.hideUncheckedState=!1}createRenderRoot(){return this}render(){return p`<div class=tree-toolbar><div class=tree-toolbar__buttons><input type=search autocomplete=off class="form-control ${this.settings.searchInput}" placeholder=${s.get("tcatree.findItem")} @input=${e=>this.filter(e)}><div class=btn-group><button type=button class="btn btn-default ${this.settings.expandAllBtn}" title=${s.get("tcatree.expandAll")} @click=${()=>this.expandAll()}><typo3-backend-icon identifier=apps-pagetree-category-expand-all size=small></typo3-backend-icon></button> <button type=button class="btn btn-default ${this.settings.collapseAllBtn}" title=${s.get("tcatree.collapseAll")} @click=${e=>this.collapseAll(e)}><typo3-backend-icon identifier=apps-pagetree-category-collapse-all size=small></typo3-backend-icon></button> <button type=button class="btn btn-default ${this.settings.toggleHideUnchecked}" title=${s.get("tcatree.toggleHideUnchecked")} @click=${()=>this.toggleHideUnchecked()}><typo3-backend-icon identifier=apps-pagetree-category-toggle-hide-checked size=small></typo3-backend-icon></button></div></div></div>`}collapseAll(e){e.preventDefault(),this.tree.nodes.forEach(t=>{t.__parents.length&&this.tree.hideChildren(t)})}expandAll(){this.tree.expandAll()}filter(e){const t=e.target;this.tree.filter(t.value.trim())}toggleHideUnchecked(){this.hideUncheckedState=!this.hideUncheckedState,this.hideUncheckedState?this.tree.nodes.forEach(e=>{e.checked?(this.tree.showParents(e),e.expanded=!0,e.__hidden=!1):(e.expanded=!1,e.__hidden=!0)}):this.tree.nodes.forEach(e=>e.__hidden=!1)}};r=f([h("typo3-backend-form-selecttree-toolbar")],r);export{r as SelectTreeToolbar};
@@ -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{html as a}from"lit";import{Tree as f}from"@typo3/backend/tree/tree.js";import{state as h,customElement as u}from"lit/decorators.js";var o=function(r,e,t,s){var l=arguments.length,n=l<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,e,t,s);else for(var d=r.length-1;d>=0;d--)(i=r[d])&&(n=(l<3?i(n):l>3?i(e,t,n):i(e,t))||n);return l>3&&n&&Object.defineProperty(e,t,n),n};let c=class extends f{constructor(){super(),this.settings={unselectableElements:[],exclusiveNodesIdentifiers:"",validation:{},readOnlyMode:!1,showIcons:!0,width:300,dataUrl:"",defaultProperties:{},expandUpToLevel:null},this.exclusiveSelectedNode=null,this.addEventListener("typo3:tree:nodes-prepared",this.prepareLoadedNodes)}expandAll(){this.nodes.forEach(e=>{this.showChildren(e)})}selectNode(e,t=!0){if(!this.isNodeSelectable(e))return;const s=e.checked;this.handleExclusiveNodeSelection(e),!s&&this.settings.validation.maxItems==1&&this.getSelectedNodes().length>0&&(this.getSelectedNodes()[0].checked=!1),!(this.settings.validation&&this.settings.validation.maxItems&&!s&&this.getSelectedNodes().length>=this.settings.validation.maxItems)&&(e.checked=!s,this.dispatchEvent(new CustomEvent("typo3:tree:node-selected",{detail:{node:e,propagate:t}})))}filter(e){const t=[];this.searchTerm=e,this.nodes.length&&(this.nodes[0].__expanded=!1);const s=this.nodes[0],l=new RegExp(e,"i");this.nodes.forEach(i=>{i!==s&&(i.__expanded=!1,i.__hidden=!0,l.test(i.name)&&t.push(i))}),t.forEach(i=>{i.__hidden=!1,this.showParents(i)}),this.nodes.filter(i=>t.some(d=>i.__parents.includes(d.identifier))).forEach(i=>{i.__hidden=!1})}showParents(e){if(e.__parents.length===0)return;const t=this.nodes.find(s=>s.identifier===e.__parents.at(-1));t.__hidden=!1,t.__expanded=!0,this.showParents(t)}isNodeSelectable(e){return!this.settings.readOnlyMode&&this.settings.unselectableElements.indexOf(e.identifier)===-1}createNodeContent(e){return a`${this.renderCheckbox(e)} ${super.createNodeContent(e)}`}renderCheckbox(e){const t=!!e.checked;let s="actions-square";return!this.isNodeSelectable(e)&&!t?s="actions-minus-circle":e.checked?s="actions-check-square":e.__indeterminate&&!t&&(s="actions-minus-square"),a`<span class=node-select> <typo3-backend-icon identifier=${s} size=small></typo3-backend-icon> </span>`}prepareLoadedNodes(e){const t=e.detail.nodes;e.detail.nodes=t.map(s=>(s.selectable===!1&&this.settings.unselectableElements.push(s.identifier),s))}handleExclusiveNodeSelection(e){const t=this.settings.exclusiveNodesIdentifiers.split(",");this.settings.exclusiveNodesIdentifiers.length&&e.checked===!1&&(t.indexOf(""+e.identifier)>-1?(this.resetSelectedNodes(),this.exclusiveSelectedNode=e):t.indexOf(""+e.identifier)===-1&&this.exclusiveSelectedNode&&(this.exclusiveSelectedNode.checked=!1,this.exclusiveSelectedNode=null))}};o([h()],c.prototype,"settings",void 0),o([h()],c.prototype,"exclusiveSelectedNode",void 0),c=o([u("typo3-backend-form-selecttree")],c);export{c as SelectTree};
@@ -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 u from"@typo3/core/ajax/ajax-request.js";import p from"@typo3/core/document-service.js";import h from"@typo3/core/event/debounce-event.js";import c from"@typo3/core/event/regular-event.js";var a;(function(n){n.toggleButton=".t3js-form-field-slug-toggle",n.recreateButton=".t3js-form-field-slug-recreate",n.inputField=".t3js-form-field-slug-input",n.readOnlyField=".t3js-form-field-slug-readonly",n.hiddenField=".t3js-form-field-slug-hidden"})(a||(a={}));var o;(function(n){n.AUTO="auto",n.RECREATE="recreate",n.MANUAL="manual"})(o||(o={}));class f{constructor(t,i){this.options=null,this.fullElement=null,this.manuallyChanged=!1,this.readOnlyField=null,this.inputField=null,this.hiddenField=null,this.request=null,this.fieldsToListenOn={},this.options=i,this.fieldsToListenOn=this.options.listenerFieldNames||{},p.ready().then(l=>{this.fullElement=l.querySelector(t),this.inputField=this.fullElement.querySelector(a.inputField),this.readOnlyField=this.fullElement.querySelector(a.readOnlyField),this.hiddenField=this.fullElement.querySelector(a.hiddenField),this.registerEvents()})}registerEvents(){const t=Object.values(this.getAvailableFieldsForProposalGeneration()).map(e=>e.dataset.slugSelector),i=this.fullElement.querySelector(a.recreateButton);t.length>0&&this.options.command==="new"&&new h("input",()=>{this.manuallyChanged||this.sendSlugProposal(o.AUTO)}).delegateTo(document,t.join(",")),t.length>0||this.hasPostModifiersDefined()?new c("click",e=>{e.preventDefault(),this.readOnlyField.classList.contains("hidden")&&(this.readOnlyField.classList.toggle("hidden",!1),this.inputField.classList.toggle("hidden",!0)),this.sendSlugProposal(o.RECREATE)}).bindTo(i):(i.classList.add("disabled"),i.disabled=!0),new h("input",()=>{this.manuallyChanged=!0,this.sendSlugProposal(o.MANUAL)}).bindTo(this.inputField);const l=this.fullElement.querySelector(a.toggleButton);new c("click",e=>{e.preventDefault();const s=this.readOnlyField.classList.contains("hidden");if(this.readOnlyField.classList.toggle("hidden",!s),this.inputField.classList.toggle("hidden",s),!s){this.hiddenField.value=this.inputField.value;return}this.inputField.value!==this.readOnlyField.value?this.readOnlyField.value=this.inputField.value:(this.manuallyChanged=!1,this.fullElement.querySelector(".t3js-form-proposal-accepted").classList.add("hidden"),this.fullElement.querySelector(".t3js-form-proposal-different").classList.add("hidden")),this.hiddenField.value=this.readOnlyField.value}).bindTo(l)}sendSlugProposal(t){const i={};t===o.AUTO||t===o.RECREATE?(Object.entries(this.getAvailableFieldsForProposalGeneration()).forEach(l=>{i[l[0]]=l[1].value}),this.options.includeUidInValues===!0&&(i.uid=this.options.recordId.toString())):i.manual=this.inputField.value,this.request instanceof u&&this.request.abort(),this.request=new u(TYPO3.settings.ajaxUrls.record_slug_suggest),this.request.post({values:i,mode:t,tableName:this.options.tableName,pageId:this.options.pageId,parentPageId:this.options.parentPageId,recordId:this.options.recordId,language:this.options.language,fieldName:this.options.fieldName,command:this.options.command,signature:this.options.signature}).then(async l=>{const e=await l.resolve(),s="/"+e.proposal.replace(/^\//,""),d=this.fullElement.querySelector(".t3js-form-proposal-accepted"),r=this.fullElement.querySelector(".t3js-form-proposal-different");d.classList.toggle("hidden",e.hasConflicts),r.classList.toggle("hidden",!e.hasConflicts),(e.hasConflicts?r:d).querySelector("span").innerText=s,this.hiddenField.value!==e.proposal&&this.fullElement.querySelector("input[data-formengine-input-name]").dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),t===o.AUTO||t===o.RECREATE?(this.readOnlyField.value=e.proposal,this.hiddenField.value=e.proposal,this.inputField.value=e.proposal):this.hiddenField.value=e.proposal}).finally(()=>{this.request=null})}getAvailableFieldsForProposalGeneration(){const t={};for(const[i,l]of Object.entries(this.fieldsToListenOn)){const e=['[data-formengine-input-name="'+l+'"]','[name="'+l+'"]'];let s,d="";e.some(r=>(s=document.querySelector(r),d=r,s!==null)),s!==null&&(s.dataset.slugSelector=d,t[i]=s)}return t}hasPostModifiersDefined(){return Array.isArray(this.options.config.generatorOptions.postModifiers)&&this.options.config.generatorOptions.postModifiers.length>0}}export{f as default};
@@ -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 f}from"lit/decorators.js";import{LitElement as m,html as r,css as g}from"lit";import"@typo3/backend/form-engine/element/suggest/result-item.js";import h from"~labels/backend.alt_doc";var a=function(s,e,t,l){var o=arguments.length,n=o<3?e:l===null?l=Object.getOwnPropertyDescriptor(e,t):l,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(s,e,t,l);else for(var u=s.length-1;u>=0;u--)(i=s[u])&&(n=(o<3?i(n):o>3?i(e,t,n):i(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};let c=class extends m{constructor(){super(...arguments),this.results=null}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){this.removeEventListener("keydown",this.handleKeyDown),super.disconnectedCallback()}createRenderRoot(){return this}render(){let e;return this.results!==null&&(this.results.length===0?e=r`<div class="alert alert-info">${h.get("search.no_records_found")}</div>`:e=r`${this.results.map(t=>this.renderResultItem(t))}`),r`<typo3-backend-formengine-suggest-result-list>${e}</typo3-backend-formengine-suggest-result-list>`}renderResultItem(e){return r`<typo3-backend-formengine-suggest-result-item tabindex=1 icon=${JSON.stringify(e.icon)} uid=${e.uid} table=${e.table} label=${e.label} path=${e.path}></typo3-backend-formengine-suggest-result-item>`}handleKeyDown(e){if(e.preventDefault(),e.key==="Escape"){this.closest(".t3-form-suggest-container").querySelector('input[type="search"]').focus(),this.hidden=!0;return}if(!["ArrowDown","ArrowUp"].includes(e.key)||document.activeElement.tagName.toLowerCase()!=="typo3-backend-formengine-suggest-result-item")return;let t;e.key==="ArrowDown"?t=document.activeElement.nextElementSibling:(t=document.activeElement.previousElementSibling,t===null&&(t=this.closest(".t3-form-suggest-container").querySelector('input[type="search"]'))),t!==null&&t.focus()}};a([p({type:Object})],c.prototype,"results",void 0),c=a([f("typo3-backend-formengine-suggest-result-container")],c);let d=class extends m{static{this.styles=g`:host{display:block}`}render(){return r`<slot></slot>`}};d=a([f("typo3-backend-formengine-suggest-result-list")],d);export{c as ResultContainer,d as ResultList};
@@ -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{html as u}from"lit";import{property as l,customElement as m}from"lit/decorators.js";import{PseudoButtonLitElement as d}from"@typo3/backend/element/pseudo-button.js";import"@typo3/backend/element/icon-element.js";var s=function(c,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(c,e,t,n);else for(var p=c.length-1;p>=0;p--)(a=c[p])&&(o=(r<3?a(o):r>3?a(e,t,o):a(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o};let i=class extends d{constructor(){super(),this.addEventListener("blur",this.onBlur)}buttonActivated(e){this.dispatchItemChosenEvent(e.currentTarget)}createRenderRoot(){return this}render(){return u`<div class=formengine-suggest-result-item-icon><typo3-backend-icon title=${this.icon.title} identifier=${this.icon.identifier} overlay=${this.icon.overlay} size=small></typo3-backend-icon></div><div class=formengine-suggest-result-item-label>${this.label} <small>[${this.uid}] ${this.path}</small></div>`}onBlur(e){let t=!0;const n=e.relatedTarget,r=this.closest("typo3-backend-formengine-suggest-result-container");n?.tagName.toLowerCase()==="typo3-backend-formengine-suggest-result-item"&&(t=!1),n?.matches('input[type="search"]')&&r.contains(n)&&(t=!1),r.hidden=t}dispatchItemChosenEvent(e){e.closest("typo3-backend-formengine-suggest-result-container").dispatchEvent(new CustomEvent("typo3:formengine:suggest-item-chosen",{detail:{element:e}}))}};s([l({type:Object})],i.prototype,"icon",void 0),s([l({type:Number})],i.prototype,"uid",void 0),s([l({type:String})],i.prototype,"table",void 0),s([l({type:String})],i.prototype,"label",void 0),s([l({type:String})],i.prototype,"path",void 0),i=s([m("typo3-backend-formengine-suggest-result-item")],i);export{i as ResultItem};
@@ -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 o from"@typo3/core/document-service.js";import n from"@typo3/core/event/regular-event.js";import{selector as a}from"@typo3/core/literals.js";import{MultiRecordSelectionSelectors as m}from"@typo3/backend/multi-record-selection.js";var l;(function(s){s.none="none",s.select="select",s.modify="modify"})(l||(l={}));class r extends HTMLElement{constructor(){super(...arguments),this.selectStateField=null,this.modifyStateField=null}async connectedCallback(){await o.ready(),this.selectStateField=this.querySelector(a`input[name=${this.getAttribute("selectStateFieldName")||""}]`),this.modifyStateField=this.querySelector(a`input[name=${this.getAttribute("modifyStateFieldName")||""}]`),!(this.selectStateField===null||this.modifyStateField===null)&&this.registerEventHandler()}registerEventHandler(){new n("change",e=>{this.handleSingleItemChange(e.target)}).delegateTo(this.querySelector("table"),".t3js-table-permissions-item"),new n("multiRecordSelection:checkbox:state:changed",e=>{const t=e.target.name;if(this.querySelectorAll(a`input[name="${t}"]:checked`).length===0){const i=this.querySelector(a`input[name="${t}"]`);i.value=l.none,this.handleSingleItemChange(i),this.querySelector(a`input[name="${t}"][value="${l.none}"]`).checked=!0}}).delegateTo(this.querySelector("table"),m.checkboxSelector)}handleSingleItemChange(e){switch(e.value){case l.select:this.addItem(e.dataset.table,this.selectStateField),this.removeItem(e.dataset.table,this.modifyStateField);break;case l.modify:this.addItem(e.dataset.table,this.selectStateField),this.addItem(e.dataset.table,this.modifyStateField);break;case l.none:default:this.removeItem(e.dataset.table,this.selectStateField),this.removeItem(e.dataset.table,this.modifyStateField);break}}removeItem(e,t){t.value=(t.value.length?t.value.split(","):[]).filter(i=>i!==e).join(",")}addItem(e,t){const i=t.value.length?t.value.split(","):[];i.includes(e)||(i.push(e),t.value=i.join(","))}}window.customElements.define("typo3-formengine-element-tablepermission",r);
File diff suppressed because one or more lines are too long
@@ -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 e from"@typo3/core/document-service.js";import{Resizable as t}from"@typo3/backend/form-engine/element/modifier/resizable.js";import{Tabbable as n}from"@typo3/backend/form-engine/element/modifier/tabbable.js";class l extends HTMLElement{constructor(){super(...arguments),this.element=null}async connectedCallback(){this.element===null&&(await e.ready(),this.element=document.getElementById(this.getAttribute("recordFieldId")||""),this.element&&(t.enable(this.element),n.enable(this.element)))}}window.customElements.define("typo3-formengine-element-text",l);
@@ -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{Resizable as t}from"@typo3/backend/form-engine/element/modifier/resizable.js";import{Tabbable as l}from"@typo3/backend/form-engine/element/modifier/tabbable.js";import m from"@typo3/core/document-service.js";class n{constructor(e){this.element=null,m.ready().then(()=>{this.element=document.getElementById(e),t.enable(this.element),l.enable(this.element)})}}export{n as default};