File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed
components/input-image-cropper
modals/image-cropper-editor/components Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ export class UmbImageCropperPreviewElement extends LitElement {
13
13
@property ( { type : String , attribute : false } )
14
14
src : string = '' ;
15
15
16
+ @property ( { type : String } )
17
+ label ?: string ;
18
+
16
19
@property ( { attribute : false } )
17
20
get focalPoint ( ) {
18
21
return this . #focalPoint;
@@ -140,14 +143,14 @@ export class UmbImageCropperPreviewElement extends LitElement {
140
143
141
144
render ( ) {
142
145
if ( ! this . crop ) {
143
- return nothing ;
146
+ return html `<span id = "label" > ${ this . label } < / span > ` ;
144
147
}
145
148
146
149
return html `
147
150
<div id= "container" >
148
151
<img id= "image" src = ${ this . src } alt= "" / >
149
152
</ div>
150
- <span id= "alias" > ${ this . crop . alias } </ span>
153
+ <span id= "alias" > ${ this . label ?? this . crop . alias } </ span>
151
154
<span id= "dimensions" > ${ this . crop . width } x ${ this . crop . height } </ span>
152
155
${ this . crop . coordinates
153
156
? html `<span id= "user-defined" > <umb- localize key= "imagecropper_customCrop" > User defined </ umb- localize> </ span> `
@@ -178,6 +181,9 @@ export class UmbImageCropperPreviewElement extends LitElement {
178
181
max-height : 200px ;
179
182
user-select : none;
180
183
}
184
+ # label {
185
+ font-weight : bold;
186
+ }
181
187
# alias {
182
188
font-weight : bold;
183
189
margin-top : var (--uui-size-space-3 );
Original file line number Diff line number Diff line change @@ -29,11 +29,10 @@ export class UmbImageCropperEditorFieldElement extends UmbInputImageCropperField
29
29
override renderSide ( ) {
30
30
if ( ! this . value || ! this . crops ) return ;
31
31
32
- return html ` <uui- menu- item
33
- id= "reset-current-crop"
32
+ return html ` <umb- image-cropper- preview
34
33
@click = ${ this . #resetCurrentCrop}
35
34
?active= ${ ! this . currentCrop }
36
- label= ${ this . localize . term ( 'general_media' ) } > </ uui - menu - item >
35
+ . label = ${ this . localize . term ( 'general_media' ) } > </ umb - image-cropper - preview >
37
36
38
37
${ repeat (
39
38
this . crops ,
@@ -75,14 +74,6 @@ export class UmbImageCropperEditorFieldElement extends UmbInputImageCropperField
75
74
padding-right : var (--uui-size-3 );
76
75
}
77
76
78
- # reset-current-crop {
79
- --uui-menu-item-flat-structure : 1 ;
80
- --uui-menu-item-border-radius : var (--uui-border-radius );
81
- border-radius : var (--uui-border-radius );
82
- width : 100% ;
83
- background-color : var (--uui-color-surface );
84
- }
85
-
86
77
slot [name = 'actions' ] {
87
78
display : block;
88
79
flex : 1 ;
You can’t perform that action at this time.
0 commit comments