typo3-typescript-sources 13.4.26 → 14.1.0
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 +114 -66
- package/.last-synced-tag +1 -1
- package/README.md +8 -1
- package/backend/action-button/deferred-action.ts +2 -0
- package/backend/action-button/immediate-action.ts +2 -0
- package/backend/ajax-data-handler.ts +1 -116
- package/backend/clear-cache.ts +1 -1
- package/backend/clipboard-panel.ts +5 -5
- package/backend/code-editor/element/code-mirror-element.ts +1 -1
- package/backend/code-editor/stream-parser/typoscript.ts +2 -2
- package/backend/color-picker.ts +5 -4
- package/backend/color-scheme-switch.ts +1 -1
- package/backend/column-selector-button.ts +1 -1
- package/backend/context-menu-actions.ts +17 -2
- package/backend/context-menu.ts +3 -3
- package/backend/copy-to-clipboard.ts +1 -1
- package/backend/date-time-picker.ts +30 -16
- package/backend/drag-tooltip.ts +1 -1
- package/backend/drag-uploader.ts +44 -40
- package/backend/element/alert-element.ts +2 -2
- package/backend/element/breadcrumb.ts +306 -0
- package/backend/element/combobox-element.ts +712 -0
- package/backend/element/dispatch-modal-button.ts +1 -1
- package/backend/element/draggable-resizable-element.ts +1 -1
- package/backend/element/editable-page-title.ts +6 -5
- package/backend/element/icon-element.ts +2 -2
- package/backend/element/pagination.ts +4 -4
- package/backend/element/progress-bar-element.ts +129 -3
- package/backend/element/progress-tracker-element.ts +2 -2
- package/backend/element/pseudo-button.ts +1 -1
- package/backend/element/qrcode-element.ts +129 -0
- package/backend/element/sidebar-toggle-element.ts +110 -0
- package/backend/element/spinner-element.ts +1 -1
- package/backend/element/thumbnail-element.ts +3 -0
- package/backend/enum/viewport/scaffold-identifier.ts +24 -4
- package/backend/form-engine/container/files-control-container.ts +12 -12
- package/backend/form-engine/container/flex-form-section-container.ts +0 -1
- package/backend/form-engine/container/inline-control-container.ts +12 -16
- package/backend/form-engine/container/site-language-container.ts +10 -10
- package/backend/form-engine/element/abstract-sortable-select-items.ts +2 -2
- package/backend/form-engine/element/category-element.ts +0 -1
- package/backend/form-engine/element/color-element.ts +2 -1
- package/backend/form-engine/element/datetime-element.ts +2 -1
- package/backend/form-engine/element/extra/char-counter.ts +1 -1
- package/backend/form-engine/element/extra/select-box-filter.ts +4 -0
- package/backend/form-engine/element/online-media-form-element.ts +1 -1
- package/backend/form-engine/element/select-country-element.ts +82 -0
- package/backend/form-engine/element/select-tree-element.ts +0 -1
- package/backend/form-engine/element/select-tree-toolbar.ts +15 -18
- package/backend/form-engine/element/select-tree.ts +6 -1
- package/backend/form-engine/element/suggest/result-container.ts +1 -1
- package/backend/form-engine/element/suggest/result-item.ts +1 -1
- package/backend/form-engine/element/table-wizard-element.ts +1 -1
- package/backend/form-engine/field-control/password-generator.ts +2 -1
- package/backend/form-engine/field-wizard/value-picker.ts +7 -34
- package/backend/form-engine/inline-relation/inline-response-interface.ts +0 -1
- package/backend/form-engine-link-browser-adapter.ts +1 -5
- package/backend/form-engine-review.ts +2 -2
- package/backend/form-engine-suggest.ts +1 -1
- package/backend/form-engine-validation.ts +20 -80
- package/backend/form-engine.ts +40 -42
- package/backend/grid-editor.ts +4 -4
- package/backend/hotkeys/hotkey-storage.ts +18 -3
- package/backend/hotkeys.ts +46 -27
- package/backend/image-manipulation.ts +4 -4
- package/backend/layout-module/drag-drop.ts +1 -1
- package/backend/link-browser.ts +1 -11
- package/backend/live-search/element/backend-search.ts +1 -1
- package/backend/live-search/element/hint.ts +1 -1
- package/backend/live-search/element/provider/default-result-item.ts +1 -1
- package/backend/live-search/element/provider/page-provider-result-item.ts +1 -1
- package/backend/live-search/element/result/item/action/action-container.ts +1 -1
- package/backend/live-search/element/result/item/action/action.ts +2 -2
- package/backend/live-search/element/result/item/item-container.ts +2 -2
- package/backend/live-search/element/result/item/item.ts +1 -1
- package/backend/live-search/element/result/result-container.ts +1 -1
- package/backend/live-search/element/result/result-detail-container.ts +1 -1
- package/backend/live-search/element/result/result-pagination.ts +1 -1
- package/backend/live-search/element/search-option-item.ts +1 -1
- package/backend/live-search/live-search-shortcut.ts +14 -1
- package/backend/localization/finisher/noop-finisher.ts +48 -0
- package/backend/localization/finisher/redirect-finisher.ts +55 -0
- package/backend/localization/finisher/reload-finisher.ts +45 -0
- package/backend/localization/localization-button.ts +52 -0
- package/backend/localization/localization-finisher.ts +50 -0
- package/backend/localization/localization-wizard.ts +451 -0
- package/backend/localization/steps/confirm-step.ts +61 -0
- package/backend/localization/steps/content-record-selection-step.ts +389 -0
- package/backend/localization/steps/finisher-step.ts +179 -0
- package/backend/localization/steps/handler-selection-step.ts +200 -0
- package/backend/localization/steps/mode-step.ts +199 -0
- package/backend/localization/steps/source-language-step.ts +187 -0
- package/backend/localization/steps/target-language-step.ts +195 -0
- package/backend/localization.ts +2 -377
- package/backend/login/pasted-password-checker.ts +22 -0
- package/backend/login-refresh.ts +1 -1
- package/backend/login.ts +31 -0
- package/backend/modal.ts +144 -82
- package/backend/module/iframe.ts +1 -1
- package/backend/module/router.ts +12 -18
- package/backend/module-menu.ts +11 -82
- package/backend/multi-record-selection-edit-action.ts +1 -0
- package/backend/multi-step-wizard.ts +50 -50
- package/backend/new-content-element-wizard-button.ts +1 -1
- package/backend/new-record-wizard.ts +102 -9
- package/backend/notification.ts +3 -3
- package/backend/online-media.ts +9 -3
- package/backend/pagetsconfig/pagetsconfig-includes.ts +1 -1
- package/backend/record-download-button.ts +2 -3
- package/backend/record-usage/record-usage-store.ts +65 -0
- package/backend/recordlist.ts +73 -3
- package/backend/resource/resource.ts +4 -0
- package/backend/security/element/csp-reports.ts +3 -2
- package/backend/security/element/sudo-mode.ts +1 -1
- package/backend/settings/editor/editable-setting.ts +3 -2
- package/backend/settings/editor.ts +19 -6
- package/backend/settings/type/base.ts +1 -1
- package/backend/settings/type/bool.ts +1 -1
- package/backend/settings/type/color.ts +1 -1
- package/backend/settings/type/int.ts +2 -2
- package/backend/settings/type/number.ts +2 -2
- package/backend/settings/type/page.ts +1 -1
- package/backend/settings/type/string.ts +2 -2
- package/backend/settings/type/stringlist.ts +1 -1
- package/backend/settings/type/url.ts +43 -0
- package/backend/storage/abstract-client-storage.ts +1 -1
- package/backend/storage/module-state-storage.ts +5 -0
- package/backend/switch-user.ts +1 -1
- package/backend/tests/form-engine-validation-test.ts +12 -12
- package/backend/tests/login/pasted-password-checker-test.ts +43 -0
- package/backend/toolbar/live-search.ts +4 -5
- package/backend/toolbar/shortcut-menu.ts +2 -2
- package/backend/toolbar.ts +8 -5
- package/backend/tree/file-storage-browser.ts +9 -14
- package/backend/tree/file-storage-tree-container.ts +21 -20
- package/backend/tree/file-storage-tree.ts +13 -1
- package/backend/tree/page-browser.ts +15 -11
- package/backend/tree/page-tree-element.ts +99 -43
- package/backend/tree/tree-module-state.ts +1 -1
- package/backend/tree/tree-node-toggle.ts +1 -1
- package/backend/tree/tree-node.ts +1 -0
- package/backend/tree/tree-toolbar.ts +11 -6
- package/backend/tree/tree.ts +16 -9
- package/backend/user-settings-manager.ts +47 -2
- package/backend/utility/collapse-state-search.ts +5 -6
- package/backend/utility/dom-helper.ts +11 -1
- package/backend/utility/format-utility.ts +30 -0
- package/backend/utility.ts +0 -21
- package/backend/viewport/content-container.ts +4 -1
- package/backend/viewport/content-navigation-toggle.ts +277 -0
- package/backend/viewport/content-navigation.ts +470 -0
- package/backend/viewport/loader.ts +13 -5
- package/backend/viewport/navigation-container.ts +27 -20
- package/backend/viewport/scaffold-state.ts +268 -0
- package/backend/viewport/toolbar.ts +75 -0
- package/backend/wizard/move-content-element.ts +2 -2
- package/backend/wizard/move-page.ts +2 -2
- package/core/ajax/ajax-request.ts +5 -2
- package/core/authentication/mfa-provider/totp.ts +1 -1
- package/core/directive/markdown.ts +2 -2
- package/core/event/throttle-event.ts +1 -1
- package/core/factory/url-factory.ts +73 -0
- package/core/lit-helper.ts +2 -2
- package/core/tests/factory/url-factory-test.ts +105 -0
- package/dashboard/dashboard.ts +100 -5
- package/extensionmanager/distribution-image.ts +1 -1
- package/extensionmanager/main.ts +30 -15
- package/extensionmanager/repository.ts +21 -16
- package/extensionmanager/update.ts +13 -3
- package/filelist/browse-files.ts +0 -6
- package/filelist/context-menu-actions.ts +21 -16
- package/filelist/file-delete.ts +1 -1
- package/filelist/file-list-actions.ts +9 -1
- package/filelist/file-list-rename-handler.ts +7 -4
- package/filelist/file-list-replace-handler.ts +141 -0
- package/filelist/file-list.ts +19 -8
- package/filelist/{create-folder.ts → resource-creation.ts} +2 -2
- package/form/backend/form-editor/component/property-grid-editor.ts +4 -4
- package/form/backend/form-editor/core.ts +1 -2
- package/form/backend/form-editor/inspector-component.ts +6 -1
- package/form/backend/form-editor/stage-component.ts +6 -1
- package/form/backend/form-editor/tree-component.ts +3 -1
- package/form/backend/form-manager/main.ts +10 -11
- package/form/backend/form-manager/view-model.ts +28 -67
- package/install/installer.ts +4 -4
- package/install/module/environment/folder-structure.ts +4 -1
- package/install/module/maintenance/reference-index.ts +154 -0
- package/install/module/password-strength.ts +2 -0
- package/install/module/settings/extension-configuration.ts +0 -2
- package/install/module/settings/local-configuration.ts +0 -4
- package/install/module/upgrade/upgrade-docs.ts +5 -4
- package/install/module/upgrade/upgrade-wizards.ts +3 -1
- package/install/renderable/flash-message.ts +1 -1
- package/install/renderable/info-box.ts +1 -1
- package/install/renderable/language-packs.ts +3 -3
- package/install/renderable/offset-group.ts +1 -1
- package/install/renderable/wrap-group.ts +1 -1
- package/install/router.ts +7 -30
- package/package.json +2 -2
- package/recycler/recycler.ts +30 -18
- package/redirects/element/qrcode-modal-button.ts +75 -0
- package/rte-ckeditor/ckeditor5.ts +3 -3
- package/rte-ckeditor/plugin/typo3-link.ts +2 -1
- package/rte-ckeditor/rte-link-browser.ts +1 -0
- package/scheduler/form-engine/element/timing-options-element.ts +74 -0
- package/scheduler/new-scheduler-task-wizard-button.ts +51 -0
- package/scheduler/scheduler-add-group.ts +28 -0
- package/scheduler/scheduler.ts +3 -359
- package/scheduler/setup-check-button.ts +50 -0
- package/styleguide/element/theme-switcher-element.ts +4 -3
- package/styleguide/processing-indicator.ts +16 -7
- package/sys-note/element/delete-button.ts +1 -1
- package/tstemplate/template-analyzer.ts +1 -1
- package/viewpage/main.ts +5 -3
- package/workspaces/backend.ts +41 -44
- package/workspaces/preview.ts +6 -8
- package/workspaces/renderable/comment-view.ts +3 -3
- package/workspaces/renderable/diff-view.ts +3 -3
- package/workspaces/renderable/history-view.ts +3 -3
- package/workspaces/renderable/record-information.ts +2 -2
- package/workspaces/renderable/record-table.ts +26 -6
- package/workspaces/renderable/send-to-stage-form.ts +1 -9
- package/workspaces/toolbar/workspaces-menu.ts +5 -3
- package/workspaces/workspaces.ts +11 -40
- package/backend/document-save-actions.ts +0 -159
- package/backend/hotkeys/events.ts +0 -47
- package/backend/hotkeys/hotkey-struct.ts +0 -58
- package/backend/hotkeys/negotiator.ts +0 -53
- package/backend/viewport/resizable-navigation.ts +0 -176
- package/backend/wizard.ts +0 -331
- package/filelist/file-replace.ts +0 -37
- package/install/renderable/clearable.ts +0 -113
- package/lowlevel/reference-index.ts +0 -44
- package/scheduler/scheduler-editable-group-name.ts +0 -307
|
@@ -47,6 +47,7 @@ class ContextMenuActions {
|
|
|
47
47
|
top.TYPO3.settings.FormEngine.moduleUrl
|
|
48
48
|
+ '&edit[' + table + '][' + uid + ']=edit'
|
|
49
49
|
+ overrideVals
|
|
50
|
+
+ '&module=' + encodeURIComponent(top.TYPO3.ModuleMenu.App.getCurrentModule())
|
|
50
51
|
+ '&returnUrl=' + ContextMenuActions.getReturnUrl(),
|
|
51
52
|
);
|
|
52
53
|
}
|
|
@@ -116,7 +117,7 @@ class ContextMenuActions {
|
|
|
116
117
|
|
|
117
118
|
public static openListModule(table: string, uid: number, dataset: DOMStringMap): void {
|
|
118
119
|
const pageId = table === 'pages' ? uid : dataset.pageUid;
|
|
119
|
-
ModuleMenu.App.showModule('
|
|
120
|
+
ModuleMenu.App.showModule('records', 'id=' + pageId);
|
|
120
121
|
}
|
|
121
122
|
|
|
122
123
|
public static pagesSort(table: string, uid: number, dataset: DOMStringMap): void {
|
|
@@ -126,6 +127,20 @@ class ContextMenuActions {
|
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
|
|
130
|
+
public static openSiteSettings(table: string, uid: number, dataset: DOMStringMap): void {
|
|
131
|
+
const siteSettingsUrl = dataset.siteSettingsUrl;
|
|
132
|
+
if (siteSettingsUrl) {
|
|
133
|
+
Viewport.ContentContainer.setUrl(siteSettingsUrl + '&returnUrl=' + ContextMenuActions.getReturnUrl());
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
public static openSiteConfiguration(table: string, uid: number, dataset: DOMStringMap): void {
|
|
138
|
+
const siteConfigurationUrl = dataset.siteConfigurationUrl;
|
|
139
|
+
if (siteConfigurationUrl) {
|
|
140
|
+
Viewport.ContentContainer.setUrl(siteConfigurationUrl + '&returnUrl=' + ContextMenuActions.getReturnUrl());
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
129
144
|
public static pagesNewMultiple(table: string, uid: number, dataset: DOMStringMap): void {
|
|
130
145
|
const pagesSortUrl = dataset.pagesNewMultipleUrl;
|
|
131
146
|
if (pagesSortUrl) {
|
|
@@ -239,7 +254,7 @@ class ContextMenuActions {
|
|
|
239
254
|
* Clear cache for given page uid
|
|
240
255
|
*/
|
|
241
256
|
public static clearCache(table: string, uid: number): void {
|
|
242
|
-
(new AjaxRequest(TYPO3.settings.ajaxUrls.
|
|
257
|
+
(new AjaxRequest(TYPO3.settings.ajaxUrls.records_clearpagecache)).withQueryArguments({ id: uid }).get({ cache: 'no-cache' }).then(
|
|
243
258
|
async (response: AjaxResponse): Promise<void> => {
|
|
244
259
|
const data = await response.resolve();
|
|
245
260
|
if (data.success === true) {
|
package/backend/context-menu.ts
CHANGED
|
@@ -15,11 +15,11 @@ import { AjaxResponse } from '@typo3/core/ajax/ajax-response';
|
|
|
15
15
|
import AjaxRequest from '@typo3/core/ajax/ajax-request';
|
|
16
16
|
import ContextMenuActions from './context-menu-actions';
|
|
17
17
|
import '@typo3/backend/element/spinner-element';
|
|
18
|
-
import { customElement, queryAll, state } from 'lit/decorators
|
|
18
|
+
import { customElement, queryAll, state } from 'lit/decorators';
|
|
19
19
|
import { html, LitElement, nothing, type TemplateResult } from 'lit';
|
|
20
20
|
import { delay } from '@typo3/core/lit-helper';
|
|
21
|
-
import { styleMap } from 'lit/directives/style-map
|
|
22
|
-
import { unsafeHTML } from 'lit/directives/unsafe-html
|
|
21
|
+
import { styleMap } from 'lit/directives/style-map';
|
|
22
|
+
import { unsafeHTML } from 'lit/directives/unsafe-html';
|
|
23
23
|
import { Task, initialState } from '@lit/task';
|
|
24
24
|
import Notification from '@typo3/backend/notification';
|
|
25
25
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* The TYPO3 project - inspiring people to share!
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { customElement, property } from 'lit/decorators
|
|
14
|
+
import { customElement, property } from 'lit/decorators';
|
|
15
15
|
import { PseudoButtonLitElement } from '@typo3/backend/element/pseudo-button';
|
|
16
16
|
import Notification from '@typo3/backend/notification';
|
|
17
17
|
import { lll } from '@typo3/core/lit-helper';
|
|
@@ -12,13 +12,14 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import flatpickr from 'flatpickr';
|
|
15
|
+
import Persistent from '@typo3/backend/storage/persistent';
|
|
15
16
|
import ShortcutButtonsPlugin from 'shortcut-buttons-flatpickr';
|
|
16
17
|
import { DateTime } from 'luxon';
|
|
17
18
|
import ThrottleEvent from '@typo3/core/event/throttle-event';
|
|
18
19
|
import type { PostValidationEvent } from '@typo3/backend/form-engine-validation';
|
|
19
20
|
import '@typo3/backend/input/clearable';
|
|
20
21
|
|
|
21
|
-
const
|
|
22
|
+
const ISO8601_LOCALTIME = 'ISO8601_LOCALTIME';
|
|
22
23
|
|
|
23
24
|
interface FlatpickrInputElement extends HTMLInputElement {
|
|
24
25
|
_flatpickr: flatpickr.Instance;
|
|
@@ -63,6 +64,20 @@ class DateTimePicker {
|
|
|
63
64
|
const scrollEvent = this.getScrollEvent();
|
|
64
65
|
const options = this.getDateOptions(inputElement);
|
|
65
66
|
options.locale = locale;
|
|
67
|
+
|
|
68
|
+
// Custom "first day of week" user preference
|
|
69
|
+
const dow = Persistent.get('dateTimeFirstDayOfWeek');
|
|
70
|
+
|
|
71
|
+
if (dow !== '') {
|
|
72
|
+
// stored number is 1-index based, convert to 0-index.
|
|
73
|
+
const dowNumber = parseInt(dow, 10) - 1;
|
|
74
|
+
|
|
75
|
+
// two entries need to be adjusted here for proper utilization
|
|
76
|
+
// in non-english localisations.
|
|
77
|
+
flatpickr.l10ns[locale].firstDayOfWeek = dowNumber;
|
|
78
|
+
flatpickr.l10ns.default.firstDayOfWeek = dowNumber;
|
|
79
|
+
}
|
|
80
|
+
|
|
66
81
|
options.onOpen = [
|
|
67
82
|
(): void => {
|
|
68
83
|
scrollEvent.bindTo(document.querySelector('.t3js-module-body'));
|
|
@@ -150,31 +165,25 @@ class DateTimePicker {
|
|
|
150
165
|
// We configure a dummy dateFormat token and use luxon parsing/formatting
|
|
151
166
|
// internally, as flatpickr cannot be configured to ignore timezones
|
|
152
167
|
// (in order to behave similar to <input type=datetime-local>)
|
|
153
|
-
dateFormat:
|
|
168
|
+
dateFormat: ISO8601_LOCALTIME,
|
|
154
169
|
defaultHour: now.getHours(),
|
|
155
170
|
defaultMinute: now.getMinutes(),
|
|
156
171
|
enableSeconds: false,
|
|
157
172
|
enableTime: false,
|
|
158
173
|
formatDate: (date: Date, format: string) => {
|
|
159
174
|
const dt = DateTime.fromJSDate(date);
|
|
160
|
-
if (format ===
|
|
161
|
-
|
|
162
|
-
// We discard the intermediate local-time offset; that means the hours and minutes from localtime are rendered as-is
|
|
163
|
-
return dt.toUTC().plus(dt.offset * 60 * 1000).toISO({ suppressMilliseconds: true });
|
|
175
|
+
if (format === ISO8601_LOCALTIME) {
|
|
176
|
+
return dt.toISO({ suppressMilliseconds: true, includeOffset: false });
|
|
164
177
|
}
|
|
165
178
|
return dt.toFormat(format);
|
|
166
179
|
},
|
|
167
180
|
parseDate: (currentDateString: string, format: string): Date => {
|
|
168
|
-
if (format ===
|
|
169
|
-
const
|
|
170
|
-
if (!
|
|
181
|
+
if (format === ISO8601_LOCALTIME) {
|
|
182
|
+
const localDate = DateTime.fromISO(currentDateString);
|
|
183
|
+
if (!localDate.isValid) {
|
|
171
184
|
throw new Error('Invalid ISO8601 date: ' + currentDateString);
|
|
172
185
|
}
|
|
173
|
-
|
|
174
|
-
// This is the reverse operation of the formatting in `formatDate`:
|
|
175
|
-
// We substract the localtime offset to generate a local-time JS Date instance,
|
|
176
|
-
// that will contain the same local-time hour/time values as the UTC input.
|
|
177
|
-
return localDate.minus(localDate.offset * 60 * 1000).toJSDate();
|
|
186
|
+
return localDate.toJSDate();
|
|
178
187
|
}
|
|
179
188
|
return DateTime.fromFormat(currentDateString, format).toJSDate();
|
|
180
189
|
},
|
|
@@ -257,6 +266,11 @@ class DateTimePicker {
|
|
|
257
266
|
options.enableTime = true;
|
|
258
267
|
options.noCalendar = true;
|
|
259
268
|
break;
|
|
269
|
+
case 'datetimesec':
|
|
270
|
+
options.altFormat = format[0] + ' HH:mm:ss';
|
|
271
|
+
options.enableSeconds = true;
|
|
272
|
+
options.enableTime = true;
|
|
273
|
+
break;
|
|
260
274
|
case 'year':
|
|
261
275
|
options.altFormat = 'yyyy';
|
|
262
276
|
break;
|
|
@@ -264,11 +278,11 @@ class DateTimePicker {
|
|
|
264
278
|
}
|
|
265
279
|
|
|
266
280
|
if (inputElement.dataset.dateMinDate !== undefined) {
|
|
267
|
-
options.minDate = options.parseDate(inputElement.dataset.dateMinDate,
|
|
281
|
+
options.minDate = options.parseDate(inputElement.dataset.dateMinDate, ISO8601_LOCALTIME);
|
|
268
282
|
options.minDate.setSeconds(0);
|
|
269
283
|
}
|
|
270
284
|
if (inputElement.dataset.dateMaxDate !== undefined) {
|
|
271
|
-
options.maxDate = options.parseDate(inputElement.dataset.dateMaxDate,
|
|
285
|
+
options.maxDate = options.parseDate(inputElement.dataset.dateMaxDate, ISO8601_LOCALTIME);
|
|
272
286
|
options.maxDate.setSeconds(59);
|
|
273
287
|
}
|
|
274
288
|
|
package/backend/drag-tooltip.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
import { html, LitElement, nothing, type TemplateResult } from 'lit';
|
|
15
|
-
import { customElement, property, state } from 'lit/decorators
|
|
15
|
+
import { customElement, property, state } from 'lit/decorators';
|
|
16
16
|
import { BroadcastMessage } from '@typo3/backend/broadcast-message';
|
|
17
17
|
import BroadcastService from '@typo3/backend/broadcast-service';
|
|
18
18
|
import { DataTransferTypes } from '@typo3/backend/enum/data-transfer-types';
|
package/backend/drag-uploader.ts
CHANGED
|
@@ -16,7 +16,6 @@ import { DateTime } from 'luxon';
|
|
|
16
16
|
import type { AjaxResponse } from '@typo3/core/ajax/ajax-response';
|
|
17
17
|
import { SeverityEnum } from './enum/severity';
|
|
18
18
|
import { MessageUtility } from './utility/message-utility';
|
|
19
|
-
import NProgress from 'nprogress';
|
|
20
19
|
import AjaxRequest from '@typo3/core/ajax/ajax-request';
|
|
21
20
|
import { default as Modal, type ModalElement, Sizes as ModalSizes } from './modal';
|
|
22
21
|
import Notification from './notification';
|
|
@@ -28,6 +27,7 @@ import DomHelper from '@typo3/backend/utility/dom-helper';
|
|
|
28
27
|
import { KeyTypesEnum } from '@typo3/backend/enum/key-types';
|
|
29
28
|
import '@typo3/backend/element/progress-bar-element';
|
|
30
29
|
import type { ProgressBarElement } from '@typo3/backend/element/progress-bar-element';
|
|
30
|
+
import { FormatUtility } from '@typo3/backend/utility/format-utility';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Possible actions for conflicts w/ existing files
|
|
@@ -39,6 +39,11 @@ enum Action {
|
|
|
39
39
|
USE_EXISTING = 'useExisting',
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
enum Mode {
|
|
43
|
+
MANAGE = 'manage',
|
|
44
|
+
BROWSE = 'browse',
|
|
45
|
+
}
|
|
46
|
+
|
|
42
47
|
/**
|
|
43
48
|
* Properties of a file as returned from the AJAX action; essential, this is a serialized instance of
|
|
44
49
|
* \TYPO3\CMS\Core\Resource\File plus some extra properties (see FileController::flattenResultDataValue())
|
|
@@ -80,7 +85,7 @@ export default class DragUploader {
|
|
|
80
85
|
public filesExtensionsDisallowed: string;
|
|
81
86
|
public fileDenyPattern: RegExp | null;
|
|
82
87
|
public maxFileSize: number;
|
|
83
|
-
public trigger: HTMLElement;
|
|
88
|
+
public trigger: HTMLElement | null;
|
|
84
89
|
public target: string;
|
|
85
90
|
public reloadUrl: string;
|
|
86
91
|
public manualTable: boolean;
|
|
@@ -91,6 +96,7 @@ export default class DragUploader {
|
|
|
91
96
|
private askForOverride: Array<FileConflict> = [];
|
|
92
97
|
|
|
93
98
|
private percentagePerFile: number = 1;
|
|
99
|
+
private overallProgressBar: ProgressBarElement | null = null;
|
|
94
100
|
|
|
95
101
|
private readonly body: HTMLElement;
|
|
96
102
|
private readonly element: HTMLElement;
|
|
@@ -111,13 +117,13 @@ export default class DragUploader {
|
|
|
111
117
|
constructor(element: HTMLElement) {
|
|
112
118
|
this.body = document.querySelector('body');
|
|
113
119
|
this.element = element;
|
|
114
|
-
const hasTrigger = this.element.dataset.dropzoneTrigger !== undefined;
|
|
115
120
|
this.trigger = document.querySelector(this.element.dataset.dropzoneTrigger);
|
|
116
121
|
this.defaultAction = this.element.dataset.defaultAction as Action || Action.SKIP;
|
|
117
122
|
this.dropzone = document.createElement('div');
|
|
118
123
|
this.dropzone.classList.add('dropzone');
|
|
119
124
|
this.dropzone.setAttribute('hidden', 'hidden');
|
|
120
125
|
this.irreObjectUid = this.element.dataset.fileIrreObject;
|
|
126
|
+
this.manualTable = this.element.hasAttribute('data-manual-table');
|
|
121
127
|
|
|
122
128
|
const dropZoneEscapedTarget = document.querySelector(this.element.dataset.dropzoneTarget);
|
|
123
129
|
if (this.irreObjectUid && DomHelper.nextAll(dropZoneEscapedTarget).length !== 0) {
|
|
@@ -229,7 +235,7 @@ export default class DragUploader {
|
|
|
229
235
|
}
|
|
230
236
|
});
|
|
231
237
|
|
|
232
|
-
this.bindUploadButton(
|
|
238
|
+
this.bindUploadButton(this.trigger !== null ? this.trigger : this.element);
|
|
233
239
|
}
|
|
234
240
|
|
|
235
241
|
public static init(): void {
|
|
@@ -260,18 +266,6 @@ export default class DragUploader {
|
|
|
260
266
|
});
|
|
261
267
|
}
|
|
262
268
|
|
|
263
|
-
public static fileSizeAsString(size: number): string {
|
|
264
|
-
const sizeKB: number = size / 1024;
|
|
265
|
-
let str = '';
|
|
266
|
-
|
|
267
|
-
if (sizeKB > 1024) {
|
|
268
|
-
str = (sizeKB / 1024).toFixed(1) + ' MB';
|
|
269
|
-
} else {
|
|
270
|
-
str = sizeKB.toFixed(1) + ' KB';
|
|
271
|
-
}
|
|
272
|
-
return str;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
269
|
/**
|
|
276
270
|
* @param {string} irreObject
|
|
277
271
|
* @param {UploadedFile} file
|
|
@@ -370,7 +364,9 @@ export default class DragUploader {
|
|
|
370
364
|
this.fileList.closest('.filelist-main')?.querySelector('.t3-filelist-info-container')?.setAttribute('hidden', 'hidden');
|
|
371
365
|
}
|
|
372
366
|
|
|
373
|
-
|
|
367
|
+
this.overallProgressBar = document.createElement('typo3-backend-progress-bar');
|
|
368
|
+
document.body.appendChild(this.overallProgressBar);
|
|
369
|
+
this.overallProgressBar.start();
|
|
374
370
|
this.percentagePerFile = 1 / files.length;
|
|
375
371
|
|
|
376
372
|
// Check for each file if is already exist before adding it to the queue
|
|
@@ -388,9 +384,11 @@ export default class DragUploader {
|
|
|
388
384
|
uploaded: file,
|
|
389
385
|
action: this.irreObjectUid ? Action.USE_EXISTING : this.defaultAction,
|
|
390
386
|
});
|
|
391
|
-
|
|
387
|
+
if (this.overallProgressBar) {
|
|
388
|
+
this.overallProgressBar.inc(this.percentagePerFile);
|
|
389
|
+
}
|
|
392
390
|
} else {
|
|
393
|
-
new FileQueueItem(this, file, Action.SKIP);
|
|
391
|
+
new FileQueueItem(this, file, Action.SKIP, this.fileList.dataset.mode === Mode.BROWSE ? Mode.BROWSE : Mode.MANAGE);
|
|
394
392
|
}
|
|
395
393
|
});
|
|
396
394
|
ajaxCalls.push(request);
|
|
@@ -398,7 +396,9 @@ export default class DragUploader {
|
|
|
398
396
|
|
|
399
397
|
Promise.all(ajaxCalls).then((): void => {
|
|
400
398
|
this.drawOverrideModal();
|
|
401
|
-
|
|
399
|
+
if (this.overallProgressBar) {
|
|
400
|
+
this.overallProgressBar.done();
|
|
401
|
+
}
|
|
402
402
|
});
|
|
403
403
|
|
|
404
404
|
this.fileInput.value = '';
|
|
@@ -500,11 +500,11 @@ export default class DragUploader {
|
|
|
500
500
|
: this.askForOverride[i].original.icon}
|
|
501
501
|
</td>
|
|
502
502
|
<td>
|
|
503
|
-
${this.askForOverride[i].original.name} (${
|
|
503
|
+
${this.askForOverride[i].original.name} (${FormatUtility.fileSizeAsString(this.askForOverride[i].original.size)})<br />
|
|
504
504
|
${DateTime.fromSeconds(this.askForOverride[i].original.mtime).toLocaleString(DateTime.DATETIME_MED)}
|
|
505
505
|
</td>
|
|
506
506
|
<td>
|
|
507
|
-
${this.askForOverride[i].uploaded.name} (${
|
|
507
|
+
${this.askForOverride[i].uploaded.name} (${FormatUtility.fileSizeAsString(this.askForOverride[i].uploaded.size)})<br />
|
|
508
508
|
${DateTime.fromMillis(this.askForOverride[i].uploaded.lastModified).toLocaleString(DateTime.DATETIME_MED)}
|
|
509
509
|
</td>
|
|
510
510
|
<td>
|
|
@@ -596,7 +596,7 @@ export default class DragUploader {
|
|
|
596
596
|
fileInfo.original,
|
|
597
597
|
);
|
|
598
598
|
} else if (fileInfo.action !== Action.SKIP) {
|
|
599
|
-
new FileQueueItem(this, fileInfo.uploaded, fileInfo.action);
|
|
599
|
+
new FileQueueItem(this, fileInfo.uploaded, fileInfo.action, this.fileList.dataset.mode === Mode.BROWSE ? Mode.BROWSE : Mode.MANAGE);
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
this.askForOverride = [];
|
|
@@ -612,6 +612,7 @@ export default class DragUploader {
|
|
|
612
612
|
|
|
613
613
|
class FileQueueItem {
|
|
614
614
|
private readonly row: HTMLElement;
|
|
615
|
+
private readonly mode: Mode;
|
|
615
616
|
private readonly progress: HTMLElement;
|
|
616
617
|
private readonly file: File;
|
|
617
618
|
private readonly override: Action;
|
|
@@ -621,10 +622,11 @@ class FileQueueItem {
|
|
|
621
622
|
private readonly progressBar: ProgressBarElement;
|
|
622
623
|
private readonly dragUploader: DragUploader;
|
|
623
624
|
|
|
624
|
-
constructor(dragUploader: DragUploader, file: File, override: Action) {
|
|
625
|
+
constructor(dragUploader: DragUploader, file: File, override: Action, mode: Mode) {
|
|
625
626
|
this.dragUploader = dragUploader;
|
|
626
627
|
this.file = file;
|
|
627
628
|
this.override = override;
|
|
629
|
+
this.mode = mode;
|
|
628
630
|
|
|
629
631
|
this.row = document.createElement('tr');
|
|
630
632
|
this.row.classList.add('upload-queue-item');
|
|
@@ -676,7 +678,7 @@ class FileQueueItem {
|
|
|
676
678
|
if (this.dragUploader.maxFileSize > 0 && this.file.size > this.dragUploader.maxFileSize) {
|
|
677
679
|
this.updateMessage(TYPO3.lang['file_upload.maxFileSizeExceeded']
|
|
678
680
|
.replace(/\{0\}/g, this.file.name)
|
|
679
|
-
.replace(/\{1\}/g,
|
|
681
|
+
.replace(/\{1\}/g, FormatUtility.fileSizeAsString(this.dragUploader.maxFileSize)));
|
|
680
682
|
this.progressBar.value = 100;
|
|
681
683
|
this.progressBar.severity = SeverityEnum.error;
|
|
682
684
|
|
|
@@ -695,7 +697,7 @@ class FileQueueItem {
|
|
|
695
697
|
this.progressBar.value = 100;
|
|
696
698
|
this.progressBar.severity = SeverityEnum.error;
|
|
697
699
|
} else {
|
|
698
|
-
this.updateMessage('- ' +
|
|
700
|
+
this.updateMessage('- ' + FormatUtility.fileSizeAsString(this.file.size));
|
|
699
701
|
|
|
700
702
|
const formData = new FormData();
|
|
701
703
|
formData.append('data[upload][1][target]', this.dragUploader.target);
|
|
@@ -865,24 +867,26 @@ class FileQueueItem {
|
|
|
865
867
|
this.row.append(fileExtColumn);
|
|
866
868
|
|
|
867
869
|
const fileSizeColumn = document.createElement('td');
|
|
868
|
-
fileSizeColumn.textContent =
|
|
870
|
+
fileSizeColumn.textContent = FormatUtility.fileSizeAsString(fileInfo.size);
|
|
869
871
|
this.row.append(fileSizeColumn);
|
|
870
872
|
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
873
|
+
if (this.mode === Mode.MANAGE) {
|
|
874
|
+
let permissions = '';
|
|
875
|
+
if (fileInfo.permissions.read) {
|
|
876
|
+
permissions += '<strong class="text-danger">' + TYPO3.lang['permissions.read'] + '</strong>';
|
|
877
|
+
}
|
|
878
|
+
if (fileInfo.permissions.write) {
|
|
879
|
+
permissions += '<strong class="text-danger">' + TYPO3.lang['permissions.write'] + '</strong>';
|
|
880
|
+
}
|
|
878
881
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
+
const permissionsColumn = document.createElement('td');
|
|
883
|
+
permissionsColumn.innerHTML = permissions;
|
|
884
|
+
this.row.append(permissionsColumn);
|
|
882
885
|
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
+
const emptyColumn = document.createElement('td');
|
|
887
|
+
emptyColumn.textContent = '-';
|
|
888
|
+
this.row.append(emptyColumn);
|
|
889
|
+
}
|
|
886
890
|
|
|
887
891
|
// add spacing cells when more columns are displayed (column selector)
|
|
888
892
|
for (let i = this.row.querySelectorAll('td').length; i < this.dragUploader.fileListColumnCount; i++) {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* The TYPO3 project - inspiring people to share!
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { customElement, property } from 'lit/decorators
|
|
14
|
+
import { customElement, property } from 'lit/decorators';
|
|
15
15
|
import { html, LitElement, nothing, type TemplateResult } from 'lit';
|
|
16
|
-
import { classMap, type ClassInfo } from 'lit/directives/class-map
|
|
16
|
+
import { classMap, type ClassInfo } from 'lit/directives/class-map';
|
|
17
17
|
import { SeverityEnum } from '@typo3/backend/enum/severity';
|
|
18
18
|
import Severity from '../severity';
|
|
19
19
|
import '@typo3/backend/element/icon-element';
|