@umbraco-cms/backoffice 14.0.0--preview004-7c68c6a6 → 14.0.0--preview004-3aedfe8e
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/custom-elements.json +12 -3
- package/dist-cms/libs/context-api/consume/context-consumer.d.ts +9 -2
- package/dist-cms/libs/context-api/consume/context-consumer.js +16 -7
- package/dist-cms/libs/context-api/consume/context-request.event.d.ts +5 -4
- package/dist-cms/libs/context-api/consume/context-request.event.js +2 -1
- package/dist-cms/libs/context-api/provide/context-provider.d.ts +3 -2
- package/dist-cms/libs/context-api/provide/context-provider.js +7 -4
- package/dist-cms/libs/context-api/token/context-token.d.ts +17 -3
- package/dist-cms/libs/context-api/token/context-token.js +18 -4
- package/dist-cms/packages/core/collection/components/collection-view-bundle.element.d.ts +2 -2
- package/dist-cms/packages/core/collection/components/collection-view-bundle.element.js +26 -25
- package/dist-cms/packages/core/components/index.d.ts +1 -0
- package/dist-cms/packages/core/components/index.js +1 -0
- package/dist-cms/packages/core/components/popover-layout/index.d.ts +2 -0
- package/dist-cms/packages/core/components/popover-layout/index.js +2 -0
- package/dist-cms/packages/core/components/popover-layout/popover-layout.element.d.ts +10 -0
- package/dist-cms/packages/core/components/popover-layout/popover-layout.element.js +33 -0
- package/dist-cms/packages/core/data-type/variant-context/data-type-variant-context.token.d.ts +3 -3
- package/dist-cms/packages/core/data-type/variant-context/data-type-variant-context.token.js +3 -3
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace.context.d.ts +9 -9
- package/dist-cms/packages/core/data-type/workspace/data-type-workspace.context.js +1 -1
- package/dist-cms/packages/core/workspace/variant-context/nameable-variant-context.token.d.ts +3 -3
- package/dist-cms/packages/core/workspace/variant-context/nameable-variant-context.token.js +2 -2
- package/dist-cms/packages/core/workspace/variant-context/variant-context.token.d.ts +2 -2
- package/dist-cms/packages/core/workspace/variant-context/variant-context.token.js +2 -2
- package/dist-cms/packages/core/workspace/workspace-context/variant-workspace-context.token.js +1 -1
- package/dist-cms/packages/core/workspace/workspace-context/workspace-context.interface.d.ts +2 -1
- package/dist-cms/packages/dictionary/dictionary/workspace/dictionary-workspace.context.d.ts +5 -5
- package/dist-cms/packages/dictionary/dictionary/workspace/dictionary-workspace.context.js +2 -2
- package/dist-cms/packages/documents/document-types/workspace/document-type-workspace-editor.element.js +2 -2
- package/dist-cms/packages/documents/document-types/workspace/document-type-workspace.context.js +1 -1
- package/dist-cms/packages/documents/documents/variant-context/document-variant-context.token.js +1 -1
- package/dist-cms/packages/documents/documents/workspace/document-workspace.context.js +1 -3
- package/dist-cms/packages/documents/documents/workspace/document-workspace.element.js +1 -4
- package/dist-cms/packages/media/media/workspace/manifests.js +2 -1
- package/dist-cms/packages/media/media/workspace/media-workspace.context.d.ts +3 -1
- package/dist-cms/packages/media/media/workspace/media-workspace.context.js +2 -1
- package/dist-cms/packages/media/media/workspace/media-workspace.element.d.ts +2 -1
- package/dist-cms/packages/media/media/workspace/media-workspace.element.js +29 -9
- package/dist-cms/packages/media/media-types/workspace/media-type-workspace.context.d.ts +8 -8
- package/dist-cms/packages/media/media-types/workspace/media-type-workspace.context.js +2 -2
- package/dist-cms/packages/members/member-groups/workspace/member-group-workspace.context.d.ts +2 -2
- package/dist-cms/packages/members/member-groups/workspace/member-group-workspace.context.js +1 -1
- package/dist-cms/packages/members/member-types/workspace/member-type-workspace.context.d.ts +2 -2
- package/dist-cms/packages/members/member-types/workspace/member-type-workspace.context.js +2 -2
- package/dist-cms/packages/members/members/workspace/member-workspace.context.d.ts +1 -1
- package/dist-cms/packages/members/members/workspace/member-workspace.context.js +1 -1
- package/dist-cms/packages/settings/languages/workspace/language/language-workspace.context.d.ts +4 -4
- package/dist-cms/packages/settings/languages/workspace/language/language-workspace.context.js +2 -2
- package/dist-cms/packages/settings/relation-types/workspace/relation-type-workspace.context.d.ts +5 -5
- package/dist-cms/packages/settings/relation-types/workspace/relation-type-workspace.context.js +2 -2
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.context.d.ts +7 -7
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.context.js +1 -1
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.context.d.ts +10 -10
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.context.js +1 -1
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.element.js +3 -3
- package/dist-cms/packages/templating/templates/workspace/template-workspace.context.js +1 -1
- package/dist-cms/packages/templating/templates/workspace/template-workspace.element.d.ts +0 -1
- package/dist-cms/packages/templating/templates/workspace/template-workspace.element.js +0 -3
- package/dist-cms/packages/templating/utils.d.ts +0 -2
- package/dist-cms/packages/templating/utils.js +2 -6
- package/dist-cms/packages/user/user/collection/user-collection-header.element.js +51 -40
- package/dist-cms/packages/user/user/workspace/user-workspace.context.js +1 -1
- package/dist-cms/packages/user/user-group/workspace/user-group-workspace.context.js +2 -2
- package/dist-cms/shared/utils/diff.type.d.ts +2 -2
- package/dist-cms/shared/utils/index.d.ts +3 -1
- package/dist-cms/shared/utils/index.js +3 -1
- package/dist-cms/shared/utils/path-decode.function.d.ts +1 -0
- package/dist-cms/shared/utils/path-decode.function.js +1 -0
- package/dist-cms/shared/utils/path-encode.function.d.ts +1 -0
- package/dist-cms/shared/utils/path-encode.function.js +1 -0
- package/dist-cms/shared/utils/umbraco-path.function.js +1 -0
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +7 -2
- package/package.json +1 -1
|
@@ -1939,6 +1939,17 @@
|
|
|
1939
1939
|
}
|
|
1940
1940
|
]
|
|
1941
1941
|
},
|
|
1942
|
+
{
|
|
1943
|
+
"name": "umb-popover-layout",
|
|
1944
|
+
"path": "./../src/packages/core/components/popover-layout/popover-layout.element.ts",
|
|
1945
|
+
"properties": [
|
|
1946
|
+
{
|
|
1947
|
+
"name": "styles",
|
|
1948
|
+
"type": "array",
|
|
1949
|
+
"default": "[\"UmbTextStyles\",null]"
|
|
1950
|
+
}
|
|
1951
|
+
]
|
|
1952
|
+
},
|
|
1942
1953
|
{
|
|
1943
1954
|
"name": "umb-property-editor-config",
|
|
1944
1955
|
"path": "./../src/packages/core/components/property-editor-config/property-editor-config.element.ts",
|
|
@@ -7000,9 +7011,7 @@
|
|
|
7000
7011
|
"path": "./../src/packages/media/media/workspace/media-workspace.element.ts",
|
|
7001
7012
|
"properties": [
|
|
7002
7013
|
{
|
|
7003
|
-
"name": "
|
|
7004
|
-
"type": "\"Umb.Workspace.Media\"",
|
|
7005
|
-
"default": "\"Umb.Workspace.Media\""
|
|
7014
|
+
"name": "manifest"
|
|
7006
7015
|
},
|
|
7007
7016
|
{
|
|
7008
7017
|
"name": "styles",
|
|
@@ -11,16 +11,23 @@ export declare class UmbContextConsumer<BaseType = unknown, ResultType extends B
|
|
|
11
11
|
/**
|
|
12
12
|
* Creates an instance of UmbContextConsumer.
|
|
13
13
|
* @param {EventTarget} hostElement
|
|
14
|
-
* @param {string}
|
|
14
|
+
* @param {string} contextIdentifier
|
|
15
15
|
* @param {UmbContextCallback} callback
|
|
16
16
|
* @memberof UmbContextConsumer
|
|
17
17
|
*/
|
|
18
|
-
constructor(hostElement: EventTarget,
|
|
18
|
+
constructor(hostElement: EventTarget, contextIdentifier: string | UmbContextToken<BaseType, ResultType>, callback?: UmbContextCallback<ResultType>);
|
|
19
19
|
protected _onResponse: (instance: BaseType) => boolean;
|
|
20
20
|
protected setInstance(instance: ResultType): void;
|
|
21
|
+
/**
|
|
22
|
+
* @public
|
|
23
|
+
* @memberof UmbContextConsumer
|
|
24
|
+
* @description Get the context as a promise.
|
|
25
|
+
*/
|
|
21
26
|
asPromise(): Promise<ResultType>;
|
|
22
27
|
/**
|
|
28
|
+
* @public
|
|
23
29
|
* @memberof UmbContextConsumer
|
|
30
|
+
* @description Request the context from the host element.
|
|
24
31
|
*/
|
|
25
32
|
request(): void;
|
|
26
33
|
hostConnected(): void;
|
|
@@ -17,19 +17,20 @@ export class UmbContextConsumer {
|
|
|
17
17
|
return this.#instance;
|
|
18
18
|
}
|
|
19
19
|
#contextAlias;
|
|
20
|
+
#apiAlias;
|
|
20
21
|
#discriminator;
|
|
21
22
|
/**
|
|
22
23
|
* Creates an instance of UmbContextConsumer.
|
|
23
24
|
* @param {EventTarget} hostElement
|
|
24
|
-
* @param {string}
|
|
25
|
+
* @param {string} contextIdentifier
|
|
25
26
|
* @param {UmbContextCallback} callback
|
|
26
27
|
* @memberof UmbContextConsumer
|
|
27
28
|
*/
|
|
28
|
-
constructor(hostElement,
|
|
29
|
+
constructor(hostElement, contextIdentifier, callback) {
|
|
29
30
|
this.hostElement = hostElement;
|
|
30
31
|
this._onResponse = (instance) => {
|
|
31
32
|
if (this.#instance === instance) {
|
|
32
|
-
return
|
|
33
|
+
return true;
|
|
33
34
|
}
|
|
34
35
|
if (this.#discriminator) {
|
|
35
36
|
// Notice if discriminator returns false, we do not want to setInstance.
|
|
@@ -52,9 +53,11 @@ export class UmbContextConsumer {
|
|
|
52
53
|
this.request();
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
|
-
|
|
56
|
+
const idSplit = contextIdentifier.toString().split('#');
|
|
57
|
+
this.#contextAlias = idSplit[0];
|
|
58
|
+
this.#apiAlias = idSplit[1] ?? 'default';
|
|
56
59
|
this.#callback = callback;
|
|
57
|
-
this.#discriminator =
|
|
60
|
+
this.#discriminator = contextIdentifier.getDiscriminator?.();
|
|
58
61
|
}
|
|
59
62
|
setInstance(instance) {
|
|
60
63
|
this.#instance = instance;
|
|
@@ -64,6 +67,11 @@ export class UmbContextConsumer {
|
|
|
64
67
|
this.#promise = undefined;
|
|
65
68
|
}
|
|
66
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* @public
|
|
72
|
+
* @memberof UmbContextConsumer
|
|
73
|
+
* @description Get the context as a promise.
|
|
74
|
+
*/
|
|
67
75
|
asPromise() {
|
|
68
76
|
return (this.#promise ??
|
|
69
77
|
(this.#promise = new Promise((resolve) => {
|
|
@@ -71,10 +79,12 @@ export class UmbContextConsumer {
|
|
|
71
79
|
})));
|
|
72
80
|
}
|
|
73
81
|
/**
|
|
82
|
+
* @public
|
|
74
83
|
* @memberof UmbContextConsumer
|
|
84
|
+
* @description Request the context from the host element.
|
|
75
85
|
*/
|
|
76
86
|
request() {
|
|
77
|
-
const event = new UmbContextRequestEventImplementation(this.#contextAlias, this._onResponse);
|
|
87
|
+
const event = new UmbContextRequestEventImplementation(this.#contextAlias, this.#apiAlias, this._onResponse);
|
|
78
88
|
this.hostElement.dispatchEvent(event);
|
|
79
89
|
}
|
|
80
90
|
hostConnected() {
|
|
@@ -107,7 +117,6 @@ export class UmbContextConsumer {
|
|
|
107
117
|
}
|
|
108
118
|
}
|
|
109
119
|
*/
|
|
110
|
-
// TODO: Test destroy scenarios:
|
|
111
120
|
destroy() {
|
|
112
121
|
this.hostDisconnected();
|
|
113
122
|
this.#callback = undefined;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { UmbContextToken } from '../token/context-token.js';
|
|
2
1
|
export declare const UMB_CONTENT_REQUEST_EVENT_TYPE = "umb:context-request";
|
|
3
2
|
export declare const UMB_DEBUG_CONTEXT_EVENT_TYPE = "umb:debug-contexts";
|
|
4
3
|
export type UmbContextCallback<T> = (instance: T) => void;
|
|
@@ -7,7 +6,8 @@ export type UmbContextCallback<T> = (instance: T) => void;
|
|
|
7
6
|
* @interface UmbContextRequestEvent
|
|
8
7
|
*/
|
|
9
8
|
export interface UmbContextRequestEvent<ResultType = unknown> extends Event {
|
|
10
|
-
readonly contextAlias: string
|
|
9
|
+
readonly contextAlias: string;
|
|
10
|
+
readonly apiAlias: string;
|
|
11
11
|
readonly callback: (context: ResultType) => boolean;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
@@ -17,9 +17,10 @@ export interface UmbContextRequestEvent<ResultType = unknown> extends Event {
|
|
|
17
17
|
* @implements {UmbContextRequestEvent}
|
|
18
18
|
*/
|
|
19
19
|
export declare class UmbContextRequestEventImplementation<ResultType = unknown> extends Event implements UmbContextRequestEvent<ResultType> {
|
|
20
|
-
readonly contextAlias: string
|
|
20
|
+
readonly contextAlias: string;
|
|
21
|
+
readonly apiAlias: string;
|
|
21
22
|
readonly callback: (context: ResultType) => boolean;
|
|
22
|
-
constructor(contextAlias: string
|
|
23
|
+
constructor(contextAlias: string, apiAlias: string, callback: (context: ResultType) => boolean);
|
|
23
24
|
}
|
|
24
25
|
export declare class UmbContextDebugRequest extends Event {
|
|
25
26
|
readonly callback: any;
|
|
@@ -7,9 +7,10 @@ export const UMB_DEBUG_CONTEXT_EVENT_TYPE = 'umb:debug-contexts';
|
|
|
7
7
|
* @implements {UmbContextRequestEvent}
|
|
8
8
|
*/
|
|
9
9
|
export class UmbContextRequestEventImplementation extends Event {
|
|
10
|
-
constructor(contextAlias, callback) {
|
|
10
|
+
constructor(contextAlias, apiAlias, callback) {
|
|
11
11
|
super(UMB_CONTENT_REQUEST_EVENT_TYPE, { bubbles: true, composed: true, cancelable: true });
|
|
12
12
|
this.contextAlias = contextAlias;
|
|
13
|
+
this.apiAlias = apiAlias;
|
|
13
14
|
this.callback = callback;
|
|
14
15
|
}
|
|
15
16
|
}
|
|
@@ -7,6 +7,7 @@ export declare class UmbContextProvider<BaseType = unknown, ResultType extends B
|
|
|
7
7
|
#private;
|
|
8
8
|
protected hostElement: EventTarget;
|
|
9
9
|
protected _contextAlias: string;
|
|
10
|
+
protected _apiAlias: string;
|
|
10
11
|
/**
|
|
11
12
|
* Method to enable comparing the context providers by the instance they provide.
|
|
12
13
|
* Note this method should have a unique name for the provider controller, for it not to be confused with a consumer.
|
|
@@ -16,11 +17,11 @@ export declare class UmbContextProvider<BaseType = unknown, ResultType extends B
|
|
|
16
17
|
/**
|
|
17
18
|
* Creates an instance of UmbContextProvider.
|
|
18
19
|
* @param {EventTarget} host
|
|
19
|
-
* @param {string}
|
|
20
|
+
* @param {string | UmbContextToken} contextIdentifier
|
|
20
21
|
* @param {*} instance
|
|
21
22
|
* @memberof UmbContextProvider
|
|
22
23
|
*/
|
|
23
|
-
constructor(hostElement: EventTarget,
|
|
24
|
+
constructor(hostElement: EventTarget, contextIdentifier: string | UmbContextToken<BaseType, ResultType>, instance: ResultType);
|
|
24
25
|
/**
|
|
25
26
|
* @memberof UmbContextProvider
|
|
26
27
|
*/
|
|
@@ -19,11 +19,11 @@ export class UmbContextProvider {
|
|
|
19
19
|
/**
|
|
20
20
|
* Creates an instance of UmbContextProvider.
|
|
21
21
|
* @param {EventTarget} host
|
|
22
|
-
* @param {string}
|
|
22
|
+
* @param {string | UmbContextToken} contextIdentifier
|
|
23
23
|
* @param {*} instance
|
|
24
24
|
* @memberof UmbContextProvider
|
|
25
25
|
*/
|
|
26
|
-
constructor(hostElement,
|
|
26
|
+
constructor(hostElement, contextIdentifier, instance) {
|
|
27
27
|
/**
|
|
28
28
|
* @private
|
|
29
29
|
* @param {UmbContextRequestEvent} event
|
|
@@ -34,7 +34,8 @@ export class UmbContextProvider {
|
|
|
34
34
|
return;
|
|
35
35
|
// Since the alias matches, we will stop it from bubbling further up. But we still allow it to ask the other Contexts of the element. Hence not calling `event.stopImmediatePropagation();`
|
|
36
36
|
event.stopPropagation();
|
|
37
|
-
|
|
37
|
+
// First and importantly, check that the apiAlias matches and then call the callback. If that returns true then we can stop the event completely.
|
|
38
|
+
if (this._apiAlias === event.apiAlias && event.callback(this.#instance)) {
|
|
38
39
|
// Make sure the event not hits any more Contexts as we have found a match.
|
|
39
40
|
event.stopImmediatePropagation();
|
|
40
41
|
}
|
|
@@ -52,7 +53,9 @@ export class UmbContextProvider {
|
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
55
|
this.hostElement = hostElement;
|
|
55
|
-
|
|
56
|
+
const idSplit = contextIdentifier.toString().split('#');
|
|
57
|
+
this._contextAlias = idSplit[0];
|
|
58
|
+
this._apiAlias = idSplit[1] ?? 'default';
|
|
56
59
|
this.#instance = instance;
|
|
57
60
|
}
|
|
58
61
|
/**
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
export type UmbContextDiscriminator<BaseType, DiscriminatorResult extends BaseType> = (instance: BaseType) => instance is DiscriminatorResult;
|
|
2
|
+
/**
|
|
3
|
+
* @export
|
|
4
|
+
* @class UmbContextToken
|
|
5
|
+
* @template BaseType - A generic type of the API before decimated.
|
|
6
|
+
* @template ResultType - A concrete type of the API after decimation, use this when you apply a discriminator method. Note this is optional and defaults to the BaseType.
|
|
7
|
+
*/
|
|
2
8
|
export declare class UmbContextToken<BaseType = unknown, ResultType extends BaseType = BaseType> {
|
|
3
9
|
#private;
|
|
4
|
-
protected
|
|
10
|
+
protected contextAlias: string;
|
|
11
|
+
protected apiAlias: string;
|
|
5
12
|
/**
|
|
6
13
|
* Get the type of the token
|
|
7
14
|
*
|
|
@@ -13,9 +20,16 @@ export declare class UmbContextToken<BaseType = unknown, ResultType extends Base
|
|
|
13
20
|
*/
|
|
14
21
|
readonly TYPE: ResultType;
|
|
15
22
|
/**
|
|
16
|
-
* @param
|
|
23
|
+
* @param contextAlias Unique identifier for the context
|
|
24
|
+
* @param apiAlias Unique identifier for the api
|
|
25
|
+
* @param discriminator A discriminator that will be used to discriminate the API — testing if the API lives up to a certain requirement. If the API does not meet the requirement then the consumer will not receive this API.
|
|
26
|
+
*/
|
|
27
|
+
constructor(contextAlias: string, apiAlias?: string, discriminator?: UmbContextDiscriminator<BaseType, ResultType>);
|
|
28
|
+
/**
|
|
29
|
+
* Get the discriminator method for the token
|
|
30
|
+
*
|
|
31
|
+
* @returns the discriminator method
|
|
17
32
|
*/
|
|
18
|
-
constructor(alias: string, discriminator?: UmbContextDiscriminator<BaseType, ResultType>);
|
|
19
33
|
getDiscriminator(): UmbContextDiscriminator<BaseType, ResultType> | undefined;
|
|
20
34
|
/**
|
|
21
35
|
* This method must always return the unique alias of the token since that
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @export
|
|
3
|
+
* @class UmbContextToken
|
|
4
|
+
* @template BaseType - A generic type of the API before decimated.
|
|
5
|
+
* @template ResultType - A concrete type of the API after decimation, use this when you apply a discriminator method. Note this is optional and defaults to the BaseType.
|
|
6
|
+
*/
|
|
1
7
|
export class UmbContextToken {
|
|
2
8
|
#discriminator;
|
|
3
9
|
/**
|
|
4
|
-
* @param
|
|
10
|
+
* @param contextAlias Unique identifier for the context
|
|
11
|
+
* @param apiAlias Unique identifier for the api
|
|
12
|
+
* @param discriminator A discriminator that will be used to discriminate the API — testing if the API lives up to a certain requirement. If the API does not meet the requirement then the consumer will not receive this API.
|
|
5
13
|
*/
|
|
6
|
-
constructor(
|
|
7
|
-
this.
|
|
14
|
+
constructor(contextAlias, apiAlias = 'default', discriminator) {
|
|
15
|
+
this.contextAlias = contextAlias;
|
|
16
|
+
this.apiAlias = apiAlias;
|
|
8
17
|
/**
|
|
9
18
|
* Get the type of the token
|
|
10
19
|
*
|
|
@@ -17,6 +26,11 @@ export class UmbContextToken {
|
|
|
17
26
|
this.TYPE = undefined;
|
|
18
27
|
this.#discriminator = discriminator;
|
|
19
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the discriminator method for the token
|
|
31
|
+
*
|
|
32
|
+
* @returns the discriminator method
|
|
33
|
+
*/
|
|
20
34
|
getDiscriminator() {
|
|
21
35
|
return this.#discriminator;
|
|
22
36
|
}
|
|
@@ -27,6 +41,6 @@ export class UmbContextToken {
|
|
|
27
41
|
* @returns the unique alias of the token
|
|
28
42
|
*/
|
|
29
43
|
toString() {
|
|
30
|
-
return this.
|
|
44
|
+
return this.contextAlias + '#' + this.apiAlias;
|
|
31
45
|
}
|
|
32
46
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ManifestCollectionView } from '../../extension-registry/models/collection-view.model.js';
|
|
2
|
+
import { nothing } from '../../../../external/lit/index.js';
|
|
2
3
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
3
4
|
export declare class UmbCollectionViewBundleElement extends UmbLitElement {
|
|
4
5
|
#private;
|
|
5
6
|
_views: Array<ManifestCollectionView>;
|
|
6
7
|
_currentView?: ManifestCollectionView;
|
|
7
|
-
private _isOpen;
|
|
8
8
|
private _collectionRootPathname;
|
|
9
9
|
constructor();
|
|
10
|
-
render(): import("lit-html").TemplateResult<1
|
|
10
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
11
11
|
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
12
12
|
}
|
|
13
13
|
declare global {
|
|
@@ -13,7 +13,6 @@ export let UmbCollectionViewBundleElement = class UmbCollectionViewBundleElement
|
|
|
13
13
|
constructor() {
|
|
14
14
|
super();
|
|
15
15
|
this._views = [];
|
|
16
|
-
this._isOpen = false;
|
|
17
16
|
this._collectionRootPathname = '';
|
|
18
17
|
this.consumeContext(UMB_COLLECTION_CONTEXT, (context) => {
|
|
19
18
|
this.#collectionContext = context;
|
|
@@ -26,6 +25,7 @@ export let UmbCollectionViewBundleElement = class UmbCollectionViewBundleElement
|
|
|
26
25
|
}
|
|
27
26
|
#observeCurrentView() {
|
|
28
27
|
this.observe(this.#collectionContext.currentView, (view) => {
|
|
28
|
+
//TODO: This is not called when the view is changed
|
|
29
29
|
this._currentView = view;
|
|
30
30
|
}, 'umbCurrentCollectionViewObserver');
|
|
31
31
|
}
|
|
@@ -34,39 +34,43 @@ export let UmbCollectionViewBundleElement = class UmbCollectionViewBundleElement
|
|
|
34
34
|
this._views = views;
|
|
35
35
|
}, 'umbCollectionViewsObserver');
|
|
36
36
|
}
|
|
37
|
-
#toggleDropdown() {
|
|
38
|
-
this._isOpen = !this._isOpen;
|
|
39
|
-
}
|
|
40
|
-
#closeDropdown() {
|
|
41
|
-
this._isOpen = false;
|
|
42
|
-
}
|
|
43
37
|
render() {
|
|
44
|
-
return html `${this.#renderLayoutButton()}`;
|
|
45
|
-
}
|
|
46
|
-
#renderLayoutButton() {
|
|
47
38
|
if (!this._currentView)
|
|
48
39
|
return nothing;
|
|
49
|
-
return html `
|
|
50
|
-
<uui-button
|
|
51
|
-
|
|
52
|
-
>
|
|
53
|
-
<
|
|
54
|
-
|
|
40
|
+
return html `
|
|
41
|
+
<uui-button compact popovertarget="collection-view-bundle-popover" label="status">
|
|
42
|
+
${this.#renderItemDisplay(this._currentView)}
|
|
43
|
+
</uui-button>
|
|
44
|
+
<uui-popover-container id="collection-view-bundle-popover" popover placement="bottom">
|
|
45
|
+
<umb-popover-layout>
|
|
46
|
+
<div class="filter-dropdown">${this._views.map((view) => this.#renderItem(view))}</div>
|
|
47
|
+
</umb-popover-layout>
|
|
48
|
+
</uui-popover-container>
|
|
49
|
+
`;
|
|
55
50
|
}
|
|
56
51
|
#renderItem(view) {
|
|
57
|
-
return html
|
|
52
|
+
return html `
|
|
53
|
+
<uui-button compact href="${this._collectionRootPathname}/${view.meta.pathName}">
|
|
54
|
+
${this.#renderItemDisplay(view)} <span class="label">${view.meta.label}</span>
|
|
55
|
+
</uui-button>
|
|
56
|
+
`;
|
|
58
57
|
}
|
|
59
58
|
#renderItemDisplay(view) {
|
|
60
|
-
return html `<
|
|
59
|
+
return html `<uui-icon name=${view.meta.icon}></uui-icon>`;
|
|
61
60
|
}
|
|
62
61
|
static { this.styles = [
|
|
63
62
|
UmbTextStyles,
|
|
64
63
|
css `
|
|
65
|
-
|
|
64
|
+
:host {
|
|
65
|
+
--uui-button-content-align: left;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
.label {
|
|
68
|
+
margin-left: var(--uui-size-space-1);
|
|
69
|
+
}
|
|
70
|
+
.filter-dropdown {
|
|
71
|
+
display: flex;
|
|
72
|
+
gap: var(--uui-size-space-3);
|
|
73
|
+
flex-direction: column;
|
|
70
74
|
}
|
|
71
75
|
`,
|
|
72
76
|
]; }
|
|
@@ -77,9 +81,6 @@ __decorate([
|
|
|
77
81
|
__decorate([
|
|
78
82
|
state()
|
|
79
83
|
], UmbCollectionViewBundleElement.prototype, "_currentView", void 0);
|
|
80
|
-
__decorate([
|
|
81
|
-
state()
|
|
82
|
-
], UmbCollectionViewBundleElement.prototype, "_isOpen", void 0);
|
|
83
84
|
__decorate([
|
|
84
85
|
state()
|
|
85
86
|
], UmbCollectionViewBundleElement.prototype, "_collectionRootPathname", void 0);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
2
|
+
export declare class UmbPopoverLayoutElement extends UmbLitElement {
|
|
3
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
4
|
+
static styles: import("@lit/reactive-element/css-tag").CSSResult[];
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'umb-popover-layout': UmbPopoverLayoutElement;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { UmbTextStyles } from '../../../../shared/style/index.js';
|
|
8
|
+
import { css, html, customElement } from '../../../../external/lit/index.js';
|
|
9
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
10
|
+
// TODO: maybe move this to UI Library.
|
|
11
|
+
// TODO: add overwrites for customization.
|
|
12
|
+
export let UmbPopoverLayoutElement = class UmbPopoverLayoutElement extends UmbLitElement {
|
|
13
|
+
render() {
|
|
14
|
+
return html `<slot></slot>`;
|
|
15
|
+
}
|
|
16
|
+
static { this.styles = [
|
|
17
|
+
UmbTextStyles,
|
|
18
|
+
css `
|
|
19
|
+
:host {
|
|
20
|
+
background-color: var(--uui-color-surface);
|
|
21
|
+
display: block;
|
|
22
|
+
border: 1px solid var(--uui-color-border);
|
|
23
|
+
border-radius: var(--uui-border-radius);
|
|
24
|
+
box-shadow: var(--uui-shadow-depth-3);
|
|
25
|
+
padding: var(--uui-size-space-3);
|
|
26
|
+
overflow: clip;
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
]; }
|
|
30
|
+
};
|
|
31
|
+
UmbPopoverLayoutElement = __decorate([
|
|
32
|
+
customElement('umb-popover-layout')
|
|
33
|
+
], UmbPopoverLayoutElement);
|
package/dist-cms/packages/core/data-type/variant-context/data-type-variant-context.token.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UmbDataTypeVariantContext } from
|
|
2
|
-
import { UmbVariantContext } from
|
|
3
|
-
import { UmbContextToken } from
|
|
1
|
+
import type { UmbDataTypeVariantContext } from './data-type-variant-context.js';
|
|
2
|
+
import { UmbVariantContext } from '../../workspace/index.js';
|
|
3
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
4
4
|
export declare const isDataTypeVariantContext: (context: UmbVariantContext) => context is UmbDataTypeVariantContext;
|
|
5
5
|
export declare const UMB_DATA_TYPE_VARIANT_CONTEXT: UmbContextToken<UmbVariantContext, UmbDataTypeVariantContext>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { UmbContextToken } from
|
|
2
|
-
export const isDataTypeVariantContext = (context) =>
|
|
3
|
-
export const UMB_DATA_TYPE_VARIANT_CONTEXT = new UmbContextToken(
|
|
1
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
2
|
+
export const isDataTypeVariantContext = (context) => 'properties' in context && context.getType() === 'data-type';
|
|
3
|
+
export const UMB_DATA_TYPE_VARIANT_CONTEXT = new UmbContextToken('UmbVariantContext', undefined, isDataTypeVariantContext);
|
|
@@ -8,12 +8,12 @@ import { Observable } from '../../../../external/rxjs/index.js';
|
|
|
8
8
|
import { PropertyEditorConfigDefaultData, PropertyEditorConfigProperty } from '../../extension-registry/index.js';
|
|
9
9
|
export declare class UmbDataTypeWorkspaceContext extends UmbEditableWorkspaceContextBase<UmbDataTypeDetailRepository, DataTypeResponseModel> implements UmbInvariantableWorkspaceContextInterface<DataTypeResponseModel | undefined> {
|
|
10
10
|
#private;
|
|
11
|
-
data: Observable<DataTypeResponseModel | undefined>;
|
|
12
|
-
name: Observable<string | undefined>;
|
|
13
|
-
id: Observable<string | undefined>;
|
|
14
|
-
propertyEditorUiAlias: Observable<string | null | undefined>;
|
|
15
|
-
propertyEditorSchemaAlias: Observable<string | undefined>;
|
|
16
|
-
properties: Observable<Array<PropertyEditorConfigProperty> | undefined>;
|
|
11
|
+
readonly data: Observable<DataTypeResponseModel | undefined>;
|
|
12
|
+
readonly name: Observable<string | undefined>;
|
|
13
|
+
readonly id: Observable<string | undefined>;
|
|
14
|
+
readonly propertyEditorUiAlias: Observable<string | null | undefined>;
|
|
15
|
+
readonly propertyEditorSchemaAlias: Observable<string | undefined>;
|
|
16
|
+
readonly properties: Observable<Array<PropertyEditorConfigProperty> | undefined>;
|
|
17
17
|
private _propertyEditorSchemaConfigDefaultData;
|
|
18
18
|
private _propertyEditorUISettingsDefaultData;
|
|
19
19
|
private _propertyEditorSchemaConfigProperties;
|
|
@@ -21,9 +21,9 @@ export declare class UmbDataTypeWorkspaceContext extends UmbEditableWorkspaceCon
|
|
|
21
21
|
private _propertyEditorSchemaConfigDefaultUIAlias;
|
|
22
22
|
private _configDefaultData?;
|
|
23
23
|
private _propertyEditorUISettingsSchemaAlias?;
|
|
24
|
-
defaults: Observable<PropertyEditorConfigDefaultData[]>;
|
|
25
|
-
propertyEditorUiIcon: Observable<string | null>;
|
|
26
|
-
propertyEditorUiName: Observable<string | null>;
|
|
24
|
+
readonly defaults: Observable<PropertyEditorConfigDefaultData[]>;
|
|
25
|
+
readonly propertyEditorUiIcon: Observable<string | null>;
|
|
26
|
+
readonly propertyEditorUiName: Observable<string | null>;
|
|
27
27
|
constructor(host: UmbControllerHostElement);
|
|
28
28
|
private _mergeConfigProperties;
|
|
29
29
|
private _mergeConfigDefaultData;
|
|
@@ -194,4 +194,4 @@ export class UmbDataTypeWorkspaceContext extends UmbEditableWorkspaceContextBase
|
|
|
194
194
|
this.#data.destroy();
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
export const UMB_DATA_TYPE_WORKSPACE_CONTEXT = new UmbContextToken('UmbWorkspaceContext', (context) => context.getEntityType?.() === 'data-type');
|
|
197
|
+
export const UMB_DATA_TYPE_WORKSPACE_CONTEXT = new UmbContextToken('UmbWorkspaceContext', undefined, (context) => context.getEntityType?.() === 'data-type');
|
package/dist-cms/packages/core/workspace/variant-context/nameable-variant-context.token.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type UmbVariantContext } from
|
|
2
|
-
import { UmbNameableVariantContext } from
|
|
3
|
-
import { UmbContextToken } from
|
|
1
|
+
import { type UmbVariantContext } from './variant-context.interface.js';
|
|
2
|
+
import { UmbNameableVariantContext } from './nameable-variant-context.interface.js';
|
|
3
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
4
4
|
export declare const isNameablePropertySetContext: (context: UmbVariantContext) => context is UmbNameableVariantContext;
|
|
5
5
|
export declare const UMB_NAMEABLE_VARIANT_CONTEXT: UmbContextToken<UmbVariantContext, UmbNameableVariantContext>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { UmbContextToken } from
|
|
1
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
2
2
|
export const isNameablePropertySetContext = (context) => 'setName' in context;
|
|
3
|
-
export const UMB_NAMEABLE_VARIANT_CONTEXT = new UmbContextToken(
|
|
3
|
+
export const UMB_NAMEABLE_VARIANT_CONTEXT = new UmbContextToken('UmbVariantContext', undefined, isNameablePropertySetContext);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type UmbVariantContext } from
|
|
2
|
-
import { UmbContextToken } from
|
|
1
|
+
import { type UmbVariantContext } from './variant-context.interface.js';
|
|
2
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
3
3
|
export declare const UMB_VARIANT_CONTEXT: UmbContextToken<UmbVariantContext, UmbVariantContext>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UmbContextToken } from
|
|
2
|
-
export const UMB_VARIANT_CONTEXT = new UmbContextToken(
|
|
1
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
2
|
+
export const UMB_VARIANT_CONTEXT = new UmbContextToken('UmbVariantContext');
|
package/dist-cms/packages/core/workspace/workspace-context/variant-workspace-context.token.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
2
|
-
export const UMB_VARIANT_WORKSPACE_CONTEXT_TOKEN = new UmbContextToken('UmbWorkspaceContext', (context) => 'variants' in context);
|
|
2
|
+
export const UMB_VARIANT_WORKSPACE_CONTEXT_TOKEN = new UmbContextToken('UmbWorkspaceContext', undefined, (context) => 'variants' in context);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type { UmbApi } from '../../../../libs/extension-api/index.js';
|
|
2
|
+
export interface UmbWorkspaceContextInterface extends UmbApi {
|
|
2
3
|
readonly workspaceAlias: string;
|
|
3
4
|
getEntityType(): string;
|
|
4
5
|
getEntityId(): string | undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { UmbDictionaryRepository } from '../repository/dictionary.repository.js';
|
|
2
|
-
import { UmbSaveableWorkspaceContextInterface, UmbEditableWorkspaceContextBase } from '../../../core/workspace/index.js';
|
|
3
|
-
import { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
2
|
+
import { type UmbSaveableWorkspaceContextInterface, UmbEditableWorkspaceContextBase } from '../../../core/workspace/index.js';
|
|
3
|
+
import type { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
4
4
|
import { DictionaryItemResponseModel } from '../../../../external/backend-api/index.js';
|
|
5
5
|
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
6
6
|
export declare class UmbDictionaryWorkspaceContext extends UmbEditableWorkspaceContextBase<UmbDictionaryRepository, DictionaryItemResponseModel> implements UmbSaveableWorkspaceContextInterface<DictionaryItemResponseModel | undefined> {
|
|
7
7
|
#private;
|
|
8
|
-
data: import("rxjs").Observable<DictionaryItemResponseModel | undefined>;
|
|
9
|
-
name: import("rxjs").Observable<string | undefined>;
|
|
10
|
-
dictionary: import("rxjs").Observable<DictionaryItemResponseModel | undefined>;
|
|
8
|
+
readonly data: import("rxjs").Observable<DictionaryItemResponseModel | undefined>;
|
|
9
|
+
readonly name: import("rxjs").Observable<string | undefined>;
|
|
10
|
+
readonly dictionary: import("rxjs").Observable<DictionaryItemResponseModel | undefined>;
|
|
11
11
|
constructor(host: UmbControllerHostElement);
|
|
12
12
|
getData(): DictionaryItemResponseModel | undefined;
|
|
13
13
|
getEntityId(): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UmbDictionaryRepository } from '../repository/dictionary.repository.js';
|
|
2
|
-
import { UmbEditableWorkspaceContextBase } from '../../../core/workspace/index.js';
|
|
2
|
+
import { UmbEditableWorkspaceContextBase, } from '../../../core/workspace/index.js';
|
|
3
3
|
import { UmbObjectState } from '../../../../libs/observable-api/index.js';
|
|
4
4
|
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
5
5
|
export class UmbDictionaryWorkspaceContext extends UmbEditableWorkspaceContextBase {
|
|
@@ -74,4 +74,4 @@ export class UmbDictionaryWorkspaceContext extends UmbEditableWorkspaceContextBa
|
|
|
74
74
|
this.#data.destroy();
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
export const UMB_DICTIONARY_WORKSPACE_CONTEXT = new UmbContextToken('UmbWorkspaceContext', (context) => context.getEntityType?.() === 'dictionary-item');
|
|
77
|
+
export const UMB_DICTIONARY_WORKSPACE_CONTEXT = new UmbContextToken('UmbWorkspaceContext', undefined, (context) => context.getEntityType?.() === 'dictionary-item');
|