Commit d0da616d authored by Benjamin Franzke's avatar Benjamin Franzke
Browse files

[TASK] Update to Lit v2-rc1

Lit is the umbrella term for the next major
lit-html (v2) and lit-element (v3) versions.
Therefore we will refer to these components as
*Lit* in TYPO3 from now on as well.

These two libraries also have been migrated into
a single entry point module named `lit`.
It is officially described as:
> The main module exports the core pieces needed for component
> development: LitElement, html, css, and the most

lit-html v2 and lit-element v3 are mostly compatible
to the previous major versions. Main changes are

 * Deprecation of the `lit-element` entry point in
   favor of the new `lit` module
 * @internalProperty changed to @state
 * shadow css declaration via static property
   instead of static getter method
 * The CSSResult type declaration is gone
 * Directive (currently unused in TYPO3) API has changed

Related testing framework change is:
https://github.com/TYPO3/testing-framework/pull/229

Commands used:

  rm -rf typo3/sysext/core/Resources/Public/JavaScript/Contrib/{@lit,lit-element,lit-html,lit}/
  yarn add lit@^2.0.0-rc.1 lit-html@^2.0.0-rc.2 lit-element@^3.0.0-rc.1
  yarn add --dev rollup@^2.32.0 @rollup/plugin-replace
  grunt build
  git add typo3/sysext/core/Resources/Public/JavaScript/Contrib/{@lit,lit-element,lit-html,lit}/

  composer require --dev typo3/testing-framework:^6.8.1
  composer require --dev typo3/testing-framework:^6.8.1 \
    --no-update --working-dir=typo3/sysext/core

Resolves: #93965
Releases: master
Change-Id: I9b659d851e6ad9dc3cc649bd40aab886b86fb0f8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68104

Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
parent 0005bc5b
......@@ -12,6 +12,7 @@
"yarn": "^1.22.0"
},
"devDependencies": {
"@rollup/plugin-replace": "^2.4.2",
"@types/bootstrap": "^5.0.9",
"@types/chosen-js": "^1.8.1",
"@types/chrome": "^0.0.123",
......@@ -61,6 +62,7 @@
"patch-package": "^6.2.2",
"postcss-banner": "^3.0.2",
"postcss-clean": "^1.1.0",
"rollup": "^2.32.0",
"stylefmt": "^6.0.3",
"stylelint": "^13.12.0",
"terser": "^5.3.2",
......@@ -97,8 +99,9 @@
"imagesloaded": "^4.1.4",
"jquery": "^3.5.1",
"jquery-ui": "github:jquery/jquery-ui#1.11.4",
"lit-element": "^2.4",
"lit-html": "^1.3",
"lit": "^2.0.0-rc.1",
"lit-element": "^3.0.0-rc.1",
"lit-html": "^2.0.0-rc.2",
"moment": "^2.29.0",
"moment-timezone": "^0.5.31",
"muuri": "^0.9.3",
......
......@@ -405,6 +405,11 @@
resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd"
integrity sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==
"@lit/reactive-element@^1.0.0-rc.1":
version "1.0.0-rc.1"
resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.0.0-rc.1.tgz#3e6639241de1f63f7746b4b410df1c7fb206e15f"
integrity sha512-TLRPKOhQLNOMcpCXHiTKrNKX5eNzhf9y07jp27MXkjTH1IbXFvcT9/mVdOG/3qfMkip+iO6CEfv5a+y0wFhQig==
"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
......@@ -444,6 +449,23 @@
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.6.0.tgz#f022195afdfc942e088ee2101285a1d31c7d727f"
integrity sha512-cPqjjzuFWNK3BSKLm0abspP0sp/IGOli4p5I5fKFAzdS8fvjdOwDCfZqAaIiXd9lPkOWi3SUUfZof3hEb7J/uw==
"@rollup/plugin-replace@^2.4.2":
version "2.4.2"
resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a"
integrity sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==
dependencies:
"@rollup/pluginutils" "^3.1.0"
magic-string "^0.25.7"
"@rollup/pluginutils@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
dependencies:
"@types/estree" "0.0.39"
estree-walker "^1.0.1"
picomatch "^2.2.2"
"@sindresorhus/is@^0.7.0":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd"
......@@ -514,6 +536,11 @@
resolved "https://registry.yarnpkg.com/@types/d3-selection/-/d3-selection-2.0.0.tgz#59df94a8e47ed1050a337d4ffb4d4d213aa590a8"
integrity sha512-EF0lWZ4tg7oDFg4YQFlbOU3936e3a9UmoQ2IXlBy1+cv2c2Pv7knhKUzGlH5Hq2sF/KeDTH1amiRPey2rrLMQA==
"@types/estree@0.0.39":
version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
"@types/filesystem@*":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/filesystem/-/filesystem-0.0.29.tgz#ee3748eb5be140dcf980c3bd35f11aec5f7a3748"
......@@ -619,6 +646,11 @@
resolved "https://registry.yarnpkg.com/@types/sortablejs/-/sortablejs-1.10.6.tgz#98725ae08f1dfe28b8da0fdf302c417f5ff043c0"
integrity sha512-QRz8Z+uw2Y4Gwrtxw8hD782zzuxxugdcq8X/FkPsXUa1kfslhGzy13+4HugO9FXNo+jlWVcE6DYmmegniIQ30A==
"@types/trusted-types@^1.0.1":
version "1.0.6"
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-1.0.6.tgz#569b8a08121d3203398290d602d84d73c8dcf5da"
integrity sha512-230RC8sFeHoT6sSUlRO6a8cAnclO06eeiq1QDfiv2FGCLWFvvERWgwIQD4FWqD9A69BN7Lzee4OXwoMVnnsWDw==
"@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e"
......@@ -2989,6 +3021,11 @@ estraverse@^5.1.0, estraverse@^5.2.0:
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880"
integrity sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==
estree-walker@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
esutils@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
......@@ -5702,17 +5739,29 @@ lintspaces@^0.7.0:
minimist "^1.2.5"
rc "^1.2.8"
lit-element@^2.4:
version "2.4.0"
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-2.4.0.tgz#b22607a037a8fc08f5a80736dddf7f3f5d401452"
integrity sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==
lit-element@^3.0.0-rc.1:
version "3.0.0-rc.1"
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.0.0-rc.1.tgz#1d67c835364adc6ca051c68a7699e2123fa1a16c"
integrity sha512-SQH7LODMy+42UTOGiyHUTXronvv8Cud0Y/8Q8/1jd/9Putuh66GjN7FEjyNRxVbpIygnPqMbG854J9Ct9IJlFw==
dependencies:
lit-html "^1.1.1"
"@lit/reactive-element" "^1.0.0-rc.1"
lit-html "^2.0.0-rc.1"
lit-html@^1.1.1, lit-html@^1.3:
version "1.3.0"
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.3.0.tgz#c80f3cc5793a6dea6c07172be90a70ab20e56034"
integrity sha512-0Q1bwmaFH9O14vycPHw8C/IeHMk/uSDldVLIefu/kfbTBGIc44KGH6A8p1bDfxUfHdc8q6Ct7kQklWoHgr4t1Q==
lit-html@^2.0.0-rc.1, lit-html@^2.0.0-rc.2:
version "2.0.0-rc.2"
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.0.0-rc.2.tgz#c7ac652af1df7e5d8e32a3e6130221766d09cbde"
integrity sha512-rl3vtIQ0jq6r0GVbg+57Et9ra+iNhiz/v5V7uPTb6VxnjJaCCYKI7WkzKNlyzjMM2N/ytih3Uxb5vyyaOpjb0Q==
dependencies:
"@types/trusted-types" "^1.0.1"
lit@^2.0.0-rc.1:
version "2.0.0-rc.1"
resolved "https://registry.yarnpkg.com/lit/-/lit-2.0.0-rc.1.tgz#e1cb53ea3ba0f77b5a9235282b4b257efa8b972a"
integrity sha512-cf4r18feMhu56sO963a5MaHUn6OX2Am9sj9lzyGTYx2IPDhC9NP/Xh4rj9Ialo9dA+lI4brD7+9cxSzRIWHOmw==
dependencies:
"@lit/reactive-element" "^1.0.0-rc.1"
lit-element "^3.0.0-rc.1"
lit-html "^2.0.0-rc.1"
livereload-js@^2.3.0:
version "2.4.0"
......@@ -5928,6 +5977,13 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"
magic-string@^0.25.7:
version "0.25.7"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051"
integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==
dependencies:
sourcemap-codec "^1.4.4"
make-dir@^1.0.0, make-dir@^1.2.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c"
......@@ -7335,6 +7391,11 @@ picomatch@^2.0.4, picomatch@^2.0.5, picomatch@^2.2.1:
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==
picomatch@^2.2.2:
version "2.2.3"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.3.tgz#465547f359ccc206d3c48e46a1bcb89bf7ee619d"
integrity sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==
pify@^2.0.0, pify@^2.2.0, pify@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
......@@ -8632,6 +8693,11 @@ source-sans-pro@^3.6.0:
resolved "https://registry.yarnpkg.com/source-sans-pro/-/source-sans-pro-3.6.0.tgz#f4167065ebf096136b1b4f141dbd48886dda1486"
integrity sha512-C1RFUGu+YASuqpgDRInTM7Y6OwqeWNOuKn7v0P/4Kh66epTI4PYWwPWP5kdA4l/VqzBAWiqoz5dk0trof73R7w==
sourcemap-codec@^1.4.4:
version "1.4.8"
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==
spdx-correct@^3.0.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.1.tgz#dece81ac9c1e6713e5f7d1b6f17d468fa53d89a9"
......
......@@ -96,7 +96,7 @@
"phpstan/phpstan": "^0.12.64",
"phpunit/phpunit": "^8.5.13",
"typo3/cms-styleguide": "~11.1.0",
"typo3/testing-framework": "^6.8.0"
"typo3/testing-framework": "^6.8.1"
},
"suggest": {
"ext-gd": "GDlib/Freetype is required for building images with text (GIFBUILDER) and can also be used to scale images",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "aca1527ea046c7ec4f59152ffe60f7e5",
"content-hash": "e661c475caacd455010205b5f679d96c",
"packages": [
{
"name": "bacon/bacon-qr-code",
......@@ -7541,16 +7541,16 @@
},
{
"name": "typo3/testing-framework",
"version": "6.8.0",
"version": "6.8.1",
"source": {
"type": "git",
"url": "https://github.com/TYPO3/testing-framework.git",
"reference": "9e8e2700bef2281af5d0b8d0693dd0b0cc1bfe04"
"reference": "dd3668c24bfd0c244d68620f16d8deb227f4755c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/9e8e2700bef2281af5d0b8d0693dd0b0cc1bfe04",
"reference": "9e8e2700bef2281af5d0b8d0693dd0b0cc1bfe04",
"url": "https://api.github.com/repos/TYPO3/testing-framework/zipball/dd3668c24bfd0c244d68620f16d8deb227f4755c",
"reference": "dd3668c24bfd0c244d68620f16d8deb227f4755c",
"shasum": ""
},
"require": {
......@@ -7597,9 +7597,9 @@
"support": {
"general": "https://typo3.org/support/",
"issues": "https://github.com/TYPO3/testing-framework/issues",
"source": "https://github.com/TYPO3/testing-framework/tree/6.8.0"
"source": "https://github.com/TYPO3/testing-framework/tree/6.8.1"
},
"time": "2021-03-14T17:11:58+00:00"
"time": "2021-04-22T14:57:44+00:00"
}
],
"aliases": [],
......
......@@ -10,12 +10,14 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __decorate=this&&this.__decorate||function(e,t,i,n){var o,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,i,s):o(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};define(["require","exports","lit-element","lit-html/directives/unsafe-html","lit-html/directives/until","../Enum/IconTypes","../Icons","TYPO3/CMS/Backend/Element/SpinnerElement"],(function(e,t,i,n,o,r,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconElement=void 0;let a=class extends i.LitElement{constructor(){super(...arguments),this.size=r.Sizes.default,this.state=r.States.default,this.overlay=null,this.markup=r.MarkupIdentifiers.inline,this.raw=null}static get styles(){const e=(e,t)=>i.css`
var __decorate=this&&this.__decorate||function(e,t,i,n){var o,r=arguments.length,s=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(r<3?o(s):r>3?o(t,i,s):o(t,i))||s);return r>3&&s&&Object.defineProperty(t,i,s),s};define(["require","exports","lit","lit/decorators","lit/directives/unsafe-html","lit/directives/until","../Enum/IconTypes","../Icons","TYPO3/CMS/Backend/Element/SpinnerElement"],(function(e,t,i,n,o,r,s,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IconElement=void 0;const l=(e,t)=>i.css`
:host([size=${e}]),
:host([raw]) .icon-size-${e} {
font-size: ${t}px;
}
`;return[i.css`
`;let c=class extends i.LitElement{constructor(){super(...arguments),this.size=s.Sizes.default,this.state=s.States.default,this.overlay=null,this.markup=s.MarkupIdentifiers.inline,this.raw=null}render(){if(this.raw)return i.html`${o.unsafeHTML(this.raw)}`;if(!this.identifier)return i.html``;const e=a.getIcon(this.identifier,this.size,this.overlay,this.state,this.markup).then(e=>i.html`
${o.unsafeHTML(e)}
`);return i.html`${r.until(e,i.html`<typo3-backend-spinner></typo3-backend-spinner>`)}`}};c.styles=[i.css`
:host {
display: flex;
font-size: 1em;
......@@ -96,7 +98,4 @@ var __decorate=this&&this.__decorate||function(e,t,i,n){var o,r=arguments.length
transform: rotate(360deg);
}
}
`,e(i.unsafeCSS(r.Sizes.small),16),e(i.unsafeCSS(r.Sizes.default),32),e(i.unsafeCSS(r.Sizes.large),48),e(i.unsafeCSS(r.Sizes.mega),64)]}render(){if(this.raw)return i.html`${n.unsafeHTML(this.raw)}`;if(!this.identifier)return i.html``;const e=s.getIcon(this.identifier,this.size,this.overlay,this.state,this.markup).then(e=>i.html`
${n.unsafeHTML(e)}
`);return i.html`${o.until(e,i.html`<typo3-backend-spinner></typo3-backend-spinner>`)}`}};__decorate([i.property({type:String})],a.prototype,"identifier",void 0),__decorate([i.property({type:String,reflect:!0})],a.prototype,"size",void 0),__decorate([i.property({type:String})],a.prototype,"state",void 0),__decorate([i.property({type:String})],a.prototype,"overlay",void 0),__decorate([i.property({type:String})],a.prototype,"markup",void 0),__decorate([i.property({type:String})],a.prototype,"raw",void 0),a=__decorate([i.customElement("typo3-backend-icon")],a),t.IconElement=a}));
\ No newline at end of file
`,l(i.unsafeCSS(s.Sizes.small),16),l(i.unsafeCSS(s.Sizes.default),32),l(i.unsafeCSS(s.Sizes.large),48),l(i.unsafeCSS(s.Sizes.mega),64)],__decorate([n.property({type:String})],c.prototype,"identifier",void 0),__decorate([n.property({type:String,reflect:!0})],c.prototype,"size",void 0),__decorate([n.property({type:String})],c.prototype,"state",void 0),__decorate([n.property({type:String})],c.prototype,"overlay",void 0),__decorate([n.property({type:String})],c.prototype,"markup",void 0),__decorate([n.property({type:String})],c.prototype,"raw",void 0),c=__decorate([n.customElement("typo3-backend-icon")],c),t.IconElement=c}));
\ No newline at end of file
......@@ -10,7 +10,7 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __decorate=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o};define(["require","exports","lit-element","../Enum/IconTypes"],(function(e,t,r,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpinnerElement=void 0;let i=class extends r.LitElement{constructor(){super(...arguments),this.size=n.Sizes.default}static get styles(){return r.css`
var __decorate=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o};define(["require","exports","lit","lit/decorators","../Enum/IconTypes"],(function(e,t,r,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SpinnerElement=void 0;let s=class extends r.LitElement{constructor(){super(...arguments),this.size=i.Sizes.default}render(){return r.html`<div class="spinner"></div>`}};s.styles=r.css`
:host {
font-size: 32px;
width: 1em;
......@@ -42,4 +42,4 @@ var __decorate=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
`}render(){return r.html`<div class="spinner"></div>`}};__decorate([r.property({type:String})],i.prototype,"size",void 0),i=__decorate([r.customElement("typo3-backend-spinner")],i),t.SpinnerElement=i}));
\ No newline at end of file
`,__decorate([n.property({type:String})],s.prototype,"size",void 0),s=__decorate([n.customElement("typo3-backend-spinner")],s),t.SpinnerElement=s}));
\ No newline at end of file
......@@ -10,7 +10,7 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __decorate=this&&this.__decorate||function(t,e,l,a){var n,s=arguments.length,o=s<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--)(n=t[i])&&(o=(s<3?n(o):s>3?n(e,l,o):n(e,l))||o);return s>3&&o&&Object.defineProperty(e,l,o),o};define(["require","exports","lit-element","TYPO3/CMS/Core/lit-helper","TYPO3/CMS/Backend/Element/IconElement"],(function(t,e,l,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableWizardElement=void 0;let n=class extends l.LitElement{constructor(){super(...arguments),this.type="textarea",this.table=[],this.appendRows=1,this.l10n={}}get firstRow(){return this.table[0]||[]}createRenderRoot(){return this}render(){return this.renderTemplate()}provideMinimalTable(){0!==this.table.length&&0!==this.firstRow.length||(this.table=[[""]])}modifyTable(t,e,l){const a=t.target;this.table[e][l]=a.value,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.requestUpdate()}appendColumn(t,e){this.table=this.table.map(t=>(t.splice(e+1,0,""),t)),this.requestUpdate()}removeColumn(t,e){this.table=this.table.map(t=>(t.splice(e,1),t)),this.requestUpdate()}moveRow(t,e,l){const a=this.table.splice(e,1);this.table.splice(l,0,...a),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.requestUpdate()}removeRow(t,e){this.table.splice(e,1),this.requestUpdate()}renderTemplate(){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 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/Element/IconElement"],(function(t,e,l,a,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TableWizardElement=void 0;let n=class extends l.LitElement{constructor(){super(...arguments),this.type="textarea",this.table=[],this.appendRows=1,this.l10n={}}get firstRow(){return this.table[0]||[]}createRenderRoot(){return this}render(){return this.renderTemplate()}provideMinimalTable(){0!==this.table.length&&0!==this.firstRow.length||(this.table=[[""]])}modifyTable(t,e,l){const a=t.target;this.table[e][l]=a.value,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.requestUpdate()}appendColumn(t,e){this.table=this.table.map(t=>(t.splice(e+1,0,""),t)),this.requestUpdate()}removeColumn(t,e){this.table=this.table.map(t=>(t.splice(e,1),t)),this.requestUpdate()}moveRow(t,e,l){const a=this.table.splice(e,1);this.table.splice(l,0,...a),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.requestUpdate()}removeRow(t,e){this.table.splice(e,1),this.requestUpdate()}renderTemplate(){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,55 +34,55 @@ var __decorate=this&&this.__decorate||function(t,e,l,a){var n,s=arguments.length
</tbody>
</table>
</div>
`}renderDataElement(t,e,a){const n=t=>this.modifyTable(t,e,a);switch(this.type){case"input":return l.html`
`}renderDataElement(t,e,a){const s=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="${n}" .value="${t.replace(/\n/g,"<br>")}">
@change="${s}" .value="${t.replace(/\n/g,"<br>")}">
`;case"textarea":default:return l.html`
<textarea class="form-control" rows="6" name="TABLE[c][${e}][${a}]"
@change="${n}" .value="${t.replace(/<br[ ]*\/?>/g,"\n")}"></textarea>
@change="${s}" .value="${t.replace(/<br[ ]*\/?>/g,"\n")}"></textarea>
`}}renderTypeButton(){return l.html`
<span class="btn-group">
<button class="btn btn-default" type="button" title="${a.lll("table_smallFields")}"
<button class="btn btn-default" type="button" title="${s.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>
</span>
`}renderColButtons(t,e){const n={title:0===t?a.lll("table_end"):a.lll("table_left"),class:0===t?"double-right":"left",target:0===t?e:t-1},s={title:t===e?a.lll("table_start"):a.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?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`
<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>
</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>
<button class="btn btn-default" type="button" title="${s.title}"
@click="${e=>this.moveColumn(e,t,s.target)}">
<span class="t3-icon fa fa-fw fa-angle-${s.class}"></span>
</button>
<button class="btn btn-default" type="button" title="${a.lll("table_removeColumn")}"
<button class="btn btn-default" type="button" title="${s.lll("table_removeColumn")}"
@click="${e=>this.removeColumn(e,t)}">
<span class="t3-icon fa fa-fw fa-trash"></span>
</button>
<button class="btn btn-default" type="button" title="${a.lll("table_addColumn")}"
<button class="btn btn-default" type="button" title="${s.lll("table_addColumn")}"
@click="${e=>this.appendColumn(e,t)}">
<span class="t3-icon fa fa-fw fa-plus"></span>
</button>
</span>
`}renderRowButtons(t,e){const n={title:0===t?a.lll("table_bottom"):a.lll("table_up"),class:0===t?"double-down":"up",target:0===t?e:t-1},s={title:t===e?a.lll("table_top"):a.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?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`
<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>
</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>
<button class="btn btn-default" type="button" title="${s.title}"
@click="${e=>this.moveRow(e,t,s.target)}">
<span class="t3-icon fa fa-fw fa-angle-${s.class}"></span>
</button>
<button class="btn btn-default" type="button" title="${a.lll("table_removeRow")}"
<button class="btn btn-default" type="button" title="${s.lll("table_removeRow")}"
@click="${e=>this.removeRow(e,t)}">
<span class="t3-icon fa fa-fw fa-trash"></span>
</button>
<button class="btn btn-default" type="button" title="${a.lll("table_addRow")}"
<button class="btn btn-default" type="button" title="${s.lll("table_addRow")}"
@click="${e=>this.appendRow(e,t)}">
<span class="t3-icon fa fa-fw fa-plus"></span>
</button>
</span>
`}};__decorate([l.property({type:String})],n.prototype,"type",void 0),__decorate([l.property({type:Array})],n.prototype,"table",void 0),__decorate([l.property({type:Number,attribute:"append-rows"})],n.prototype,"appendRows",void 0),__decorate([l.property({type:Object})],n.prototype,"l10n",void 0),n=__decorate([l.customElement("typo3-backend-table-wizard")],n),e.TableWizardElement=n}));
\ No newline at end of file
`}};__decorate([a.property({type:String})],n.prototype,"type",void 0),__decorate([a.property({type:Array})],n.prototype,"table",void 0),__decorate([a.property({type:Number,attribute:"append-rows"})],n.prototype,"appendRows",void 0),__decorate([a.property({type:Object})],n.prototype,"l10n",void 0),n=__decorate([a.customElement("typo3-backend-table-wizard")],n),e.TableWizardElement=n}));
\ No newline at end of file
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__decorate=this&&this.__decorate||function(e,t,i,s){var n,d=arguments.length,r=d<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(d<3?n(r):d>3?n(t,i,r):n(t,i))||r);return d>3&&r&&Object.defineProperty(t,i,r),r},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(t,e,i);return __setModuleDefault(t,e),t};define(["require","exports","d3-selection","../../SvgTree","lit-element"],(function(e,t,i,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectTree=void 0,i=__importStar(i);let d=class extends s.SvgTree{constructor(){super(),this.textPosition=30,this.settings={unselectableElements:[],exclusiveNodesIdentifiers:"",validation:{},readOnlyMode:!1,showIcons:!0,marginTop:15,nodeHeight:20,indentWidth:16,width:300,duration:400,dataUrl:"",defaultProperties:{},expandUpToLevel:null},this.exclusiveSelectedNode=null,this.addIcons(),this.addEventListener("typo3:svg-tree:nodes-prepared",this.prepareLoadedNodes)}expandAll(){this.nodes.forEach(e=>{this.showChildren(e)}),this.prepareDataForVisibleNodes(),this.updateVisibleNodes()}collapseAll(){this.nodes.forEach(e=>{this.hideChildren(e)}),this.prepareDataForVisibleNodes(),this.updateVisibleNodes()}selectNode(e){if(!this.isNodeSelectable(e))return;const t=e.checked;this.handleExclusiveNodeSelection(e),this.settings.validation&&this.settings.validation.maxItems&&!t&&this.getSelectedNodes().length>=this.settings.validation.maxItems||(e.checked=!t,this.dispatchEvent(new CustomEvent("typo3:svg-tree:node-selected",{detail:{node:e}})),this.updateVisibleNodes())}filter(e){this.searchTerm=e,this.nodes.length&&(this.nodes[0].expanded=!1);const t=new RegExp(e,"i");this.nodes.forEach(e=>{t.test(e.name)?(this.showParents(e),e.expanded=!0,e.hidden=!1):(e.hidden=!0,e.expanded=!1)}),this.prepareDataForVisibleNodes(),this.updateVisibleNodes()}showParents(e){if(0===e.parents.length)return;const t=this.nodes[e.parents[0]];t.hidden=!1,t.expanded=!0,this.showParents(t)}updateVisibleNodes(){super.updateVisibleNodes();const e=Math.ceil(this.viewportHeight/this.settings.nodeHeight+1),t=Math.floor(Math.max(this.scrollTop-2*this.settings.nodeHeight,0)/this.settings.nodeHeight),s=this.data.nodes.slice(t,t+e);this.nodesContainer.selectAll(".node").data(s,e=>e.stateIdentifier).selectAll(".tree-check use").attr("visibility",(function(e){const t=Boolean(e.checked),s=i.select(this);return s.classed("icon-checked")&&t||s.classed("icon-indeterminate")&&e.indeterminate&&!t?"visible":!s.classed("icon-check")||e.indeterminate||t?"hidden":"visible"}))}isNodeSelectable(e){return!this.settings.readOnlyMode&&-1===this.settings.unselectableElements.indexOf(e.identifier)}appendTextElement(e){return this.renderCheckbox(e),super.appendTextElement(e)}renderCheckbox(e){const t=e.filter(e=>this.isNodeSelectable(e)||Boolean(e.checked)).append("g").attr("class","tree-check").on("click",(e,t)=>this.selectNode(t));t.append("use").attr("x",28).attr("y",-8).attr("visibility","hidden").attr("class","icon-check").attr("xlink:href","#icon-check"),t.append("use").attr("x",28).attr("y",-8).attr("visibility","hidden").attr("class","icon-checked").attr("xlink:href","#icon-checked"),t.append("use").attr("x",28).attr("y",-8).attr("visibility","hidden").attr("class","icon-indeterminate").attr("xlink:href","#icon-indeterminate")}prepareLoadedNodes(e){let t=e.detail.nodes;e.detail.nodes=t.map(e=>{if(!e.stateIdentifier){const t=e.parents.length?e.parents[e.parents.length-1]:e.identifier;e.stateIdentifier=t+"_"+e.identifier}return!1===e.selectable&&this.settings.unselectableElements.push(e.identifier),e})}handleExclusiveNodeSelection(e){const t=this.settings.exclusiveNodesIdentifiers.split(",");this.settings.exclusiveNodesIdentifiers.length&&!1===e.checked&&(t.indexOf(""+e.identifier)>-1?(this.disableSelectedNodes(),this.exclusiveSelectedNode=e):-1===t.indexOf(""+e.identifier)&&this.exclusiveSelectedNode&&(this.exclusiveSelectedNode.checked=!1,this.exclusiveSelectedNode=null))}addIcons(){this.icons={check:{identifier:"check",icon:'<g width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><rect height="16" width="16" fill="transparent"></rect><path transform="scale(0.01)" d="M1312 256h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-832q0-66-47-113t-113-47zm288 160v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"></path></g>'},checked:{identifier:"checked",icon:'<g width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><rect height="16" width="16" fill="transparent"></rect><path transform="scale(0.01)" d="M813 1299l614-614q19-19 19-45t-19-45l-102-102q-19-19-45-19t-45 19l-467 467-211-211q-19-19-45-19t-45 19l-102 102q-19 19-19 45t19 45l358 358q19 19 45 19t45-19zm851-883v960q0 119-84.5 203.5t-203.5 84.5h-960q-119 0-203.5-84.5t-84.5-203.5v-960q0-119 84.5-203.5t203.5-84.5h960q119 0 203.5 84.5t84.5 203.5z"></path></g>'},indeterminate:{identifier:"indeterminate",icon:'<g width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><rect height="16" width="16" fill="transparent"></rect><path transform="scale(0.01)" d="M1344 800v64q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"></path></g>'}}}};d=__decorate([n.customElement("typo3-backend-form-selecttree")],d),t.SelectTree=d}));
\ No newline at end of file
var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,i,s){void 0===s&&(s=i),Object.defineProperty(e,s,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,s){void 0===s&&(s=i),e[s]=t[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__decorate=this&&this.__decorate||function(e,t,i,s){var n,d=arguments.length,r=d<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(d<3?n(r):d>3?n(t,i,r):n(t,i))||r);return d>3&&r&&Object.defineProperty(t,i,r),r},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(t,e,i);return __setModuleDefault(t,e),t};define(["require","exports","d3-selection","../../SvgTree","lit/decorators"],(function(e,t,i,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectTree=void 0,i=__importStar(i);let d=class extends s.SvgTree{constructor(){super(),this.textPosition=30,this.settings={unselectableElements:[],exclusiveNodesIdentifiers:"",validation:{},readOnlyMode:!1,showIcons:!0,marginTop:15,nodeHeight:20,indentWidth:16,width:300,duration:400,dataUrl:"",defaultProperties:{},expandUpToLevel:null},this.exclusiveSelectedNode=null,this.addIcons(),this.addEventListener("typo3:svg-tree:nodes-prepared",this.prepareLoadedNodes)}expandAll(){this.nodes.forEach(e=>{this.showChildren(e)}),this.prepareDataForVisibleNodes(),this.updateVisibleNodes()}collapseAll(){this.nodes.forEach(e=>{this.hideChildren(e)}),this.prepareDataForVisibleNodes(),this.updateVisibleNodes()}selectNode(e){if(!this.isNodeSelectable(e))return;const t=e.checked;this.handleExclusiveNodeSelection(e),this.settings.validation&&this.settings.validation.maxItems&&!t&&this.getSelectedNodes().length>=this.settings.validation.maxItems||(e.checked=!t,this.dispatchEvent(new CustomEvent("typo3:svg-tree:node-selected",{detail:{node:e}})),this.updateVisibleNodes())}filter(e){this.searchTerm=e,this.nodes.length&&(this.nodes[0].expanded=!1);const t=new RegExp(e,"i");this.nodes.forEach(e=>{t.test(e.name)?(this.showParents(e),e.expanded=!0,e.hidden=!1):(e.hidden=!0,e.expanded=!1)}),this.prepareDataForVisibleNodes(),this.updateVisibleNodes()}showParents(e){if(0===e.parents.length)return;const t=this.nodes[e.parents[0]];t.hidden=!1,t.expanded=!0,this.showParents(t)}updateVisibleNodes(){super.updateVisibleNodes();const e=Math.ceil(this.viewportHeight/this.settings.nodeHeight+1),t=Math.floor(Math.max(this.scrollTop-2*this.settings.nodeHeight,0)/this.settings.nodeHeight),s=this.data.nodes.slice(t,t+e);this.nodesContainer.selectAll(".node").data(s,e=>e.stateIdentifier).selectAll(".tree-check use").attr("visibility",(function(e){const t=Boolean(e.checked),s=i.select(this);return s.classed("icon-checked")&&t||s.classed("icon-indeterminate")&&e.indeterminate&&!t?"visible":!s.classed("icon-check")||e.indeterminate||t?"hidden":"visible"}))}isNodeSelectable(e){return!this.settings.readOnlyMode&&-1===this.settings.unselectableElements.indexOf(e.identifier)}appendTextElement(e){return this.renderCheckbox(e),super.appendTextElement(e)}renderCheckbox(e){const t=e.filter(e=>this.isNodeSelectable(e)||Boolean(e.checked)).append("g").attr("class","tree-check").on("click",(e,t)=>this.selectNode(t));t.append("use").attr("x",28).attr("y",-8).attr("visibility","hidden").attr("class","icon-check").attr("xlink:href","#icon-check"),t.append("use").attr("x",28).attr("y",-8).attr("visibility","hidden").attr("class","icon-checked").attr("xlink:href","#icon-checked"),t.append("use").attr("x",28).attr("y",-8).attr("visibility","hidden").attr("class","icon-indeterminate").attr("xlink:href","#icon-indeterminate")}prepareLoadedNodes(e){let t=e.detail.nodes;e.detail.nodes=t.map(e=>{if(!e.stateIdentifier){const t=e.parents.length?e.parents[e.parents.length-1]:e.identifier;e.stateIdentifier=t+"_"+e.identifier}return!1===e.selectable&&this.settings.unselectableElements.push(e.identifier),e})}handleExclusiveNodeSelection(e){const t=this.settings.exclusiveNodesIdentifiers.split(",");this.settings.exclusiveNodesIdentifiers.length&&!1===e.checked&&(t.indexOf(""+e.identifier)>-1?(this.disableSelectedNodes(),this.exclusiveSelectedNode=e):-1===t.indexOf(""+e.identifier)&&this.exclusiveSelectedNode&&(this.exclusiveSelectedNode.checked=!1,this.exclusiveSelectedNode=null))}addIcons(){this.icons={check:{identifier:"check",icon:'<g width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><rect height="16" width="16" fill="transparent"></rect><path transform="scale(0.01)" d="M1312 256h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113v-832q0-66-47-113t-113-47zm288 160v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"></path></g>'},checked:{identifier:"checked",icon:'<g width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><rect height="16" width="16" fill="transparent"></rect><path transform="scale(0.01)" d="M813 1299l614-614q19-19 19-45t-19-45l-102-102q-19-19-45-19t-45 19l-467 467-211-211q-19-19-45-19t-45 19l-102 102q-19 19-19 45t19 45l358 358q19 19 45 19t45-19zm851-883v960q0 119-84.5 203.5t-203.5 84.5h-960q-119 0-203.5-84.5t-84.5-203.5v-960q0-119 84.5-203.5t203.5-84.5h960q119 0 203.5 84.5t84.5 203.5z"></path></g>'},indeterminate:{identifier:"indeterminate",icon:'<g width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><rect height="16" width="16" fill="transparent"></rect><path transform="scale(0.01)" d="M1344 800v64q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z"></path></g>'}}}};d=__decorate([n.customElement("typo3-backend-form-selecttree")],d),t.SelectTree=d}));
\ No newline at end of file
......@@ -10,24 +10,24 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __decorate=this&&this.__decorate||function(e,t,i,r){var a,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var d=e.length-1;d>=0;d--)(a=e[d])&&(s=(n<3?a(s):n>3?a(t,i,s):a(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};define(["require","exports","bootstrap","lit-element","TYPO3/CMS/Core/lit-helper","TYPO3/CMS/Backend/FormEngineValidation","TYPO3/CMS/Backend/Element/IconElement","./SelectTree"],(function(e,t,i,r,a,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectTreeElement=void 0;t.SelectTreeElement=class{constructor(e,t,i){this.recordField=null,this.tree=null,this.selectNode=e=>{const t=e.detail.node;this.updateAncestorsIndeterminateState(t),this.calculateIndeterminate(this.tree.nodes),this.saveCheckboxes(),this.tree.setup.input.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},this.loadDataAfter=()=>{this.tree.nodes=this.tree.nodes.map(e=>(e.indeterminate=!1,e)),this.calculateIndeterminate(this.tree.nodes),this.saveCheckboxes(),n.validateField(this.recordField)},this.saveCheckboxes=()=>{void 0!==this.recordField&&(this.recordField.value=this.tree.getSelectedNodes().map(e=>e.identifier).join(","))},this.recordField=document.getElementById(t);const r=document.getElementById(e);this.tree=document.createElement("typo3-backend-form-selecttree"),this.tree.classList.add("svg-tree-wrapper"),this.tree.addEventListener("typo3:svg-tree:nodes-prepared",this.loadDataAfter),this.tree.addEventListener("typo3:svg-tree:node-selected",this.selectNode),this.tree.addEventListener("typo3:svg-tree:node-selected",()=>{i()});const a={dataUrl:this.generateRequestUrl(),readOnlyMode:1===parseInt(this.recordField.dataset.readOnly,10),input:this.recordField,exclusiveNodesIdentifiers:this.recordField.dataset.treeExclusiveKeys,validation:JSON.parse(this.recordField.dataset.formengineValidationRules)[0],expandUpToLevel:this.recordField.dataset.treeExpandUpToLevel,unselectableElements:[]};this.tree.addEventListener("svg-tree:initialized",()=>{const e=document.createElement("typo3-backend-form-selecttree-toolbar");e.tree=this.tree,this.tree.prepend(e)}),this.tree.setup=a,r.append(this.tree),this.listenForVisibleTree()}listenForVisibleTree(){if(!this.tree.offsetParent){let e=this.tree.closest(".tab-pane").getAttribute("id");if(e){document.querySelector('[aria-controls="'+e+'"]').addEventListener("shown.bs.tab",()=>{this.tree.dispatchEvent(new Event("svg-tree:visible"))})}}}generateRequestUrl(){const e={tableName:this.recordField.dataset.tablename,fieldName:this.recordField.dataset.fieldname,uid:this.recordField.dataset.uid,recordTypeValue:this.recordField.dataset.recordtypevalue,dataStructureIdentifier:this.recordField.dataset.datastructureidentifier,flexFormSheetName:this.recordField.dataset.flexformsheetname,flexFormFieldName:this.recordField.dataset.flexformfieldname,flexFormContainerName:this.recordField.dataset.flexformcontainername,flexFormContainerIdentifier:this.recordField.dataset.flexformcontaineridentifier,flexFormContainerFieldName:this.recordField.dataset.flexformcontainerfieldname,flexFormSectionContainerIsNew:this.recordField.dataset.flexformsectioncontainerisnew,command:this.recordField.dataset.command};return TYPO3.settings.ajaxUrls.record_tree_data+"&"+new URLSearchParams(e)}updateAncestorsIndeterminateState(e){let t=!1;e.parents.forEach(e=>{const i=this.tree.nodes[e];i.indeterminate=i.checked||i.indeterminate||t,t=i.checked||i.indeterminate||i.checked||i.indeterminate})}calculateIndeterminate(e){e.forEach(t=>{(t.checked||t.indeterminate)&&t.parents&&t.parents.length>0&&t.parents.forEach(t=>{e[t].indeterminate=!0})})}};let s=class extends r.LitElement{constructor(){super(...arguments),this.settings={collapseAllBtn:"collapse-all-btn",expandAllBtn:"expand-all-btn",searchInput:"search-input",toggleHideUnchecked:"hide-unchecked-btn"},this.hideUncheckedState=!1}createRenderRoot(){return this}firstUpdated(){this.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(e=>new i.Tooltip(e))}render(){return r.html`
var __decorate=this&&this.__decorate||function(e,t,i,r){var a,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var d=e.length-1;d>=0;d--)(a=e[d])&&(s=(n<3?a(s):n>3?a(t,i,s):a(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};define(["require","exports","bootstrap","lit","lit/decorators","TYPO3/CMS/Core/lit-helper","TYPO3/CMS/Backend/FormEngineValidation","TYPO3/CMS/Backend/Element/IconElement","./SelectTree"],(function(e,t,i,r,a,n,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectTreeElement=void 0;t.SelectTreeElement=class{constructor(e,t,i){this.recordField=null,this.tree=null,this.selectNode=e=>{const t=e.detail.node;this.updateAncestorsIndeterminateState(t),this.calculateIndeterminate(this.tree.nodes),this.saveCheckboxes(),this.tree.setup.input.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},this.loadDataAfter=()=>{this.tree.nodes=this.tree.nodes.map(e=>(e.indeterminate=!1,e)),this.calculateIndeterminate(this.tree.nodes),this.saveCheckboxes(),s.validateField(this.recordField)},this.saveCheckboxes=()=>{void 0!==this.recordField&&(this.recordField.value=this.tree.getSelectedNodes().map(e=>e.identifier).join(","))},this.recordField=document.getElementById(t);const r=document.getElementById(e);this.tree=document.createElement("typo3-backend-form-selecttree"),this.tree.classList.add("svg-tree-wrapper"),this.tree.addEventListener("typo3:svg-tree:nodes-prepared",this.loadDataAfter),this.tree.addEventListener("typo3:svg-tree:node-selected",this.selectNode),this.tree.addEventListener("typo3:svg-tree:node-selected",()=>{i()});const a={dataUrl:this.generateRequestUrl(),readOnlyMode:1===parseInt(this.recordField.dataset.readOnly,10),input:this.recordField,exclusiveNodesIdentifiers:this.recordField.dataset.treeExclusiveKeys,validation:JSON.parse(this.recordField.dataset.formengineValidationRules)[0],expandUpToLevel:this.recordField.dataset.treeExpandUpToLevel,unselectableElements:[]};this.tree.addEventListener("svg-tree:initialized",()=>{const e=document.createElement("typo3-backend-form-selecttree-toolbar");e.tree=this.tree,this.tree.prepend(e)}),this.tree.setup=a,r.append(this.tree),this.listenForVisibleTree()}listenForVisibleTree(){if(!this.tree.offsetParent){let e=this.tree.closest(".tab-pane").getAttribute("id");if(e){document.querySelector('[aria-controls="'+e+'"]').addEventListener("shown.bs.tab",()=>{this.tree.dispatchEvent(new Event("svg-tree:visible"))})}}}generateRequestUrl(){const e={tableName:this.recordField.dataset.tablename,fieldName:this.recordField.dataset.fieldname,uid:this.recordField.dataset.uid,recordTypeValue:this.recordField.dataset.recordtypevalue,dataStructureIdentifier:this.recordField.dataset.datastructureidentifier,flexFormSheetName:this.recordField.dataset.flexformsheetname,flexFormFieldName:this.recordField.dataset.flexformfieldname,flexFormContainerName:this.recordField.dataset.flexformcontainername,flexFormContainerIdentifier:this.recordField.dataset.flexformcontaineridentifier,flexFormContainerFieldName:this.recordField.dataset.flexformcontainerfieldname,flexFormSectionContainerIsNew:this.recordField.dataset.flexformsectioncontainerisnew,command:this.recordField.dataset.command};return TYPO3.settings.ajaxUrls.record_tree_data+"&"+new URLSearchParams(e)}updateAncestorsIndeterminateState(e){let t=!1;e.parents.forEach(e=>{const i=this.tree.nodes[e];i.indeterminate=i.checked||i.indeterminate||t,t=i.checked||i.indeterminate||i.checked||i.indeterminate})}calculateIndeterminate(e){e.forEach(t=>{(t.checked||t.indeterminate)&&t.parents&&t.parents.length>0&&t.parents.forEach(t=>{e[t].indeterminate=!0})})}};let d=class extends r.LitElement{constructor(){super(...arguments),this.settings={collapseAllBtn:"collapse-all-btn",expandAllBtn:"expand-all-btn",searchInput:"search-input",toggleHideUnchecked:"hide-unchecked-btn"},this.hideUncheckedState=!1}createRenderRoot(){return this}firstUpdated(){this.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(e=>new i.Tooltip(e))}render(){return r.html`
<div class="tree-toolbar btn-toolbar">
<div class="input-group">
<span class="input-group-addon input-group-icon filter">
<typo3-backend-icon identifier="actions-filter" size="small"></typo3-backend-icon>
</span>
<input type="text" class="form-control ${this.settings.searchInput}" placeholder="${a.lll("tcatree.findItem")}" @input="${e=>this.filter(e)}">
<input type="text" class="form-control ${this.settings.searchInput}" placeholder="${n.lll("tcatree.findItem")}" @input="${e=>this.filter(e)}">
</div>
<div class="btn-group">
<button type="button" data-bs-toggle="tooltip" class="btn btn-default ${this.settings.expandAllBtn}" title="${a.lll("tcatree.expandAll")}" @click="${()=>this.expandAll()}">
<button type="button" data-bs-toggle="tooltip" class="btn btn-default ${this.settings.expandAllBtn}" title="${n.lll("tcatree.expandAll")}" @click="${()=>this.expandAll()}">
<typo3-backend-icon identifier="apps-pagetree-category-expand-all" size="small"></typo3-backend-icon>
</button>
<button type="button" data-bs-toggle="tooltip" class="btn btn-default ${this.settings.collapseAllBtn}" title="${a.lll("tcatree.collapseAll")}" @click="${()=>this.collapseAll()}">
<button type="button" data-bs-toggle="tooltip" class="btn btn-default ${this.settings.collapseAllBtn}" title="${n.lll("tcatree.collapseAll")}" @click="${()=>this.collapseAll()}">
<typo3-backend-icon identifier="apps-pagetree-category-collapse-all" size="small"></typo3-backend-icon>
</button>
<button type="button" data-bs-toggle="tooltip" class="btn btn-default ${this.settings.toggleHideUnchecked}" title="${a.lll("tcatree.toggleHideUnchecked")}" @click="${()=>this.toggleHideUnchecked()}">
<button type="button" data-bs-toggle="tooltip" class="btn btn-default ${this.settings.toggleHideUnchecked}" title="${n.lll("tcatree.toggleHideUnchecked")}" @click="${()=>this.toggleHideUnchecked()}">
<typo3-backend-icon identifier="apps-pagetree-category-toggle-hide-checked" size="small"></typo3-backend-icon>
</button>
</div>
</div>
`}collapseAll(){this.tree.collapseAll()}expandAll(){this.tree.expandAll()}filter(e){const t=e.target;this.tree.filter(t.value.trim())}toggleHideUnchecked(){this.hideUncheckedState=!this.hideUncheckedState,this.hideUncheckedState?this.tree.nodes.forEach(e=>{e.checked?(this.tree.showParents(e),e.expanded=!0,e.hidden=!1):(e.hidden=!0,e.expanded=!1)}):this.tree.nodes.forEach(e=>e.hidden=!1),this.tree.prepareDataForVisibleNodes(),this.tree.updateVisibleNodes()}};s=__decorate([r.customElement("typo3-backend-form-selecttree-toolbar")],s)}));
\ No newline at end of file
`}collapseAll(){this.tree.collapseAll()}expandAll(){this.tree.expandAll()}filter(e){const t=e.target;this.tree.filter(t.value.trim())}toggleHideUnchecked(){this.hideUncheckedState=!this.hideUncheckedState,this.hideUncheckedState?this.tree.nodes.forEach(e=>{e.checked?(this.tree.showParents(e),e.expanded=!0,e.hidden=!1):(e.hidden=!0,e.expanded=!1)}):this.tree.nodes.forEach(e=>e.hidden=!1),this.tree.prepareDataForVisibleNodes(),this.tree.updateVisibleNodes()}};d=__decorate([a.customElement("typo3-backend-form-selecttree-toolbar")],d)}));
\ No newline at end of file
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __decorate=this&&this.__decorate||function(e,t,r,o){var n,c=arguments.length,i=c<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(c<3?n(i):c>3?n(t,r,i):n(t,r))||i);return c>3&&i&&Object.defineProperty(t,r,i),i};define(["require","exports","lit-element","TYPO3/CMS/Backend/FormEngine"],(function(e,t,r,o){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ask="ask",e.enforce="enforce"}(n||(n={}));const c={fromAttribute:e=>document.querySelectorAll(e)};let i=class extends r.LitElement{constructor(){super(...arguments),this.mode=n.ask,this.requestFormEngineUpdate=()=>{const e=this.mode===n.ask;o.requestFormEngineUpdate(e)}}connectedCallback(){super.connectedCallback();for(let e of this.fields)e.addEventListener("change",this.requestFormEngineUpdate)}disconnectedCallback(){super.disconnectedCallback();for(let e of this.fields)e.removeEventListener("change",this.requestFormEngineUpdate)}};__decorate([r.property({type:String,attribute:"mode"})],i.prototype,"mode",void 0),__decorate([r.property({attribute:"field",converter:c})],i.prototype,"fields",void 0),i=__decorate([r.customElement("typo3-formengine-updater")],i)}));
\ No newline at end of file
var __decorate=this&&this.__decorate||function(e,t,r,o){var n,c=arguments.length,i=c<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(c<3?n(i):c>3?n(t,r,i):n(t,r))||i);return c>3&&i&&Object.defineProperty(t,r,i),i};define(["require","exports","lit","lit/decorators","TYPO3/CMS/Backend/FormEngine"],(function(e,t,r,o,n){"use strict";var c;Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.ask="ask",e.enforce="enforce"}(c||(c={}));const i={fromAttribute:e=>document.querySelectorAll(e)};let s=class extends r.LitElement{constructor(){super(...arguments),this.mode=c.ask,this.requestFormEngineUpdate=()=>{const e=this.mode===c.ask;n.requestFormEngineUpdate(e)}}connectedCallback(){super.connectedCallback();for(let e of this.fields)e.addEventListener("change",this.requestFormEngineUpdate)}disconnectedCallback(){super.disconnectedCallback();for(let e of this.fields)e.removeEventListener("change",this.requestFormEngineUpdate)}};__decorate([o.property({type:String,attribute:"mode"})],s.prototype,"mode",void 0),__decorate([o.property({attribute:"field",converter:i})],s.prototype,"fields",void 0),s=__decorate([o.customElement("typo3-formengine-updater")],s)}));
\ No newline at end of file
......@@ -10,7 +10,7 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","jquery","./Viewport","./Icons","lit-html","lit-html/directives/unsafe-html","TYPO3/CMS/Core/lit-helper","jquery/autocomplete","./Input/Clearable"],(function(e,t,l,o,a,r,s,n){"use strict";var i;l=__importDefault(l),function(e){e.containerSelector="#typo3-cms-backend-backend-toolbaritems-livesearchtoolbaritem",e.toolbarItem=".t3js-toolbar-item-search",e.dropdownToggle=".t3js-toolbar-search-dropdowntoggle",e.searchFieldSelector=".t3js-topbar-navigation-search-field",e.formSelector=".t3js-topbar-navigation-search"}(i||(i={}));return new class{constructor(){this.url=TYPO3.settings.ajaxUrls.livesearch,o.Topbar.Toolbar.registerEvent(()=>{let e;this.registerAutocomplete(),this.registerEvents(),l.default(i.toolbarItem).removeAttr("style"),null!==(e=document.querySelector(i.searchFieldSelector))&&e.clearable({onClear:()=>{l.default(i.dropdownToggle).hasClass("show")&&l.default(i.dropdownToggle).dropdown("toggle")}})})}registerAutocomplete(){l.default(i.searchFieldSelector).autocomplete({serviceUrl:this.url,paramName:"q",dataType:"json",minChars:2,width:"100%",groupBy:"typeLabel",noCache:!0,containerClass:i.toolbarItem.substr(1,i.toolbarItem.length),appendTo:i.containerSelector+" .dropdown-menu",forceFixPosition:!1,preserveInput:!0,showNoSuggestionNotice:!0,triggerSelectOnValidInput:!1,preventBadQueries:!1,noSuggestionNotice:'<h3 class="dropdown-headline">'+TYPO3.lang.liveSearch_listEmptyText+"</h3><p>"+TYPO3.lang.liveSearch_helpTitle+"</p><hr><p>"+TYPO3.lang.liveSearch_helpDescription+"<br>"+TYPO3.lang.liveSearch_helpDescriptionPages+"</p>",transformResult:e=>({suggestions:l.default.map(e,e=>({value:e.title,data:e}))}),formatGroup:(e,t,l)=>n.renderHTML(r.html`
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","jquery","./Viewport","./Icons","lit","lit/directives/unsafe-html","TYPO3/CMS/Core/lit-helper","jquery/autocomplete","./Input/Clearable"],(function(e,t,l,o,a,r,s,n){"use strict";var i;l=__importDefault(l),function(e){e.containerSelector="#typo3-cms-backend-backend-toolbaritems-livesearchtoolbaritem",e.toolbarItem=".t3js-toolbar-item-search",e.dropdownToggle=".t3js-toolbar-search-dropdowntoggle",e.searchFieldSelector=".t3js-topbar-navigation-search-field",e.formSelector=".t3js-topbar-navigation-search"}(i||(i={}));return new class{constructor(){this.url=TYPO3.settings.ajaxUrls.livesearch,o.Topbar.Toolbar.registerEvent(()=>{let e;this.registerAutocomplete(),this.registerEvents(),l.default(i.toolbarItem).removeAttr("style"),null!==(e=document.querySelector(i.searchFieldSelector))&&e.clearable({onClear:()=>{l.default(i.dropdownToggle).hasClass("show")&&l.default(i.dropdownToggle).dropdown("toggle")}})})}registerAutocomplete(){l.default(i.searchFieldSelector).autocomplete({serviceUrl:this.url,paramName:"q",dataType:"json",minChars:2,width:"100%",groupBy:"typeLabel",noCache:!0,containerClass:i.toolbarItem.substr(1,i.toolbarItem.length),appendTo:i.containerSelector+" .dropdown-menu",forceFixPosition:!1,preserveInput:!0,showNoSuggestionNotice:!0,triggerSelectOnValidInput:!1,preventBadQueries:!1,noSuggestionNotice:'<h3 class="dropdown-headline">'+TYPO3.lang.liveSearch_listEmptyText+"</h3><p>"+TYPO3.lang.liveSearch_helpTitle+"</p><hr><p>"+TYPO3.lang.liveSearch_helpDescription+"<br>"+TYPO3.lang.liveSearch_helpDescriptionPages+"</p>",transformResult:e=>({suggestions:l.default.map(e,e=>({value:e.title,data:e}))}),formatGroup:(e,t,l)=>n.renderHTML(r.html`
${l>0?r.html`<hr>`:""}
<h3 class="dropdown-headline">${t}</h3>