1
1
import { UMB_MEMBER_GROUP_ROOT_WORKSPACE_PATH } from '../../paths.js' ;
2
2
import { UMB_MEMBER_GROUP_WORKSPACE_CONTEXT } from './member-group-workspace.context-token.js' ;
3
3
import { UmbTextStyles } from '@umbraco-cms/backoffice/style' ;
4
- import { css , html , customElement , property , state , nothing } from '@umbraco-cms/backoffice/external/lit' ;
5
- import { UmbLitElement , umbFocus } from '@umbraco-cms/backoffice/lit-element' ;
6
- import type { ManifestWorkspace } from '@umbraco-cms/backoffice/workspace' ;
7
- import type { UUIInputElement } from '@umbraco-cms/backoffice/external/uui' ;
8
- import { UUIInputEvent } from '@umbraco-cms/backoffice/external/uui' ;
4
+ import { css , html , customElement , state , nothing } from '@umbraco-cms/backoffice/external/lit' ;
5
+ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element' ;
9
6
10
7
@customElement ( 'umb-member-group-workspace-editor' )
11
8
export class UmbMemberGroupWorkspaceEditorElement extends UmbLitElement {
12
- @property ( { attribute : false } )
13
- manifest ?: ManifestWorkspace ;
14
-
15
- @state ( )
16
- private _name = '' ;
17
-
18
9
@state ( )
19
10
private _unique ?: string ;
20
11
@@ -26,22 +17,10 @@ export class UmbMemberGroupWorkspaceEditorElement extends UmbLitElement {
26
17
this . consumeContext ( UMB_MEMBER_GROUP_WORKSPACE_CONTEXT , ( workspaceContext ) => {
27
18
this . #workspaceContext = workspaceContext ;
28
19
if ( ! this . #workspaceContext) return ;
29
- this . observe ( this . #workspaceContext. name , ( name ) => ( this . _name = name ?? '' ) ) ;
30
20
this . observe ( this . #workspaceContext. unique , ( unique ) => ( this . _unique = unique ?? undefined ) ) ;
31
21
} ) ;
32
22
}
33
23
34
- // TODO. find a way where we don't have to do this for all Workspaces.
35
- #onInput( event : UUIInputEvent ) {
36
- if ( event instanceof UUIInputEvent ) {
37
- const target = event . composedPath ( ) [ 0 ] as UUIInputElement ;
38
-
39
- if ( typeof target ?. value === 'string' ) {
40
- this . #workspaceContext?. setName ( target . value ) ;
41
- }
42
- }
43
- }
44
-
45
24
#renderActions( ) {
46
25
// Actions only works if we have a valid unique.
47
26
if ( ! this . _unique || this . #workspaceContext?. getIsNew ( ) ) return nothing ;
@@ -52,10 +31,8 @@ export class UmbMemberGroupWorkspaceEditorElement extends UmbLitElement {
52
31
override render ( ) {
53
32
return html `
54
33
<umb- wor kspace- edito r alias= "Umb.Workspace.MemberGroup" back-path = ${ UMB_MEMBER_GROUP_ROOT_WORKSPACE_PATH } >
34
+ <umb- wor kspace- name slot= "header" > </ umb- wor kspace- name>
55
35
${ this . #renderActions( ) }
56
- <div id= "header" slot = "header" >
57
- <uui- input id= "nameInput" .value = ${ this . _name } @input = "${ this . #onInput} " ${ umbFocus ( ) } > </ uui- input>
58
- </ div>
59
36
<umb- wor kspace- entity- action- menu slot= "action-menu" > </ umb- wor kspace- entity- action- menu>
60
37
</ umb- wor kspace- edito r>
61
38
` ;
@@ -69,14 +46,6 @@ export class UmbMemberGroupWorkspaceEditorElement extends UmbLitElement {
69
46
width : 100% ;
70
47
height : 100% ;
71
48
}
72
- # header {
73
- display : flex;
74
- align-items : center;
75
- width : 100% ;
76
- }
77
- uui-input {
78
- width : 100% ;
79
- }
80
49
` ,
81
50
] ;
82
51
}
0 commit comments