typo3-typescript-sources 14.3.7 → 14.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/sync-and-publish.yml +240 -191
- package/.last-synced-tag +1 -1
- package/README.md +13 -5
- package/adminpanel/admin-panel.ts +22 -22
- package/adminpanel/modules/cache.ts +3 -3
- package/backend/action-dispatcher.ts +8 -3
- package/backend/bookmark/bookmark-store.ts +5 -5
- package/backend/clipboard-panel.ts +2 -2
- package/backend/code-editor/element/code-mirror-element.ts +1 -1
- package/backend/code-editor/language/typoscript.ts +3 -3
- package/backend/code-editor/stream-parser/typoscript.ts +2 -2
- package/backend/color-picker.ts +2 -2
- package/backend/column-selector-button.ts +11 -8
- package/backend/context-help.ts +3 -3
- package/backend/context-menu.ts +8 -3
- package/backend/drag-tooltip.ts +9 -4
- package/backend/drag-uploader.ts +81 -89
- package/backend/element/draggable-resizable-element.ts +18 -12
- package/backend/element/icon-element.ts +2 -2
- package/backend/element/thumbnail-element.ts +2 -2
- package/backend/element-browser.ts +1 -1
- package/backend/event/consumer-scope.ts +2 -2
- package/backend/event/interaction-request-assignment.ts +1 -1
- package/backend/event/interaction-request-map.ts +3 -3
- package/backend/form-engine/container/flex-form-container-container.ts +2 -2
- package/backend/form-engine/container/flex-form-section-container.ts +1 -1
- package/backend/form-engine/container/inline-control-container.ts +14 -14
- package/backend/form-engine/element/abstract-sortable-select-items.ts +3 -3
- package/backend/form-engine/element/color-element.ts +1 -1
- package/backend/form-engine/element/datetime-element.ts +1 -1
- package/backend/form-engine/element/extra/char-counter.ts +2 -2
- package/backend/form-engine/element/extra/select-box-filter.ts +1 -1
- package/backend/form-engine/element/mfa-info-element.ts +2 -2
- package/backend/form-engine/element/online-media-form-element.ts +8 -4
- package/backend/form-engine/element/select-multiple-side-by-side-element.ts +2 -2
- package/backend/form-engine/element/select-tree.ts +3 -3
- package/backend/form-engine/element/slug-element.ts +7 -7
- package/backend/form-engine/element/suggest/result-container.ts +1 -1
- package/backend/form-engine/element/table-wizard-element.ts +4 -4
- package/backend/form-engine/inline-relation/ajax-dispatcher.ts +3 -3
- package/backend/form-engine-validation.ts +11 -5
- package/backend/form-engine.ts +19 -23
- package/backend/global-event-handler.ts +1 -1
- package/backend/hotkeys/hotkey-struct.ts +1 -1
- package/backend/hotkeys.ts +3 -3
- package/backend/image-manipulation.ts +19 -19
- package/backend/layout-module/column-restriction.ts +61 -0
- package/backend/layout-module/drag-drop.ts +16 -4
- package/backend/layout-module/paste.ts +8 -1
- package/backend/live-search/element/result/item/action/action-container.ts +1 -1
- package/backend/live-search/element/result/item/item-container.ts +4 -4
- package/backend/live-search/element/result/result-container.ts +5 -0
- package/backend/live-search/element/result/result-pagination.ts +1 -1
- package/backend/live-search/live-search.ts +2 -2
- package/backend/localization/label-provider.ts +4 -4
- package/backend/localization/localization-wizard.ts +4 -4
- package/backend/localization/steps/content-record-selection-step.ts +8 -8
- package/backend/localization/steps/handler-selection-step.ts +4 -4
- package/backend/localization/steps/mode-step.ts +4 -4
- package/backend/localization/steps/source-language-step.ts +4 -4
- package/backend/localization/steps/target-language-step.ts +4 -4
- package/backend/login-refresh.ts +1 -9
- package/backend/login.ts +2 -2
- package/backend/modal.ts +38 -5
- package/backend/module/iframe.ts +10 -0
- package/backend/module/router.ts +10 -0
- package/backend/module-menu.ts +3 -3
- package/backend/multi-record-selection-action.ts +1 -1
- package/backend/multi-record-selection-delete-action.ts +1 -1
- package/backend/multi-record-selection.ts +14 -14
- package/backend/multi-step-wizard.ts +9 -2
- package/backend/new-multiple-pages.ts +2 -2
- package/backend/new-record-wizard.ts +15 -15
- package/backend/notification.ts +90 -6
- package/backend/online-media.ts +1 -3
- package/backend/page-wizard/page-wizard.ts +2 -2
- package/backend/page-wizard/steps/doktype-step.ts +5 -5
- package/backend/pagetsconfig/pagetsconfig-includes.ts +1 -1
- package/backend/popover.ts +5 -5
- package/backend/record-download-button.ts +5 -6
- package/backend/recordlist.ts +11 -6
- package/backend/security/element/csp-reports.ts +8 -8
- package/backend/setup-module.ts +2 -2
- package/backend/sortable-table.ts +10 -4
- package/backend/storage/abstract-client-storage.ts +2 -2
- package/backend/storage/module-state-storage.ts +2 -2
- package/backend/tests/backend/utility/dom-helper-test.ts +2 -2
- package/backend/tests/fixtures/modal-autofocus.html +1 -0
- package/backend/tests/form-engine/element/extra/select-box-filter-test.ts +3 -3
- package/backend/tests/form-engine-validation-test.ts +1 -1
- package/backend/tests/modal-test.ts +91 -0
- package/backend/tests/notification-test.ts +176 -0
- package/backend/tests/tree/tree-test.ts +41 -0
- package/backend/tree/file-storage-browser.ts +1 -1
- package/backend/tree/file-storage-tree-container.ts +4 -4
- package/backend/tree/page-browser.ts +1 -1
- package/backend/tree/page-position-select.ts +1 -1
- package/backend/tree/page-tree-element.ts +9 -2
- package/backend/tree/page-tree.ts +7 -1
- package/backend/tree/tree-module-state.ts +5 -5
- package/backend/tree/tree.ts +15 -8
- package/backend/user-pass-login.ts +2 -2
- package/backend/utility/collapse-state-persister.ts +1 -1
- package/backend/utility/collapse-state-search.ts +6 -6
- package/backend/utility/dom-helper.ts +3 -3
- package/backend/utility.ts +6 -6
- package/backend/viewport/content-navigation.ts +5 -0
- package/backend/viewport/navigation-container.ts +1 -1
- package/backend/viewport/toolbar.ts +3 -3
- package/backend/window-manager.ts +2 -2
- package/backend/wizard/events/auto-advance-event.ts +6 -0
- package/backend/wizard/events/before-next-step-event.ts +6 -0
- package/backend/wizard/events/step-summary-event.ts +6 -0
- package/backend/wizard/move-content-element.ts +1 -1
- package/backend/wizard/wizard.ts +8 -10
- package/belog/backend-log.ts +2 -2
- package/beuser/permissions.ts +2 -2
- package/core/ajax/ajax-response.ts +1 -1
- package/core/ajax/input-transformer.ts +1 -1
- package/core/event/debounce-event.ts +4 -4
- package/core/event/event-interface.ts +3 -3
- package/core/event/regular-event.ts +7 -7
- package/core/event/request-animation-frame-event.ts +4 -4
- package/core/event/throttle-event.ts +4 -4
- package/core/java-script-item-processor.ts +6 -0
- package/core/referrer-refresh.ts +2 -2
- package/core/security-utility.ts +1 -1
- package/dashboard/dashboard-wizard.ts +2 -2
- package/dashboard/dashboard.ts +8 -13
- package/dashboard/wizard/steps/preset-step.ts +3 -3
- package/extensionmanager/main.ts +7 -7
- package/filelist/browse-files.ts +1 -1
- package/filelist/browse-folders.ts +2 -2
- package/filelist/file-list-dragdrop.ts +5 -5
- package/filelist/file-list-rename-handler.ts +3 -6
- package/filelist/file-list-replace-handler.ts +3 -6
- package/filelist/file-list-transfer-handler.ts +2 -2
- package/filelist/file-list.ts +8 -9
- package/form/backend/form-editor/component/date-editor.ts +4 -0
- package/form/backend/form-editor/component/form-element-selector.ts +4 -0
- package/form/backend/form-editor/inspector-component.ts +6 -6
- package/form/backend/form-editor/mediator.ts +36 -36
- package/form/backend/form-editor/modals-component.ts +115 -6
- package/form/backend/form-editor/stage-component.ts +4 -4
- package/form/backend/form-editor/view-model.ts +7 -7
- package/form/backend/form-manager/view-model.ts +5 -5
- package/form/backend/form-wizard/form-wizard.ts +2 -2
- package/form/backend/form-wizard/steps/storage-step.ts +1 -1
- package/impexp/import-export.ts +1 -1
- package/info/translation-status.ts +2 -2
- package/install/ajax/ajax-queue.ts +1 -1
- package/install/module/abstract-interactable-module.ts +2 -2
- package/install/module/environment/image-processing.ts +4 -4
- package/install/module/environment/mail-test.ts +2 -2
- package/install/module/maintenance/clear-tables.ts +3 -3
- package/install/module/maintenance/clear-typo3temp-files.ts +8 -8
- package/install/module/maintenance/create-admin.ts +3 -3
- package/install/module/maintenance/database-analyzer.ts +9 -7
- package/install/module/maintenance/language-packs.ts +4 -4
- package/install/module/maintenance/reference-index.ts +1 -1
- package/install/module/settings/change-install-tool-password.ts +1 -1
- package/install/module/settings/extension-configuration.ts +5 -5
- package/install/module/settings/features.ts +1 -1
- package/install/module/settings/local-configuration.ts +5 -5
- package/install/module/settings/presets.ts +2 -2
- package/install/module/settings/system-maintainer.ts +1 -1
- package/install/module/upgrade/extension-scanner.ts +5 -5
- package/install/module/upgrade/tca-migrations-check.ts +1 -1
- package/install/module/upgrade/upgrade-docs.ts +16 -16
- package/install/module/upgrade/upgrade-wizards.ts +7 -8
- package/install/renderable/language-packs.ts +8 -2
- package/lowlevel/query-generator.ts +2 -2
- package/package.json +2 -2
- package/redirects/event-handler.ts +6 -0
- package/rte-ckeditor/ckeditor5.ts +7 -3
- package/rte-ckeditor/legacy/ckeditor5-bundle.ts +0 -1
- package/rte-ckeditor/plugin/typo3-link.ts +7 -9
- package/rte-ckeditor/rte-link-browser.ts +1 -1
- package/rte-ckeditor/tests/ckeditor5-test.ts +68 -0
- package/scheduler/form-engine/element/timing-options-element.ts +1 -1
- package/scheduler/scheduler-add-group.ts +4 -12
- package/scheduler/scheduler.ts +2 -2
- package/styleguide/checkbox-demo.ts +1 -1
- package/tstemplate/template-analyzer.ts +1 -1
- package/viewpage/main.ts +1 -1
- package/workspaces/backend.ts +5 -5
- package/workspaces/preview.ts +41 -2
- package/workspaces/renderable/record-table.ts +95 -78
- package/workspaces/renderable/send-to-stage-form.ts +1 -1
|
@@ -37,23 +37,23 @@
|
|
|
37
37
|
|
|
38
38
|
constructor() {
|
|
39
39
|
this.adminPanel = document.querySelector(AdminPanelSelectors.adminPanelRole) as HTMLFormElement;
|
|
40
|
-
this.modules =
|
|
41
|
-
(moduleTrigger
|
|
40
|
+
this.modules = this.querySelectorAll(AdminPanelSelectors.moduleTriggerRole).map(
|
|
41
|
+
(moduleTrigger) => {
|
|
42
42
|
const moduleParent = moduleTrigger.closest(AdminPanelSelectors.moduleParentClass);
|
|
43
43
|
return new AdminPanelModule(this, moduleParent, moduleTrigger);
|
|
44
44
|
},
|
|
45
45
|
);
|
|
46
46
|
this.popups = this.querySelectorAll(AdminPanelSelectors.popupTriggerRole).map(
|
|
47
|
-
(popupTrigger
|
|
47
|
+
(popupTrigger) => new AdminPanelPopup(this, popupTrigger),
|
|
48
48
|
);
|
|
49
49
|
this.querySelectorAll(AdminPanelSelectors.panelTriggerRole).forEach(
|
|
50
|
-
(panelTrigger
|
|
50
|
+
(panelTrigger) => {
|
|
51
51
|
const panelParent = panelTrigger.closest(AdminPanelSelectors.panelParentClass);
|
|
52
52
|
new AdminPanelPanel(panelParent, panelTrigger);
|
|
53
53
|
},
|
|
54
54
|
);
|
|
55
55
|
this.querySelectorAll(AdminPanelSelectors.contentSettingsTriggerRole).forEach(
|
|
56
|
-
(contentSettingTrigger
|
|
56
|
+
(contentSettingTrigger) => {
|
|
57
57
|
const contentSettingElement = contentSettingTrigger
|
|
58
58
|
.closest(AdminPanelSelectors.contentParentClass)
|
|
59
59
|
.querySelector(AdminPanelSelectors.contentSettingsParentClass);
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
disableModules(): void {
|
|
70
|
-
this.modules.forEach((module
|
|
70
|
+
this.modules.forEach((module) => module.disable());
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
disablePopups(): void {
|
|
74
|
-
this.popups.forEach((popup
|
|
74
|
+
this.popups.forEach((popup) => popup.disable());
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
renderBackdrop(): void {
|
|
@@ -93,33 +93,33 @@
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
private querySelectorAll(selectors: string, subject: Element = null):
|
|
96
|
+
private querySelectorAll<T extends HTMLElement = HTMLElement>(selectors: string, subject: Element = null): T[] {
|
|
97
97
|
if (subject === null) {
|
|
98
|
-
return Array.from(document.querySelectorAll(selectors));
|
|
98
|
+
return Array.from(document.querySelectorAll<T>(selectors));
|
|
99
99
|
}
|
|
100
|
-
return Array.from(subject.querySelectorAll(selectors));
|
|
100
|
+
return Array.from(subject.querySelectorAll<T>(selectors));
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
private initializeEvents(): void {
|
|
104
104
|
this
|
|
105
105
|
.querySelectorAll(AdminPanelSelectors.contentTabRole)
|
|
106
|
-
.forEach((tab
|
|
106
|
+
.forEach((tab) => tab.addEventListener('click', this.switchTab.bind(this)));
|
|
107
107
|
this
|
|
108
108
|
.querySelectorAll(AdminPanelSelectors.zoomTarget)
|
|
109
|
-
.forEach((zoomTrigger
|
|
109
|
+
.forEach((zoomTrigger) => zoomTrigger.addEventListener('click', this.openZoom.bind(this)));
|
|
110
110
|
this
|
|
111
111
|
.querySelectorAll(AdminPanelSelectors.zoomClose)
|
|
112
|
-
.forEach((zoomTrigger
|
|
112
|
+
.forEach((zoomTrigger) => zoomTrigger.addEventListener('click', this.closeZoom.bind(this)));
|
|
113
113
|
this
|
|
114
114
|
.querySelectorAll(AdminPanelSelectors.triggerRole)
|
|
115
|
-
.forEach((trigger
|
|
115
|
+
.forEach((trigger) => trigger.addEventListener('click', this.toggleAdminPanelState.bind(this)));
|
|
116
116
|
this
|
|
117
117
|
.querySelectorAll(AdminPanelSelectors.saveButtonRole)
|
|
118
|
-
.forEach((elm
|
|
118
|
+
.forEach((elm) => elm.addEventListener('click', this.sendAdminPanelForm.bind(this)));
|
|
119
119
|
|
|
120
120
|
this
|
|
121
121
|
.querySelectorAll('[data-typo3-role=typo3-adminPanel-content-close]')
|
|
122
|
-
.forEach((elm
|
|
122
|
+
.forEach((elm) => {
|
|
123
123
|
elm.addEventListener('click', () => {
|
|
124
124
|
this.disableModules();
|
|
125
125
|
this.removeBackdrop();
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
});
|
|
128
128
|
this
|
|
129
129
|
.querySelectorAll('.typo3-adminPanel-table th, .typo3-adminPanel-table td')
|
|
130
|
-
.forEach((elm
|
|
130
|
+
.forEach((elm) => {
|
|
131
131
|
elm.addEventListener('click', () => {
|
|
132
132
|
elm.focus();
|
|
133
133
|
try {
|
|
@@ -149,9 +149,9 @@
|
|
|
149
149
|
const contentTabs = this.querySelectorAll(AdminPanelSelectors.contentTabRole, currentContent);
|
|
150
150
|
const contentPanes = this.querySelectorAll(AdminPanelSelectors.contentPaneRole, currentContent);
|
|
151
151
|
|
|
152
|
-
contentTabs.forEach((element
|
|
152
|
+
contentTabs.forEach((element) => element.classList.remove(activeTabClass));
|
|
153
153
|
currentTab.classList.add(activeTabClass);
|
|
154
|
-
contentPanes.forEach((element
|
|
154
|
+
contentPanes.forEach((element) => element.classList.remove(activePaneClass));
|
|
155
155
|
|
|
156
156
|
const activePane = document.querySelector('[data-typo3-tab-id=' + currentTab.dataset.typo3TabTarget + ']');
|
|
157
157
|
activePane.classList.add(activePaneClass);
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
*/
|
|
197
197
|
private getCleanReloadUrl(): string {
|
|
198
198
|
const urlParams: string[] = [];
|
|
199
|
-
location.search.substr(1).split('&').forEach((item
|
|
199
|
+
location.search.substr(1).split('&').forEach((item): void => {
|
|
200
200
|
if (item && !item.includes('ADMCMD_')) {
|
|
201
201
|
urlParams.push(item);
|
|
202
202
|
}
|
|
@@ -208,12 +208,12 @@
|
|
|
208
208
|
|
|
209
209
|
private addBackdropListener(): void {
|
|
210
210
|
this.querySelectorAll('.' + AdminPanelClasses.backdrop)
|
|
211
|
-
.forEach((elm
|
|
211
|
+
.forEach((elm) => {
|
|
212
212
|
elm.addEventListener('click', () => {
|
|
213
213
|
this.removeBackdrop();
|
|
214
214
|
this
|
|
215
215
|
.querySelectorAll(AdminPanelSelectors.moduleTriggerRole)
|
|
216
|
-
.forEach((innerElm
|
|
216
|
+
.forEach((innerElm) => {
|
|
217
217
|
innerElm.closest(AdminPanelSelectors.moduleParentClass)
|
|
218
218
|
.classList.remove(AdminPanelClasses.activeModule);
|
|
219
219
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
((): void => {
|
|
2
2
|
class AdminPanelCache {
|
|
3
|
-
private readonly buttons:
|
|
3
|
+
private readonly buttons: NodeListOf<HTMLElement>;
|
|
4
4
|
|
|
5
5
|
constructor() {
|
|
6
|
-
this.buttons = document.querySelectorAll('[data-typo3-role="clearCacheButton"]');
|
|
6
|
+
this.buttons = document.querySelectorAll<HTMLElement>('[data-typo3-role="clearCacheButton"]');
|
|
7
7
|
|
|
8
|
-
this.buttons.forEach((element
|
|
8
|
+
this.buttons.forEach((element): void => {
|
|
9
9
|
element.addEventListener('click', (): void => {
|
|
10
10
|
const url = element.dataset.typo3AjaxUrl;
|
|
11
11
|
const request = new XMLHttpRequest();
|
|
@@ -19,6 +19,11 @@ import documentService from '@typo3/core/document-service';
|
|
|
19
19
|
import Utility from '@typo3/backend/utility';
|
|
20
20
|
|
|
21
21
|
declare type ActionDispatchArgument = unknown;
|
|
22
|
+
/**
|
|
23
|
+
* Delegates are invoked with arguments resolved from the DOM, so their concrete
|
|
24
|
+
* signature is only known to the registering side.
|
|
25
|
+
*/
|
|
26
|
+
declare type ActionDispatchDelegate = (...args: never[]) => void;
|
|
22
27
|
|
|
23
28
|
/**
|
|
24
29
|
* Module: @typo3/backend/action-dispatcher
|
|
@@ -33,7 +38,7 @@ declare type ActionDispatchArgument = unknown;
|
|
|
33
38
|
* data-dispatch-disabled>
|
|
34
39
|
*/
|
|
35
40
|
class ActionDispatcher {
|
|
36
|
-
private delegates:
|
|
41
|
+
private delegates: Record<string, ActionDispatchDelegate> = {};
|
|
37
42
|
|
|
38
43
|
public constructor() {
|
|
39
44
|
this.createDelegates();
|
|
@@ -82,7 +87,7 @@ class ActionDispatcher {
|
|
|
82
87
|
const action = target.dataset.dispatchAction;
|
|
83
88
|
let args: ActionDispatchArgument[] = ActionDispatcher.resolveArguments(target);
|
|
84
89
|
if (args instanceof Array) {
|
|
85
|
-
args = args.map((arg
|
|
90
|
+
args = args.map((arg): ActionDispatchArgument => {
|
|
86
91
|
switch (arg) {
|
|
87
92
|
case '{$target}':
|
|
88
93
|
return target;
|
|
@@ -94,7 +99,7 @@ class ActionDispatcher {
|
|
|
94
99
|
});
|
|
95
100
|
}
|
|
96
101
|
if (this.delegates[action]) {
|
|
97
|
-
this.delegates[action].apply(null, args || []);
|
|
102
|
+
this.delegates[action].apply(null, (args || []) as never[]);
|
|
98
103
|
}
|
|
99
104
|
}
|
|
100
105
|
}
|
|
@@ -159,10 +159,10 @@ class BookmarkStore {
|
|
|
159
159
|
let bookmarks = await this.getBookmarks();
|
|
160
160
|
|
|
161
161
|
if (options?.accessibleOnly) {
|
|
162
|
-
bookmarks = bookmarks.filter((b
|
|
162
|
+
bookmarks = bookmarks.filter((b) => b.accessible);
|
|
163
163
|
}
|
|
164
164
|
if (options?.groupId !== undefined) {
|
|
165
|
-
bookmarks = bookmarks.filter((b
|
|
165
|
+
bookmarks = bookmarks.filter((b) => b.groupId === options.groupId);
|
|
166
166
|
}
|
|
167
167
|
if (options?.limit !== undefined && options.limit > 0 && bookmarks.length > options.limit) {
|
|
168
168
|
bookmarks = bookmarks.slice(0, options.limit);
|
|
@@ -178,8 +178,8 @@ class BookmarkStore {
|
|
|
178
178
|
groupSortingMap.set(group.id, group.sorting);
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
const groupIds = [...new Set(bookmarks.map((b
|
|
182
|
-
const sortedBookmarkGroupIds = groupIds.sort((a
|
|
181
|
+
const groupIds = [...new Set(bookmarks.map((b) => b.groupId))];
|
|
182
|
+
const sortedBookmarkGroupIds = groupIds.sort((a, b) => {
|
|
183
183
|
// First sort by priority (lower values first)
|
|
184
184
|
const priorityA = groupPriorityMap.get(a) ?? Number.MAX_SAFE_INTEGER;
|
|
185
185
|
const priorityB = groupPriorityMap.get(b) ?? Number.MAX_SAFE_INTEGER;
|
|
@@ -195,7 +195,7 @@ class BookmarkStore {
|
|
|
195
195
|
});
|
|
196
196
|
|
|
197
197
|
for (const groupId of sortedBookmarkGroupIds) {
|
|
198
|
-
const groupBookmarks = bookmarks.filter((b
|
|
198
|
+
const groupBookmarks = bookmarks.filter((b) => b.groupId === groupId);
|
|
199
199
|
if (groupBookmarks.length > 0) {
|
|
200
200
|
grouped.set(groupId, groupBookmarks);
|
|
201
201
|
}
|
|
@@ -105,7 +105,7 @@ export class ClipboardPanel extends LitElement {
|
|
|
105
105
|
<div class="table-fit">
|
|
106
106
|
<table class="table">
|
|
107
107
|
<tbody>
|
|
108
|
-
${clipboardData.tabs.map((tab
|
|
108
|
+
${clipboardData.tabs.map((tab): TemplateResult => this.renderTab(tab, clipboardData))}
|
|
109
109
|
</tbody>
|
|
110
110
|
</table>
|
|
111
111
|
</div>
|
|
@@ -166,7 +166,7 @@ export class ClipboardPanel extends LitElement {
|
|
|
166
166
|
`}
|
|
167
167
|
</td>
|
|
168
168
|
</tr>
|
|
169
|
-
${clipboardData.current === tab.identifier && tab.items ? tab.items.map((tabItem
|
|
169
|
+
${clipboardData.current === tab.identifier && tab.items ? tab.items.map((tabItem): TemplateResult => this.renderTabItem(tabItem, tab.identifier, clipboardData)) : nothing}
|
|
170
170
|
`;
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -163,7 +163,7 @@ export class CodeMirrorElement extends LitElement {
|
|
|
163
163
|
root: document.body
|
|
164
164
|
};
|
|
165
165
|
const observer = new IntersectionObserver((entries: IntersectionObserverEntry[]): void => {
|
|
166
|
-
entries.forEach((entry
|
|
166
|
+
entries.forEach((entry): void => {
|
|
167
167
|
if (entry.intersectionRatio > 0) {
|
|
168
168
|
observer.unobserve(entry.target);
|
|
169
169
|
if (this.firstElementChild && this.firstElementChild.nodeName.toLowerCase() === 'textarea') {
|
|
@@ -90,7 +90,7 @@ export async function complete(context: CompletionContext): Promise<CompletionRe
|
|
|
90
90
|
const completions = getCompletions(tokenValue, keywords);
|
|
91
91
|
return {
|
|
92
92
|
from: completionStart,
|
|
93
|
-
options: completions.map((result
|
|
93
|
+
options: completions.map((result) => {
|
|
94
94
|
return { label: result, type: 'keyword' };
|
|
95
95
|
})
|
|
96
96
|
};
|
|
@@ -129,7 +129,7 @@ function extractCodemirror5StyleLineTokens(lineCount: number, context: Completio
|
|
|
129
129
|
// stream parser doesn't perform proper tokenization.
|
|
130
130
|
// Insert content as null-type token into the lineToken array.
|
|
131
131
|
if (lastToken < start) {
|
|
132
|
-
context.state.sliceDoc(lastToken, start).split(context.state.lineBreak).forEach((part
|
|
132
|
+
context.state.sliceDoc(lastToken, start).split(context.state.lineBreak).forEach((part) => {
|
|
133
133
|
if (part) {
|
|
134
134
|
lineTokens[Math.min(lineNumber - 1, lineCount - 1)].push({ type: null, string: part, start: lastToken, end: lastToken + part.length });
|
|
135
135
|
lineNumber++;
|
|
@@ -162,7 +162,7 @@ function tokenIsSubStringOfKeywords(token: string, keywords: string[]): boolean
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
function getCompletions(token: string, keywords: string[]) {
|
|
165
|
-
const found = new Set();
|
|
165
|
+
const found = new Set<string>();
|
|
166
166
|
|
|
167
167
|
const maybeAdd = (str: string) => {
|
|
168
168
|
if (str.lastIndexOf(token, 0) === 0 && !found.has(str)) {
|
|
@@ -8,8 +8,8 @@ type Keyword = {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
type CombinatorReturnType = boolean | undefined;
|
|
11
|
-
type CombinatorFunction = (type?: Type, value?:
|
|
12
|
-
type CombinatorLexFunction = ((type?: Type, value?:
|
|
11
|
+
type CombinatorFunction = (type?: Type, value?: Value) => CombinatorReturnType;
|
|
12
|
+
type CombinatorLexFunction = ((type?: Type, value?: Value) => CombinatorReturnType) & { lex: true };
|
|
13
13
|
type CC = CombinatorFunction | CombinatorLexFunction;
|
|
14
14
|
|
|
15
15
|
type CX = {
|
package/backend/color-picker.ts
CHANGED
|
@@ -107,7 +107,7 @@ export class Typo3BackendColorPicker extends LitElement {
|
|
|
107
107
|
|
|
108
108
|
// input: react on user input
|
|
109
109
|
// change: react on indirect changes, e.g. a value picker
|
|
110
|
-
['input', 'change'].forEach((eventName
|
|
110
|
+
['input', 'change'].forEach((eventName): void => {
|
|
111
111
|
new RegularEvent(eventName, (e: Event): void => {
|
|
112
112
|
const input = (e.target as HTMLInputElement);
|
|
113
113
|
this.color = input.value;
|
|
@@ -151,7 +151,7 @@ class LegacyColorPicker {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
const colorPicker = document.createElement('typo3-backend-color-picker');
|
|
154
|
-
colorPicker.swatches = options.swatches.map((swatch
|
|
154
|
+
colorPicker.swatches = options.swatches.map((swatch) => ({ color: swatch, label: swatch }));
|
|
155
155
|
colorPicker.opacity = options.opacity ?? false;
|
|
156
156
|
element.parentNode.insertBefore(colorPicker, element);
|
|
157
157
|
colorPicker.appendChild(element);
|
|
@@ -116,7 +116,7 @@ export class ColumnSelectorButton extends PseudoButtonLitElement {
|
|
|
116
116
|
* @private
|
|
117
117
|
*/
|
|
118
118
|
private static filterColumns(columnsFilter: HTMLInputElement, columns: NodeListOf<HTMLInputElement>): void {
|
|
119
|
-
columns.forEach((column
|
|
119
|
+
columns.forEach((column) => {
|
|
120
120
|
const columnContainer: HTMLDivElement = column.closest(Selectors.columnsContainerSelector);
|
|
121
121
|
if (!column.disabled && columnContainer !== null) {
|
|
122
122
|
const filterValue: string = columnContainer.querySelector('.form-check-label')?.textContent;
|
|
@@ -160,7 +160,7 @@ export class ColumnSelectorButton extends PseudoButtonLitElement {
|
|
|
160
160
|
text: this.buttonOk,
|
|
161
161
|
btnClass: 'btn-primary',
|
|
162
162
|
name: 'update',
|
|
163
|
-
|
|
163
|
+
form: 'columnSelectorForm',
|
|
164
164
|
}
|
|
165
165
|
],
|
|
166
166
|
ajaxCallback: (): void => this.handleModalContentLoaded(modal)
|
|
@@ -198,7 +198,10 @@ export class ColumnSelectorButton extends PseudoButtonLitElement {
|
|
|
198
198
|
return;
|
|
199
199
|
}
|
|
200
200
|
// Prevent the form from being submitted as the form data will be send via an ajax request
|
|
201
|
-
form.addEventListener('submit', (e: Event): void => {
|
|
201
|
+
form.addEventListener('submit', (e: Event): void => {
|
|
202
|
+
e.preventDefault();
|
|
203
|
+
this.processSelection(currentModal);
|
|
204
|
+
});
|
|
202
205
|
|
|
203
206
|
const columns: NodeListOf<HTMLInputElement> = currentModal.querySelectorAll(Selectors.columnsSelector);
|
|
204
207
|
const columnsFilter: HTMLInputElement = currentModal.querySelector(Selectors.columnsFilterSelector);
|
|
@@ -215,7 +218,7 @@ export class ColumnSelectorButton extends PseudoButtonLitElement {
|
|
|
215
218
|
ColumnSelectorButton.toggleSelectorActions(columns, selectAll, selectNone, true);
|
|
216
219
|
|
|
217
220
|
// Add event listener for each column to toggle the selector actions after change
|
|
218
|
-
columns.forEach((column
|
|
221
|
+
columns.forEach((column) => {
|
|
219
222
|
column.addEventListener('change', (): void => {
|
|
220
223
|
ColumnSelectorButton.toggleSelectorActions(columns, selectAll, selectNone);
|
|
221
224
|
});
|
|
@@ -245,7 +248,7 @@ export class ColumnSelectorButton extends PseudoButtonLitElement {
|
|
|
245
248
|
|
|
246
249
|
// Add event listener for all columns select actions. querySelectorAll will return
|
|
247
250
|
// at least two actions (selectAll and selectNone) which we checked above already
|
|
248
|
-
columnsSelectorActions.querySelectorAll('button[data-action]').forEach((action
|
|
251
|
+
columnsSelectorActions.querySelectorAll<HTMLButtonElement>('button[data-action]').forEach((action) => {
|
|
249
252
|
action.addEventListener('click', (e: Event): void => {
|
|
250
253
|
e.preventDefault();
|
|
251
254
|
|
|
@@ -258,21 +261,21 @@ export class ColumnSelectorButton extends PseudoButtonLitElement {
|
|
|
258
261
|
// Perform requested action
|
|
259
262
|
switch (target.dataset.action) {
|
|
260
263
|
case SelectorActions.toggle:
|
|
261
|
-
columns.forEach((column
|
|
264
|
+
columns.forEach((column) => {
|
|
262
265
|
if (!column.disabled && !ColumnSelectorButton.isColumnHidden(column)) {
|
|
263
266
|
column.checked = !column.checked;
|
|
264
267
|
}
|
|
265
268
|
});
|
|
266
269
|
break;
|
|
267
270
|
case SelectorActions.all:
|
|
268
|
-
columns.forEach((column
|
|
271
|
+
columns.forEach((column) => {
|
|
269
272
|
if (!column.disabled && !ColumnSelectorButton.isColumnHidden(column)) {
|
|
270
273
|
column.checked = true;
|
|
271
274
|
}
|
|
272
275
|
});
|
|
273
276
|
break;
|
|
274
277
|
case SelectorActions.none:
|
|
275
|
-
columns.forEach((column
|
|
278
|
+
columns.forEach((column) => {
|
|
276
279
|
if (!column.disabled && !ColumnSelectorButton.isColumnHidden(column)) {
|
|
277
280
|
column.checked = false;
|
|
278
281
|
}
|
package/backend/context-help.ts
CHANGED
|
@@ -32,8 +32,8 @@ class ContextHelp {
|
|
|
32
32
|
|
|
33
33
|
public async initialize(): Promise<void> {
|
|
34
34
|
await DocumentService.ready();
|
|
35
|
-
const elements = document.querySelectorAll(this.selector);
|
|
36
|
-
elements.forEach((element
|
|
35
|
+
const elements = document.querySelectorAll<HTMLElement>(this.selector);
|
|
36
|
+
elements.forEach((element): void => {
|
|
37
37
|
element.dataset.bsHtml = 'true';
|
|
38
38
|
element.dataset.bsPlacement = this.placement;
|
|
39
39
|
element.dataset.bsTrigger = this.trigger;
|
|
@@ -56,7 +56,7 @@ class ContextHelp {
|
|
|
56
56
|
|
|
57
57
|
new RegularEvent('click', (e: Event): void => {
|
|
58
58
|
const me = e.target as HTMLElement;
|
|
59
|
-
elements.forEach((element
|
|
59
|
+
elements.forEach((element): void => {
|
|
60
60
|
if (!element.isEqualNode(me)) {
|
|
61
61
|
Popover.hide(element);
|
|
62
62
|
}
|
package/backend/context-menu.ts
CHANGED
|
@@ -192,11 +192,11 @@ export class ContextMenuElement extends LitElement {
|
|
|
192
192
|
onComplete: () => {
|
|
193
193
|
this.focusFirstElement = true;
|
|
194
194
|
},
|
|
195
|
-
onError: (error:
|
|
195
|
+
onError: (error: unknown) => {
|
|
196
196
|
if (error instanceof AjaxResponse) {
|
|
197
197
|
Notification.error('', error.response.status + ' ' + error.response.statusText, 5);
|
|
198
198
|
} else {
|
|
199
|
-
Notification.error('', error.message);
|
|
199
|
+
Notification.error('', (error as Error).message);
|
|
200
200
|
}
|
|
201
201
|
},
|
|
202
202
|
});
|
|
@@ -551,7 +551,7 @@ export class ContextMenuElement extends LitElement {
|
|
|
551
551
|
|
|
552
552
|
private getNodeByIdentifier(identifier: string): MenuItemInterface | null {
|
|
553
553
|
const flattenedNodes = this.flattenMenuItems(this.nodes);
|
|
554
|
-
return flattenedNodes.find((node
|
|
554
|
+
return flattenedNodes.find((node) => {
|
|
555
555
|
return this.getNodeIdentifier(node) === identifier;
|
|
556
556
|
}) ?? null;
|
|
557
557
|
}
|
|
@@ -748,4 +748,9 @@ declare global {
|
|
|
748
748
|
interface HTMLElementTagNameMap {
|
|
749
749
|
'typo3-backend-context-menu': ContextMenuElement;
|
|
750
750
|
}
|
|
751
|
+
|
|
752
|
+
interface DocumentEventMap {
|
|
753
|
+
[ContextMenuEvent.open]: CustomEvent<ContextMenuEventDetail>;
|
|
754
|
+
[ContextMenuEvent.close]: CustomEvent<ContextMenuEventDetail>;
|
|
755
|
+
}
|
|
751
756
|
}
|
package/backend/drag-tooltip.ts
CHANGED
|
@@ -144,15 +144,15 @@ export class DragToolTip extends LitElement implements DragTooltipMetadata {
|
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
const propertyNames = [...changedProperties.keys()].filter(
|
|
148
|
-
(propName
|
|
147
|
+
const propertyNames = ([...changedProperties.keys()] as (keyof this)[]).filter(
|
|
148
|
+
(propName) => (this.constructor as typeof ReactiveElement).elementProperties.get(propName).attribute !== false
|
|
149
149
|
);
|
|
150
150
|
|
|
151
151
|
if (propertyNames.length === 0) {
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
const newProperties = propertyNames.map((propName
|
|
155
|
+
const newProperties = propertyNames.map((propName) => [ propName, this[propName] ]);
|
|
156
156
|
this.broadcast('changedProperties', Object.fromEntries(newProperties));
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -212,7 +212,7 @@ export class DragToolTip extends LitElement implements DragTooltipMetadata {
|
|
|
212
212
|
|
|
213
213
|
protected onBroadcastChangedProperties = (event: CustomEvent<{ payload: Partial<WritablePart<DragToolTip>> }>) => {
|
|
214
214
|
const newProperties = event.detail.payload;
|
|
215
|
-
Object.keys(newProperties)
|
|
215
|
+
(Object.keys(newProperties) as (keyof WritablePart<DragToolTip>)[]).forEach((key) => {
|
|
216
216
|
(this[key] as unknown) = newProperties[key];
|
|
217
217
|
});
|
|
218
218
|
this.skipNextUpdateBroadcast = true;
|
|
@@ -282,4 +282,9 @@ declare global {
|
|
|
282
282
|
interface HTMLElementTagNameMap {
|
|
283
283
|
'typo3-backend-drag-tooltip': DragToolTip;
|
|
284
284
|
}
|
|
285
|
+
|
|
286
|
+
interface DocumentEventMap {
|
|
287
|
+
'typo3:drag-tooltip:metadata-update': CustomEvent<DragTooltipMetadata>;
|
|
288
|
+
'typo3:drag-tooltip:changedProperties': CustomEvent<{ payload: Partial<WritablePart<DragToolTip>> }>;
|
|
289
|
+
}
|
|
285
290
|
}
|