@umbraco-cms/backoffice 14.0.0--preview004-2a8fbe36 → 14.0.0--preview004-eaff2f45
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/apps/app/app.context.js +1 -1
- package/dist-cms/custom-elements.json +184 -173
- package/dist-cms/packages/core/components/property-type-based-property/property-type-based-property.element.js +2 -2
- package/dist-cms/packages/core/components/variant-selector/variant-selector.element.js +4 -3
- package/dist-cms/packages/core/data-type/components/property-editor-config/property-editor-config.element.d.ts +1 -1
- package/dist-cms/packages/core/data-type/components/property-editor-config/property-editor-config.element.js +9 -8
- package/dist-cms/packages/core/data-type/index.d.ts +0 -1
- package/dist-cms/packages/core/data-type/index.js +0 -1
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace-editor.element.js +1 -1
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace.context.d.ts +3 -3
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace.context.js +44 -6
- package/dist-cms/packages/core/data-type/workspace/views/details/data-type-details-workspace-view.element.js +2 -2
- package/dist-cms/packages/core/data-type/workspace/views/info/workspace-view-data-type-info.element.js +6 -6
- package/dist-cms/packages/core/modal/common/embedded-media/embedded-media-modal.element.js +12 -12
- package/dist-cms/packages/core/property/index.d.ts +4 -0
- package/dist-cms/packages/core/property/index.js +4 -0
- package/dist-cms/packages/core/property/property/index.d.ts +2 -0
- package/dist-cms/packages/core/property/property/index.js +2 -0
- package/dist-cms/packages/core/{workspace/workspace-property/workspace-property.context.d.ts → property/property/property.context.d.ts} +3 -3
- package/dist-cms/packages/core/{workspace/workspace-property/workspace-property.context.js → property/property/property.context.js} +15 -15
- package/dist-cms/packages/core/{workspace/workspace-property/workspace-property.element.d.ts → property/property/property.element.d.ts} +9 -10
- package/dist-cms/packages/core/{workspace/workspace-property/workspace-property.element.js → property/property/property.element.js} +63 -56
- package/dist-cms/packages/core/property/property-dataset/index.d.ts +6 -0
- package/dist-cms/packages/core/property/property-dataset/index.js +6 -0
- package/dist-cms/packages/core/property/property-dataset/nameable-property-dataset-context.interface.d.ts +7 -0
- package/dist-cms/packages/core/property/property-dataset/nameable-property-dataset-context.token.d.ts +5 -0
- package/dist-cms/packages/core/property/property-dataset/nameable-property-dataset-context.token.js +4 -0
- package/dist-cms/packages/core/property/property-dataset/property-dataset-base-context.d.ts +33 -0
- package/dist-cms/packages/core/property/property-dataset/property-dataset-base-context.js +58 -0
- package/dist-cms/packages/core/{workspace/variant-context/variant-context.interface.d.ts → property/property-dataset/property-dataset-context.interface.d.ts} +7 -6
- package/dist-cms/packages/core/property/property-dataset/property-dataset-context.token.d.ts +3 -0
- package/dist-cms/packages/core/property/property-dataset/property-dataset-context.token.js +2 -0
- package/dist-cms/packages/core/property/property-dataset/property-dataset.element.d.ts +67 -0
- package/dist-cms/packages/core/property/property-dataset/property-dataset.element.js +119 -0
- package/dist-cms/packages/core/property/property-layout/index.d.ts +1 -0
- package/dist-cms/packages/core/property/property-layout/index.js +1 -0
- package/dist-cms/packages/core/{workspace/workspace-property-layout/workspace-property-layout.element.d.ts → property/property-layout/property-layout.element.d.ts} +4 -4
- package/dist-cms/packages/core/{workspace/workspace-property-layout/workspace-property-layout.element.js → property/property-layout/property-layout.element.js} +12 -12
- package/dist-cms/packages/core/property/types/index.d.ts +1 -0
- package/dist-cms/packages/core/property/types/index.js +1 -0
- package/dist-cms/packages/core/property/types/property-value-data.type.d.ts +4 -0
- package/dist-cms/packages/core/property/types/property-value-data.type.js +1 -0
- package/dist-cms/packages/core/property-action/common/clear/property-action-clear.element.js +2 -2
- package/dist-cms/packages/core/property-editor/uis/block-grid/property-editor-ui-block-grid.element.js +2 -2
- package/dist-cms/packages/core/property-editor/uis/block-list/config/block-configuration/property-editor-ui-block-list-block-configuration.element.js +1 -1
- package/dist-cms/packages/core/property-editor/uis/multi-url-picker/property-editor-ui-multi-url-picker.element.js +2 -2
- package/dist-cms/packages/core/property-editor/uis/text-box/property-editor-ui-text-box.element.js +5 -2
- package/dist-cms/packages/core/workspace/index.d.ts +1 -3
- package/dist-cms/packages/core/workspace/index.js +1 -3
- package/dist-cms/packages/core/workspace/workspace-context/workspace-invariantable-context.interface.d.ts +3 -2
- package/dist-cms/packages/core/workspace/workspace-context/workspace-variantable-context.interface.d.ts +2 -2
- package/dist-cms/packages/core/workspace/workspace-modal/workspace-modal.element.d.ts +1 -1
- package/dist-cms/packages/core/workspace/workspace-modal/workspace-modal.element.js +2 -2
- package/dist-cms/packages/core/workspace/workspace-property-dataset/index.d.ts +1 -0
- package/dist-cms/packages/core/workspace/workspace-property-dataset/index.js +1 -0
- package/dist-cms/packages/core/workspace/workspace-property-dataset/invariant-workspace-property-dataset-context.d.ts +26 -0
- package/dist-cms/packages/core/workspace/workspace-property-dataset/invariant-workspace-property-dataset-context.js +44 -0
- package/dist-cms/packages/core/workspace/workspace-split-view/workspace-split-view.context.js +1 -1
- package/dist-cms/packages/dictionary/dictionary/workspace/views/editor/workspace-view-dictionary-editor.element.js +2 -2
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit-property.element.js +1 -1
- package/dist-cms/packages/documents/document-types/workspace/views/settings/document-type-workspace-view-settings.element.js +8 -8
- package/dist-cms/packages/documents/document-types/workspace/views/structure/document-type-workspace-view-structure.element.js +6 -6
- package/dist-cms/packages/documents/document-types/workspace/views/templates/document-type-workspace-view-templates.element.js +4 -4
- package/dist-cms/packages/documents/documents/{variant-context/document-variant-context.d.ts → property-dataset-context/document-property-dataset-context.d.ts} +4 -4
- package/dist-cms/packages/documents/documents/{variant-context/document-variant-context.js → property-dataset-context/document-property-dataset-context.js} +6 -8
- package/dist-cms/packages/documents/documents/property-dataset-context/document-property-dataset-context.token.d.ts +5 -0
- package/dist-cms/packages/documents/documents/{variant-context/document-variant-context.token.js → property-dataset-context/document-property-dataset-context.token.js} +1 -1
- package/dist-cms/packages/documents/documents/workspace/document-workspace.context.d.ts +2 -2
- package/dist-cms/packages/documents/documents/workspace/document-workspace.context.js +3 -3
- package/dist-cms/packages/media/media-types/workspace/views/design/media-type-workspace-view-edit-property.element.js +1 -1
- package/dist-cms/packages/media/media-types/workspace/views/structure/media-type-workspace-view-structure.element.js +6 -6
- package/dist-cms/packages/packages/package-builder/workspace/workspace-package-builder.element.js +15 -29
- package/dist-cms/packages/settings/languages/workspace/language/views/details/language-details-workspace-view.element.js +8 -8
- package/dist-cms/packages/settings/relation-types/workspace/views/relation-type/relation-type-workspace-view-relation-type.element.js +6 -6
- package/dist-cms/packages/tags/property-editors/tags/property-editor-ui-tags.element.js +2 -2
- package/dist-cms/packages/user/user/workspace/components/user-workspace-access-settings/user-workspace-access-settings.element.js +6 -6
- package/dist-cms/packages/user/user/workspace/components/user-workspace-profile-settings/user-workspace-profile-settings.element.js +4 -4
- package/dist-cms/packages/user/user-group/workspace/user-group-workspace-editor.element.js +6 -6
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +63 -68
- package/examples/dashboard-with-property-dataset/README.md +5 -0
- package/examples/dashboard-with-property-dataset/dataset-dashboard.ts +75 -0
- package/examples/dashboard-with-property-dataset/index.ts +15 -0
- package/package.json +4 -1
- package/dist-cms/packages/core/data-type/variant-context/data-type-variant-context.d.ts +0 -7
- package/dist-cms/packages/core/data-type/variant-context/data-type-variant-context.js +0 -7
- package/dist-cms/packages/core/data-type/variant-context/data-type-variant-context.token.d.ts +0 -5
- package/dist-cms/packages/core/data-type/variant-context/data-type-variant-context.token.js +0 -3
- package/dist-cms/packages/core/data-type/variant-context/index.d.ts +0 -2
- package/dist-cms/packages/core/data-type/variant-context/index.js +0 -2
- package/dist-cms/packages/core/workspace/variant-context/index.d.ts +0 -5
- package/dist-cms/packages/core/workspace/variant-context/index.js +0 -5
- package/dist-cms/packages/core/workspace/variant-context/invariant-workspace-variant-context.d.ts +0 -29
- package/dist-cms/packages/core/workspace/variant-context/invariant-workspace-variant-context.js +0 -48
- package/dist-cms/packages/core/workspace/variant-context/nameable-variant-context.interface.d.ts +0 -7
- package/dist-cms/packages/core/workspace/variant-context/nameable-variant-context.token.d.ts +0 -5
- package/dist-cms/packages/core/workspace/variant-context/nameable-variant-context.token.js +0 -3
- package/dist-cms/packages/core/workspace/variant-context/variant-context.token.d.ts +0 -3
- package/dist-cms/packages/core/workspace/variant-context/variant-context.token.js +0 -2
- package/dist-cms/packages/core/workspace/workspace-property/index.d.ts +0 -2
- package/dist-cms/packages/core/workspace/workspace-property/index.js +0 -2
- package/dist-cms/packages/documents/documents/variant-context/document-variant-context.token.d.ts +0 -5
- /package/dist-cms/packages/core/{workspace/variant-context/nameable-variant-context.interface.js → property/property-dataset/nameable-property-dataset-context.interface.js} +0 -0
- /package/dist-cms/packages/core/{workspace/variant-context/variant-context.interface.js → property/property-dataset/property-dataset-context.interface.js} +0 -0
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import type { UmbVariantId } from '../../variant/variant-id.class.js';
|
|
2
2
|
import type { Observable } from '../../../../external/rxjs/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* A
|
|
4
|
+
* A property dataset context, represents the data of a set of properties.
|
|
5
5
|
* This can take form as many, so to list a few:
|
|
6
|
-
* - A specific variant of content
|
|
7
|
-
* - Content that does not vary
|
|
6
|
+
* - A specific variant of content.
|
|
7
|
+
* - Content that does not vary.
|
|
8
8
|
* - A block.
|
|
9
9
|
* - A DataType configuration.
|
|
10
|
+
* - A property editor that hosts a set of properties.
|
|
10
11
|
*
|
|
11
12
|
* The base type of this holds a Name and some Properties.
|
|
12
13
|
* Some might be enriches with Variant Info, like culture and segment.
|
|
13
14
|
* Others might have saved publishing status.
|
|
14
15
|
* Also setting the name is an additional feature.
|
|
15
16
|
*/
|
|
16
|
-
export interface
|
|
17
|
-
|
|
17
|
+
export interface UmbPropertyDatasetContext {
|
|
18
|
+
getEntityType(): string;
|
|
18
19
|
getUnique(): string | undefined;
|
|
19
20
|
getVariantId: () => UmbVariantId;
|
|
20
21
|
getName(): string | undefined;
|
|
@@ -22,5 +23,5 @@ export interface UmbVariantContext {
|
|
|
22
23
|
destroy(): void;
|
|
23
24
|
propertyVariantId?: (propertyAlias: string) => Promise<Observable<UmbVariantId | undefined>>;
|
|
24
25
|
propertyValueByAlias<ReturnType = unknown>(propertyAlias: string): Promise<Observable<ReturnType | undefined>>;
|
|
25
|
-
setPropertyValue(propertyAlias: string, value: unknown):
|
|
26
|
+
setPropertyValue(propertyAlias: string, value: unknown): void;
|
|
26
27
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type UmbPropertyDatasetContext } from './property-dataset-context.interface.js';
|
|
2
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
3
|
+
export declare const UMB_PROPERTY_DATASET_CONTEXT: UmbContextToken<UmbPropertyDatasetContext, UmbPropertyDatasetContext>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { UmbPropertyValueData } from '../types/property-value-data.type.js';
|
|
2
|
+
import { UmbPropertyDatasetBaseContext } from './property-dataset-base-context.js';
|
|
3
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* @element umb-property-dataset
|
|
6
|
+
* @description - Element for hosting a property dataset. This is needed for umb-property to work.
|
|
7
|
+
* @slot default - Slot for rendering content within.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UmbPropertyDatasetElement extends UmbLitElement {
|
|
10
|
+
#private;
|
|
11
|
+
readonly context: UmbPropertyDatasetBaseContext;
|
|
12
|
+
/**
|
|
13
|
+
* The value of the dataset.
|
|
14
|
+
* @returns {Array<UmbPropertyValueData>}
|
|
15
|
+
* @memberof UmbBasicVariantElement
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const dataSet = [
|
|
19
|
+
* {
|
|
20
|
+
* alias: 'testAlias',
|
|
21
|
+
* value: 'value as a string',
|
|
22
|
+
* },
|
|
23
|
+
* {
|
|
24
|
+
* alias: 'anotherAlias',
|
|
25
|
+
* value: 123,
|
|
26
|
+
* }
|
|
27
|
+
* ]
|
|
28
|
+
*
|
|
29
|
+
* html`
|
|
30
|
+
* <umb-property-dataset .value="${dataSet}">
|
|
31
|
+
* <umb-property
|
|
32
|
+
* label="My label for this property"
|
|
33
|
+
* description="The description to show on the property"
|
|
34
|
+
* alias="testAlias"
|
|
35
|
+
* property-editor-ui-alias="Umb.PropertyEditorUi.TextBox"
|
|
36
|
+
* .config=${...}>
|
|
37
|
+
* </umb-property>
|
|
38
|
+
* </umb-property-dataset>
|
|
39
|
+
* `
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
get value(): Array<UmbPropertyValueData>;
|
|
43
|
+
set value(value: Array<UmbPropertyValueData>);
|
|
44
|
+
/**
|
|
45
|
+
* The name of the dataset, this name varies depending on the use-case. But this is either
|
|
46
|
+
* @type {string}
|
|
47
|
+
* @returns {string}
|
|
48
|
+
* @memberof UmbBasicVariantElement
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* html`
|
|
52
|
+
* <umb-property-dataset name="My variant name">
|
|
53
|
+
* ...
|
|
54
|
+
* </umb-property-dataset>
|
|
55
|
+
* `
|
|
56
|
+
*/
|
|
57
|
+
get name(): string | undefined;
|
|
58
|
+
set name(value: string | undefined);
|
|
59
|
+
constructor();
|
|
60
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
61
|
+
}
|
|
62
|
+
export default UmbPropertyDatasetElement;
|
|
63
|
+
declare global {
|
|
64
|
+
interface HTMLElementTagNameMap {
|
|
65
|
+
'umb-property-dataset': UmbPropertyDatasetElement;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { UmbPropertyDatasetBaseContext } from './property-dataset-base-context.js';
|
|
8
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
9
|
+
import { customElement, html, property } from '../../../../external/lit/index.js';
|
|
10
|
+
import { UmbChangeEvent } from '../../event/index.js';
|
|
11
|
+
/**
|
|
12
|
+
* @element umb-property-dataset
|
|
13
|
+
* @description - Element for hosting a property dataset. This is needed for umb-property to work.
|
|
14
|
+
* @slot default - Slot for rendering content within.
|
|
15
|
+
*/
|
|
16
|
+
let UmbPropertyDatasetElement = class UmbPropertyDatasetElement extends UmbLitElement {
|
|
17
|
+
// Determine wether state change should fire an event when the value is changed.
|
|
18
|
+
#allowChangeEvent = false;
|
|
19
|
+
/**
|
|
20
|
+
* The value of the dataset.
|
|
21
|
+
* @returns {Array<UmbPropertyValueData>}
|
|
22
|
+
* @memberof UmbBasicVariantElement
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* const dataSet = [
|
|
26
|
+
* {
|
|
27
|
+
* alias: 'testAlias',
|
|
28
|
+
* value: 'value as a string',
|
|
29
|
+
* },
|
|
30
|
+
* {
|
|
31
|
+
* alias: 'anotherAlias',
|
|
32
|
+
* value: 123,
|
|
33
|
+
* }
|
|
34
|
+
* ]
|
|
35
|
+
*
|
|
36
|
+
* html`
|
|
37
|
+
* <umb-property-dataset .value="${dataSet}">
|
|
38
|
+
* <umb-property
|
|
39
|
+
* label="My label for this property"
|
|
40
|
+
* description="The description to show on the property"
|
|
41
|
+
* alias="testAlias"
|
|
42
|
+
* property-editor-ui-alias="Umb.PropertyEditorUi.TextBox"
|
|
43
|
+
* .config=${...}>
|
|
44
|
+
* </umb-property>
|
|
45
|
+
* </umb-property-dataset>
|
|
46
|
+
* `
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
get value() {
|
|
50
|
+
return this.context.getValues();
|
|
51
|
+
}
|
|
52
|
+
set value(value) {
|
|
53
|
+
this.#allowChangeEvent = false;
|
|
54
|
+
this.context.setValues(value);
|
|
55
|
+
// Above might not trigger a observer callback (if no change), so set the allow change event to true:
|
|
56
|
+
this.#allowChangeEvent = true;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The name of the dataset, this name varies depending on the use-case. But this is either
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @returns {string}
|
|
62
|
+
* @memberof UmbBasicVariantElement
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* html`
|
|
66
|
+
* <umb-property-dataset name="My variant name">
|
|
67
|
+
* ...
|
|
68
|
+
* </umb-property-dataset>
|
|
69
|
+
* `
|
|
70
|
+
*/
|
|
71
|
+
get name() {
|
|
72
|
+
return this.context.getName();
|
|
73
|
+
}
|
|
74
|
+
set name(value) {
|
|
75
|
+
this.#allowChangeEvent = false;
|
|
76
|
+
this.context.setName(value);
|
|
77
|
+
// Above might not trigger a observer callback (if no change), so set the allow change event to true:
|
|
78
|
+
this.#allowChangeEvent = true;
|
|
79
|
+
}
|
|
80
|
+
constructor() {
|
|
81
|
+
super();
|
|
82
|
+
// Prevent any child events escaping this element.
|
|
83
|
+
this.addEventListener('change', (e) => {
|
|
84
|
+
if (e.target !== this) {
|
|
85
|
+
e.stopImmediatePropagation();
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
this.context = new UmbPropertyDatasetBaseContext(this);
|
|
89
|
+
// prevent the first change event from firing:
|
|
90
|
+
this.#allowChangeEvent = false;
|
|
91
|
+
this.observe(this.context.name, this.#observerCallback);
|
|
92
|
+
// prevent the first change event from firing:
|
|
93
|
+
this.#allowChangeEvent = false;
|
|
94
|
+
this.observe(this.context.values, this.#observerCallback);
|
|
95
|
+
}
|
|
96
|
+
#observerCallback = () => {
|
|
97
|
+
if (this.#allowChangeEvent) {
|
|
98
|
+
this.dispatchEvent(new UmbChangeEvent());
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// Set allow change event to true.
|
|
102
|
+
this.#allowChangeEvent = true;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
render() {
|
|
106
|
+
return html `<slot></slot>`;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
__decorate([
|
|
110
|
+
property({ attribute: false })
|
|
111
|
+
], UmbPropertyDatasetElement.prototype, "value", null);
|
|
112
|
+
__decorate([
|
|
113
|
+
property({ attribute: false })
|
|
114
|
+
], UmbPropertyDatasetElement.prototype, "name", null);
|
|
115
|
+
UmbPropertyDatasetElement = __decorate([
|
|
116
|
+
customElement('umb-property-dataset')
|
|
117
|
+
], UmbPropertyDatasetElement);
|
|
118
|
+
export { UmbPropertyDatasetElement };
|
|
119
|
+
export default UmbPropertyDatasetElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './property-layout.element.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './property-layout.element.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { LitElement } from '../../../../external/lit/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* @element umb-
|
|
3
|
+
* @element umb-property-layout
|
|
4
4
|
* @description - Element for displaying a property in an workspace.
|
|
5
5
|
* @slot editor - Slot for rendering the Property Editor
|
|
6
6
|
* @slot description - Slot for rendering things below the label.
|
|
7
|
-
* @slot
|
|
7
|
+
* @slot action-menu - Slot for rendering the Property Action Menu
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class UmbPropertyLayoutElement extends LitElement {
|
|
10
10
|
/**
|
|
11
11
|
* Alias. The technical name of the property.
|
|
12
12
|
* @type {string}
|
|
@@ -41,6 +41,6 @@ export declare class UmbWorkspacePropertyLayoutElement extends LitElement {
|
|
|
41
41
|
}
|
|
42
42
|
declare global {
|
|
43
43
|
interface HTMLElementTagNameMap {
|
|
44
|
-
'umb-
|
|
44
|
+
'umb-property-layout': UmbPropertyLayoutElement;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -7,13 +7,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { css, html, LitElement, customElement, property } from '../../../../external/lit/index.js';
|
|
8
8
|
import { UmbTextStyles } from '../../../../shared/style/index.js';
|
|
9
9
|
/**
|
|
10
|
-
* @element umb-
|
|
10
|
+
* @element umb-property-layout
|
|
11
11
|
* @description - Element for displaying a property in an workspace.
|
|
12
12
|
* @slot editor - Slot for rendering the Property Editor
|
|
13
13
|
* @slot description - Slot for rendering things below the label.
|
|
14
|
-
* @slot
|
|
14
|
+
* @slot action-menu - Slot for rendering the Property Action Menu
|
|
15
15
|
*/
|
|
16
|
-
let
|
|
16
|
+
let UmbPropertyLayoutElement = class UmbPropertyLayoutElement extends LitElement {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
19
|
/**
|
|
@@ -51,7 +51,7 @@ let UmbWorkspacePropertyLayoutElement = class UmbWorkspacePropertyLayoutElement
|
|
|
51
51
|
return html `
|
|
52
52
|
<div id="headerColumn">
|
|
53
53
|
<uui-label title=${this.alias}>${this.label}</uui-label>
|
|
54
|
-
<slot name="
|
|
54
|
+
<slot name="action-menu"></slot>
|
|
55
55
|
<div id="description">${this.description}</div>
|
|
56
56
|
<slot name="description"></slot>
|
|
57
57
|
</div>
|
|
@@ -114,17 +114,17 @@ let UmbWorkspacePropertyLayoutElement = class UmbWorkspacePropertyLayoutElement
|
|
|
114
114
|
};
|
|
115
115
|
__decorate([
|
|
116
116
|
property({ type: String })
|
|
117
|
-
],
|
|
117
|
+
], UmbPropertyLayoutElement.prototype, "alias", void 0);
|
|
118
118
|
__decorate([
|
|
119
119
|
property({ type: String })
|
|
120
|
-
],
|
|
120
|
+
], UmbPropertyLayoutElement.prototype, "label", void 0);
|
|
121
121
|
__decorate([
|
|
122
122
|
property({ type: String })
|
|
123
|
-
],
|
|
123
|
+
], UmbPropertyLayoutElement.prototype, "orientation", void 0);
|
|
124
124
|
__decorate([
|
|
125
125
|
property({ type: String })
|
|
126
|
-
],
|
|
127
|
-
|
|
128
|
-
customElement('umb-
|
|
129
|
-
],
|
|
130
|
-
export {
|
|
126
|
+
], UmbPropertyLayoutElement.prototype, "description", void 0);
|
|
127
|
+
UmbPropertyLayoutElement = __decorate([
|
|
128
|
+
customElement('umb-property-layout')
|
|
129
|
+
], UmbPropertyLayoutElement);
|
|
130
|
+
export { UmbPropertyLayoutElement };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './property-value-data.type.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './property-value-data.type.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist-cms/packages/core/property-action/common/clear/property-action-clear.element.js
CHANGED
|
@@ -4,8 +4,8 @@ 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 { UMB_PROPERTY_CONTEXT } from '../../../property/index.js';
|
|
7
8
|
import { html, customElement, property } from '../../../../../external/lit/index.js';
|
|
8
|
-
import { UMB_WORKSPACE_PROPERTY_CONTEXT_TOKEN } from '../../../workspace/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
10
10
|
let UmbPropertyActionClearElement = class UmbPropertyActionClearElement extends UmbLitElement {
|
|
11
11
|
constructor() {
|
|
@@ -16,7 +16,7 @@ let UmbPropertyActionClearElement = class UmbPropertyActionClearElement extends
|
|
|
16
16
|
this._propertyActionMenuContext = propertyActionsContext;
|
|
17
17
|
});
|
|
18
18
|
*/
|
|
19
|
-
this.consumeContext(
|
|
19
|
+
this.consumeContext(UMB_PROPERTY_CONTEXT, (propertyContext) => {
|
|
20
20
|
this._propertyContext = propertyContext;
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -4,7 +4,7 @@ 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 {
|
|
7
|
+
import { UMB_PROPERTY_CONTEXT } from '../../../property/index.js';
|
|
8
8
|
import { html, customElement, property, state } from '../../../../../external/lit/index.js';
|
|
9
9
|
import { UmbTextStyles } from '../../../../../shared/style/index.js';
|
|
10
10
|
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
@@ -16,7 +16,7 @@ let UmbPropertyEditorUIBlockGridElement = class UmbPropertyEditorUIBlockGridElem
|
|
|
16
16
|
super();
|
|
17
17
|
this.value = '';
|
|
18
18
|
this._routes = [];
|
|
19
|
-
this.consumeContext(
|
|
19
|
+
this.consumeContext(UMB_PROPERTY_CONTEXT, (context) => {
|
|
20
20
|
this.observe(context?.variantId, (propertyVariantId) => {
|
|
21
21
|
this._variantId = propertyVariantId;
|
|
22
22
|
this.setupRoutes();
|
|
@@ -16,7 +16,7 @@ let UmbPropertyEditorUIBlockListBlockConfigurationElement = class UmbPropertyEdi
|
|
|
16
16
|
this.value = '';
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return html
|
|
19
|
+
return html ` <div>umb-property-editor-ui-block-list-block-configuration</div> `;
|
|
20
20
|
}
|
|
21
21
|
static { this.styles = [UmbTextStyles]; }
|
|
22
22
|
};
|
|
@@ -4,9 +4,9 @@ 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 { UMB_PROPERTY_CONTEXT } from '../../../property/index.js';
|
|
7
8
|
import { html, customElement, property, state } from '../../../../../external/lit/index.js';
|
|
8
9
|
import { UmbTextStyles } from '../../../../../shared/style/index.js';
|
|
9
|
-
import { UMB_WORKSPACE_PROPERTY_CONTEXT_TOKEN } from '../../../workspace/index.js';
|
|
10
10
|
import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
|
|
11
11
|
/**
|
|
12
12
|
* @element umb-property-editor-ui-multi-url-picker
|
|
@@ -22,7 +22,7 @@ let UmbPropertyEditorUIMultiUrlPickerElement = class UmbPropertyEditorUIMultiUrl
|
|
|
22
22
|
constructor() {
|
|
23
23
|
super();
|
|
24
24
|
this.value = [];
|
|
25
|
-
this.consumeContext(
|
|
25
|
+
this.consumeContext(UMB_PROPERTY_CONTEXT, (context) => {
|
|
26
26
|
this.observe(context.alias, (alias) => {
|
|
27
27
|
this._alias = alias;
|
|
28
28
|
});
|
package/dist-cms/packages/core/property-editor/uis/text-box/property-editor-ui-text-box.element.js
CHANGED
|
@@ -21,7 +21,10 @@ let UmbPropertyEditorUITextBoxElement = class UmbPropertyEditorUITextBoxElement
|
|
|
21
21
|
this._maxChars = config?.getValueByAlias('maxChars');
|
|
22
22
|
}
|
|
23
23
|
onChange(e) {
|
|
24
|
-
|
|
24
|
+
const newValue = e.target.value;
|
|
25
|
+
if (newValue === this.value)
|
|
26
|
+
return;
|
|
27
|
+
this.value = newValue;
|
|
25
28
|
this.dispatchEvent(new CustomEvent('property-value-change'));
|
|
26
29
|
}
|
|
27
30
|
render() {
|
|
@@ -30,7 +33,7 @@ let UmbPropertyEditorUITextBoxElement = class UmbPropertyEditorUITextBoxElement
|
|
|
30
33
|
.type=${this._type}
|
|
31
34
|
inputMode=${ifDefined(this._inputMode)}
|
|
32
35
|
maxlength=${ifDefined(this._maxChars)}
|
|
33
|
-
@
|
|
36
|
+
@input=${this.onChange}></uui-input>`;
|
|
34
37
|
}
|
|
35
38
|
static { this.styles = [
|
|
36
39
|
UmbTextStyles,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './workspace-property-dataset/index.js';
|
|
2
2
|
export * from './workspace-action-menu/index.js';
|
|
3
3
|
export * from './workspace-action/index.js';
|
|
4
4
|
export type { WorkspaceAliasConditionConfig } from './workspace-alias.condition.js';
|
|
@@ -8,7 +8,5 @@ export * from './workspace-editor/index.js';
|
|
|
8
8
|
export * from './workspace-footer/index.js';
|
|
9
9
|
export * from './workspace-is-new-redirect-controller/index.js';
|
|
10
10
|
export * from './workspace-modal/index.js';
|
|
11
|
-
export * from './workspace-property-layout/workspace-property-layout.element.js';
|
|
12
|
-
export * from './workspace-property/index.js';
|
|
13
11
|
export * from './workspace-split-view-manager.class.js';
|
|
14
12
|
export * from './workspace-split-view/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './workspace-property-dataset/index.js';
|
|
2
2
|
export * from './workspace-action-menu/index.js';
|
|
3
3
|
export * from './workspace-action/index.js';
|
|
4
4
|
export * from './workspace-context/index.js';
|
|
@@ -6,7 +6,5 @@ export * from './workspace-editor/index.js';
|
|
|
6
6
|
export * from './workspace-footer/index.js';
|
|
7
7
|
export * from './workspace-is-new-redirect-controller/index.js';
|
|
8
8
|
export * from './workspace-modal/index.js';
|
|
9
|
-
export * from './workspace-property-layout/workspace-property-layout.element.js';
|
|
10
|
-
export * from './workspace-property/index.js';
|
|
11
9
|
export * from './workspace-split-view-manager.class.js';
|
|
12
10
|
export * from './workspace-split-view/index.js';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { UmbVariantId } from '../../variant/variant-id.class.js';
|
|
2
|
-
import {
|
|
2
|
+
import { UmbPropertyDatasetContext } from '../../property/property-dataset/property-dataset-context.interface.js';
|
|
3
3
|
import type { UmbSaveableWorkspaceContextInterface } from './saveable-workspace-context.interface.js';
|
|
4
4
|
import { UmbControllerHost } from '../../../../libs/controller-api/index.js';
|
|
5
5
|
import type { Observable } from '../../../../external/rxjs/index.js';
|
|
6
6
|
export interface UmbInvariantableWorkspaceContextInterface<T = unknown> extends UmbSaveableWorkspaceContextInterface<T> {
|
|
7
|
+
name: Observable<string | undefined>;
|
|
7
8
|
getName(): string | undefined;
|
|
8
9
|
setName(name: string): void;
|
|
9
10
|
propertyValueByAlias<ReturnType = unknown>(alias: string): Promise<Observable<ReturnType | undefined>>;
|
|
10
11
|
getPropertyValue<ReturnType = unknown>(alias: string): ReturnType;
|
|
11
12
|
setPropertyValue(alias: string, value: unknown): Promise<void>;
|
|
12
|
-
|
|
13
|
+
createPropertyDatasetContext(host: UmbControllerHost, variantId?: UmbVariantId): UmbPropertyDatasetContext;
|
|
13
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UmbWorkspaceSplitViewManager } from '../workspace-split-view-manager.class.js';
|
|
2
|
-
import {
|
|
2
|
+
import { UmbPropertyDatasetContext } from '../../property/property-dataset/property-dataset-context.interface.js';
|
|
3
3
|
import type { UmbSaveableWorkspaceContextInterface } from './saveable-workspace-context.interface.js';
|
|
4
4
|
import type { Observable } from '../../../../external/rxjs/index.js';
|
|
5
5
|
import type { UmbVariantId } from '../../variant/index.js';
|
|
@@ -16,5 +16,5 @@ export interface UmbVariantableWorkspaceContextInterface<EntityType = unknown> e
|
|
|
16
16
|
propertyValueByAlias<ReturnValue = unknown>(alias: string, variantId?: UmbVariantId): Promise<Observable<ReturnValue | undefined>>;
|
|
17
17
|
getPropertyValue<ReturnValue = unknown>(alias: string, variantId?: UmbVariantId): ReturnValue | undefined;
|
|
18
18
|
setPropertyValue(alias: string, value: unknown, variantId?: UmbVariantId): Promise<void>;
|
|
19
|
-
|
|
19
|
+
createPropertyDatasetContext(host: UmbControllerHost, variantId?: UmbVariantId): UmbPropertyDatasetContext;
|
|
20
20
|
}
|
|
@@ -7,7 +7,7 @@ export declare class UmbWorkspaceModalElement extends UmbLitElement {
|
|
|
7
7
|
* TODO: Consider if this binding and events integration is the right for communicating back the modal handler. Or if we should go with some Context API. like a Modal Context API.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
10
|
+
render(): "" | import("lit-html").TemplateResult<1>;
|
|
11
11
|
static styles: CSSResultGroup;
|
|
12
12
|
}
|
|
13
13
|
export default UmbWorkspaceModalElement;
|
|
@@ -13,7 +13,7 @@ let UmbWorkspaceModalElement = class UmbWorkspaceModalElement extends UmbLitElem
|
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
15
15
|
render() {
|
|
16
|
-
return html `<umb-workspace .entityType=${this.data
|
|
16
|
+
return this.data ? html `<umb-workspace .entityType=${this.data.entityType}></umb-workspace>` : '';
|
|
17
17
|
}
|
|
18
18
|
static { this.styles = [
|
|
19
19
|
UmbTextStyles,
|
|
@@ -26,7 +26,7 @@ let UmbWorkspaceModalElement = class UmbWorkspaceModalElement extends UmbLitElem
|
|
|
26
26
|
]; }
|
|
27
27
|
};
|
|
28
28
|
__decorate([
|
|
29
|
-
property()
|
|
29
|
+
property({ attribute: false })
|
|
30
30
|
], UmbWorkspaceModalElement.prototype, "data", void 0);
|
|
31
31
|
UmbWorkspaceModalElement = __decorate([
|
|
32
32
|
customElement('umb-workspace-modal')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './invariant-workspace-property-dataset-context.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './invariant-workspace-property-dataset-context.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UmbPropertyDatasetContext, UmbNameablePropertyDatasetContext } from '../../property/index.js';
|
|
2
|
+
import { type UmbControllerHost } from '../../../../libs/controller-api/index.js';
|
|
3
|
+
import { UmbBaseController } from '../../../../libs/class-api/index.js';
|
|
4
|
+
import { UmbVariantId } from '../../variant/index.js';
|
|
5
|
+
import { UmbInvariantableWorkspaceContextInterface } from '../index.js';
|
|
6
|
+
/**
|
|
7
|
+
* A property dataset context that hooks directly into the workspace context.
|
|
8
|
+
*/
|
|
9
|
+
export declare class UmbInvariantWorkspacePropertyDatasetContext<WorkspaceType extends UmbInvariantableWorkspaceContextInterface = UmbInvariantableWorkspaceContextInterface> extends UmbBaseController implements UmbPropertyDatasetContext, UmbNameablePropertyDatasetContext {
|
|
10
|
+
#private;
|
|
11
|
+
name: import("rxjs").Observable<string | undefined>;
|
|
12
|
+
getVariantId(): UmbVariantId;
|
|
13
|
+
getEntityType(): string;
|
|
14
|
+
getUnique(): string | undefined;
|
|
15
|
+
getName(): string | undefined;
|
|
16
|
+
setName(name: string): void;
|
|
17
|
+
constructor(host: UmbControllerHost, workspace: WorkspaceType);
|
|
18
|
+
/**
|
|
19
|
+
* TODO: Write proper JSDocs here.
|
|
20
|
+
*/
|
|
21
|
+
propertyValueByAlias<ReturnType = unknown>(propertyAlias: string): Promise<import("rxjs").Observable<ReturnType | undefined>>;
|
|
22
|
+
/**
|
|
23
|
+
* TODO: Write proper JSDocs here.
|
|
24
|
+
*/
|
|
25
|
+
setPropertyValue(propertyAlias: string, value: unknown): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { UMB_PROPERTY_DATASET_CONTEXT, } from '../../property/index.js';
|
|
2
|
+
import { UmbBaseController } from '../../../../libs/class-api/index.js';
|
|
3
|
+
import { UmbVariantId } from '../../variant/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* A property dataset context that hooks directly into the workspace context.
|
|
6
|
+
*/
|
|
7
|
+
export class UmbInvariantWorkspacePropertyDatasetContext extends UmbBaseController {
|
|
8
|
+
#workspace;
|
|
9
|
+
// default data:
|
|
10
|
+
getVariantId() {
|
|
11
|
+
return UmbVariantId.CreateInvariant();
|
|
12
|
+
}
|
|
13
|
+
getEntityType() {
|
|
14
|
+
return this.#workspace.getEntityType();
|
|
15
|
+
}
|
|
16
|
+
getUnique() {
|
|
17
|
+
return this.#workspace.getEntityId();
|
|
18
|
+
}
|
|
19
|
+
getName() {
|
|
20
|
+
return this.#workspace.getName();
|
|
21
|
+
}
|
|
22
|
+
setName(name) {
|
|
23
|
+
this.#workspace.setName(name);
|
|
24
|
+
}
|
|
25
|
+
constructor(host, workspace) {
|
|
26
|
+
// The controller alias, is a very generic name cause we want only one of these for this controller host.
|
|
27
|
+
super(host, 'variantContext');
|
|
28
|
+
this.#workspace = workspace;
|
|
29
|
+
this.name = this.#workspace.name;
|
|
30
|
+
this.provideContext(UMB_PROPERTY_DATASET_CONTEXT, this);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* TODO: Write proper JSDocs here.
|
|
34
|
+
*/
|
|
35
|
+
async propertyValueByAlias(propertyAlias) {
|
|
36
|
+
return await this.#workspace.propertyValueByAlias(propertyAlias);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* TODO: Write proper JSDocs here.
|
|
40
|
+
*/
|
|
41
|
+
async setPropertyValue(propertyAlias, value) {
|
|
42
|
+
return this.#workspace.setPropertyValue(propertyAlias, value);
|
|
43
|
+
}
|
|
44
|
+
}
|
package/dist-cms/packages/core/workspace/workspace-split-view/workspace-split-view.context.js
CHANGED
|
@@ -38,7 +38,7 @@ export class UmbWorkspaceSplitViewContext extends UmbBaseController {
|
|
|
38
38
|
// TODO: Ask workspace context to create the specific variant context.
|
|
39
39
|
this.#variantContext?.destroy();
|
|
40
40
|
const variantId = UmbVariantId.Create(activeVariantInfo);
|
|
41
|
-
this.#variantContext = this.#workspaceContext?.
|
|
41
|
+
this.#variantContext = this.#workspaceContext?.createPropertyDatasetContext(this, variantId);
|
|
42
42
|
}, '_observeActiveVariant');
|
|
43
43
|
}
|
|
44
44
|
switchVariant(variant) {
|
|
@@ -34,14 +34,14 @@ let UmbWorkspaceViewDictionaryEditorElement = class UmbWorkspaceViewDictionaryEd
|
|
|
34
34
|
if (!language.isoCode)
|
|
35
35
|
return;
|
|
36
36
|
const translation = this._dictionary?.translations?.find((x) => x.isoCode === language.isoCode);
|
|
37
|
-
return html ` <umb-
|
|
37
|
+
return html ` <umb-property-layout label=${language.name ?? language.isoCode}>
|
|
38
38
|
<uui-textarea
|
|
39
39
|
slot="editor"
|
|
40
40
|
name=${language.isoCode}
|
|
41
41
|
label="translation"
|
|
42
42
|
@change=${this.#onTextareaChange}
|
|
43
43
|
value=${ifDefined(translation?.translation)}></uui-textarea>
|
|
44
|
-
</umb-
|
|
44
|
+
</umb-property-layout>`;
|
|
45
45
|
}
|
|
46
46
|
#onTextareaChange(e) {
|
|
47
47
|
if (e instanceof UUITextareaEvent) {
|
|
@@ -165,7 +165,7 @@ let UmbDocumentTypeWorkspacePropertyElement = class UmbDocumentTypeWorkspaceProp
|
|
|
165
165
|
.value=${this.property.name}
|
|
166
166
|
@input=${this.#onNameChange}></uui-input>
|
|
167
167
|
${this.renderPropertyAlias()}
|
|
168
|
-
<slot name="
|
|
168
|
+
<slot name="action-menu"></slot>
|
|
169
169
|
<p>
|
|
170
170
|
<uui-textarea
|
|
171
171
|
label="description"
|