Commit f86a3e1c authored by Benjamin Kott's avatar Benjamin Kott Committed by Benni Mack
Browse files

[TASK] Use @typo3/icons within TableWizardElement

Resolves: #95348
Releases: master
Change-Id: I66214bec9ade995f43a16698629b89f0be5cc1c8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71230

Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent a5aff368
......@@ -11,13 +11,13 @@
* The TYPO3 project - inspiring people to share!
*/
import {html, LitElement, TemplateResult, render} from 'lit';
import {customElement, property} from 'lit/decorators';
import {lll} from 'TYPO3/CMS/Core/lit-helper';
import { html, LitElement, TemplateResult, render } from 'lit';
import { customElement, property } from 'lit/decorators';
import { lll } from 'TYPO3/CMS/Core/lit-helper';
import 'TYPO3/CMS/Backend/Element/IconElement';
import Severity = require('TYPO3/CMS/Backend/Severity');
import Modal = require('TYPO3/CMS/Backend/Modal');
import {SeverityEnum} from 'TYPO3/CMS/Backend/Enum/Severity';
import { SeverityEnum } from 'TYPO3/CMS/Backend/Enum/Severity';
/**
* Module: TYPO3/CMS/Backend/Element/TableWizardElement
......@@ -31,10 +31,10 @@ import {SeverityEnum} from 'TYPO3/CMS/Backend/Enum/Severity';
*/
@customElement('typo3-backend-table-wizard')
export class TableWizardElement extends LitElement {
@property({type: String}) type: string = 'textarea';
@property({type: String}) selectorData: string = '';
@property({type: Number, attribute: 'append-rows'}) appendRows: number = 1;
@property({type: Object}) l10n: any = {};
@property({ type: String }) type: string = 'textarea';
@property({ type: String }) selectorData: string = '';
@property({ type: Number, attribute: 'append-rows' }) appendRows: number = 1;
@property({ type: Object }) l10n: any = {};
private table: string[][] = [];
......@@ -74,7 +74,7 @@ export class TableWizardElement extends LitElement {
let table: string[][] = [];
textarea.value.split('\n').forEach((row: string) => {
if(row !== '') {
if (row !== '') {
let cols = row.split('|')
table.push(cols)
}
......@@ -206,16 +206,16 @@ export class TableWizardElement extends LitElement {
return html`
<span class="btn-group">
<button class="btn btn-default" type="button" title="${lll('table_smallFields')}"
@click="${(evt: Event) => this.toggleType(evt)}">
@click="${(evt: Event) => this.toggleType(evt)}">
<typo3-backend-icon identifier="${this.type === 'input' ? 'actions-chevron-expand' : 'actions-chevron-contract'}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${lll('table_setCount')}"
@click="${(evt: Event) => this.showTableConfigurationModal(evt)}">
<span class="t3-icon fa fa-fw fa-plus"></span>
@click="${(evt: Event) => this.showTableConfigurationModal(evt)}">
<typo3-backend-icon identifier="actions-add" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${lll('table_showCode')}"
@click="${(evt: Event) => this.showTableSyntax(evt)}">
<span class="t3-icon fa fa-fw fa-code"></span>
@click="${(evt: Event) => this.showTableSyntax(evt)}">
<typo3-backend-icon identifier="actions-code" size="small"></typo3-backend-icon>
</button>
</span>
`;
......@@ -224,31 +224,31 @@ export class TableWizardElement extends LitElement {
private renderColButtons(col: number, last: number): TemplateResult {
const leftButton = {
title: col === 0 ? lll('table_end') : lll('table_left'),
class: col === 0 ? 'double-right' : 'left',
class: col === 0 ? 'bar-right' : 'left',
target: col === 0 ? last : col - 1,
};
const rightButton = {
title: col === last ? lll('table_start') : lll('table_right'),
class: col === last ? 'double-left' : 'right',
class: col === last ? 'bar-left' : 'right',
target: col === last ? 0 : col + 1,
};
return html`
<span class="btn-group">
<button class="btn btn-default" type="button" title="${leftButton.title}"
@click="${(evt: Event) => this.moveColumn(evt, col, leftButton.target)}">
<span class="t3-icon fa fa-fw fa-angle-${leftButton.class}"></span>
<typo3-backend-icon identifier="actions-chevron-${leftButton.class}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${rightButton.title}"
@click="${(evt: Event) => this.moveColumn(evt, col, rightButton.target)}">
<span class="t3-icon fa fa-fw fa-angle-${rightButton.class}"></span>
<typo3-backend-icon identifier="actions-chevron-${rightButton.class}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${lll('table_removeColumn')}"
@click="${(evt: Event) => this.removeColumn(evt, col)}">
<span class="t3-icon fa fa-fw fa-trash"></span>
<typo3-backend-icon identifier="actions-delete" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${lll('table_addColumn')}"
@click="${(evt: Event) => this.appendColumn(evt, col)}">
<span class="t3-icon fa fa-fw fa-plus"></span>
<typo3-backend-icon identifier="actions-add" size="small"></typo3-backend-icon>
</button>
</span>
`;
......@@ -257,31 +257,31 @@ export class TableWizardElement extends LitElement {
private renderRowButtons(row: number, last: number): TemplateResult {
const topButton = {
title: row === 0 ? lll('table_bottom') : lll('table_up'),
class: row === 0 ? 'double-down' : 'up',
class: row === 0 ? 'bar-down' : 'up',
target: row === 0 ? last : row - 1,
};
const bottomButton = {
title: row === last ? lll('table_top') : lll('table_down'),
class: row === last ? 'double-up' : 'down',
class: row === last ? 'bar-up' : 'down',
target: row === last ? 0 : row + 1,
};
return html`
<span class="btn-group${this.type === 'input' ? '' : '-vertical'}">
<button class="btn btn-default" type="button" title="${topButton.title}"
@click="${(evt: Event) => this.moveRow(evt, row, topButton.target)}">
<span class="t3-icon fa fa-fw fa-angle-${topButton.class}"></span>
<typo3-backend-icon identifier="actions-chevron-${topButton.class}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${bottomButton.title}"
@click="${(evt: Event) => this.moveRow(evt, row, bottomButton.target)}">
<span class="t3-icon fa fa-fw fa-angle-${bottomButton.class}"></span>
<typo3-backend-icon identifier="actions-chevron-${bottomButton.class}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${lll('table_removeRow')}"
@click="${(evt: Event) => this.removeRow(evt, row)}">
<span class="t3-icon fa fa-fw fa-trash"></span>
<typo3-backend-icon identifier="actions-delete" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${lll('table_addRow')}"
@click="${(evt: Event) => this.appendRow(evt, row)}">
<span class="t3-icon fa fa-fw fa-plus"></span>
<typo3-backend-icon identifier="actions-add" size="small"></typo3-backend-icon>
</button>
</span>
`;
......
......@@ -10,7 +10,7 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __decorate=this&&this.__decorate||function(t,e,l,a){var s,n=arguments.length,o=n<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,l):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,l,a);else for(var i=t.length-1;i>=0;i--)(s=t[i])&&(o=(n<3?s(o):n>3?s(e,l,o):s(e,l))||o);return n>3&&o&&Object.defineProperty(e,l,o),o};define(["require","exports","lit","lit/decorators","TYPO3/CMS/Core/lit-helper","TYPO3/CMS/Backend/Severity","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Enum/Severity","TYPO3/CMS/Backend/Element/IconElement"],(function(t,e,l,a,s,n,o,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableWizardElement=void 0;let r=class extends l.LitElement{constructor(){super(),this.type="textarea",this.selectorData="",this.appendRows=1,this.l10n={},this.table=[],this.selectorData=this.getAttribute("selector"),this.readTableFromTextarea()}get firstRow(){return this.table[0]||[]}createRenderRoot(){return this}render(){return this.renderTemplate()}provideMinimalTable(){0!==this.table.length&&0!==this.firstRow.length||(this.table=[[""]])}readTableFromTextarea(){let t=document.querySelector(this.selectorData),e=[];t.value.split("\n").forEach(t=>{if(""!==t){let l=t.split("|");e.push(l)}}),this.table=e}writeTableSyntaxToTextarea(){let t=document.querySelector(this.selectorData),e="";this.table.forEach(t=>{e+=t.join("|")+"\n"}),t.value=e}modifyTable(t,e,l){const a=t.target;this.table[e][l]=a.value,this.writeTableSyntaxToTextarea(),this.requestUpdate()}toggleType(t){this.type="input"===this.type?"textarea":"input"}moveColumn(t,e,l){this.table=this.table.map(t=>{const a=t.splice(e,1);return t.splice(l,0,...a),t}),this.writeTableSyntaxToTextarea(),this.requestUpdate()}appendColumn(t,e){this.table=this.table.map(t=>(t.splice(e+1,0,""),t)),this.writeTableSyntaxToTextarea(),this.requestUpdate()}removeColumn(t,e){this.table=this.table.map(t=>(t.splice(e,1),t)),this.writeTableSyntaxToTextarea(),this.requestUpdate()}moveRow(t,e,l){const a=this.table.splice(e,1);this.table.splice(l,0,...a),this.writeTableSyntaxToTextarea(),this.requestUpdate()}appendRow(t,e){let l=this.firstRow.concat().fill(""),a=new Array(this.appendRows).fill(l);this.table.splice(e+1,0,...a),this.writeTableSyntaxToTextarea(),this.requestUpdate()}removeRow(t,e){this.table.splice(e,1),this.writeTableSyntaxToTextarea(),this.requestUpdate()}renderTemplate(){this.provideMinimalTable();const t=Object.keys(this.firstRow).map(t=>parseInt(t,10)),e=t[t.length-1],a=this.table.length-1;return l.html`
var __decorate=this&&this.__decorate||function(t,e,l,a){var n,o=arguments.length,i=o<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,l):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,l,a);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(i=(o<3?n(i):o>3?n(e,l,i):n(e,l))||i);return o>3&&i&&Object.defineProperty(e,l,i),i};define(["require","exports","lit","lit/decorators","TYPO3/CMS/Core/lit-helper","TYPO3/CMS/Backend/Severity","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Enum/Severity","TYPO3/CMS/Backend/Element/IconElement"],(function(t,e,l,a,n,o,i,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableWizardElement=void 0;let r=class extends l.LitElement{constructor(){super(),this.type="textarea",this.selectorData="",this.appendRows=1,this.l10n={},this.table=[],this.selectorData=this.getAttribute("selector"),this.readTableFromTextarea()}get firstRow(){return this.table[0]||[]}createRenderRoot(){return this}render(){return this.renderTemplate()}provideMinimalTable(){0!==this.table.length&&0!==this.firstRow.length||(this.table=[[""]])}readTableFromTextarea(){let t=document.querySelector(this.selectorData),e=[];t.value.split("\n").forEach(t=>{if(""!==t){let l=t.split("|");e.push(l)}}),this.table=e}writeTableSyntaxToTextarea(){let t=document.querySelector(this.selectorData),e="";this.table.forEach(t=>{e+=t.join("|")+"\n"}),t.value=e}modifyTable(t,e,l){const a=t.target;this.table[e][l]=a.value,this.writeTableSyntaxToTextarea(),this.requestUpdate()}toggleType(t){this.type="input"===this.type?"textarea":"input"}moveColumn(t,e,l){this.table=this.table.map(t=>{const a=t.splice(e,1);return t.splice(l,0,...a),t}),this.writeTableSyntaxToTextarea(),this.requestUpdate()}appendColumn(t,e){this.table=this.table.map(t=>(t.splice(e+1,0,""),t)),this.writeTableSyntaxToTextarea(),this.requestUpdate()}removeColumn(t,e){this.table=this.table.map(t=>(t.splice(e,1),t)),this.writeTableSyntaxToTextarea(),this.requestUpdate()}moveRow(t,e,l){const a=this.table.splice(e,1);this.table.splice(l,0,...a),this.writeTableSyntaxToTextarea(),this.requestUpdate()}appendRow(t,e){let l=this.firstRow.concat().fill(""),a=new Array(this.appendRows).fill(l);this.table.splice(e+1,0,...a),this.writeTableSyntaxToTextarea(),this.requestUpdate()}removeRow(t,e){this.table.splice(e,1),this.writeTableSyntaxToTextarea(),this.requestUpdate()}renderTemplate(){this.provideMinimalTable();const t=Object.keys(this.firstRow).map(t=>parseInt(t,10)),e=t[t.length-1],a=this.table.length-1;return l.html`
<style>
:host, typo3-backend-table-wizard { display: inline-block; }
</style>
......@@ -34,72 +34,72 @@ var __decorate=this&&this.__decorate||function(t,e,l,a){var s,n=arguments.length
</tbody>
</table>
</div>
`}renderDataElement(t,e,a){const s=t=>this.modifyTable(t,e,a);switch(this.type){case"input":return l.html`
`}renderDataElement(t,e,a){const n=t=>this.modifyTable(t,e,a);switch(this.type){case"input":return l.html`
<input class="form-control" type="text" name="TABLE[c][${e}][${a}]"
@change="${s}" .value="${t.replace(/\n/g,"<br>")}">
@change="${n}" .value="${t.replace(/\n/g,"<br>")}">
`;case"textarea":default:return l.html`
<textarea class="form-control" rows="6" name="TABLE[c][${e}][${a}]"
@change="${s}" .value="${t.replace(/<br[ ]*\/?>/g,"\n")}"></textarea>
@change="${n}" .value="${t.replace(/<br[ ]*\/?>/g,"\n")}"></textarea>
`}}renderTypeButton(){return l.html`
<span class="btn-group">
<button class="btn btn-default" type="button" title="${s.lll("table_smallFields")}"
@click="${t=>this.toggleType(t)}">
<button class="btn btn-default" type="button" title="${n.lll("table_smallFields")}"
@click="${t=>this.toggleType(t)}">
<typo3-backend-icon identifier="${"input"===this.type?"actions-chevron-expand":"actions-chevron-contract"}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${s.lll("table_setCount")}"
@click="${t=>this.showTableConfigurationModal(t)}">
<span class="t3-icon fa fa-fw fa-plus"></span>
<button class="btn btn-default" type="button" title="${n.lll("table_setCount")}"
@click="${t=>this.showTableConfigurationModal(t)}">
<typo3-backend-icon identifier="actions-add" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${s.lll("table_showCode")}"
@click="${t=>this.showTableSyntax(t)}">
<span class="t3-icon fa fa-fw fa-code"></span>
<button class="btn btn-default" type="button" title="${n.lll("table_showCode")}"
@click="${t=>this.showTableSyntax(t)}">
<typo3-backend-icon identifier="actions-code" size="small"></typo3-backend-icon>
</button>
</span>
`}renderColButtons(t,e){const a={title:0===t?s.lll("table_end"):s.lll("table_left"),class:0===t?"double-right":"left",target:0===t?e:t-1},n={title:t===e?s.lll("table_start"):s.lll("table_right"),class:t===e?"double-left":"right",target:t===e?0:t+1};return l.html`
`}renderColButtons(t,e){const a={title:0===t?n.lll("table_end"):n.lll("table_left"),class:0===t?"bar-right":"left",target:0===t?e:t-1},o={title:t===e?n.lll("table_start"):n.lll("table_right"),class:t===e?"bar-left":"right",target:t===e?0:t+1};return l.html`
<span class="btn-group">
<button class="btn btn-default" type="button" title="${a.title}"
@click="${e=>this.moveColumn(e,t,a.target)}">
<span class="t3-icon fa fa-fw fa-angle-${a.class}"></span>
<typo3-backend-icon identifier="actions-chevron-${a.class}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${n.title}"
@click="${e=>this.moveColumn(e,t,n.target)}">
<span class="t3-icon fa fa-fw fa-angle-${n.class}"></span>
<button class="btn btn-default" type="button" title="${o.title}"
@click="${e=>this.moveColumn(e,t,o.target)}">
<typo3-backend-icon identifier="actions-chevron-${o.class}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${s.lll("table_removeColumn")}"
<button class="btn btn-default" type="button" title="${n.lll("table_removeColumn")}"
@click="${e=>this.removeColumn(e,t)}">
<span class="t3-icon fa fa-fw fa-trash"></span>
<typo3-backend-icon identifier="actions-delete" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${s.lll("table_addColumn")}"
<button class="btn btn-default" type="button" title="${n.lll("table_addColumn")}"
@click="${e=>this.appendColumn(e,t)}">
<span class="t3-icon fa fa-fw fa-plus"></span>
<typo3-backend-icon identifier="actions-add" size="small"></typo3-backend-icon>
</button>
</span>
`}renderRowButtons(t,e){const a={title:0===t?s.lll("table_bottom"):s.lll("table_up"),class:0===t?"double-down":"up",target:0===t?e:t-1},n={title:t===e?s.lll("table_top"):s.lll("table_down"),class:t===e?"double-up":"down",target:t===e?0:t+1};return l.html`
`}renderRowButtons(t,e){const a={title:0===t?n.lll("table_bottom"):n.lll("table_up"),class:0===t?"bar-down":"up",target:0===t?e:t-1},o={title:t===e?n.lll("table_top"):n.lll("table_down"),class:t===e?"bar-up":"down",target:t===e?0:t+1};return l.html`
<span class="btn-group${"input"===this.type?"":"-vertical"}">
<button class="btn btn-default" type="button" title="${a.title}"
@click="${e=>this.moveRow(e,t,a.target)}">
<span class="t3-icon fa fa-fw fa-angle-${a.class}"></span>
<typo3-backend-icon identifier="actions-chevron-${a.class}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${n.title}"
@click="${e=>this.moveRow(e,t,n.target)}">
<span class="t3-icon fa fa-fw fa-angle-${n.class}"></span>
<button class="btn btn-default" type="button" title="${o.title}"
@click="${e=>this.moveRow(e,t,o.target)}">
<typo3-backend-icon identifier="actions-chevron-${o.class}" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${s.lll("table_removeRow")}"
<button class="btn btn-default" type="button" title="${n.lll("table_removeRow")}"
@click="${e=>this.removeRow(e,t)}">
<span class="t3-icon fa fa-fw fa-trash"></span>
<typo3-backend-icon identifier="actions-delete" size="small"></typo3-backend-icon>
</button>
<button class="btn btn-default" type="button" title="${s.lll("table_addRow")}"
<button class="btn btn-default" type="button" title="${n.lll("table_addRow")}"
@click="${e=>this.appendRow(e,t)}">
<span class="t3-icon fa fa-fw fa-plus"></span>
<typo3-backend-icon identifier="actions-add" size="small"></typo3-backend-icon>
</button>
</span>
`}showTableConfigurationModal(t){const e=this.firstRow.length,a=this.table.length,r=a||1,c=e||1;o.advanced({content:"",title:s.lll("table_setCountHeadline"),severity:i.SeverityEnum.notice,size:o.sizes.small,buttons:[{text:s.lll("button.close")||"Close",active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>o.dismiss()},{text:s.lll("table_buttonApply")||"Apply",btnClass:"btn-"+n.getCssClass(i.SeverityEnum.info),name:"apply",trigger:()=>{const l=o.currentModal[0].querySelector("#t3js-expand-rows"),s=o.currentModal[0].querySelector("#t3js-expand-cols");if(null!==l&&null!==s)if(l.checkValidity()&&s.checkValidity()){const n=Number(l.value)-a,i=Number(s.value)-e;this.setColAndRowCount(t,i,n),o.dismiss()}else l.reportValidity(),s.reportValidity()}}],callback:t=>{l.render(l.html`
`}showTableConfigurationModal(t){const e=this.firstRow.length,a=this.table.length,r=a||1,c=e||1;i.advanced({content:"",title:n.lll("table_setCountHeadline"),severity:s.SeverityEnum.notice,size:i.sizes.small,buttons:[{text:n.lll("button.close")||"Close",active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>i.dismiss()},{text:n.lll("table_buttonApply")||"Apply",btnClass:"btn-"+o.getCssClass(s.SeverityEnum.info),name:"apply",trigger:()=>{const l=i.currentModal[0].querySelector("#t3js-expand-rows"),n=i.currentModal[0].querySelector("#t3js-expand-cols");if(null!==l&&null!==n)if(l.checkValidity()&&n.checkValidity()){const o=Number(l.value)-a,s=Number(n.value)-e;this.setColAndRowCount(t,s,o),i.dismiss()}else l.reportValidity(),n.reportValidity()}}],callback:t=>{l.render(l.html`
<div class="form-group ">
<label>${s.lll("table_rowCount")}</label>
<label>${n.lll("table_rowCount")}</label>
<input id="t3js-expand-rows" class="form-control" type="number" min="1" required value="${r}">
</div>
<div class="form-group ">
<label>${s.lll("table_colCount")}</label>
<label>${n.lll("table_colCount")}</label>
<input id="t3js-expand-cols" class="form-control" type="number" min="1" required value="${c}">
</div>
`,t[0].querySelector(".t3js-modal-body"))}})}showTableSyntax(t){o.advanced({content:"",title:s.lll("table_showCode"),severity:i.SeverityEnum.notice,size:o.sizes.small,buttons:[{text:s.lll("button.close")||"Close",active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>o.dismiss()},{text:s.lll("table_buttonApply")||"Apply",btnClass:"btn-"+n.getCssClass(i.SeverityEnum.info),name:"apply",trigger:()=>{document.querySelector(this.selectorData).value=o.currentModal[0].querySelector("textarea").value,this.readTableFromTextarea(),this.requestUpdate(),o.dismiss()}}],callback:t=>{let e=document.querySelector(this.selectorData);l.render(l.html`<textarea style="width: 100%;">${e.value}</textarea>`,t[0].querySelector(".t3js-modal-body"))}})}setColAndRowCount(t,e,l){const a=this.table.length;if(l>0)for(let e=0;e<l;e++)this.appendRow(t,a);else for(let e=0;e<Math.abs(l);e++)this.removeRow(t,this.table.length-1);if(e>0)for(let l=0;l<e;l++)this.appendColumn(t,e);else for(let l=0;l<Math.abs(e);l++)this.removeColumn(t,this.firstRow.length-1)}};__decorate([a.property({type:String})],r.prototype,"type",void 0),__decorate([a.property({type:String})],r.prototype,"selectorData",void 0),__decorate([a.property({type:Number,attribute:"append-rows"})],r.prototype,"appendRows",void 0),__decorate([a.property({type:Object})],r.prototype,"l10n",void 0),r=__decorate([a.customElement("typo3-backend-table-wizard")],r),e.TableWizardElement=r}));
\ No newline at end of file
`,t[0].querySelector(".t3js-modal-body"))}})}showTableSyntax(t){i.advanced({content:"",title:n.lll("table_showCode"),severity:s.SeverityEnum.notice,size:i.sizes.small,buttons:[{text:n.lll("button.close")||"Close",active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>i.dismiss()},{text:n.lll("table_buttonApply")||"Apply",btnClass:"btn-"+o.getCssClass(s.SeverityEnum.info),name:"apply",trigger:()=>{document.querySelector(this.selectorData).value=i.currentModal[0].querySelector("textarea").value,this.readTableFromTextarea(),this.requestUpdate(),i.dismiss()}}],callback:t=>{let e=document.querySelector(this.selectorData);l.render(l.html`<textarea style="width: 100%;">${e.value}</textarea>`,t[0].querySelector(".t3js-modal-body"))}})}setColAndRowCount(t,e,l){const a=this.table.length;if(l>0)for(let e=0;e<l;e++)this.appendRow(t,a);else for(let e=0;e<Math.abs(l);e++)this.removeRow(t,this.table.length-1);if(e>0)for(let l=0;l<e;l++)this.appendColumn(t,e);else for(let l=0;l<Math.abs(e);l++)this.removeColumn(t,this.firstRow.length-1)}};__decorate([a.property({type:String})],r.prototype,"type",void 0),__decorate([a.property({type:String})],r.prototype,"selectorData",void 0),__decorate([a.property({type:Number,attribute:"append-rows"})],r.prototype,"appendRows",void 0),__decorate([a.property({type:Object})],r.prototype,"l10n",void 0),r=__decorate([a.customElement("typo3-backend-table-wizard")],r),e.TableWizardElement=r}));
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment