TYPO3 v15 dev-main snapshot ()
This commit is contained in:
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{LitElement as f,html as r,nothing as p}from"lit";import{property as u,state as g,customElement as b}from"lit/decorators.js";import{until as h}from"lit/directives/until.js";import"@typo3/backend/element/icon-element.js";import{copyToClipboard as v}from"@typo3/backend/copy-to-clipboard.js";import $ from"@typo3/backend/notification.js";import{markdown as w}from"@typo3/core/directive/markdown.js";import k from"@typo3/core/ajax/ajax-request.js";import{SettingsMode as c,sanitizeSettingsMode as A}from"@typo3/backend/settings/enum/settings-mode.enum.js";import y from"~labels/backend.settingseditor";import S from"~labels/backend.copytoclipboard";import"bootstrap";var d=function(l,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(l,e,t,i);else for(var m=l.length-1;m>=0;m--)(s=l[m])&&(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};let a=class extends f{constructor(){super(...arguments),this.mode=c.basic,this.hasChange=!1,this.typeElement=null}createRenderRoot(){return this}render(){const{value:e,systemDefault:t,definition:i}=this.setting;return r`<div class=${`settings-item settings-item-${i.type} ${this.hasChange?"has-change":""}`} tabindex=0 data-status=${JSON.stringify(e)===JSON.stringify(t)?"none":"modified"}><div class=settings-item-indicator></div><div class=settings-item-title><label for=${`setting-${i.key}`} class=settings-item-label>${i.label}</label><div class=settings-item-description>${w(i.description??"","minimal")}</div>${this.mode===c.advanced?r`<div class=settings-item-key>${i.key}</div>`:p}</div><div class=settings-item-control>${h(this.renderField(),p)}</div><div class=settings-item-message></div><div class=settings-item-actions>${this.renderActions()}</div></div>`}renderField(){return this.typeElement!==null?(this.updateFieldAttributes(this.typeElement),this.typeElement):(async()=>{const{typeImplementation:e}=this.setting,t=await import(e);if(!("componentName"in t))throw new Error(`module ${e} is missing the "componentName" export`);const i=document.createElement(t.componentName);return i.addEventListener("typo3:setting:changed",o=>{this.hasChange=JSON.stringify(this.setting.value)!==JSON.stringify(o.detail.value)}),this.updateFieldAttributes(i),this.typeElement=i,i})()}updateFieldAttributes(e){const{definition:t,value:i}=this.setting,o={key:t.key,formid:`setting-${t.key}`,name:`settings[${t.key}]`,value:Array.isArray(i)?JSON.stringify(i):String(i),debug:this.mode===c.advanced,readonly:t.readonly,enum:Object.keys(t.enum).length>0?JSON.stringify(t.enum):!1,default:Array.isArray(t.default)?JSON.stringify(t.default):String(t.default),options:JSON.stringify(t.options)};for(const[n,s]of Object.entries(o)){if(typeof s=="boolean"){s&&!e.hasAttribute(n)&&e.setAttribute(n,""),!s&&e.hasAttribute(n)&&e.removeAttribute(n);continue}e.getAttribute(n)!==s&&e.setAttribute(n,s)}}renderActions(){const{definition:e}=this.setting;return r`<div class=dropdown><button class=dropdown-toggle type=button data-bs-toggle=dropdown aria-expanded=false><typo3-backend-icon identifier=actions-cog size=small></typo3-backend-icon><span class=visually-hidden>More actions</span></button><ul class=dropdown-menu><li><button class="dropdown-item dropdown-item-spaced" type=button ?disabled=${e.readonly} @click=${()=>this.setToDefaultValue()}><typo3-backend-icon identifier=actions-undo size=small></typo3-backend-icon>${y.get("settingseditor.edit.resetSetting")}</button></li>${this.mode===c.advanced?r`<li><hr class=dropdown-divider></li><li><typo3-copy-to-clipboard text=${e.key} class="dropdown-item dropdown-item-spaced"><typo3-backend-icon identifier=actions-clipboard size=small></typo3-backend-icon>${y.get("settingseditor.edit.copySettingsIdentifier")}</typo3-copy-to-clipboard></li>${this.dumpuri?r`<li><button class="dropdown-item dropdown-item-spaced" type=button @click=${()=>this.copyAsYaml()}><typo3-backend-icon identifier=actions-clipboard-paste size=small></typo3-backend-icon>${y.get("settingseditor.edit.copyAsYaml")}</button></li>`:p}`:p}</ul></div>`}setToDefaultValue(){this.typeElement&&(this.typeElement.value=this.setting.systemDefault,this.typeElement.requestUpdate("value"))}async copyAsYaml(){const e=new FormData(this.typeElement.form),t=`settings[${this.setting.definition.key}]`,i=e.get(t),o=new FormData;o.append("specificSetting",this.setting.definition.key),o.append(t,i);const s=await(await new k(this.dumpuri).post(o)).resolve();typeof s.yaml=="string"?v(s.yaml):(console.warn("Value can not be copied to clipboard.",typeof s.yaml),$.error(S.get("copyToClipboard.error")))}};d([u({type:Object})],a.prototype,"setting",void 0),d([u({type:String})],a.prototype,"dumpuri",void 0),d([u({type:String,converter:A})],a.prototype,"mode",void 0),d([g()],a.prototype,"hasChange",void 0),a=d([b("typo3-backend-editable-setting")],a);export{a as EditableSettingElement};
|
||||
@@ -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!
|
||||
*/
|
||||
var a;(function(i){i.minimal="minimal",i.basic="basic",i.advanced="advanced"})(a||(a={}));function n(i){return Object.values(a).includes(i)?i:a.basic}export{a as SettingsMode,n as sanitizeSettingsMode};
|
||||
@@ -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}from"lit";import{defaultConverter as v}from"@lit/reactive-element";import{property as a}from"lit/decorators.js";var i=function(u,t,e,r){var s=arguments.length,l=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(u,t,e,r);else for(var b=u.length-1;b>=0;b--)(c=u[b])&&(l=(s<3?c(l):s>3?c(t,e,l):c(t,e))||l);return s>3&&l&&Object.defineProperty(t,e,l),l};const n=Symbol("internals"),h=Symbol("privateInternals"),p=Symbol("getFormValue"),d=Symbol("getFormState");class o extends f{constructor(){super(...arguments),this.readonly=!1,this.debug=!1}static{this.formAssociated=!0}createRenderRoot(){return this}get[n](){return this[h]||(this[h]=this.attachInternals()),this[h]}get form(){return this[n].form}get labels(){return this[n].labels}get name(){return this.getAttribute("name")??""}set name(t){this.setAttribute("name",t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}attributeChangedCallback(t,e,r){if(t==="name"||t==="disabled"){const s=t==="disabled"?e!==null:e;this.requestUpdate(t,s);return}super.attributeChangedCallback(t,e,r)}requestUpdate(t,e,r){super.requestUpdate(t,e,r),t==="value"&&(this.dispatchEvent(new CustomEvent("typo3:setting:changed",{detail:{value:this.value}})),this[n].setFormValue(this[p](),this[d]()))}formDisabledCallback(t){this.disabled=t}formResetCallback(){const t=this.value,e=this.getAttribute("value");this.attributeChangedCallback("value",this.valueToString(t),null),this.attributeChangedCallback("value",null,e)}formStateRestoreCallback(t){if(typeof t=="string")this.attributeChangedCallback("value",this.valueToString(this.value),null),this.attributeChangedCallback("value",null,t);else throw new Error(`formStateRestoreCallback() needs to be implemented for <${this.localName}> for state type "${typeof t}"`)}[d](){return this[p]()}[p](){return this.valueToString(this.value)}valueToString(t){const r=this.constructor.getPropertyOptions("value");return(typeof r.converter=="object"&&typeof r.converter?.toAttribute=="function"?r.converter.toAttribute:v.toAttribute)(t,r.type)}}i([a({type:String})],o.prototype,"key",void 0),i([a({type:String})],o.prototype,"formid",void 0),i([a({type:Boolean})],o.prototype,"readonly",void 0),i([a({type:Object})],o.prototype,"enum",void 0),i([a({type:Boolean})],o.prototype,"debug",void 0),i([a({type:Object})],o.prototype,"options",void 0),i([a({noAccessor:!0})],o.prototype,"name",null),i([a({type:Boolean,noAccessor:!0})],o.prototype,"disabled",null);export{o as BaseElement,d as getFormState,p as getFormValue,n as internals};
|
||||
@@ -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 s,customElement as a}from"lit/decorators.js";import{BaseElement as h}from"@typo3/backend/settings/type/base.js";var m=function(e,t,r,n){var c=arguments.length,o=c<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var i=e.length-1;i>=0;i--)(l=e[i])&&(o=(c<3?l(o):c>3?l(t,r,o):l(t,r))||o);return c>3&&o&&Object.defineProperty(t,r,o),o};const f="typo3-backend-settings-type-bool";let p=class extends h{render(){return u`<div class="form-check form-check-type-toggle"><input type=checkbox id=${this.formid} class=form-check-input value=1 ?disabled=${this.readonly} .checked=${this.value} @change=${t=>this.value=t.target.checked}></div>`}};m([s({type:Boolean,converter:{toAttribute:e=>e?"1":"0",fromAttribute:e=>e==="1"||e==="true"}})],p.prototype,"value",void 0),p=m([a(f)],p);export{p as BoolTypeElement,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{html as m}from"lit";import{property as f,customElement as s}from"lit/decorators.js";import{BaseElement as d}from"@typo3/backend/settings/type/base.js";import"@typo3/backend/color-picker.js";import y from"@typo3/core/event/regular-event.js";var a=function(r,e,o,n){var l=arguments.length,t=l<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,o,n);else for(var u=r.length-1;u>=0;u--)(p=r[u])&&(t=(l<3?p(t):l>3?p(e,o,t):p(e,o))||t);return l>3&&t&&Object.defineProperty(e,o,t),t};const c="typo3-backend-settings-type-color";let i=class extends d{firstUpdated(){const e=this.getInputElement();e&&new y("blur",o=>{this.updateValue(o.target.value)}).bindTo(e)}updateValue(e){this.value=e}render(){return m`<typo3-backend-color-picker><input type=text id=${this.formid} class=form-control ?readonly=${this.readonly} .value=${this.value} @change=${e=>this.updateValue(e.target.value)}></typo3-backend-color-picker>`}getInputElement(){return this.querySelector("input")}};a([f({type:String})],i.prototype,"value",void 0),i=a([s(c)],i);export{i as ColorTypeElement,c 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{html as l,nothing as p}from"lit";import{property as f,customElement as d}from"lit/decorators.js";import{live as h}from"lit/directives/live.js";import{BaseElement as $}from"@typo3/backend/settings/type/base.js";var u=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var m=i.length-1;m>=0;m--)(s=i[m])&&(n=(r<3?s(n):r>3?s(e,t,n):s(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n};const c="typo3-backend-settings-type-int";let a=class extends ${handleChange(e){const t=e.target;t.reportValidity()&&(t instanceof HTMLInputElement?this.value=t.valueAsNumber:this.value=parseInt(t.value,10))}renderEnum(){return l`<select id=${this.formid} class=form-select ?readonly=${this.readonly} .value=${h(this.value)} @change=${this.handleChange}>${Object.entries(this.enum).map(([e,t])=>l`<option ?selected=${this.value.toString()===e} value=${e}>${t}${this.debug?l`[${e}]`:p}</option>`)}</select>`}render(){return typeof this.enum=="object"?this.renderEnum():l`<input type=number id=${this.formid} class=form-control ?readonly=${this.readonly} .value=${h(String(this.value))} required min=${this.options.min??p} max=${this.options.max??p} step=${this.options.step??p} @change=${this.handleChange}>`}};u([f({type:Number})],a.prototype,"value",void 0),a=u([d(c)],a);export{a as IntTypeElement,c 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{html as f,nothing as s}from"lit";import{property as c,customElement as h}from"lit/decorators.js";import{live as d}from"lit/directives/live.js";import{BaseElement as y}from"@typo3/backend/settings/type/base.js";var a=function(o,e,t,r){var i=arguments.length,n=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(o,e,t,r);else for(var l=o.length-1;l>=0;l--)(m=o[l])&&(n=(i<3?m(n):i>3?m(e,t,n):m(e,t))||n);return i>3&&n&&Object.defineProperty(e,t,n),n};const u="typo3-backend-settings-type-number";let p=class extends y{handleChange(e){const t=e.target;t.reportValidity()&&(this.value=t.valueAsNumber)}render(){return f`<input type=number id=${this.formid} class=form-control ?readonly=${this.readonly} .value=${d(this.value)} required min=${this.options.min??s} max=${this.options.max??s} step=${this.options.step??"0.01"} @change=${this.handleChange}>`}};a([c({type:Number})],p.prototype,"value",void 0),p=a([h(u)],p);export{p as NumberTypeElement,u 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{html as m,nothing as c}from"lit";import{property as u,customElement as g}from"lit/decorators.js";import{MessageUtility as y}from"@typo3/backend/utility/message-utility.js";import{BaseElement as h}from"@typo3/backend/settings/type/base.js";import d from"@typo3/backend/modal.js";import v from"~labels/backend.settingseditor";import"@typo3/backend/element/icon-element.js";var p=function(o,e,n,r){var i=arguments.length,t=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,e,n,r);else for(var l=o.length-1;l>=0;l--)(s=o[l])&&(t=(i<3?s(t):i>3?s(e,n,t):s(e,n))||t);return i>3&&t&&Object.defineProperty(e,n,t),t};const f="typo3-backend-settings-type-page";let a=class extends h{constructor(){super(...arguments),this.elementBrowserListener=e=>{if(!y.verifyOrigin(e.origin))throw"Denied message sent by "+e.origin;if(e.data.actionName==="typo3:elementBrowser:elementAdded"){if(typeof e.data.fieldName>"u")throw"fieldName not defined in message";if(typeof e.data.value>"u")throw"value not defined in message";this.value=e.data.value.split("_").pop()}}}render(){return m`<div class=input-grouped><input type=number id=${this.formid} class=form-control ?readonly=${this.readonly} .value=${this.value} @change=${e=>this.value=parseInt(e.target.value,10)}> ${this.canUseElementBrowser()?m`<button type=button class="btn btn-default" @click=${()=>this.openElementBrowser()}><typo3-backend-icon identifier=apps-pagetree-page size=small></typo3-backend-icon>${v.get("settingseditor.type.page.button")||"Select page"}</button>`:c}</div>`}canUseElementBrowser(){return top.TYPO3.settings?.Wizards?.elementBrowserUrl!==void 0}openElementBrowser(){const e="db",n=new URLSearchParams({mode:e,fieldReference:this.formid,allowedTypes:"pages"}),r=d.advanced({type:d.types.iframe,content:top.TYPO3.settings.Wizards.elementBrowserUrl+"&"+n.toString(),size:d.sizes.large});window.addEventListener("message",this.elementBrowserListener),r.addEventListener("typo3-modal-hide",()=>{window.removeEventListener("message",this.elementBrowserListener)})}};p([u({type:Number})],a.prototype,"value",void 0),a=p([g(f)],a);export{a as PageTypeElement,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{html as s,nothing as m}from"lit";import{property as f,customElement as d}from"lit/decorators.js";import{live as p}from"lit/directives/live.js";import{BaseElement as $}from"@typo3/backend/settings/type/base.js";var c=function(i,e,t,o){var r=arguments.length,n=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,e,t,o);else for(var h=i.length-1;h>=0;h--)(l=i[h])&&(n=(r<3?l(n):r>3?l(e,t,n):l(e,t))||n);return r>3&&n&&Object.defineProperty(e,t,n),n};const u="typo3-backend-settings-type-string";let a=class extends ${handleChange(e){const t=e.target;t.reportValidity()&&(this.value=t.value)}renderEnum(){return s`<select id=${this.formid} class=form-select ?readonly=${this.readonly} .value=${p(this.value)} @change=${this.handleChange}>${Object.entries(this.enum).map(([e,t])=>s`<option ?selected=${this.value===e} value=${e}>${t}${this.debug?s`[${e}]`:m}</option>`)}</select>`}render(){return typeof this.enum=="object"?this.renderEnum():s`<input type=text id=${this.formid} class=form-control ?readonly=${this.readonly} .value=${p(this.value)} minlength=${this.options.min??m} maxlength=${this.options.max??m} @change=${this.handleChange}>`}};c([f({type:String})],a.prototype,"value",void 0),a=c([d(u)],a);export{a as StringTypeElement,u 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{html as d}from"lit";import{property as p,customElement as b}from"lit/decorators.js";import{BaseElement as m}from"@typo3/backend/settings/type/base.js";import{live as f}from"lit/directives/live.js";var c=function(i,t,e,l){var n=arguments.length,o=n<3?t:l===null?l=Object.getOwnPropertyDescriptor(t,e):l,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,e,l);else for(var s=i.length-1;s>=0;s--)(a=i[s])&&(o=(n<3?a(o):n>3?a(t,e,o):a(t,e))||o);return n>3&&o&&Object.defineProperty(t,e,o),o};const u="typo3-backend-settings-type-stringlist";let r=class extends m{updateValue(t,e){const l=[...this.value];l[e]=t,this.value=l}addValue(t,e=""){this.value=this.value.toSpliced(t+1,0,e)}removeValue(t){this.value=this.value.toSpliced(t,1)}renderItem(t,e){return d`<tr><td width=99%><input id=${`${this.formid}${e>0?"-"+e:""}`} type=text class=form-control ?readonly=${this.readonly} .value=${f(t)} @change=${l=>this.updateValue(l.target.value,e)}></td><td><div class=btn-group role=group><button class="btn btn-default" type=button ?disabled=${this.readonly} @click=${()=>this.addValue(e)}><typo3-backend-icon identifier=actions-plus size=small></typo3-backend-icon></button> <button class="btn btn-default" type=button ?disabled=${this.readonly} @click=${()=>this.removeValue(e)}><typo3-backend-icon identifier=actions-delete size=small></typo3-backend-icon></button></div></td></tr>`}render(){const t=this.value||[];return t.length===0?d`<button id=${this.formid} class="btn btn-default" type=button ?disabled=${this.readonly} @click=${()=>this.addValue(0)}><typo3-backend-icon identifier=actions-plus size=small></typo3-backend-icon></button>`:d`<div class=form-control-wrap><div class=table-fit><table class="table table-hover"><tbody>${t.map((e,l)=>this.renderItem(e,l))}</tbody></table></div></div>`}};c([p({type:Array})],r.prototype,"value",void 0),r=c([b(u)],r);export{r as StringlistTypeElement,u 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{html as u,nothing as c}from"lit";import{property as f,customElement as h}from"lit/decorators.js";import{live as d}from"lit/directives/live.js";import{BaseElement as v}from"@typo3/backend/settings/type/base.js";var m=function(n,e,t,o){var l=arguments.length,r=l<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(n,e,t,o);else for(var a=n.length-1;a>=0;a--)(i=n[a])&&(r=(l<3?i(r):l>3?i(e,t,r):i(e,t))||r);return l>3&&r&&Object.defineProperty(e,t,r),r};const s="typo3-backend-settings-type-url";let p=class extends v{constructor(){super(...arguments),this.value=""}handleChange(e){const t=e.target;t.reportValidity()&&(this.value=t.value.trim())}render(){return u`<input type=url id=${this.formid} class=form-control .value=${d(this.value)} ?readonly=${this.readonly} pattern=${this.options.pattern??c} @change=${this.handleChange}>`}};m([f({type:String})],p.prototype,"value",void 0),p=m([h(s)],p);export{p as UrlTypeElement,s as componentName};
|
||||
Reference in New Issue
Block a user