TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
/*!
|
||||
* 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!
|
||||
*/
|
||||
.formeditor{--formeditor-module-gap:var(--module-body-padding-x);--formeditor-module-inspector:400px;--formeditor-inspector-color:var(--typo3-text-color-base);--formeditor-inspector-bg:var(--typo3-surface-container-low);--formeditor-inspector-border-width:var(--typo3-component-border-width);--formeditor-inspector-border-color:color-mix(in srgb,var(--formeditor-inspector-bg),var(--formeditor-inspector-color) var(--typo3-border-mix));--formeditor-inspector-border-radius:var(--typo3-component-border-radius);--formeditor-inspector-box-shadow:var(--typo3-component-box-shadow);--formeditor-stage-element-padding-y:.5rem;--formeditor-stage-element-padding-x:.75rem;--formeditor-stage-element-validator-width:100px;--formeditor-stage-spacing:1rem;--formeditor-stage-element-border-width:var(--typo3-component-border-width);--formeditor-stage-element-border-radius:var(--typo3-component-border-radius);--formeditor-stage-element-border-color-state:initial;--formeditor-stage-element-bg:var(--typo3-surface-bright);--formeditor-stage-element-color:var(--typo3-component-color);--formeditor-stage-element-border-color:var(--typo3-component-border-color);--formeditor-stage-element-hover-border-color:var(--typo3-component-hover-border-color);--formeditor-stage-element-active-border-color:var(--typo3-component-active-border-color);--formeditor-stage-element-hidden-bg:var(--typo3-surface-bright);--formeditor-stage-element-hidden-color:var(--typo3-component-color);--formeditor-stage-element-hidden-border-color:var(--typo3-component-border-color);position:relative}
|
||||
[data-module-name=form_editor]{overflow-x:clip}
|
||||
@media (max-width:949px){
|
||||
body:has(.formeditor-inspector-expanded){max-height:100dvh;overflow:hidden}}
|
||||
.formeditor-loader{align-items:center;display:flex;flex-direction:column;gap:.25rem;inset:0;justify-content:center;overflow:hidden;position:absolute}
|
||||
.formeditor-module,.formeditor-stage-container{flex-grow:1;min-height:0;min-width:0}
|
||||
.formeditor-stage-container{position:relative}
|
||||
.formeditor-stage-container-inner{position:relative;width:100%}
|
||||
.formeditor-stage-container-inner>:last-child{margin-bottom:0}
|
||||
.formeditor-header{align-items:center;display:flex;gap:1rem;justify-content:space-between;margin-bottom:var(--typo3-spacing)}
|
||||
.formeditor-header h1{margin:0}
|
||||
.formeditor-header-actions{align-items:center;display:flex;gap:.5rem}
|
||||
.formeditor-inspector{border:var(--formeditor-inspector-border-width) solid var(--formeditor-inspector-border-color);color:var(--formeditor-inspector-color);display:flex;flex-direction:column;height:calc(100dvh - var(--module-docheader-height) - var(--module-body-padding-y));inset-inline-end:calc(var(--module-body-padding-x)*-1);position:absolute;top:calc((var(--module-body-padding-y) + var(--formeditor-inspector-border-width))*-1);width:calc(100% + var(--module-body-padding-x));z-index:var(--typo3-zindex-header);-webkit-border-end:0;background:var(--formeditor-inspector-bg);border-inline-end:0;border-radius:var(--formeditor-inspector-border-radius) 0 0 var(--formeditor-inspector-border-radius);box-shadow:var(--typo3-component-box-shadow-flyout);isolation:isolate;overflow:hidden;transform:translateX(100%);transition:transform .3s ease-out}
|
||||
.formeditor-inspector.formeditor-inspector-expanded{transform:translateX(0)}
|
||||
.formeditor-inspector-inner{flex-grow:1;min-height:0;overflow:auto;padding:var(--module-body-padding)}
|
||||
.formeditor-inspector-collapse{display:flex;justify-content:flex-end;margin-bottom:calc(var(--typo3-spacing)/2)}
|
||||
.formeditor-inspector-expand{display:inline-flex}
|
||||
.formeditor-inspector-content .input-group{flex-wrap:nowrap}
|
||||
.formeditor-inspector-content .input-group>:first-child{flex-grow:1}
|
||||
.formeditor-inspector-content .input-group>:first-child>*{border-end-end-radius:0;border-start-end-radius:0}
|
||||
.formeditor-inspector-content .input-group .input-group-btn .btn-group .btn{border-end-start-radius:0;border-start-start-radius:0}
|
||||
.formeditor-inspector-content>.formeditor-inspector-element-remove-button{border-top:1px solid var(--module-docheader-border-color);padding-top:1rem}
|
||||
.formeditor-inspector-content>.formeditor-inspector-element-remove-button .btn{width:100%}
|
||||
.formeditor-inspector-element:last-child>:last-child{margin-bottom:0}
|
||||
.formeditor-inspector-element-headline{border-bottom:1px solid color-mix(in srgb,transparent,currentColor 15%);margin-bottom:1.5rem;padding-bottom:1rem}
|
||||
.formeditor-inspector-element-headline h2{align-items:center;display:flex;font-family:inherit;font-size:var(--typo3-font-size);font-weight:700;gap:.25rem;margin:0}
|
||||
typo3-form-form-element-stage-item-toolbar{display:block}
|
||||
.formeditor-stage{border:1px dotted color-mix(in srgb,var(--module-bg),currentColor 30%);border-radius:var(--formeditor-stage-element-border-radius);margin-bottom:var(--typo3-spacing);overflow-x:auto;overflow-y:hidden;padding:var(--module-body-padding)}
|
||||
.formeditor-stage typo3-form-form-element-stage-item,.formeditor-stage typo3-form-page-stage-item{display:block}
|
||||
.formeditor-stage .formeditor-page-title{cursor:pointer;font-size:.875rem;font-weight:700;margin:0 0 var(--typo3-spacing)}
|
||||
.formeditor-stage .formeditor-page-title:empty:before{content:attr(data-empty-message);opacity:.75}
|
||||
.formeditor-stage .formeditor-page-title:hover{text-decoration:underline;-webkit-text-decoration-color:color-mix(in srgb,currentColor,transparent 50%);text-decoration-color:color-mix(in srgb,currentColor,transparent 50%);text-underline-offset:.1em}
|
||||
.formeditor-stage-section{background-color:var(--typo3-surface-container-base);border-radius:calc(var(--formeditor-stage-element-border-radius) - 3px)}
|
||||
.formeditor-stage-heading{margin-bottom:var(--formeditor-stage-spacing)}
|
||||
.formeditor-stage-area{padding:var(--formeditor-stage-spacing)}
|
||||
.formeditor-list,.formeditor-stage-list{display:grid;gap:var(--formeditor-stage-spacing);grid-template-columns:minmax(0,1fr);list-style:none;margin:0;padding:0}
|
||||
.formeditor-element{background-color:var(--formeditor-stage-element-bg);border:var(--formeditor-stage-element-border-width) solid var(--formeditor-stage-element-border-color-state,var(--formeditor-stage-element-border-color));border-radius:var(--formeditor-stage-element-border-radius);color:var(--formeditor-stage-element-color);display:flex;flex-direction:column;overflow:hidden}
|
||||
.formeditor-element.formeditor-element-hidden:not(.formeditor-element.selected){background-color:var(--formeditor-stage-element-hidden-bg);border:var(--formeditor-stage-element-border-width) dashed var(--formeditor-stage-element-hidden-border-color);opacity:.5;transition:opacity .3s ease-in-out}
|
||||
.formeditor-element.formeditor-element-hidden:not(.formeditor-element.selected):focus-within,.formeditor-element.formeditor-element-hidden:not(.formeditor-element.selected):hover{opacity:1}
|
||||
.formeditor-element typo3-form-form-element-stage-item,.formeditor-element typo3-form-form-element-stage-item-toolbar{display:block}
|
||||
.formeditor-element .formeditor-element-toolbar{align-items:center;display:flex;gap:.5rem;padding:var(--formeditor-stage-spacing)}
|
||||
.formeditor-element .formeditor-element-toolbar-left,.formeditor-element .formeditor-element-toolbar-right{flex-shrink:0}
|
||||
.formeditor-element .formeditor-element-toolbar-title{flex:1 1 0;font-weight:700;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
||||
.formeditor-element .formeditor-element-toolbar-label{font-weight:700}
|
||||
.formeditor-element .formeditor-element-body{background-color:var(--formeditor-stage-element-bg);border-radius:calc(var(--formeditor-stage-element-border-radius) - var(--formeditor-stage-element-border-width));border-start-end-radius:0;border-start-start-radius:0;color:var(--formeditor-stage-element-color);display:flex;overflow:hidden;position:relative}
|
||||
.formeditor-element .formeditor-element-info{display:flex;gap:var(--formeditor-stage-spacing);height:100%;padding:var(--formeditor-stage-spacing);position:relative;width:100%}
|
||||
.formeditor-element .formeditor-element-info>*{flex:0 0 50%}
|
||||
.formeditor-element .formeditor-element-info-label{align-items:flex-start;display:flex;font-weight:700;position:relative}
|
||||
.formeditor-element .formeditor-element-info-content{align-items:center;display:flex;flex-flow:row wrap}
|
||||
.formeditor-element .formeditor-element-validator{background-color:var(--typo3-component-hover-bg);border-start-start-radius:var(--formeditor-stage-element-border-radius);color:var(--typo3-component-hover-color);display:flex;height:100%;inset-inline-end:0;overflow:hidden;position:absolute;top:0;-webkit-margin-end:calc(var(--formeditor-stage-element-validator-width)*-1);margin-inline-end:calc(var(--formeditor-stage-element-validator-width)*-1);transition:margin .15s ease-in-out;z-index:2}
|
||||
.formeditor-element .formeditor-element-validator:has(.formeditor-element-validator-icon:empty){display:none}
|
||||
.formeditor-element .formeditor-element-validator-icon{height:100%}
|
||||
.formeditor-element .formeditor-element-validator-icon .icon,.formeditor-element .formeditor-element-validator-icon typo3-backend-icon{height:100%;margin-inline:var(--formeditor-stage-element-padding-x);z-index:1}
|
||||
.formeditor-element .formeditor-element-validator-list{align-items:center;display:flex;flex-flow:row wrap;gap:1px;height:100%;padding:var(--formeditor-stage-element-padding-y) var(--formeditor-stage-element-padding-x);-webkit-padding-start:0;font-size:var(--typo3-font-size-small);padding-inline-start:0;transition:margin .15s ease-in-out;width:var(--formeditor-stage-element-validator-width)}
|
||||
.formeditor-element .formeditor-element-validator-list:hover{-webkit-margin-end:0;margin-inline-end:0}
|
||||
.formeditor-element .formeditor-element-validator-list-item{opacity:.75;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}
|
||||
.formeditor-element:hover{--formeditor-stage-element-border-color-state:var(--formeditor-stage-element-hover-border-color)}
|
||||
.formeditor-element:focus-visible{outline:var(--typo3-outline-width) var(--typo3-outline-style) color-mix(in srgb,var(--typo3-state-default-focus-border-color),transparent 25%);outline-offset:0}
|
||||
.formeditor-element.selected{--formeditor-stage-element-border-color-state:var(--formeditor-stage-element-active-border-color);outline:2px solid var(--formeditor-stage-element-active-border-color);outline-offset:-1px}
|
||||
.formeditor-element:has(+.formeditor-list){border-end-end-radius:0;border-end-start-radius:0}
|
||||
.formeditor-element:has(+.formeditor-list) .formeditor-element-body{border-end-end-radius:0;border-end-start-radius:0}
|
||||
.formeditor-element+.formeditor-list:not(:empty){border:var(--formeditor-stage-element-border-width) solid var(--formeditor-stage-element-border-color-state,var(--formeditor-stage-element-border-color));border-end-end-radius:var(--formeditor-stage-element-border-radius);border-end-start-radius:var(--formeditor-stage-element-border-radius);border-top:none;padding:var(--formeditor-stage-spacing)}
|
||||
.formeditor-element.formeditor-element-hidden+.formeditor-list:not(:empty){background-color:var(--formeditor-stage-element-hidden-bg);border:var(--formeditor-stage-element-border-width) dashed var(--formeditor-stage-element-hidden-border-color);border-top:none;opacity:.5;transition:opacity .3s ease-in-out}
|
||||
@container (min-width: 500px){
|
||||
.formeditor-element-validator:hover{-webkit-margin-end:0;margin-inline-end:0}}
|
||||
typo3-form-form-element-stage-item[invalid] .formeditor-element-info-label{color:var(--typo3-text-color-danger)}
|
||||
.formeditor-element:has(>[invalid]){--formeditor-stage-element-border-color:var(--typo3-state-danger-border-color);--formeditor-stage-element-hover-border-color:var(--typo3-state-danger-hover-border-color);--formeditor-stage-element-active-border-color:var(--typo3-state-danger-focus-border-color)}
|
||||
.formeditor-sortable-handle{cursor:pointer}
|
||||
.formeditor-sortable-ghost{outline:1px dashed var(--typo3-state-success-border-color)!important;outline-offset:-1px!important}
|
||||
.formeditor-is-dragging .formeditor-new-element-placeholder{display:none}
|
||||
.formeditor-new-element-placeholder{align-items:center;display:flex;justify-content:center;list-style:none}
|
||||
.formeditor-new-element-container{align-items:center;border:var(--typo3-component-border-width) dashed color-mix(in srgb,transparent,currentColor 25%);border-radius:var(--typo3-component-border-radius);display:flex;justify-content:center;margin-top:var(--typo3-spacing);padding:.75rem .5rem}
|
||||
.property-grid .form-control{min-width:auto}
|
||||
.property-grid .table-fit{box-shadow:none;margin-bottom:0}
|
||||
.property-grid-editor__entries{background-color:var(--typo3-component-border-color);border:var(--typo3-component-border-width) solid var(--typo3-component-border-color);border-radius:var(--typo3-component-border-radius);display:grid;gap:1px}
|
||||
.property-grid-editor__entries+.property-grid-editor__actions{margin-top:calc(var(--typo3-spacing)/2)}
|
||||
.property-grid-editor__entry{background-color:color-mix(in srgb,var(--typo3-component-bg),var(--typo3-component-color) 3%);display:flex;flex-direction:row;gap:var(--typo3-spacing);padding:var(--typo3-spacing);position:relative}
|
||||
.property-grid-editor__entry:is(.dragging,.moving):after{border:2px dashed var(--typo3-state-primary-border-color);border-radius:calc(var(--typo3-component-border-radius) - var(--typo3-component-border-width));content:"";display:block;height:calc(100% - 2px);left:1px;position:absolute;top:1px;width:calc(100% - 2px)}
|
||||
.property-grid-editor__entry-inputs{flex:1}
|
||||
.property-grid-editor__entry-inputs div:last-child{margin-bottom:0}
|
||||
.property-grid-editor__entry-buttons{display:flex;flex-direction:column;gap:.25rem}
|
||||
.formeditor-module-viewmode-preview .formeditor-inspector-expand,.formeditor-module-viewmode-preview~.formeditor-inspector{display:none}
|
||||
@media (min-width:950px){
|
||||
.formeditor-module-viewmode-preview~.formeditor-inspector{display:flex;transform:translateX(100%);-webkit-margin-start:calc(var(--formeditor-module-inspector)*-1 - var(--formeditor-module-gap));margin-inline-start:calc(var(--formeditor-module-inspector)*-1 - var(--formeditor-module-gap));opacity:0}}
|
||||
.formeditor-module-viewmode-preview .formeditor-stage select[multiple=multiple]{height:auto;min-height:32px}
|
||||
.formeditor-module-viewmode-preview .formeditor-stage textarea{min-height:100px}
|
||||
.formeditor-module-viewmode-preview .formeditor-stage .container{width:auto}
|
||||
.formeditor-module-viewmode-preview .formeditor-stage .form-navigation .btn-group button,.formeditor-module-viewmode-preview .formeditor-stage .form-navigation .btn-group span{display:inline-flex;-webkit-margin-end:1em;margin-inline-end:1em}
|
||||
.formeditor-module-viewmode-preview .formeditor-stage .formeditor-element-preview{display:inline-block;position:relative;width:100%}
|
||||
.formeditor-module-viewmode-preview .formeditor-stage .formeditor-new-element-container{display:none}
|
||||
@media (min-width:950px){
|
||||
.formeditor-inner{align-items:flex-start;display:flex;gap:var(--formeditor-module-gap)}
|
||||
.formeditor-stage-container{overflow:visible}
|
||||
.formeditor-stage-container-inner{margin-inline:auto;max-width:800px}
|
||||
.formeditor-inspector{border-radius:var(--formeditor-inspector-border-radius);flex-shrink:0;height:auto;inset:auto;max-height:calc(100dvh - var(--module-docheader-height) - var(--module-body-padding-y)*2);position:-webkit-sticky;position:sticky;top:calc(1rem + var(--module-docheader-bar-height));width:var(--formeditor-module-inspector);-webkit-border-end:var(--formeditor-inspector-border-width) solid var(--formeditor-inspector-border-color);border-inline-end:var(--formeditor-inspector-border-width) solid var(--formeditor-inspector-border-color);box-shadow:var(--formeditor-inspector-box-shadow);transform:none;transition:transform .3s ease-out,opacity .3s ease-out,margin .3s ease-out}
|
||||
.formeditor-inspector-collapse,.formeditor-inspector-expand{display:none}}
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path fill="#3B7EB0" d="M0 0h64v64H0z"/><path fill="#FFF" d="M14 14h32v36H14z"/><path fill="#3B7EB0" d="M22 42h8v4h-8z"/><path fill="#3B7EB0" d="M32 42h8v4h-8z" opacity=".5"/><path fill="#3B7EB0" d="M22 18h14v2H22zM22 32h2v2h-2zM22 36h2v2h-2z"/><path fill="#3B7EB0" d="M26 32h16v2H26zM26 36h16v2H26zM22 22h20v8H22z" opacity=".5"/><path fill="#3B7EB0" d="M14 14h4v4h-4z"/><path fill="#3B7EB0" d="M16 14h2v36h-2z" opacity=".5"/></svg>
|
||||
|
After Width: | Height: | Size: 492 B |
@@ -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 c,html as f}from"lit";import{query as p,customElement as h}from"lit/decorators.js";import"@typo3/backend/tree/tree-toolbar.js";import"@typo3/form/backend/form-editor-tree.js";var l=function(i,e,t,n){var a=arguments.length,r=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,n);else for(var d=i.length-1;d>=0;d--)(s=i[d])&&(r=(a<3?s(r):a>3?s(e,t,r):s(e,t))||r);return a>3&&r&&Object.defineProperty(e,t,r),r};const m="typo3-backend-navigation-component-formeditortree";let o=class extends c{async setNodes(e){await this.updateComplete,this.tree&&this.tree.setNodes(e)}setSelectedNode(e){this.tree&&this.tree.setSelectedNode(e)}search(e){this.tree&&this.tree.search(e)}setNodeValidationError(e,t=!0){this.tree&&this.tree.setNodeValidationError(e,t)}setNodeChildHasError(e,t=!0){this.tree&&this.tree.setNodeChildHasError(e,t)}clearAllValidationErrors(){this.tree&&this.tree.clearAllValidationErrors()}createRenderRoot(){return this}render(){return f`<typo3-backend-tree-toolbar .tree=${this.tree} .showRefresh=${!1} id=typo3-formeditortree-toolbar></typo3-backend-tree-toolbar><typo3-backend-navigation-component-formeditor-tree id=typo3-formeditortree-tree></typo3-backend-navigation-component-formeditor-tree>`}firstUpdated(){this.toolbar&&this.tree&&(this.toolbar.tree=this.tree),this.dispatchEvent(new CustomEvent("typo3:tree-container:ready",{bubbles:!0,composed:!0}))}};l([p("typo3-backend-navigation-component-formeditor-tree")],o.prototype,"tree",void 0),l([p("typo3-backend-tree-toolbar")],o.prototype,"toolbar",void 0),o=l([h("typo3-backend-navigation-component-formeditortree")],o);export{o as FormEditorTreeContainer,m as navigationComponentName};
|
||||
@@ -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!
|
||||
*/
|
||||
const e={NODE_CLICKED:"typo3:form-editor-tree:node-clicked",NODE_EDIT:"typo3:form-editor-tree:node-edit",NODE_DELETE:"typo3:form-editor-tree:node-delete",DND_UPDATE:"typo3:form-editor-tree:dnd-update",DND_CHANGE:"typo3:form-editor-tree:dnd-change"};export{e as FORM_EDITOR_TREE_EVENTS};
|
||||
File diff suppressed because one or more lines are too long
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 v,html as d,nothing as p}from"lit";import{property as g,state as r,customElement as $}from"lit/decorators.js";import o from"~labels/form.relative_date_editor";var n=function(u,t,e,s){var h=arguments.length,a=h<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(u,t,e,s);else for(var m=u.length-1;m>=0;m--)(l=u[m])&&(a=(h<3?l(a):h>3?l(t,e,a):l(t,e))||a);return h>3&&a&&Object.defineProperty(t,e,a),a};class c extends Event{static{this.eventName="typo3:backend:form-editor:component:date-editor:change"}constructor(t){super(c.eventName),this.value=t}}let i=class extends v{constructor(){super(...arguments),this.mode="no",this.absoluteDate="",this.direction="-",this.amount=0,this.unit="years",this.customValue="",this.value="",this._absoluteDateRegex=null}get absoluteDateRegex(){return this._absoluteDateRegex||(this._absoluteDateRegex=new RegExp(this.absolutePattern)),this._absoluteDateRegex}firstUpdated(){if(!this.absolutePattern)throw new Error("typo3-form-date-editor: absolute-pattern attribute is required.");this.parseValue(this.value)}createRenderRoot(){return this}render(){return d`<div class=mb-2><select class=form-select @change=${this.handleModeChange} .value=${this.mode}><option value=no ?selected=${this.mode==="no"}>${o.get("mode.no")}</option><option value=today ?selected=${this.mode==="today"}>${o.get("mode.today")}</option><option value=absolute ?selected=${this.mode==="absolute"}>${o.get("mode.absolute")}</option><option value=relative ?selected=${this.mode==="relative"}>${o.get("mode.relative")}</option><option value=custom ?selected=${this.mode==="custom"}>${o.get("mode.custom")}</option></select></div>${this.mode==="absolute"?this.renderAbsolute():p} ${this.mode==="relative"?this.renderRelative():p} ${this.mode==="custom"?this.renderCustom():p}`}renderAbsolute(){return d`<div class=mb-2><input type=date class=form-control .value=${this.absoluteDate} @change=${this.handleAbsoluteChange}></div>`}renderRelative(){return d`<div class=input-group><select class=form-select .value=${this.direction} @change=${this.handleDirectionChange}><option value=- ?selected=${this.direction==="-"}>${o.get("direction.past")}</option><option value=+ ?selected=${this.direction==="+"}>${o.get("direction.future")}</option></select> <input type=number min=1 class=form-control style=max-width:80px .value=${this.amount.toString()} @input=${this.handleAmountChange}> <select class=form-select .value=${this.unit} @change=${this.handleUnitChange}><option value=days ?selected=${this.unit==="days"}>${o.get("unit.days",{count:this.amount})}</option><option value=weeks ?selected=${this.unit==="weeks"}>${o.get("unit.weeks",{count:this.amount})}</option><option value=months ?selected=${this.unit==="months"}>${o.get("unit.months",{count:this.amount})}</option><option value=years ?selected=${this.unit==="years"}>${o.get("unit.years",{count:this.amount})}</option></select></div>`}renderCustom(){return d`<div class=mb-2><input type=text class=form-control placeholder=${o.get("custom.placeholder")} .value=${this.customValue} @input=${this.handleCustomChange}></div>`}parseValue(t){if(!t){this.mode="no";return}if(t.toLowerCase()==="today"){this.mode="today";return}if(this.absoluteDateRegex.test(t)){this.mode="absolute",this.absoluteDate=t;return}const e=t.match(/^([+-]?)\s*(\d+)\s+(days?|weeks?|months?|years?)$/i);if(e){this.mode="relative",this.direction=e[1]==="+"?"+":"-",this.amount=parseInt(e[2],10);const s=e[3].toLowerCase();this.unit=s.endsWith("s")?s:`${s}s`;return}this.mode="custom",this.customValue=t}composeValue(){switch(this.mode){case"today":return"today";case"absolute":return this.absoluteDate;case"relative":return this.amount===0?"":`${this.direction}${this.amount} ${this.unit}`;case"custom":return this.customValue.trim();default:return""}}emitChange(){const t=this.composeValue();this.value=t,this.dispatchEvent(new c(t))}handleModeChange(t){const e=t.target.value;if(e==="custom"&&this.mode==="relative"){const s=this.composeValue();s&&(this.customValue=s)}this.mode=e,this.mode==="relative"&&this.amount===0&&(this.amount=1),this.emitChange()}handleAbsoluteChange(t){this.absoluteDate=t.target.value,this.emitChange()}handleDirectionChange(t){this.direction=t.target.value,this.emitChange()}handleAmountChange(t){this.amount=parseInt(t.target.value,10)||0,this.emitChange()}handleUnitChange(t){this.unit=t.target.value,this.emitChange()}handleCustomChange(t){this.customValue=t.target.value,this.emitChange()}};n([g({type:String,attribute:"absolute-pattern"})],i.prototype,"absolutePattern",void 0),n([r()],i.prototype,"mode",void 0),n([r()],i.prototype,"absoluteDate",void 0),n([r()],i.prototype,"direction",void 0),n([r()],i.prototype,"amount",void 0),n([r()],i.prototype,"unit",void 0),n([r()],i.prototype,"customValue",void 0),i=n([$("typo3-form-date-editor")],i);export{i as DateEditor,c as DateEditorChangeEvent};
|
||||
@@ -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 m,customElement as u}from"lit/decorators.js";import{LitElement as f,html as p,nothing as b}from"lit";var d=function(r,e,n,i){var s=arguments.length,t=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,n):i,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(r,e,n,i);else for(var c=r.length-1;c>=0;c--)(l=r[c])&&(t=(s<3?l(t):s>3?l(e,n,t):l(e,n))||t);return s>3&&t&&Object.defineProperty(e,n,t),t};class a extends Event{static{this.eventName="typo3:backend:form-editor:component:form-element-selector:selected"}constructor(e){super(a.eventName),this.value=e}}let o=class extends f{constructor(){super(...arguments),this.elements=[],this.size=""}createRenderRoot(){return this}render(){return this.elements?.length?p`<span class=input-group-btn role=group data-identifier=inspectorEditorFormElementSelectorControlsWrapper> <span class=btn-group data-identifier=inspectorEditorFormElementSelectorSplitButtonContainer><button type=button class="btn btn-default dropdown-toggle${this.size==="small"?" btn-sm":""}" data-bs-toggle=dropdown aria-expanded=false title="{f:translate(key: 'LLL:EXT:form/Resources/Private/Language/Database.xlf:formEditor.inspector.editor.formelement_selector.title')}"><typo3-backend-icon identifier=actions-variable-select></typo3-backend-icon><span class=visually-hidden>Toggle Dropdown</span></button> <ul class="dropdown-menu dropdown-menu-right" data-identifier=inspectorEditorFormElementSelectorSplitButtonListContainer>${this.elements.map(e=>this.renderEntry(e))}</ul> </span> </span>`:p`${b}`}renderEntry(e){return p`<li><a @click=${()=>this.onSelect(e.value)} href=# class=dropdown-item data-formelement-identifier=${e.value}> <span class=dropdown-item-columns><span class="dropdown-item-column dropdown-item-column-icon"> <typo3-backend-icon identifier=${e.icon} size=small></typo3-backend-icon> </span> <span class="dropdown-item-column dropdown-item-column-text">${e.label}</span> </span> </a></li>`}onSelect(e){this.dispatchEvent(new a(e))}};d([m({type:Array,attribute:"elements"})],o.prototype,"elements",void 0),d([m({type:String})],o.prototype,"size",void 0),o=d([u("typo3-form-element-selector")],o);export{o as FormElementSelector,a as FormElementSelectorSelectedEvent};
|
||||
+13
@@ -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,nothing as b,html as p}from"lit";import{property as n,customElement as v}from"lit/decorators.js";import c from"~labels/form.form_editor_javascript";import"@typo3/backend/element/icon-element.js";var o=function(l,e,r,a){var s=arguments.length,i=s<3?e:a===null?a=Object.getOwnPropertyDescriptor(e,r):a,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(l,e,r,a);else for(var m=l.length-1;m>=0;m--)(d=l[m])&&(i=(s<3?d(i):s>3?d(e,r,i):d(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i};let t=class extends f{constructor(){super(...arguments),this.active=!1,this.iconIdentifier="",this.elementType="",this.elementIdentifier="",this.isHidden=!1,this.isInvalid=!1}createRenderRoot(){return this}render(){return this.active?p`<div class=formeditor-element-toolbar><div class=formeditor-element-toolbar-left><typo3-backend-icon identifier=${this.iconIdentifier} size=small overlay=${this.isHidden?"overlay-hidden":this.isInvalid?"overlay-missing":""}></typo3-backend-icon></div><div class=formeditor-element-toolbar-title>${this.elementType}</div><div class=formeditor-element-toolbar-right><div class=btn-toolbar><div class="btn-group btn-group-sm" role=group><a class="btn btn-default btn-borderless" href=# title=${c.get("formEditor.stage.toolbar.new_element.before")} @click=${this.handleNewElementBefore}> <typo3-backend-icon identifier=actions-form-insert-before size=small></typo3-backend-icon> </a> <a class="btn btn-default btn-borderless" href=# title=${c.get("formEditor.stage.toolbar.new_element.after")} @click=${this.handleNewElementAfter}><typo3-backend-icon identifier=actions-form-insert-after size=small></typo3-backend-icon> </a> <a class="btn btn-default btn-borderless" href=# title=${c.get("formEditor.stage.toolbar.remove")} @click=${this.handleRemoveElement}><typo3-backend-icon identifier=actions-edit-delete size=small></typo3-backend-icon> </a></div></div></div></div>`:b}handleNewElementBefore(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("toolbar-new-element-before",{bubbles:!0,composed:!0}))}handleNewElementAfter(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("toolbar-new-element-after",{bubbles:!0,composed:!0}))}handleRemoveElement(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("toolbar-remove-element",{bubbles:!0,composed:!0}))}};o([n({type:Boolean,reflect:!0})],t.prototype,"active",void 0),o([n({type:String,attribute:"icon-identifier"})],t.prototype,"iconIdentifier",void 0),o([n({type:String,attribute:"element-type"})],t.prototype,"elementType",void 0),o([n({type:String,attribute:"element-identifier"})],t.prototype,"elementIdentifier",void 0),o([n({type:Boolean,attribute:"is-hidden"})],t.prototype,"isHidden",void 0),o([n({type:Boolean,attribute:"is-invalid"})],t.prototype,"isInvalid",void 0),t=o([v("typo3-form-form-element-stage-item-toolbar")],t);export{t as FormElementStageItemToolbar};
|
||||
@@ -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 c,html as s,nothing as f}from"lit";import{property as n,customElement as u}from"lit/decorators.js";import"@typo3/backend/element/icon-element.js";import"@typo3/form/backend/form-editor/component/form-element-stage-item-toolbar.js";import{stripTags as v}from"@typo3/form/backend/form-editor/utility/string-utility.js";var o=function(d,e,i,r){var a=arguments.length,l=a<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(d,e,i,r);else for(var p=d.length-1;p>=0;p--)(m=d[p])&&(l=(a<3?m(l):a>3?m(e,i,l):m(e,i))||l);return a>3&&l&&Object.defineProperty(e,i,l),l};let t=class extends c{constructor(){super(...arguments),this.elementType="",this.elementIdentifier="",this.elementLabel="",this.elementIconIdentifier="",this.isRequired=!1,this.isHidden=!1,this.invalid=!1,this.validators=[],this.options=[]}createRenderRoot(){return this}render(){return s`<typo3-form-form-element-stage-item-toolbar active icon-identifier=${this.elementIconIdentifier} element-type=${this.elementType} element-identifier=${this.elementIdentifier} ?is-hidden=${this.isHidden} ?is-invalid=${this.invalid}></typo3-form-form-element-stage-item-toolbar><div class=formeditor-element-body><div class=formeditor-element-info><div class=formeditor-element-info-label><span>${v(this.elementLabel)}</span> ${this.isRequired?s`<span>*</span>`:f}</div>${this.renderInfoContent()}</div>${this.renderValidators()}</div>`}renderInfoContent(){const e=this.renderContentItems();return e.length?s`<div class=formeditor-element-info-content>${e}</div>`:f}renderContentItems(){const e=[];if(this.content&&e.push(s`<div class=formeditor-element-info-text>${v(this.content)}</div>`),this.options?.length){const i=this.options.map(r=>({label:r.label,className:r.selected?"selected":void 0}));e.push(this.renderMultivalue(i))}if(this.allowedMimeTypes?.length){const i=this.allowedMimeTypes.map(r=>({label:r}));e.push(this.renderMultivalue(i))}return e}renderMultivalue(e){return s`<div class=formeditor-element-info-multivalue>${e.map(i=>s`<div class=formeditor-element-info-multivalue-item${i.className?` ${i.className}`:""}>${i.label}</div>`)}</div>`}renderValidators(){return this.validators?.length?s`<div class=formeditor-element-validator><div class=formeditor-element-validator-icon><typo3-backend-icon identifier=form-validator size=small></typo3-backend-icon></div><div class=formeditor-element-validator-list>${this.validators.map(e=>s`<div class=formeditor-element-validator-list-item>${e.label}</div>`)}</div></div>`:f}};o([n({type:String,attribute:"element-type"})],t.prototype,"elementType",void 0),o([n({type:String,attribute:"element-identifier"})],t.prototype,"elementIdentifier",void 0),o([n({type:String,attribute:"element-label"})],t.prototype,"elementLabel",void 0),o([n({type:String,attribute:"element-icon-identifier"})],t.prototype,"elementIconIdentifier",void 0),o([n({type:Boolean,attribute:"is-required"})],t.prototype,"isRequired",void 0),o([n({type:Boolean,attribute:"is-hidden"})],t.prototype,"isHidden",void 0),o([n({type:Boolean,reflect:!0})],t.prototype,"invalid",void 0),o([n({type:Array})],t.prototype,"validators",void 0),o([n({type:Array})],t.prototype,"options",void 0),o([n({type:Array})],t.prototype,"allowedMimeTypes",void 0),o([n({type:String})],t.prototype,"content",void 0),t=o([u("typo3-form-form-element-stage-item")],t);export{t as FormElementStageItem};
|
||||
@@ -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 c}from"lit";import{property as s,customElement as g}from"lit/decorators.js";import u from"~labels/form.form_editor_javascript";var a=function(o,e,r,p){var i=arguments.length,t=i<3?e:p===null?p=Object.getOwnPropertyDescriptor(e,r):p,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,e,r,p);else for(var m=o.length-1;m>=0;m--)(l=o[m])&&(t=(i<3?l(t):i>3?l(e,r,t):l(e,r))||t);return i>3&&t&&Object.defineProperty(e,r,t),t};let n=class extends f{constructor(){super(...arguments),this.pageTitle=""}createRenderRoot(){return this}render(){const e=this.pageTitle||u.get("formEditor.step.name.empty");return c`<h2 class=formeditor-page-title>${e}</h2>`}};a([s({type:String,attribute:"page-title"})],n.prototype,"pageTitle",void 0),n=a([g("typo3-form-page-stage-item")],n);export{n as PageStageItem};
|
||||
File diff suppressed because one or more lines are too long
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{merge as E}from"lodash-es";let d=null,r=null;const p={domElementClassNames:{active:"active",buttonCollectionElementRemove:"formeditor-inspector-collection-element-remove-button",buttonFormEditor:"formeditor-button",disabled:"disabled",hidden:"hidden",icon:"formeditor-icon",sortableHover:"sortable-hover"},domElementDataAttributeNames:{elementIdentifier:"data-element-identifier-path",identifier:"data-identifier",template:"data-template-name",templateProperty:"data-template-property"},domElementSelectorPattern:{bracesWithKey:"[{0}]",bracesWithKeyValue:'[{0}="{1}"]',class:".{0}",id:"#{0}",keyValue:'{0}="{1}"'}};function s(){return d}function l(){return s().getUtility()}function a(e,n,t){return s().assert(e,n,t)}function b(e){return a(typeof e=="object"&&e!==null&&!Array.isArray(e),'Invalid parameter "partialConfiguration"',1478950623),r=E({},p,e),this}function c(e,n){let t;a(!l().isUndefinedOrNull(r.domElementSelectorPattern[e]),'Invalid parameter "patternIdentifier" ('+e+")",1478801251),a(Array.isArray(n),'Invalid parameter "replacements"',1478801252),t=r.domElementSelectorPattern[e];for(let m=0,f=n.length;m<f;++m)t=t.replace("{"+m+"}",n[m]);return t}function o(e,n){return a(!l().isUndefinedOrNull(r.domElementSelectorPattern[e]),'Invalid parameter "selectorIdentifier" ('+e+")",1478372374),c(e,n)}function y(e,n){let t;return a(!l().isUndefinedOrNull(r.domElementClassNames[e]),'Invalid parameter "classNameIdentifier" ('+e+")",1478803906),t=r.domElementClassNames[e],n&&(t=o("class",[t])),t}function D(e,n){let t;return a(!l().isUndefinedOrNull(r.domElementIdNames[e]),'Invalid parameter "domElementIdNames" ('+e+")",1479251518),t=r.domElementIdNames[e],n&&(t=o("id",[t])),t}function u(e){return a(!l().isUndefinedOrNull(r.domElementDataAttributeValues[e]),'Invalid parameter "dataAttributeValueIdentifier" ('+e+")",1478806884),r.domElementDataAttributeValues[e]}function i(e,n,t){return a(!l().isUndefinedOrNull(r.domElementDataAttributeNames[e]),'Invalid parameter "dataAttributeIdentifier" ('+e+")",1478808035),l().isUndefinedOrNull(n)?r.domElementDataAttributeNames[e]:(t=t||[],o(n,[r.domElementDataAttributeNames[e]].concat(t)))}function N(e){return i("identifier","bracesWithKeyValue",[u(e)])}function v(e){return l().isUndefinedOrNull(r.domElementDataAttributeValues[e])||(e=u(e)),document.querySelector(i("template","bracesWithKeyValue",[e]))}function g(e,n){return n.querySelector(i("templateProperty","bracesWithKeyValue",[e]))}function h(e){d=e}export{h as bootstrap,c as buildDomElementSelectorHelper,y as getDomElementClassName,i as getDomElementDataAttribute,u as getDomElementDataAttributeValue,N as getDomElementDataIdentifierSelector,D as getDomElementIdName,o as getDomElementSelector,v as getTemplateElement,g as getTemplatePropertyElement,b as setConfiguration};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
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!
|
||||
*/
|
||||
function n(t){if(!t)return t;const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText||""}export{n as stripTags};
|
||||
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!
|
||||
*/
|
||||
function n(r,t,i){if(typeof r=="function"&&(r=r()!==!1),!r)throw t=t||"Assertion failed",i&&(t=t+" ("+i+")"),typeof Error<"u"?new Error(t):t}class s{constructor(t,i){this.isRunning=!1,this.configuration=t,this.viewModel=i}assert(t,i,e){n(t,i,e)}getPrototypes(){return Array.isArray(this.configuration.selectablePrototypesConfiguration)?this.configuration.selectablePrototypesConfiguration.map(t=>({label:t.label,value:t.identifier})):[]}getTemplatesForPrototype(t){if(n(typeof t=="string",'Invalid parameter "prototypeName"',1475945286),!Array.isArray(this.configuration.selectablePrototypesConfiguration))return[];const i=[];return this.configuration.selectablePrototypesConfiguration.forEach(e=>{Array.isArray(e.newFormTemplates)&&e.identifier===t&&e.newFormTemplates.forEach(a=>{i.push({label:a.label,value:a.templatePath})})}),i}getAccessibleStorageAdapters(){return Array.isArray(this.configuration.accessibleStorageAdapters)?this.configuration.accessibleStorageAdapters:[]}getAccessibleStorageLocationsForAdapter(t){const i=this.configuration.accessibleStorageAdapters?.find(e=>e.typeIdentifier===t.typeIdentifier);return!i||!i.options?.allowedStorageLocations?[]:i.options.allowedStorageLocations}getAjaxEndpoint(t){return n(typeof this.configuration.endpoints[t]<"u","Endpoint "+t+" does not exist",1477506508),this.configuration.endpoints[t]}run(){if(this.isRunning)throw"You can not run the app twice (1475942618)";return this.bootstrap(),this.isRunning=!0,this}viewSetup(){n(typeof this.viewModel.bootstrap=="function",'The view model does not implement the method "bootstrap"',1475942906),this.viewModel.bootstrap(this)}bootstrap(){this.configuration=this.configuration||{},n(typeof this.configuration.endpoints=="object",'Invalid parameter "endpoints"',1477506504),this.viewSetup()}}let o=null;function f(r,t){return o===null&&(o=new s(r,t)),o}export{s as FormManager,n as assert,f as getInstance};
|
||||
@@ -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 o from"@typo3/core/event/regular-event.js";class a{constructor(){t.ready().then(()=>{const e=document.getElementById("search_field");if(e!==null){const r=e.value!=="";new o("search",()=>{e.value===""&&r&&e.closest("form").requestSubmit()}).bindTo(e)}})}}var n=new a;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 l from"@typo3/backend/modal.js";import h from"@typo3/backend/severity.js";import v from"@typo3/backend/icons.js";import b from"@typo3/backend/notification.js";import z from"@typo3/core/security-utility.js";import M from"@typo3/core/ajax/ajax-request.js";import{AjaxResponse as L}from"@typo3/core/ajax/ajax-response.js";import{SeverityEnum as w}from"@typo3/backend/enum/severity.js";import{topLevelModuleImport as y}from"@typo3/backend/utility/top-level-module-import.js";import{html as k}from"lit";import t from"~labels/form.form_manager_javascript";const u=new z;var f;(function(e){e.newFormModalTrigger='[data-identifier="newForm"]',e.duplicateFormModalTrigger='[data-identifier="duplicateForm"]',e.removeFormModalTrigger='[data-identifier="removeForm"]',e.showReferences='[data-identifier="showReferences"]',e.referenceLink='[data-identifier="referenceLink"]'})(f||(f={}));function S(e){document.querySelectorAll(f.newFormModalTrigger).forEach(r=>{r.addEventListener("click",async c=>{c.preventDefault(),await y("@typo3/form/backend/form-wizard/form-wizard.js");const n=k`<typo3-backend-form-wizard .formManager=${e}></typo3-backend-form-wizard>`;l.advanced({title:t.get("formManager.newFormWizard.step1.title"),content:n,severity:w.notice,size:l.sizes.medium,staticBackdrop:!0,buttons:[]})})})}function T(e){document.querySelectorAll(f.removeFormModalTrigger).forEach(r=>{r.addEventListener("click",async c=>{const n=[];c.preventDefault(),n.push({text:t.get("formManager.cancel"),active:!0,btnClass:"btn-default",name:"cancel",trigger:function(i,o){o.hideModal()}}),n.push({text:t.get("formManager.remove_form"),active:!0,btnClass:"btn-danger",name:"createform",trigger:function(i,o){new M(e.getAjaxEndpoint("delete")).post({formPersistenceIdentifier:r.dataset.formPersistenceIdentifier}).then(async s=>{const d=await s.resolve();d.status==="success"?document.location=d.url:b.error(d.title,d.message),o.hideModal()})}}),l.show(t.get("formManager.remove_form_title"),t.get("formManager.remove_form_message",{0:r.dataset.formName}),h.error,n)})})}function x(e){document.querySelectorAll(f.duplicateFormModalTrigger).forEach(r=>{r.addEventListener("click",async c=>{c.preventDefault(),await y("@typo3/form/backend/form-wizard/form-wizard.js");const n={name:r.dataset.formName,persistenceIdentifier:r.dataset.formPersistenceIdentifier},i=k`<typo3-backend-form-wizard .formManager=${e} .duplicateForm=${n}></typo3-backend-form-wizard>`;l.advanced({title:t.get("formManager.duplicateFormWizard.step1.title",{0:r.dataset.formName}),content:i,severity:w.notice,size:l.sizes.medium,staticBackdrop:!0,buttons:[]})})})}function I(e){document.querySelectorAll(f.showReferences).forEach(r=>{r.addEventListener("click",c=>{c.preventDefault();const n=e.getAjaxEndpoint("references")+"&formPersistenceIdentifier="+r.dataset.formPersistenceIdentifier;new M(n).get().then(async i=>{const o=await i.resolve();let s;const d=[];d.push({text:t.get("formManager.cancel"),active:!0,btnClass:"btn-default",name:"cancel",trigger:function(a,m){m.hideModal()}});const E=o.references.length,F=await v.getIcon("actions-open",v.sizes.small);if(E>0){s='<h2 class="h3">'+t.get("formManager.references.headline")+'</h2><div class="table-fit"><table id="forms" class="table table-striped table-hover"><thead><tr><th class="col-icon"></th><th class="col-recordtitle">'+t.get("formManager.table.field.title")+"</th><th>"+t.get("formManager.table.field.uid")+'</th><th class="col-control nowrap"><span class="visually-hidden">'+t.get("formManager.table.field.control")+"</span></th></tr></thead><tbody>";for(let a=0,m=o.references.length;a<m;++a)s+='<tr><td class="col-icon">'+o.references[a].recordIcon+'</td><td class="col-recordtitle"><a href="'+u.encodeHtml(o.references[a].recordEditUrl)+'" data-identifier="referenceLink">'+u.encodeHtml(o.references[a].recordTitle)+"</a></td><td>"+u.encodeHtml(o.references[a].recordUid)+'</td><td class="col-control"><div class="btn-group" role="group"><a href="'+u.encodeHtml(o.references[a].recordEditUrl)+'" data-identifier="referenceLink" class="btn btn-default" title="'+t.get("formManager.btn.edit.title")+'">'+F+"</a></div></td></tr>";s+="</tbody></table></div>"}else s="<div><h1>"+t.get("formManager.references.title",{0:u.encodeHtml(o.formPersistenceIdentifier)})+"</h1></div><div>"+t.get("formManager.no_references")+"</div>";const g=document.createElement("template");g.innerHTML=s;const p=g.content;p.querySelectorAll(f.referenceLink).forEach(a=>{a.addEventListener("click",m=>{m.preventDefault(),l.currentModal.hideModal(),document.location=m.currentTarget.href})}),l.show(t.get("formManager.references.title",{0:r.dataset.formName}),p,h.notice,d)}).catch(i=>{i instanceof L&&b.error(i.response.statusText,String(i.response.status),2)})})})}function j(e){T(e),S(e),x(e),I(e)}export{j as bootstrap};
|
||||
+13
@@ -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/ajax/ajax-request.js";import s from"~labels/form.form_manager_javascript";class a{constructor(e){this.context=e}async execute(){const e=this.context.getDataStore(),r=this.context.formManager.getAjaxEndpoint("create"),t=await(await new o(r).post({formName:e.settings.formName,templatePath:e.settings.template,prototypeName:e.settings.prototype,storage:e.storage.typeIdentifier,storageLocation:e.settings.storageLocation})).resolve();return t?.status==="success"?{success:!0,finisher:{identifier:"redirect",module:"@typo3/backend/wizard/finisher/redirect-finisher.js",data:{url:t.url},labels:{successTitle:s.get("formManager.finisher.redirect.success.title"),successDescription:s.get("formManager.finisher.redirect.success.description")}}}:{success:!1,errors:[t?.message]}}}export{a as CreateFormSubmissionService};
|
||||
+13
@@ -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 i from"@typo3/core/ajax/ajax-request.js";import r from"~labels/form.form_manager_javascript";class o{constructor(e,s){this.context=e,this.formPersistenceIdentifier=s}async execute(){const e=this.context.getDataStore(),s=this.context.formManager.getAjaxEndpoint("duplicate"),t=await(await new i(s).post({formName:e.settings.formName,storage:e.storage.typeIdentifier,storageLocation:e.settings.storageLocation,formPersistenceIdentifier:this.formPersistenceIdentifier})).resolve();return t?.status==="success"?{success:!0,finisher:{identifier:"redirect",module:"@typo3/backend/wizard/finisher/redirect-finisher.js",data:{url:t.url},labels:{successTitle:r.get("formManager.finisher.redirect.success.title"),successDescription:r.get("formManager.finisher.redirect.success.description")}}}:{success:!1,errors:[t?.message]}}}export{o as DuplicateFormSubmissionService};
|
||||
@@ -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/wizard/wizard.js";import{state as d,property as l,query as S,customElement as w}from"lit/decorators.js";import u from"@typo3/form/backend/form-wizard/steps/settings-step.js";import{LitElement as g,html as f}from"lit";import c from"~labels/form.form_manager_javascript";import{StepSummaryEvent as h}from"@typo3/backend/wizard/events/step-summary-event.js";import{DuplicateFormSubmissionService as v}from"@typo3/form/backend/form-wizard/finisher/duplicate-form-submission-service.js";import y from"@typo3/form/backend/form-wizard/steps/mode-step.js";import{CreateFormSubmissionService as z}from"@typo3/form/backend/form-wizard/finisher/create-form-submission-service.js";import{FormManager as M}from"@typo3/form/backend/form-manager.js";import{AutoAdvanceEvent as F}from"@typo3/backend/wizard/events/auto-advance-event.js";import{StorageStep as b}from"@typo3/form/backend/form-wizard/steps/storage-step.js";var a=function(o,t,e,s){var n=arguments.length,i=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(o,t,e,s);else for(var p=o.length-1;p>=0;p--)(m=o[p])&&(i=(n<3?m(i):n>3?m(t,e,i):m(t,e))||i);return n>3&&i&&Object.defineProperty(t,e,i),i};let r=class extends g{constructor(){super(...arguments),this.steps=[],this.errorMessage=null,this.duplicateForm=null}connectedCallback(){super.connectedCallback(),this.addEventListener(h.eventName,this.handleStepSummary)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(h.eventName,this.handleStepSummary)}firstUpdated(t){if(super.firstUpdated(t),this.formManager.getAccessibleStorageAdapters().length<1){this.errorMessage=c.get("formManager.newFormWizard.step1.noStorages");return}const e={wizard:this.wizard,formManager:this.formManager,getStoreData:this.wizard.getStoreData.bind(this.wizard),setStoreData:this.wizard.setStoreData.bind(this.wizard),clearStoreData:this.wizard.clearStoreData.bind(this.wizard),getDataStore:this.wizard.getDataStore.bind(this.wizard),dispatchAutoAdvance:()=>this.wizard.dispatchEvent(new F)};this.duplicateForm!=null?(this.steps=[new b(e),new u(e)],this.submissionService=new v(e,this.duplicateForm.persistenceIdentifier)):(this.steps=[new y(e),new b(e),new u(e)],this.submissionService=new z(e))}createRenderRoot(){return this}render(){return this.errorMessage?this.wizard.renderError(this.errorMessage):f`<typo3-backend-wizard .steps=${this.steps} .submissionService=${this.submissionService} confirm-button-label=${c.get("formManager.newFormWizard.step1.title")} skip-summary></typo3-backend-wizard>`}handleStepSummary(t){this.duplicateForm!==null&&(t.detail.summaryData=[{label:c.get("formManager.form_copied"),value:f`<typo3-backend-icon identifier=content-form size=small class=me-1></typo3-backend-icon>${this.duplicateForm.name}`},...t.detail.summaryData])}};a([d()],r.prototype,"steps",void 0),a([d()],r.prototype,"submissionService",void 0),a([d()],r.prototype,"errorMessage",void 0),a([l({type:M,attribute:!1})],r.prototype,"formManager",void 0),a([l({type:Object,attribute:!1})],r.prototype,"duplicateForm",void 0),a([S("typo3-backend-wizard")],r.prototype,"wizard",void 0),r=a([w("typo3-backend-form-wizard")],r);export{r as FormWizard};
|
||||
@@ -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}from"lit";import{live as l}from"lit/directives/live.js";import{unsafeHTML as c}from"lit/directives/unsafe-html.js";import t from"~labels/form.form_manager_javascript";var a;(function(i){i.Blank="blank",i.Predefined="predefined"})(a||(a={}));class n{constructor(e){this.context=e,this.key="mode",this.title=t.get("formManager.newFormWizard.step1.progressLabel"),this.autoAdvance=!0,this.selectedMode=null,this.modes=[{key:a.Blank,label:t.get("formManager.blankForm.label"),description:t.get("formManager.blankForm.description"),iconIdentifier:"apps-pagetree-page-default"},{key:a.Predefined,label:t.get("formManager.predefinedForm.label"),description:t.get("formManager.predefinedForm.description"),iconIdentifier:"form-page"}]}isComplete(){return this.getValue()!==null}render(){return this.getValue()==null&&this.modes.length>0&&this.setValue(this.modes[0].key),s`<div class=form-mode-selection><div class=form-check-card-container>${this.modes.map(e=>s`<div class="form-check form-check-type-card"><input class=form-check-input type=radio name=${this.key} id=mode-${e.key} value=${e.key} .checked=${l(this.getValue()===e.key)} @change=${()=>this.setValue(e.key)}> <label class=form-check-label for=mode-${e.key}><span class=form-check-label-header> <typo3-backend-icon identifier=${e.iconIdentifier} size=medium></typo3-backend-icon> ${e.label} </span> <span class=form-check-label-body>${c(e.description)} </span></label></div>`)}</div></div>`}reset(){this.setValue(null),this.context.clearStoreData(this.key)}getValue(){return this.selectedMode}setValue(e){this.selectedMode=e,this.context.wizard.requestUpdate()}beforeAdvance(){this.context.setStoreData(this.key,this.getValue())}getSummaryData(){const e=this.context.getStoreData(this.key);if(!e)return[];const r=this.modes.find(o=>o.key===e);return r?[{label:t.get("formManager.newFormWizard.step.modes.summary.title"),value:s`<typo3-backend-icon identifier=${r.iconIdentifier} size=small class=me-1></typo3-backend-icon>${r.label}`}]:[]}}export{a as MODE,n as ModeStep,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{html as r,nothing as i}from"lit";import{MODE as m}from"@typo3/form/backend/form-wizard/steps/mode-step.js";import o from"~labels/form.form_manager_javascript";class c{constructor(e){this.context=e,this.key="settings",this.title=o.get("formManager.newFormWizard.step2.title"),this.autoAdvance=!0,this.data={formName:"",storageLocation:"",prototype:"",template:""},this.reset()}isComplete(){return this.getValue()?.formName!==""}render(){return r`${this.renderPredefinedFormFields()} ${this.renderSavePath()} ${this.renderFormNameInput()}`}reset(){this.setValue({formName:"",storageLocation:""}),this.setPrototype(this.context.formManager.getPrototypes()[0]?.value??""),this.context.clearStoreData(this.key)}getValue(){return this.data}setValue(e){this.data={...this.data,...e},this.context.wizard.requestUpdate()}beforeAdvance(){this.context.setStoreData(this.key,this.getValue())}getSummaryData(){const e=this.context.getStoreData(this.key),a=this.context.formManager.getPrototypes().find(s=>s.value===e.prototype)?.label,n=this.context.formManager.getTemplatesForPrototype(e.prototype).find(s=>s.value===e.template)?.label,l=this.context.getStoreData("mode")===m.Predefined,t=this.context.getStoreData("storage"),g=(t?this.context.formManager.getAccessibleStorageLocationsForAdapter(t):[]).find(s=>s.value===e.storageLocation)?.label??e.storageLocation;return[...l?[{value:a,label:o.get("formManager.form_prototype")},{value:n,label:o.get("formManager.form_template")}]:[],{value:e.formName,label:o.get("formManager.form_name")},{value:g,label:o.get("formManager.form_storageLocation")}]}renderSavePath(){const e=this.context.formManager.getAccessibleStorageLocationsForAdapter(this.context.getStoreData("storage"))??[];return e.length<=1?(this.setValue({storageLocation:e[0]?.value??""}),i):(!this.data.storageLocation&&e.length>0&&this.setValue({storageLocation:e[0].value}),r`<div class=form-group><label class=form-label for=new-form-save-path>${o.get("formManager.form_storageLocation")}</label><div class=form-description>${o.get("formManager.form_storageLocation_description")}</div><select class="new-form-save-path form-select" id=new-form-save-path data-identifier=newFormSavePath @change=${a=>this.setValue({storageLocation:a.target.value})}>${e.map(a=>r`<option value=${a.value} ?selected=${a.value===this.data.storageLocation}>${a.label}</option>`)}</select></div>`)}renderFormNameInput(){return r`<div class=form-group><label class=form-label for=new-form-name>${o.get("formManager.form_name")}</label><div class=form-description>${o.get("formManager.form_name_description")}</div><input class="form-control ${this.isComplete()?"":"has-error"}" id=new-form-name data-identifier=newFormName name=newFormName .value=${this.data.formName} @input=${e=>this.setValue({formName:e.target.value})}></div>`}renderPredefinedFormFields(){const e=this.context.formManager.getPrototypes()??[];if(this.context.getStoreData("mode")!==m.Predefined||e.length<1)return i;const a=this.data.prototype,n=this.context.formManager.getTemplatesForPrototype(a);let l=i;return n.length>0&&(l=r`<div class=form-group><label class=form-label for=new-form-template>${o.get("formManager.form_template")}</label> <select class="new-form-template form-select" id=new-form-template data-identifier=newFormTemplate @change=${t=>this.setValue({template:t.target.value})}>${n.map(t=>r`<option ?selected=${t.value===this.data.template} value=${t.value}>${t.label}</option>`)}</select></div>`),r`<div class=form-group><label class=form-label for=new-form-prototype-name>${o.get("formManager.form_prototype")}</label> <select class="new-form-prototype-name form-select" id=new-form-prototype-name data-identifier=newFormPrototype @change=${t=>this.setPrototype(t.currentTarget.value)}>${e.map(t=>r`<option value=${t.value} ?selected=${t.value===this.data.prototype}>${t.label}</option>`)}</select></div>${l}`}setPrototype(e){const a=this.context.formManager.getTemplatesForPrototype(e);this.setValue({prototype:e,template:a[0]?.value??""})}}export{c as SettingsStep,c 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{html as s}from"lit";import{live as o}from"lit/directives/live.js";import{unsafeHTML as n}from"lit/directives/unsafe-html.js";import a from"~labels/form.form_manager_javascript";class r{constructor(e){this.context=e,this.key="storage",this.title=a.get("formManager.newFormWizard.step.storages.progressLabel"),this.autoAdvance=!0,this.hasDispatchedAutoAdvance=!1,this.selectedStorage=null}isComplete(){return this.getValue()!==null}render(){const e=this.context.formManager.getAccessibleStorageAdapters();let i=!1;return this.getValue()==null&&e.length>0&&(this.setValue(e[0]),e.length===1&&(i=!0)),i&&!this.hasDispatchedAutoAdvance?(this.hasDispatchedAutoAdvance=!0,this.context.dispatchAutoAdvance(),this.context.wizard.renderLoader()):s`<h2 class=h4>${a.get("formManager.newFormWizard.step.storages.title")}</h2><p>${a.get("formManager.newFormWizard.step.storages.description")}</p><div class=form-storage-selection><div class=form-check-card-container>${e.map(t=>s`<div class="form-check form-check-type-card"><input class=form-check-input type=radio name=${this.key} id=mode-${t.typeIdentifier} value=${t.typeIdentifier} .checked=${o(this.getValue()?.typeIdentifier===t.typeIdentifier)} @change=${()=>this.setValue(t)}> <label class=form-check-label for=mode-${t.typeIdentifier}><span class=form-check-label-header> <typo3-backend-icon identifier=${t.iconIdentifier} size=medium></typo3-backend-icon> ${t.label} </span> <span class=form-check-label-body>${n(t.description)} </span></label></div>`)}</div></div>`}reset(){this.setValue(null),this.context.clearStoreData(this.key)}getValue(){return this.selectedStorage}setValue(e){this.selectedStorage=e,this.context.wizard.requestUpdate()}beforeAdvance(){this.context.setStoreData(this.key,this.getValue())}getSummaryData(){const e=this.context.getStoreData(this.key);return e?[{label:a.get("formManager.newFormWizard.step.storages.summary.title"),value:s`<typo3-backend-icon identifier=${e.iconIdentifier} size=small class=me-1></typo3-backend-icon>${e.label}`}]:[]}}export{r as StorageStep,r 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{loadModule as a}from"@typo3/core/java-script-item-processor.js";import r from"@typo3/core/document-service.js";class l{static dispatchFormEditor(o,t){r.ready().then(()=>{Promise.all([a(o.app),a(o.mediator),a(o.viewModel)]).then(e=>((d,i,n)=>{window.TYPO3.FORMEDITOR_APP=d.getInstance(t,i,n).run()})(...e))})}static dispatchFormManager(o,t){r.ready().then(()=>{Promise.all([a(o.app),a(o.viewModel)]).then(e=>((d,i)=>{window.TYPO3.FORMMANAGER_APP=d.getInstance(t,i).run()})(...e))})}}export{l as Helper};
|
||||
Reference in New Issue
Block a user