File tree 3 files changed +53
-24
lines changed
3 files changed +53
-24
lines changed Original file line number Diff line number Diff line change 1
- <div tabindex =" {{ _tabIndex }} " @click =" {{ _select }} " @keydown =" {{ _keydown }} " class =" ui5-token--wrapper" >
1
+ <div tabindex =" {{ _tabIndex }} " @click =" {{ _select }} " @keydown =" {{ _keydown }} " class =" ui5-token--wrapper" dir = " {{ dir }} " >
2
2
<span class =" ui5-token--text" ><slot ></slot ></span >
3
3
4
4
{{ #unless readonly }}
Original file line number Diff line number Diff line change 1
1
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js" ;
2
2
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js" ;
3
3
import { getTheme } from "@ui5/webcomponents-base/dist/config/Theme.js" ;
4
+ import { getRTL } from "@ui5/webcomponents-base/dist/config/RTL.js" ;
4
5
import {
5
6
isBackSpace ,
6
7
isEnter ,
@@ -157,6 +158,10 @@ class Token extends UI5Element {
157
158
return this . i18nBundle . getText ( TOKEN_ARIA_DELETABLE ) ;
158
159
}
159
160
161
+ get dir ( ) {
162
+ return getRTL ( ) ? "rtl" : "ltr" ;
163
+ }
164
+
160
165
get iconURI ( ) {
161
166
return getTheme ( ) === "sap_fiori_3" ? "sap-icon://decline" : "sap-icon://sys-cancel" ;
162
167
}
Original file line number Diff line number Diff line change 10
10
box- sizing: bor der- box;
11
11
}
12
12
13
- : host ([data-ui5-compact-size ]) {
14
- font-size : 0.75rem ;
15
- height : 1.25rem ;
16
- }
17
-
18
- : host ([data-ui5-compact-size ]) .ui5-token--icon {
19
- padding : 0 0.25rem ;
20
- width : 0.75rem ;
21
- height : 0.75rem ;
13
+ : host ([overflows ]) {
14
+ visibility : hidden;
22
15
}
23
16
24
17
: host (: not ([readonly ]): hover ) {
49
42
outline : 1px dotted var (--sapUiContentContrastFocusColor );
50
43
}
51
44
52
- : host ([overflows ]) {
53
- visibility : hidden;
54
- }
55
-
56
- .ui5-token--icon {
57
- padding : 0.25rem 0.5rem ;
58
- color : inherit;
59
- cursor : pointer;
60
- width : 1rem ;
61
- height : 1rem ;
62
- color : var (--_ui5_token_icon_color );
63
- }
64
-
65
45
.ui5-token--wrapper {
66
46
display : flex;
67
47
align-items : center;
68
48
height : 100% ;
69
49
width : 100% ;
70
50
cursor : default;
71
- padding-left : 0.375 rem ;
51
+ padding-left : 0.3125 rem ;
72
52
padding-top : 0.25rem ;
73
53
padding-bottom : 0.25rem ;
74
54
box-sizing : border-box;
85
65
.ui5-token--text {
86
66
white-space : nowrap;
87
67
}
68
+
69
+ .ui5-token--icon {
70
+ padding : 0.25rem 0.5rem ;
71
+ color : inherit;
72
+ cursor : pointer;
73
+ width : 1rem ;
74
+ height : 1rem ;
75
+ color : var (--_ui5_token_icon_color );
76
+ }
77
+
78
+ /* Compact */
79
+ : host ([data-ui5-compact-size ]) {
80
+ font-size : 0.75rem ;
81
+ height : 1.125rem ; /* Note: by design should be 1.25rem, but the token gets cut in Erron/Warning state */
82
+ }
83
+
84
+ : host ([data-ui5-compact-size ]) .ui5-token--wrapper {
85
+ padding-left : 0.25rem ;
86
+ padding-top : 0.1rem ;
87
+ padding-bottom : 0.1rem ;
88
+ }
89
+
90
+ : host ([data-ui5-compact-size ]) .ui5-token--icon {
91
+ padding : 0.1rem 0.25rem ;
92
+ width : 0.75rem ;
93
+ height : 0.75rem ;
94
+ }
95
+
96
+ /* RTL */
97
+ : host .ui5-token--wrapper [dir = "rtl" ] {
98
+ padding-right : 0.3125rem ;
99
+ padding-left : 0 ;
100
+ }
101
+
102
+ : host ([readonly ]) .ui5-token--wrapper [dir = "rtl" ] {
103
+ padding-right : 0 ;
104
+ padding-left : 0.375rem ;
105
+ }
106
+
107
+ /* RTL + Compact */
108
+ : host ([data-ui5-compact-size ]) .ui5-token--wrapper [dir = "rtl" ] {
109
+ padding-right : 0.25rem ;
110
+ padding-left : 0 ;
111
+ }
You can’t perform that action at this time.
0 commit comments