@umbraco-cms/backoffice 14.0.0--preview004-83eb6818 → 14.0.0--preview004-044c3492
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 +11 -0
- 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/templating/scripts/entity-actions/create/create-empty.action.js +4 -0
- package/dist-cms/packages/templating/scripts/workspace/script-workspace-edit.element.d.ts +0 -1
- package/dist-cms/packages/templating/scripts/workspace/script-workspace-edit.element.js +2 -7
- package/dist-cms/packages/templating/scripts/workspace/script-workspace.context.d.ts +1 -1
- package/dist-cms/packages/templating/scripts/workspace/script-workspace.context.js +12 -3
- package/dist-cms/packages/templating/scripts/workspace/script-workspace.element.js +6 -6
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace-editor.element.d.ts +0 -1
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace-editor.element.js +2 -13
- package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.context.js +5 -2
- package/dist-cms/packages/user/user/collection/user-collection-header.element.js +51 -40
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +8 -3
- 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",
|
|
@@ -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);
|
|
@@ -4,6 +4,10 @@ export class UmbCreateScriptAction extends UmbEntityActionBase {
|
|
|
4
4
|
super(host, repositoryAlias, unique);
|
|
5
5
|
}
|
|
6
6
|
async execute() {
|
|
7
|
+
if (this.unique !== null) {
|
|
8
|
+
// Note: %2F is a slash (/)
|
|
9
|
+
this.unique = this.unique.replace(/\//g, '%2F');
|
|
10
|
+
}
|
|
7
11
|
history.pushState(null, '', `section/settings/workspace/script/create/${this.unique ?? 'null'}`);
|
|
8
12
|
}
|
|
9
13
|
}
|
|
@@ -26,7 +26,6 @@ export let UmbScriptWorkspaceEditElement = class UmbScriptWorkspaceEditElement e
|
|
|
26
26
|
this.#name = '';
|
|
27
27
|
this._content = '';
|
|
28
28
|
this._path = '';
|
|
29
|
-
this._dirName = '';
|
|
30
29
|
this._ready = false;
|
|
31
30
|
this.#isNew = false;
|
|
32
31
|
this.inputQuery$ = new Subject();
|
|
@@ -42,8 +41,7 @@ export let UmbScriptWorkspaceEditElement = class UmbScriptWorkspaceEditElement e
|
|
|
42
41
|
this._content = content;
|
|
43
42
|
});
|
|
44
43
|
this.observe(this.#scriptsWorkspaceContext.path, (path) => {
|
|
45
|
-
this._path = path;
|
|
46
|
-
this._dirName = this._path?.substring(0, this._path?.lastIndexOf('\\'))?.replace(/\\/g, '/');
|
|
44
|
+
this._path = path?.replace(/\\/g, '/');
|
|
47
45
|
});
|
|
48
46
|
this.observe(this.#scriptsWorkspaceContext.isNew, (isNew) => {
|
|
49
47
|
this.#isNew = !!isNew;
|
|
@@ -81,7 +79,7 @@ export let UmbScriptWorkspaceEditElement = class UmbScriptWorkspaceEditElement e
|
|
|
81
79
|
.value=${this._name}
|
|
82
80
|
@input=${this.#onNameInput}
|
|
83
81
|
label="template name"></uui-input>
|
|
84
|
-
<small>Scripts/${this.
|
|
82
|
+
<small>Scripts/${this._path}</small>
|
|
85
83
|
</div>
|
|
86
84
|
<uui-box>
|
|
87
85
|
<!-- the div below in the header is to make the box display nicely with code editor -->
|
|
@@ -152,9 +150,6 @@ __decorate([
|
|
|
152
150
|
__decorate([
|
|
153
151
|
state()
|
|
154
152
|
], UmbScriptWorkspaceEditElement.prototype, "_path", void 0);
|
|
155
|
-
__decorate([
|
|
156
|
-
state()
|
|
157
|
-
], UmbScriptWorkspaceEditElement.prototype, "_dirName", void 0);
|
|
158
153
|
__decorate([
|
|
159
154
|
state()
|
|
160
155
|
], UmbScriptWorkspaceEditElement.prototype, "_ready", void 0);
|
|
@@ -16,7 +16,7 @@ export declare class UmbScriptWorkspaceContext extends UmbEditableWorkspaceConte
|
|
|
16
16
|
setContent(value: string): void;
|
|
17
17
|
load(entityKey: string): Promise<void>;
|
|
18
18
|
create(parentKey: string): Promise<void>;
|
|
19
|
-
getEntityId(): string
|
|
19
|
+
getEntityId(): string;
|
|
20
20
|
save(): Promise<void>;
|
|
21
21
|
destroy(): void;
|
|
22
22
|
getEntityType(): string;
|
|
@@ -52,7 +52,10 @@ export class UmbScriptWorkspaceContext extends UmbEditableWorkspaceContextBase {
|
|
|
52
52
|
this.setIsNew(true);
|
|
53
53
|
}
|
|
54
54
|
getEntityId() {
|
|
55
|
-
|
|
55
|
+
const path = this.getData()?.path?.replace(/\//g, '%2F');
|
|
56
|
+
const name = this.getData()?.name;
|
|
57
|
+
// Note: %2F is a slash (/)
|
|
58
|
+
return path && name ? `${path}%2F${name}` : name || '';
|
|
56
59
|
}
|
|
57
60
|
async save() {
|
|
58
61
|
const script = this.getData();
|
|
@@ -65,7 +68,10 @@ export class UmbScriptWorkspaceContext extends UmbEditableWorkspaceContextBase {
|
|
|
65
68
|
content: script.content,
|
|
66
69
|
parentPath: script.path + '/',
|
|
67
70
|
};
|
|
68
|
-
this.repository.create(createRequestBody);
|
|
71
|
+
const { error } = await this.repository.create(createRequestBody);
|
|
72
|
+
if (!error) {
|
|
73
|
+
this.setIsNew(false);
|
|
74
|
+
}
|
|
69
75
|
return Promise.resolve();
|
|
70
76
|
}
|
|
71
77
|
if (!script.path)
|
|
@@ -75,7 +81,10 @@ export class UmbScriptWorkspaceContext extends UmbEditableWorkspaceContextBase {
|
|
|
75
81
|
existingPath: script.path,
|
|
76
82
|
content: script.content,
|
|
77
83
|
};
|
|
78
|
-
this.repository.save(script.path, updateRequestBody);
|
|
84
|
+
const { error } = await this.repository.save(script.path, updateRequestBody);
|
|
85
|
+
if (!error) {
|
|
86
|
+
//TODO Update the URL to the new name
|
|
87
|
+
}
|
|
79
88
|
return Promise.resolve();
|
|
80
89
|
}
|
|
81
90
|
destroy() {
|
|
@@ -12,16 +12,16 @@ import { UmbWorkspaceIsNewRedirectController } from '../../../core/workspace/ind
|
|
|
12
12
|
export let UmbScriptWorkspaceElement = class UmbScriptWorkspaceElement extends UmbLitElement {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
|
-
this.#
|
|
15
|
+
this.#workspaceContext = new UmbScriptWorkspaceContext(this);
|
|
16
16
|
this._routes = [
|
|
17
17
|
{
|
|
18
18
|
path: 'create/:parentKey',
|
|
19
19
|
component: import('./script-workspace-edit.element.js'),
|
|
20
|
-
setup: async (
|
|
20
|
+
setup: async (_component, info) => {
|
|
21
21
|
const parentKey = info.match.params.parentKey;
|
|
22
22
|
const decodePath = decodeURIComponent(parentKey);
|
|
23
|
-
this.#
|
|
24
|
-
new UmbWorkspaceIsNewRedirectController(this, this.#
|
|
23
|
+
this.#workspaceContext.create(decodePath === 'null' ? '' : decodePath);
|
|
24
|
+
new UmbWorkspaceIsNewRedirectController(this, this.#workspaceContext, this.shadowRoot.querySelector('umb-router-slot'));
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -30,12 +30,12 @@ export let UmbScriptWorkspaceElement = class UmbScriptWorkspaceElement extends U
|
|
|
30
30
|
setup: (component, info) => {
|
|
31
31
|
const key = info.match.params.key;
|
|
32
32
|
const decodePath = decodeURIComponent(key).replace('-js', '.js');
|
|
33
|
-
this.#
|
|
33
|
+
this.#workspaceContext.load(decodePath);
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
];
|
|
37
37
|
}
|
|
38
|
-
#
|
|
38
|
+
#workspaceContext;
|
|
39
39
|
render() {
|
|
40
40
|
return html `<umb-router-slot .routes=${this._routes}></umb-router-slot>`;
|
|
41
41
|
}
|
package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace-editor.element.js
CHANGED
|
@@ -34,15 +34,7 @@ export let UmbStylesheetWorkspaceEditorElement = class UmbStylesheetWorkspaceEdi
|
|
|
34
34
|
#observeNameAndPath() {
|
|
35
35
|
if (!this.#workspaceContext)
|
|
36
36
|
return;
|
|
37
|
-
this.observe(this.#workspaceContext.path, (path) =>
|
|
38
|
-
this._path = path;
|
|
39
|
-
if (this._path?.includes('.css')) {
|
|
40
|
-
this._dirName = this._path?.substring(0, this._path?.lastIndexOf('\\') + 1)?.replace(/\\/g, '/');
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
this._dirName = path + '/';
|
|
44
|
-
}
|
|
45
|
-
}, '_observeStylesheetPath');
|
|
37
|
+
this.observe(this.#workspaceContext.path, (path) => (this._path = path?.replace(/\\/g, '/')), '_observeStylesheetPath');
|
|
46
38
|
this.observe(this.#workspaceContext.name, (name) => (this._name = name), '_observeStylesheetName');
|
|
47
39
|
}
|
|
48
40
|
#onNameChange(event) {
|
|
@@ -61,7 +53,7 @@ export let UmbStylesheetWorkspaceEditorElement = class UmbStylesheetWorkspaceEdi
|
|
|
61
53
|
.value=${this._name}
|
|
62
54
|
@input="${this.#onNameChange}">
|
|
63
55
|
</uui-input>
|
|
64
|
-
<small>/css/${this.
|
|
56
|
+
<small>/css/${this._path}</small>
|
|
65
57
|
</div>
|
|
66
58
|
|
|
67
59
|
<div slot="footer-info">
|
|
@@ -109,9 +101,6 @@ __decorate([
|
|
|
109
101
|
__decorate([
|
|
110
102
|
state()
|
|
111
103
|
], UmbStylesheetWorkspaceEditorElement.prototype, "_path", void 0);
|
|
112
|
-
__decorate([
|
|
113
|
-
state()
|
|
114
|
-
], UmbStylesheetWorkspaceEditorElement.prototype, "_dirName", void 0);
|
|
115
104
|
UmbStylesheetWorkspaceEditorElement = __decorate([
|
|
116
105
|
customElement('umb-stylesheet-workspace-editor')
|
|
117
106
|
], UmbStylesheetWorkspaceEditorElement);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UmbStylesheetRepository } from '../repository/stylesheet.repository.js';
|
|
2
|
-
import { UmbEditableWorkspaceContextBase } from '../../../core/workspace/index.js';
|
|
2
|
+
import { UmbEditableWorkspaceContextBase, } from '../../../core/workspace/index.js';
|
|
3
3
|
import { UmbArrayState, UmbBooleanState, UmbObjectState } from '../../../../libs/observable-api/index.js';
|
|
4
4
|
import { loadCodeEditor } from '../../code-editor/index.js';
|
|
5
5
|
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
@@ -132,7 +132,10 @@ export class UmbStylesheetWorkspaceContext extends UmbEditableWorkspaceContextBa
|
|
|
132
132
|
existingPath: stylesheet.path,
|
|
133
133
|
content: stylesheet.content,
|
|
134
134
|
};
|
|
135
|
-
this.repository.save(stylesheet.path, updateRequestBody);
|
|
135
|
+
const { error } = await this.repository.save(stylesheet.path, updateRequestBody);
|
|
136
|
+
if (!error) {
|
|
137
|
+
//TODO Update the URL to the new name
|
|
138
|
+
}
|
|
136
139
|
return Promise.resolve();
|
|
137
140
|
}
|
|
138
141
|
}
|
|
@@ -6,7 +6,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { css, html, customElement, state, repeat, ifDefined } from '../../../../external/lit/index.js';
|
|
8
8
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
9
|
-
import { UmbDropdownElement } from '../../../core/components/index.js';
|
|
10
9
|
import { UMB_COLLECTION_CONTEXT } from '../../../core/collection/index.js';
|
|
11
10
|
import { UMB_CREATE_USER_MODAL, UMB_INVITE_USER_MODAL, UMB_MODAL_MANAGER_CONTEXT_TOKEN, } from '../../../core/modal/index.js';
|
|
12
11
|
import { UserOrderModel, UserStateModel } from '../../../../external/backend-api/index.js';
|
|
@@ -42,13 +41,6 @@ export let UmbUserCollectionHeaderElement = class UmbUserCollectionHeaderElement
|
|
|
42
41
|
this._userGroups = data.items;
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
#onDropdownClick(event) {
|
|
46
|
-
const composedPath = event.composedPath();
|
|
47
|
-
const dropdown = composedPath.find((el) => el instanceof UmbDropdownElement);
|
|
48
|
-
if (dropdown) {
|
|
49
|
-
dropdown.open = !dropdown.open;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
44
|
_updateSearch(event) {
|
|
53
45
|
const target = event.target;
|
|
54
46
|
const filter = target.value || '';
|
|
@@ -81,8 +73,9 @@ export let UmbUserCollectionHeaderElement = class UmbUserCollectionHeaderElement
|
|
|
81
73
|
}
|
|
82
74
|
render() {
|
|
83
75
|
return html `
|
|
84
|
-
|
|
85
|
-
${this.#
|
|
76
|
+
<div style="display: flex; gap: var(--uui-size-space-4)">${this.#renderCollectionActions()}</div>
|
|
77
|
+
${this.#renderSearch()}
|
|
78
|
+
<div>${this.#renderFilters()} ${this.#renderCollectionViews()}</div>
|
|
86
79
|
`;
|
|
87
80
|
}
|
|
88
81
|
#renderCollectionActions() {
|
|
@@ -120,46 +113,65 @@ export let UmbUserCollectionHeaderElement = class UmbUserCollectionHeaderElement
|
|
|
120
113
|
this.#collectionContext?.setUserGroupFilter(ids);
|
|
121
114
|
}
|
|
122
115
|
#getUserGroupFilterLabel() {
|
|
123
|
-
|
|
116
|
+
const length = this._userGroupFilterSelection.length;
|
|
117
|
+
const max = 2;
|
|
118
|
+
//TODO: Temp solution to limit the amount of states shown
|
|
119
|
+
return length === 0
|
|
124
120
|
? this.localize.term('general_all')
|
|
125
|
-
: this._userGroupFilterSelection
|
|
121
|
+
: this._userGroupFilterSelection
|
|
122
|
+
.slice(0, max)
|
|
123
|
+
.map((group) => group.name)
|
|
124
|
+
.join(', ') + (length > max ? ' + ' + (length - max) : '');
|
|
125
|
+
}
|
|
126
|
+
#getStatusFilterLabel() {
|
|
127
|
+
const length = this._stateFilterSelection.length;
|
|
128
|
+
const max = 2;
|
|
129
|
+
//TODO: Temp solution to limit the amount of states shown
|
|
130
|
+
return length === 0
|
|
131
|
+
? this.localize.term('general_all')
|
|
132
|
+
: this._stateFilterSelection
|
|
133
|
+
.slice(0, max)
|
|
134
|
+
.map((state) => this.localize.term('user_state' + state))
|
|
135
|
+
.join(', ') + (length > max ? ' + ' + (length - max) : '');
|
|
126
136
|
}
|
|
127
137
|
#renderFilters() {
|
|
128
138
|
return html ` ${this.#renderStatusFilter()} ${this.#renderUserGroupFilter()} `;
|
|
129
139
|
}
|
|
130
140
|
#renderStatusFilter() {
|
|
131
141
|
return html `
|
|
132
|
-
<
|
|
133
|
-
<
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
</
|
|
145
|
-
</
|
|
142
|
+
<uui-button popovertarget="popover-user-status-filter" label="status">
|
|
143
|
+
<umb-localize key="general_status"></umb-localize>: <b>${this.#getStatusFilterLabel()}</b>
|
|
144
|
+
</uui-button>
|
|
145
|
+
<uui-popover-container id="popover-user-status-filter" popover placement="bottom">
|
|
146
|
+
<umb-popover-layout>
|
|
147
|
+
<div class="filter-dropdown">
|
|
148
|
+
${this._stateFilterOptions.map((option) => html `<uui-checkbox
|
|
149
|
+
label=${this.localize.term('user_state' + option)}
|
|
150
|
+
@change=${this.#onStateFilterChange}
|
|
151
|
+
name="state"
|
|
152
|
+
value=${option}></uui-checkbox>`)}
|
|
153
|
+
</div>
|
|
154
|
+
</umb-popover-layout>
|
|
155
|
+
</uui-popover-container>
|
|
146
156
|
`;
|
|
147
157
|
}
|
|
148
158
|
#renderUserGroupFilter() {
|
|
149
159
|
return html `
|
|
150
|
-
<
|
|
151
|
-
<
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
<uui-button popovertarget="popover-user-group-filter" label=${this.localize.term('general_groups')}>
|
|
161
|
+
<umb-localize key="general_groups"></umb-localize>: <b>${this.#getUserGroupFilterLabel()}</b>
|
|
162
|
+
</uui-button>
|
|
163
|
+
<uui-popover-container id="popover-user-group-filter" popover placement="bottom">
|
|
164
|
+
<umb-popover-layout>
|
|
165
|
+
<div class="filter-dropdown">
|
|
166
|
+
${repeat(this._userGroups, (group) => group.id, (group) => html `
|
|
167
|
+
<uui-checkbox
|
|
168
|
+
label=${ifDefined(group.name)}
|
|
169
|
+
value=${ifDefined(group.id)}
|
|
170
|
+
@change=${this.#onUserGroupFilterChange}></uui-checkbox>
|
|
171
|
+
`)}
|
|
172
|
+
</div>
|
|
173
|
+
</umb-popover-layout>
|
|
174
|
+
</uui-popover-container>
|
|
163
175
|
`;
|
|
164
176
|
}
|
|
165
177
|
#renderCollectionViews() {
|
|
@@ -189,7 +201,6 @@ export let UmbUserCollectionHeaderElement = class UmbUserCollectionHeaderElement
|
|
|
189
201
|
display: flex;
|
|
190
202
|
gap: var(--uui-size-space-3);
|
|
191
203
|
flex-direction: column;
|
|
192
|
-
width: fit-content;
|
|
193
204
|
}
|
|
194
205
|
`,
|
|
195
206
|
]; }
|