@umbraco-cms/backoffice 15.3.0-rc → 15.3.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/dist-cms/assets/lang/da-dk.js +0 -3
- package/dist-cms/assets/lang/da-dk.ts +0 -3
- package/dist-cms/assets/lang/en-us.js +0 -3
- package/dist-cms/assets/lang/en-us.ts +0 -3
- package/dist-cms/assets/lang/en.js +0 -5
- package/dist-cms/assets/lang/en.ts +0 -6
- package/dist-cms/custom-elements.json +0 -29
- package/dist-cms/external/backend-api/src/types.gen.d.ts +0 -1
- package/dist-cms/libs/context-api/provide/context-provider.controller.js +2 -1
- package/dist-cms/packages/block/block/workspace/block-element-manager.js +1 -1
- package/dist-cms/packages/block/block-list/property-editors/block-list-editor/property-editor-ui-block-list.element.js +5 -2
- package/dist-cms/packages/core/content/workspace/content-detail-workspace-base.js +1 -1
- package/dist-cms/packages/core/validation/context/validation-messages.manager.d.ts +3 -0
- package/dist-cms/packages/core/validation/context/validation-messages.manager.js +39 -0
- package/dist-cms/packages/core/validation/controllers/form-control-validator.controller.js +7 -5
- package/dist-cms/packages/core/validation/controllers/validation.controller.d.ts +2 -0
- package/dist-cms/packages/core/validation/controllers/validation.controller.js +27 -3
- package/dist-cms/packages/core/validation/utils/json-path.function.d.ts +1 -1
- package/dist-cms/packages/core/validation/utils/json-path.function.js +53 -37
- package/dist-cms/packages/core/workspace/submittable/submittable-workspace-context-base.js +10 -3
- package/dist-cms/packages/documents/document-blueprints/repository/detail/document-blueprint-detail.server.data-source.js +1 -1
- package/dist-cms/packages/documents/documents/components/input-document/input-document.context.js +1 -1
- package/dist-cms/packages/documents/documents/publishing/publish-with-descendants/modal/document-publish-with-descendants-modal.element.js +1 -23
- package/dist-cms/packages/documents/documents/publishing/publish-with-descendants/modal/document-publish-with-descendants-modal.token.d.ts +0 -1
- package/dist-cms/packages/documents/documents/publishing/repository/document-publishing.repository.d.ts +1 -2
- package/dist-cms/packages/documents/documents/publishing/repository/document-publishing.repository.js +2 -3
- package/dist-cms/packages/documents/documents/publishing/repository/document-publishing.server.data-source.d.ts +1 -2
- package/dist-cms/packages/documents/documents/publishing/repository/document-publishing.server.data-source.js +2 -4
- package/dist-cms/packages/documents/documents/publishing/workspace-context/document-publishing.workspace-context.js +1 -1
- package/dist-cms/packages/documents/documents/repository/detail/document-detail.server.data-source.js +1 -1
- package/dist-cms/packages/media/media/components/input-media/input-media.context.js +1 -1
- package/dist-cms/packages/members/member/components/input-member/input-member.context.js +1 -1
- package/dist-cms/packages/multi-url-picker/property-editor/property-editor-ui-multi-url-picker.element.d.ts +2 -2
- package/dist-cms/packages/multi-url-picker/property-editor/property-editor-ui-multi-url-picker.element.js +3 -5
- package/dist-cms/packages/property-editors/accepted-types/property-editor-ui-accepted-upload-types.element.js +5 -35
- package/dist-cms/packages/property-editors/multiple-text-string/property-editor-ui-multiple-text-string.element.d.ts +2 -6
- package/dist-cms/packages/property-editors/multiple-text-string/property-editor-ui-multiple-text-string.element.js +14 -37
- package/dist-cms/packages/tiptap/property-editors/tiptap/property-editor-ui-tiptap.element.js +1 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/umbraco-package.json +1 -1
- package/dist-cms/vscode-html-custom-data.json +3 -17
- package/package.json +1 -1
package/dist-cms/packages/documents/documents/components/input-document/input-document.context.js
CHANGED
|
@@ -23,7 +23,7 @@ export class UmbDocumentPickerInputContext extends UmbPickerInputContext {
|
|
|
23
23
|
allowedContentTypes: args?.allowedContentTypes,
|
|
24
24
|
...pickerData?.search?.queryParams,
|
|
25
25
|
};
|
|
26
|
-
super.openPicker(combinedPickerData);
|
|
26
|
+
await super.openPicker(combinedPickerData);
|
|
27
27
|
}
|
|
28
28
|
#pickableFilter = (item, allowedContentTypes) => {
|
|
29
29
|
if (allowedContentTypes && allowedContentTypes.length > 0) {
|
|
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { UmbDocumentVariantState } from '../../../types.js';
|
|
8
8
|
import { isNotPublishedMandatory } from '../../utils.js';
|
|
9
9
|
import { css, customElement, html, state } from '../../../../../../external/lit/index.js';
|
|
10
|
-
import {
|
|
10
|
+
import { UmbModalBaseElement } from '../../../../../core/modal/index.js';
|
|
11
11
|
import { UmbTextStyles } from '../../../../../core/style/index.js';
|
|
12
12
|
import { UmbSelectionManager } from '../../../../../core/utils/index.js';
|
|
13
13
|
import '../../../modals/shared/document-variant-language-picker.element.js';
|
|
@@ -16,7 +16,6 @@ let UmbDocumentPublishWithDescendantsModalElement = class UmbDocumentPublishWith
|
|
|
16
16
|
super(...arguments);
|
|
17
17
|
this.#selectionManager = new UmbSelectionManager(this);
|
|
18
18
|
this.#includeUnpublishedDescendants = false;
|
|
19
|
-
this.#forceRepublish = false;
|
|
20
19
|
this._options = [];
|
|
21
20
|
this.#pickableFilter = (option) => {
|
|
22
21
|
if (!option.variant) {
|
|
@@ -28,7 +27,6 @@ let UmbDocumentPublishWithDescendantsModalElement = class UmbDocumentPublishWith
|
|
|
28
27
|
}
|
|
29
28
|
#selectionManager;
|
|
30
29
|
#includeUnpublishedDescendants;
|
|
31
|
-
#forceRepublish;
|
|
32
30
|
#pickableFilter;
|
|
33
31
|
firstUpdated() {
|
|
34
32
|
this.#configureSelectionManager();
|
|
@@ -64,22 +62,10 @@ let UmbDocumentPublishWithDescendantsModalElement = class UmbDocumentPublishWith
|
|
|
64
62
|
#onIncludeUnpublishedDescendantsChange() {
|
|
65
63
|
this.#includeUnpublishedDescendants = !this.#includeUnpublishedDescendants;
|
|
66
64
|
}
|
|
67
|
-
async #onForceRepublishChange() {
|
|
68
|
-
this.#forceRepublish = !this.#forceRepublish;
|
|
69
|
-
}
|
|
70
65
|
async #submit() {
|
|
71
|
-
if (this.#forceRepublish) {
|
|
72
|
-
await umbConfirmModal(this, {
|
|
73
|
-
headline: this.localize.term('content_forceRepublishWarning'),
|
|
74
|
-
content: this.localize.term('content_forceRepublishAdvisory'),
|
|
75
|
-
color: 'warning',
|
|
76
|
-
confirmLabel: this.localize.term('actions_publish'),
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
66
|
this.value = {
|
|
80
67
|
selection: this.#selectionManager.getSelection(),
|
|
81
68
|
includeUnpublishedDescendants: this.#includeUnpublishedDescendants,
|
|
82
|
-
forceRepublish: this.#forceRepublish,
|
|
83
69
|
};
|
|
84
70
|
this.modalContext?.submit();
|
|
85
71
|
}
|
|
@@ -118,14 +104,6 @@ let UmbDocumentPublishWithDescendantsModalElement = class UmbDocumentPublishWith
|
|
|
118
104
|
@change=${this.#onIncludeUnpublishedDescendantsChange}></uui-toggle>
|
|
119
105
|
</uui-form-layout-item>
|
|
120
106
|
|
|
121
|
-
<uui-form-layout-item>
|
|
122
|
-
<uui-toggle
|
|
123
|
-
id="forceRepublish"
|
|
124
|
-
label=${this.localize.term('content_forceRepublish')}
|
|
125
|
-
?checked=${this.value?.forceRepublish}
|
|
126
|
-
@change=${this.#onForceRepublishChange}></uui-toggle>
|
|
127
|
-
</uui-form-layout-item>
|
|
128
|
-
|
|
129
107
|
<div slot="actions">
|
|
130
108
|
<uui-button label=${this.localize.term('general_close')} @click=${this.#close}></uui-button>
|
|
131
109
|
<uui-button
|
|
@@ -5,6 +5,5 @@ export interface UmbDocumentPublishWithDescendantsModalData extends UmbDocumentV
|
|
|
5
5
|
}
|
|
6
6
|
export interface UmbDocumentPublishWithDescendantsModalValue extends UmbDocumentVariantPickerValue {
|
|
7
7
|
includeUnpublishedDescendants?: boolean;
|
|
8
|
-
forceRepublish?: boolean;
|
|
9
8
|
}
|
|
10
9
|
export declare const UMB_DOCUMENT_PUBLISH_WITH_DESCENDANTS_MODAL: UmbModalToken<UmbDocumentPublishWithDescendantsModalData, UmbDocumentPublishWithDescendantsModalValue>;
|
|
@@ -30,10 +30,9 @@ export declare class UmbDocumentPublishingRepository extends UmbRepositoryBase {
|
|
|
30
30
|
* @param id
|
|
31
31
|
* @param variantIds
|
|
32
32
|
* @param includeUnpublishedDescendants
|
|
33
|
-
* @param forceRepublish
|
|
34
33
|
* @memberof UmbDocumentPublishingRepository
|
|
35
34
|
*/
|
|
36
|
-
publishWithDescendants(id: string, variantIds: Array<UmbVariantId>, includeUnpublishedDescendants: boolean
|
|
35
|
+
publishWithDescendants(id: string, variantIds: Array<UmbVariantId>, includeUnpublishedDescendants: boolean): Promise<{
|
|
37
36
|
error: import("../../../../../external/backend-api/index.js").ApiError | import("../../../../../external/backend-api/index.js").CancelError | undefined;
|
|
38
37
|
}>;
|
|
39
38
|
/**
|
|
@@ -60,16 +60,15 @@ export class UmbDocumentPublishingRepository extends UmbRepositoryBase {
|
|
|
60
60
|
* @param id
|
|
61
61
|
* @param variantIds
|
|
62
62
|
* @param includeUnpublishedDescendants
|
|
63
|
-
* @param forceRepublish
|
|
64
63
|
* @memberof UmbDocumentPublishingRepository
|
|
65
64
|
*/
|
|
66
|
-
async publishWithDescendants(id, variantIds, includeUnpublishedDescendants
|
|
65
|
+
async publishWithDescendants(id, variantIds, includeUnpublishedDescendants) {
|
|
67
66
|
if (!id)
|
|
68
67
|
throw new Error('id is missing');
|
|
69
68
|
if (!variantIds)
|
|
70
69
|
throw new Error('variant IDs are missing');
|
|
71
70
|
await this.#init;
|
|
72
|
-
const { error } = await this.#publishingDataSource.publishWithDescendants(id, variantIds, includeUnpublishedDescendants
|
|
71
|
+
const { error } = await this.#publishingDataSource.publishWithDescendants(id, variantIds, includeUnpublishedDescendants);
|
|
73
72
|
if (!error) {
|
|
74
73
|
const notification = { data: { message: `Document published with descendants` } };
|
|
75
74
|
// TODO: Move this to the calling workspace context [JOV]
|
|
@@ -37,10 +37,9 @@ export declare class UmbDocumentPublishingServerDataSource {
|
|
|
37
37
|
* @param unique
|
|
38
38
|
* @param variantIds
|
|
39
39
|
* @param includeUnpublishedDescendants
|
|
40
|
-
* @param forceRepublish
|
|
41
40
|
* @memberof UmbDocumentPublishingServerDataSource
|
|
42
41
|
*/
|
|
43
|
-
publishWithDescendants(unique: string, variantIds: Array<UmbVariantId>, includeUnpublishedDescendants: boolean
|
|
42
|
+
publishWithDescendants(unique: string, variantIds: Array<UmbVariantId>, includeUnpublishedDescendants: boolean): Promise<UmbDataSourceResponse<string>>;
|
|
44
43
|
/**
|
|
45
44
|
* Get the published Document by its unique
|
|
46
45
|
* @param {string} unique - Document unique
|
|
@@ -68,16 +68,14 @@ export class UmbDocumentPublishingServerDataSource {
|
|
|
68
68
|
* @param unique
|
|
69
69
|
* @param variantIds
|
|
70
70
|
* @param includeUnpublishedDescendants
|
|
71
|
-
* @param forceRepublish
|
|
72
71
|
* @memberof UmbDocumentPublishingServerDataSource
|
|
73
72
|
*/
|
|
74
|
-
async publishWithDescendants(unique, variantIds, includeUnpublishedDescendants
|
|
73
|
+
async publishWithDescendants(unique, variantIds, includeUnpublishedDescendants) {
|
|
75
74
|
if (!unique)
|
|
76
75
|
throw new Error('Id is missing');
|
|
77
76
|
const requestBody = {
|
|
78
77
|
cultures: variantIds.map((variant) => variant.toCultureString()),
|
|
79
78
|
includeUnpublishedDescendants,
|
|
80
|
-
forceRepublish,
|
|
81
79
|
};
|
|
82
80
|
return tryExecuteAndNotify(this.#host, DocumentService.putDocumentByIdPublishWithDescendants({ id: unique, requestBody }));
|
|
83
81
|
}
|
|
@@ -101,9 +99,9 @@ export class UmbDocumentPublishingServerDataSource {
|
|
|
101
99
|
values: data.values.map((value) => {
|
|
102
100
|
return {
|
|
103
101
|
editorAlias: value.editorAlias,
|
|
104
|
-
alias: value.alias,
|
|
105
102
|
culture: value.culture || null,
|
|
106
103
|
segment: value.segment || null,
|
|
104
|
+
alias: value.alias,
|
|
107
105
|
value: value.value,
|
|
108
106
|
};
|
|
109
107
|
}),
|
|
@@ -190,7 +190,7 @@ export class UmbDocumentPublishingWorkspaceContext extends UmbContextBase {
|
|
|
190
190
|
const variantIds = result?.selection.map((x) => UmbVariantId.FromString(x)) ?? [];
|
|
191
191
|
if (!variantIds.length)
|
|
192
192
|
return;
|
|
193
|
-
const { error } = await this.#publishingRepository.publishWithDescendants(unique, variantIds, result.includeUnpublishedDescendants ?? false
|
|
193
|
+
const { error } = await this.#publishingRepository.publishWithDescendants(unique, variantIds, result.includeUnpublishedDescendants ?? false);
|
|
194
194
|
if (!error) {
|
|
195
195
|
// reload the document so all states are updated after the publish operation
|
|
196
196
|
await this.#documentWorkspaceContext.reload();
|
|
@@ -79,9 +79,9 @@ export class UmbDocumentServerDataSource {
|
|
|
79
79
|
values: data.values.map((value) => {
|
|
80
80
|
return {
|
|
81
81
|
editorAlias: value.editorAlias,
|
|
82
|
-
alias: value.alias,
|
|
83
82
|
culture: value.culture || null,
|
|
84
83
|
segment: value.segment || null,
|
|
84
|
+
alias: value.alias,
|
|
85
85
|
value: value.value,
|
|
86
86
|
};
|
|
87
87
|
}),
|
|
@@ -24,7 +24,7 @@ export class UmbMediaPickerInputContext extends UmbPickerInputContext {
|
|
|
24
24
|
allowedContentTypes: args?.allowedContentTypes,
|
|
25
25
|
...pickerData?.search?.queryParams,
|
|
26
26
|
};
|
|
27
|
-
super.openPicker(combinedPickerData);
|
|
27
|
+
await super.openPicker(combinedPickerData);
|
|
28
28
|
}
|
|
29
29
|
#pickableFilter = (item, allowedContentTypes) => {
|
|
30
30
|
if (allowedContentTypes && allowedContentTypes.length > 0) {
|
|
@@ -23,7 +23,7 @@ export class UmbMemberPickerInputContext extends UmbPickerInputContext {
|
|
|
23
23
|
allowedContentTypes: args?.allowedContentTypes,
|
|
24
24
|
...pickerData?.search?.queryParams,
|
|
25
25
|
};
|
|
26
|
-
super.openPicker(combinedPickerData);
|
|
26
|
+
await super.openPicker(combinedPickerData);
|
|
27
27
|
}
|
|
28
28
|
#pickableFilter = (item, allowedContentTypes) => {
|
|
29
29
|
if (allowedContentTypes && allowedContentTypes.length > 0) {
|
|
@@ -2,12 +2,12 @@ import type { UmbLinkPickerLink } from '../link-picker-modal/types.js';
|
|
|
2
2
|
import { UmbLitElement } from '../../core/lit-element/index.js';
|
|
3
3
|
import type { UmbPropertyEditorConfigCollection, UmbPropertyEditorUiElement } from '../../core/property-editor/index.js';
|
|
4
4
|
import '../components/input-multi-url/index.js';
|
|
5
|
+
declare const UmbPropertyEditorUIMultiUrlPickerElement_base: import("../../../libs/extension-api/index.js").HTMLElementConstructor<import("../../core/validation/index.js").UmbFormControlMixinElement<UmbLinkPickerLink[] | undefined>> & typeof UmbLitElement;
|
|
5
6
|
/**
|
|
6
7
|
* @element umb-property-editor-ui-multi-url-picker
|
|
7
8
|
*/
|
|
8
|
-
export declare class UmbPropertyEditorUIMultiUrlPickerElement extends
|
|
9
|
+
export declare class UmbPropertyEditorUIMultiUrlPickerElement extends UmbPropertyEditorUIMultiUrlPickerElement_base implements UmbPropertyEditorUiElement {
|
|
9
10
|
#private;
|
|
10
|
-
value: Array<UmbLinkPickerLink>;
|
|
11
11
|
set config(config: UmbPropertyEditorConfigCollection | undefined);
|
|
12
12
|
/**
|
|
13
13
|
* Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
|
|
@@ -9,10 +9,11 @@ import { UmbLitElement } from '../../core/lit-element/index.js';
|
|
|
9
9
|
import { UmbPropertyValueChangeEvent } from '../../core/property-editor/index.js';
|
|
10
10
|
import { UMB_PROPERTY_CONTEXT } from '../../core/property/index.js';
|
|
11
11
|
import '../components/input-multi-url/index.js';
|
|
12
|
+
import { UmbFormControlMixin } from '../../core/validation/index.js';
|
|
12
13
|
/**
|
|
13
14
|
* @element umb-property-editor-ui-multi-url-picker
|
|
14
15
|
*/
|
|
15
|
-
let UmbPropertyEditorUIMultiUrlPickerElement = class UmbPropertyEditorUIMultiUrlPickerElement extends UmbLitElement {
|
|
16
|
+
let UmbPropertyEditorUIMultiUrlPickerElement = class UmbPropertyEditorUIMultiUrlPickerElement extends UmbFormControlMixin(UmbLitElement) {
|
|
16
17
|
set config(config) {
|
|
17
18
|
if (!config)
|
|
18
19
|
return;
|
|
@@ -27,7 +28,6 @@ let UmbPropertyEditorUIMultiUrlPickerElement = class UmbPropertyEditorUIMultiUrl
|
|
|
27
28
|
}
|
|
28
29
|
constructor() {
|
|
29
30
|
super();
|
|
30
|
-
this.value = [];
|
|
31
31
|
/**
|
|
32
32
|
* Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
|
|
33
33
|
* @type {boolean}
|
|
@@ -47,6 +47,7 @@ let UmbPropertyEditorUIMultiUrlPickerElement = class UmbPropertyEditorUIMultiUrl
|
|
|
47
47
|
if (this._min && this._max && this._min > this._max) {
|
|
48
48
|
console.warn(`Property '${this._label}' (Multi URL Picker) has been misconfigured, 'min' is greater than 'max'. Please correct your data type configuration.`, this);
|
|
49
49
|
}
|
|
50
|
+
this.addFormControlElement(this.shadowRoot.querySelector('umb-input-multi-url'));
|
|
50
51
|
}
|
|
51
52
|
#onChange(event) {
|
|
52
53
|
this.value = event.target.urls;
|
|
@@ -68,9 +69,6 @@ let UmbPropertyEditorUIMultiUrlPickerElement = class UmbPropertyEditorUIMultiUrl
|
|
|
68
69
|
`;
|
|
69
70
|
}
|
|
70
71
|
};
|
|
71
|
-
__decorate([
|
|
72
|
-
property({ type: Array })
|
|
73
|
-
], UmbPropertyEditorUIMultiUrlPickerElement.prototype, "value", void 0);
|
|
74
72
|
__decorate([
|
|
75
73
|
property({ type: Boolean, reflect: true })
|
|
76
74
|
], UmbPropertyEditorUIMultiUrlPickerElement.prototype, "readonly", void 0);
|
|
@@ -5,8 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { UmbPropertyEditorUIMultipleTextStringElement } from '../multiple-text-string/property-editor-ui-multiple-text-string.element.js';
|
|
8
|
-
import { css, customElement, html,
|
|
9
|
-
import { formatBytes } from '../../core/utils/index.js';
|
|
8
|
+
import { css, customElement, html, state } from '../../../external/lit/index.js';
|
|
10
9
|
import { UmbTemporaryFileConfigRepository } from '../../core/temporary-file/index.js';
|
|
11
10
|
/**
|
|
12
11
|
* @element umb-property-editor-ui-accepted-upload-types
|
|
@@ -32,7 +31,8 @@ let UmbPropertyEditorUIAcceptedUploadTypesElement = class UmbPropertyEditorUIAcc
|
|
|
32
31
|
});
|
|
33
32
|
}
|
|
34
33
|
#addValidators(config) {
|
|
35
|
-
this.
|
|
34
|
+
const inputElement = this.shadowRoot?.querySelector('umb-input-multiple-text-string');
|
|
35
|
+
inputElement?.addValidator('badInput', () => {
|
|
36
36
|
let message = this.localize.term('validation_invalidExtensions');
|
|
37
37
|
if (config.allowedUploadedFileExtensions.length) {
|
|
38
38
|
message += `<br>${this.localize.term('validation_allowedExtensions')} ${config.allowedUploadedFileExtensions.join(', ')}`;
|
|
@@ -42,7 +42,7 @@ let UmbPropertyEditorUIAcceptedUploadTypesElement = class UmbPropertyEditorUIAcc
|
|
|
42
42
|
}
|
|
43
43
|
return message;
|
|
44
44
|
}, () => {
|
|
45
|
-
const extensions =
|
|
45
|
+
const extensions = inputElement?.items;
|
|
46
46
|
if (!extensions)
|
|
47
47
|
return false;
|
|
48
48
|
if (config.allowedUploadedFileExtensions.length &&
|
|
@@ -55,38 +55,8 @@ let UmbPropertyEditorUIAcceptedUploadTypesElement = class UmbPropertyEditorUIAcc
|
|
|
55
55
|
return false;
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
#renderAcceptedTypes() {
|
|
59
|
-
if (!this._acceptedTypes.length && !this._disallowedTypes.length && !this._maxFileSize) {
|
|
60
|
-
return nothing;
|
|
61
|
-
}
|
|
62
|
-
return html `
|
|
63
|
-
<uui-box id="notice" headline=${this.localize.term('general_serverConfiguration')}>
|
|
64
|
-
<p><umb-localize key="media_noticeExtensionsServerOverride"></umb-localize></p>
|
|
65
|
-
${when(this._acceptedTypes.length, () => html `
|
|
66
|
-
<p>
|
|
67
|
-
<umb-localize key="validation_allowedExtensions"></umb-localize>
|
|
68
|
-
<strong>${this._acceptedTypes.join(', ')}</strong>
|
|
69
|
-
</p>
|
|
70
|
-
`)}
|
|
71
|
-
${when(this._disallowedTypes.length, () => html `
|
|
72
|
-
<p>
|
|
73
|
-
<umb-localize key="validation_disallowedExtensions"></umb-localize>
|
|
74
|
-
<strong>${this._disallowedTypes.join(', ')}</strong>
|
|
75
|
-
</p>
|
|
76
|
-
`)}
|
|
77
|
-
${when(this._maxFileSize, () => html `
|
|
78
|
-
<p>
|
|
79
|
-
${this.localize.term('media_maxFileSize')}
|
|
80
|
-
<strong title="${this.localize.number(this._maxFileSize)} bytes"
|
|
81
|
-
>${formatBytes(this._maxFileSize, { decimals: 2 })}</strong
|
|
82
|
-
>.
|
|
83
|
-
</p>
|
|
84
|
-
`)}
|
|
85
|
-
</uui-box>
|
|
86
|
-
`;
|
|
87
|
-
}
|
|
88
58
|
render() {
|
|
89
|
-
return html `${
|
|
59
|
+
return html `${super.render()}`;
|
|
90
60
|
}
|
|
91
61
|
static { this.styles = [
|
|
92
62
|
css `
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { UmbValidationContext } from '../../core/validation/index.js';
|
|
2
1
|
import { UmbLitElement } from '../../core/lit-element/index.js';
|
|
3
|
-
import type { UmbInputMultipleTextStringElement } from '../../core/components/index.js';
|
|
4
2
|
import type { UmbPropertyEditorConfigCollection, UmbPropertyEditorUiElement } from '../../core/property-editor/index.js';
|
|
3
|
+
declare const UmbPropertyEditorUIMultipleTextStringElement_base: import("../../../libs/extension-api/index.js").HTMLElementConstructor<import("../../core/validation/index.js").UmbFormControlMixinElement<string[] | undefined>> & typeof UmbLitElement;
|
|
5
4
|
/**
|
|
6
5
|
* @element umb-property-editor-ui-multiple-text-string
|
|
7
6
|
*/
|
|
8
|
-
export declare class UmbPropertyEditorUIMultipleTextStringElement extends
|
|
7
|
+
export declare class UmbPropertyEditorUIMultipleTextStringElement extends UmbPropertyEditorUIMultipleTextStringElement_base implements UmbPropertyEditorUiElement {
|
|
9
8
|
#private;
|
|
10
|
-
value?: Array<string>;
|
|
11
9
|
set config(config: UmbPropertyEditorConfigCollection | undefined);
|
|
12
10
|
/**
|
|
13
11
|
* Disables the Multiple Text String Property Editor UI
|
|
@@ -33,8 +31,6 @@ export declare class UmbPropertyEditorUIMultipleTextStringElement extends UmbLit
|
|
|
33
31
|
private _label?;
|
|
34
32
|
private _min;
|
|
35
33
|
private _max;
|
|
36
|
-
protected _inputElement?: UmbInputMultipleTextStringElement;
|
|
37
|
-
protected _validationContext: UmbValidationContext;
|
|
38
34
|
constructor();
|
|
39
35
|
protected firstUpdated(): void;
|
|
40
36
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -4,16 +4,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { customElement, html, property,
|
|
8
|
-
import { umbBindToValidation,
|
|
7
|
+
import { customElement, html, property, state } from '../../../external/lit/index.js';
|
|
8
|
+
import { umbBindToValidation, UmbFormControlMixin } from '../../core/validation/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../core/lit-element/index.js';
|
|
10
10
|
import { UmbPropertyValueChangeEvent } from '../../core/property-editor/index.js';
|
|
11
11
|
import { UMB_PROPERTY_CONTEXT } from '../../core/property/index.js';
|
|
12
|
-
import { UMB_SUBMITTABLE_WORKSPACE_CONTEXT, UmbSubmittableWorkspaceContextBase, } from '../../core/workspace/index.js';
|
|
13
12
|
/**
|
|
14
13
|
* @element umb-property-editor-ui-multiple-text-string
|
|
15
14
|
*/
|
|
16
|
-
let UmbPropertyEditorUIMultipleTextStringElement = class UmbPropertyEditorUIMultipleTextStringElement extends UmbLitElement {
|
|
15
|
+
let UmbPropertyEditorUIMultipleTextStringElement = class UmbPropertyEditorUIMultipleTextStringElement extends UmbFormControlMixin(UmbLitElement) {
|
|
17
16
|
set config(config) {
|
|
18
17
|
if (!config)
|
|
19
18
|
return;
|
|
@@ -45,20 +44,15 @@ let UmbPropertyEditorUIMultipleTextStringElement = class UmbPropertyEditorUIMult
|
|
|
45
44
|
this.required = false;
|
|
46
45
|
this._min = 0;
|
|
47
46
|
this._max = Infinity;
|
|
48
|
-
this._validationContext = new UmbValidationContext(this);
|
|
49
47
|
this.consumeContext(UMB_PROPERTY_CONTEXT, (context) => {
|
|
50
48
|
this._label = context.getLabel();
|
|
51
49
|
});
|
|
52
|
-
this.consumeContext(UMB_SUBMITTABLE_WORKSPACE_CONTEXT, (context) => {
|
|
53
|
-
if (context instanceof UmbSubmittableWorkspaceContextBase) {
|
|
54
|
-
context.addValidationContext(this._validationContext);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
50
|
}
|
|
58
51
|
firstUpdated() {
|
|
59
52
|
if (this._min && this._max && this._min > this._max) {
|
|
60
53
|
console.warn(`Property '${this._label}' (Multiple Text String) has been misconfigured, 'min' is greater than 'max'. Please correct your data type configuration.`, this);
|
|
61
54
|
}
|
|
55
|
+
this.addFormControlElement(this.shadowRoot.querySelector('umb-input-multiple-text-string'));
|
|
62
56
|
}
|
|
63
57
|
#onChange(event) {
|
|
64
58
|
event.stopPropagation();
|
|
@@ -66,35 +60,21 @@ let UmbPropertyEditorUIMultipleTextStringElement = class UmbPropertyEditorUIMult
|
|
|
66
60
|
this.value = target.items;
|
|
67
61
|
this.dispatchEvent(new UmbPropertyValueChangeEvent());
|
|
68
62
|
}
|
|
69
|
-
// Prevent valid events from bubbling outside the message element
|
|
70
|
-
#onValid(event) {
|
|
71
|
-
event.stopPropagation();
|
|
72
|
-
}
|
|
73
|
-
// Prevent invalid events from bubbling outside the message element
|
|
74
|
-
#onInvalid(event) {
|
|
75
|
-
event.stopPropagation();
|
|
76
|
-
}
|
|
77
63
|
render() {
|
|
78
64
|
return html `
|
|
79
|
-
<umb-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
${umbBindToValidation(this)}>
|
|
90
|
-
</umb-input-multiple-text-string>
|
|
91
|
-
</umb-form-validation-message>
|
|
65
|
+
<umb-input-multiple-text-string
|
|
66
|
+
max=${this._max}
|
|
67
|
+
min=${this._min}
|
|
68
|
+
.items=${this.value ?? []}
|
|
69
|
+
?disabled=${this.disabled}
|
|
70
|
+
?readonly=${this.readonly}
|
|
71
|
+
?required=${this.required}
|
|
72
|
+
@change=${this.#onChange}
|
|
73
|
+
${umbBindToValidation(this)}>
|
|
74
|
+
</umb-input-multiple-text-string>
|
|
92
75
|
`;
|
|
93
76
|
}
|
|
94
77
|
};
|
|
95
|
-
__decorate([
|
|
96
|
-
property({ type: Array })
|
|
97
|
-
], UmbPropertyEditorUIMultipleTextStringElement.prototype, "value", void 0);
|
|
98
78
|
__decorate([
|
|
99
79
|
property({ type: Boolean, reflect: true })
|
|
100
80
|
], UmbPropertyEditorUIMultipleTextStringElement.prototype, "disabled", void 0);
|
|
@@ -113,9 +93,6 @@ __decorate([
|
|
|
113
93
|
__decorate([
|
|
114
94
|
state()
|
|
115
95
|
], UmbPropertyEditorUIMultipleTextStringElement.prototype, "_max", void 0);
|
|
116
|
-
__decorate([
|
|
117
|
-
query('#input', true)
|
|
118
|
-
], UmbPropertyEditorUIMultipleTextStringElement.prototype, "_inputElement", void 0);
|
|
119
96
|
UmbPropertyEditorUIMultipleTextStringElement = __decorate([
|
|
120
97
|
customElement('umb-property-editor-ui-multiple-text-string')
|
|
121
98
|
], UmbPropertyEditorUIMultipleTextStringElement);
|
package/dist-cms/packages/tiptap/property-editors/tiptap/property-editor-ui-tiptap.element.js
CHANGED
|
@@ -13,7 +13,7 @@ import '../../components/input-tiptap/input-tiptap.element.js';
|
|
|
13
13
|
let UmbPropertyEditorUiTiptapElement = class UmbPropertyEditorUiTiptapElement extends UmbPropertyEditorUiRteElementBase {
|
|
14
14
|
firstUpdated(_changedProperties) {
|
|
15
15
|
super.firstUpdated(_changedProperties);
|
|
16
|
-
this.addFormControlElement(this.shadowRoot
|
|
16
|
+
this.addFormControlElement(this.shadowRoot.querySelector('umb-input-tiptap'));
|
|
17
17
|
}
|
|
18
18
|
#onChange(event) {
|
|
19
19
|
const tipTapElement = event.target;
|