|
1 | 1 | @import "./FormComponents.css";
|
| 2 | +@import "./Input.css"; |
| 3 | +@import "./InputIcon.css"; |
| 4 | +@import "./ValueStateVariables.css"; |
2 | 5 |
|
3 | 6 | :host {
|
4 | 7 | display: inline-block;
|
5 | 8 | }
|
6 | 9 |
|
7 |
| -.ui5-file-uploader-root { |
8 |
| - position: relative; |
| 10 | +:host([hide-input]) { |
| 11 | + width: max-content; |
| 12 | + height: max-content; |
9 | 13 | }
|
10 | 14 |
|
11 |
| -.ui5-file-uploader-root input[type=file] { |
12 |
| - opacity: 0; |
| 15 | +:host([hide-input]) .ui5-file-uploader-form { |
13 | 16 | position: absolute;
|
14 | 17 | top: 0;
|
15 | 18 | left: 0;
|
16 |
| - height: 100%; |
17 | 19 | width: 100%;
|
18 |
| - font-size: 0; |
| 20 | + height: 100%; |
| 21 | + display: block; |
19 | 22 | }
|
20 | 23 |
|
21 |
| -.ui5-file-uploader-root input[type=file]:not([disabled]) { |
22 |
| - cursor: pointer; |
| 24 | +.ui5-file-uploader-root, |
| 25 | +.ui5-file-uploader-form { |
| 26 | + position: relative; |
| 27 | + width: inherit; |
| 28 | + height: inherit; |
| 29 | +} |
| 30 | + |
| 31 | +.ui5-file-uploader-root .ui5-file-uploader-native-input { |
| 32 | + position: relative; |
| 33 | + display: block; |
| 34 | + width: inherit; |
| 35 | + height: inherit; |
| 36 | + opacity: 0; |
| 37 | + font-size: 0; |
23 | 38 | }
|
24 | 39 |
|
25 |
| -.ui5-file-uploader-mask { |
| 40 | +.ui5-file-uploader-display-container { |
| 41 | + position: absolute; |
| 42 | + top: 0; |
| 43 | + inset-inline-start: 0; |
| 44 | + width: inherit; |
| 45 | + height: inherit; |
26 | 46 | display: flex;
|
| 47 | + column-gap: 0.5rem; |
27 | 48 | align-items: center;
|
28 | 49 | }
|
29 | 50 |
|
30 |
| -.ui5-file-uploader-mask [ui5-input] { |
31 |
| - margin-right: 0.25rem; |
| 51 | +.ui5-file-uploader-display-elements { |
| 52 | + height: inherit; |
| 53 | + flex: 1; |
| 54 | + display: flex; |
| 55 | + position: relative; |
32 | 56 | }
|
33 | 57 |
|
34 |
| -:host([value-state="None"]:not([disabled]):hover) [ui5-input], |
35 |
| -:host(:not([value-state]):not([disabled]):hover) [ui5-input] { |
36 |
| - border: var(--_ui5_file_uploader_hover_border); |
37 |
| - background-color: var(--sapField_Hover_Background); |
38 |
| - box-shadow: var(--sapField_Hover_Shadow); |
| 58 | +.ui5-file-uploader-tokenizer, |
| 59 | +.ui5-file-uploader-display-input { |
| 60 | + position: absolute; |
| 61 | + top: 0; |
| 62 | + inset-inline-start: 0; |
| 63 | + height: inherit; |
| 64 | + border: none; |
| 65 | + outline: none; |
| 66 | + cursor: pointer; |
39 | 67 | }
|
40 | 68 |
|
41 |
| -:host([value-state="Negative"]:not([disabled]):hover) [ui5-input] { |
42 |
| - background-color: var(--_ui5_file_uploader_value_state_error_hover_background_color); |
43 |
| - box-shadow: var(--sapField_Hover_InvalidShadow); |
| 69 | +.ui5-file-uploader-clear-icon, |
| 70 | +.ui5-file-uploader-value-help-icon { |
| 71 | + position: absolute; |
| 72 | + cursor: pointer; |
44 | 73 | }
|
45 | 74 |
|
46 |
| -:host([value-state="Critical"]:not([disabled]):hover) [ui5-input] { |
47 |
| - background-color: var(--sapField_Hover_Background); |
48 |
| - box-shadow: var(--sapField_Hover_WarningShadow); |
| 75 | +.ui5-file-uploader-tokenizer { |
| 76 | + max-width: var(--_ui5_file_uploader_tokenizer_width); |
49 | 77 | }
|
50 | 78 |
|
51 |
| -:host([value-state="Positive"]:not([disabled]):hover) [ui5-input] { |
52 |
| - background-color: var(--sapField_Hover_Background); |
53 |
| - box-shadow: var(--sapField_Hover_SuccessShadow); |
| 79 | +.ui5-file-uploader-display-input { |
| 80 | + width: var(--_ui5_file_uploader_display_input_width); |
| 81 | +} |
| 82 | + |
| 83 | +.ui5-file-uploader-clear-icon { |
| 84 | + inset-inline-end: var(--_ui5_input_icon_width); |
| 85 | +} |
| 86 | + |
| 87 | +.ui5-file-uploader-value-help-icon { |
| 88 | + inset-inline-end: 0rem; |
| 89 | +} |
| 90 | + |
| 91 | +/* Input styles overrides */ |
| 92 | +:host(:not([readonly])), |
| 93 | +:host([readonly][disabled]), |
| 94 | +:host([value-state="None"]:not([readonly]):hover), |
| 95 | +:host([value-state="Negative"]:not([readonly]):not([disabled])), |
| 96 | +:host([value-state="Negative"]:not([readonly])[focused][opened]:hover), |
| 97 | +:host([value-state="Negative"]:not([readonly]):not([focused]):hover), |
| 98 | +:host([value-state="Critical"]:not([readonly]):not([disabled])), |
| 99 | +:host([value-state="Critical"]:not([readonly])[focused][opened]:hover), |
| 100 | +:host([value-state="Critical"]:not([readonly]):not([focused]):hover), |
| 101 | +:host([value-state="Positive"]:not([readonly]):not([disabled])), |
| 102 | +:host([value-state="Positive"]:not([readonly])[focused][opened]:hover), |
| 103 | +:host([value-state="Positive"]:not([readonly]):not([focused]):hover), |
| 104 | +:host([value-state="Information"]:not([readonly]):not([disabled])), |
| 105 | +:host([value-state="Information"]:not([readonly])[focused][opened]:hover), |
| 106 | +:host([value-state="Information"]:not([readonly]):not([focused]):hover), |
| 107 | +:host(:not([value-state]):not([readonly]):hover) { |
| 108 | + box-shadow: none; |
| 109 | + background: none; |
| 110 | +} |
| 111 | + |
| 112 | +:host(:not([readonly])) .ui5-file-uploader-display-elements, |
| 113 | +:host([readonly][disabled]) .ui5-file-uploader-display-elements { |
| 114 | + box-shadow: var(--sapField_Shadow); |
| 115 | + border: var(--_ui5-input-border); |
| 116 | + border-radius: var(--_ui5_input_border_radius); |
| 117 | + background: var(--sapField_BackgroundStyle); |
54 | 118 | }
|
55 | 119 |
|
56 |
| -:host([value-state="Information"]:not([disabled]):hover) [ui5-input] { |
| 120 | +/* Value state styles */ |
| 121 | +:host([value-state="Negative"]:not([readonly]):not([disabled])) .ui5-file-uploader-display-elements, |
| 122 | +:host([value-state="Critical"]:not([readonly]):not([disabled])) .ui5-file-uploader-display-elements, |
| 123 | +:host([value-state="Positive"]:not([readonly]):not([disabled])) .ui5-file-uploader-display-elements, |
| 124 | +:host([value-state="Information"]:not([readonly]):not([disabled])) .ui5-file-uploader-display-elements { |
| 125 | + box-shadow: var(--ui5_value_state-box-shadow); |
| 126 | + background: var(--ui5_value_state-background); |
| 127 | + background-color: var(--ui5_value_state-background-color); |
| 128 | +} |
| 129 | + |
| 130 | +/* Value state hover styles */ |
| 131 | +:host([value-state="None"]:not([readonly]):hover) .ui5-file-uploader-display-elements, |
| 132 | +:host(:not([value-state]):not([readonly]):hover) .ui5-file-uploader-display-elements { |
| 133 | + box-shadow: var(--sapField_Hover_Shadow); |
| 134 | + background: var(--sapField_Hover_BackgroundStyle); |
| 135 | +} |
| 136 | + |
| 137 | +:host([value-state="Negative"]:not([readonly]):not([focused]):hover) .ui5-file-uploader-display-elements, |
| 138 | +:host([value-state="Negative"]:not([readonly])[focused][opened]:hover) .ui5-file-uploader-display-elements { |
| 139 | + background-color: var(--_ui5_input_value_state_error_hover_background); |
| 140 | + box-shadow: var(--sapField_Hover_InvalidShadow); |
| 141 | +} |
| 142 | + |
| 143 | +:host([value-state="Negative"][focused]:not([opened]):not([readonly])) .ui5-file-uploader-display-elements, |
| 144 | +:host([value-state="Positive"]:not([readonly]):not([focused]):hover) .ui5-file-uploader-display-elements, |
| 145 | +:host([value-state="Positive"]:not([readonly])[focused][opened]:hover) .ui5-file-uploader-display-elements, |
| 146 | +:host([value-state="Positive"][focused]:not([opened]):not([readonly])) .ui5-file-uploader-display-elements, |
| 147 | +:host([value-state="Critical"]:not([readonly]):not([focused]):hover) .ui5-file-uploader-display-elements, |
| 148 | +:host([value-state="Critical"]:not([readonly])[focused][opened]:hover) .ui5-file-uploader-display-elements, |
| 149 | +:host([value-state="Critical"][focused]:not([opened]):not([readonly])) .ui5-file-uploader-display-elements, |
| 150 | +:host([value-state="Information"]:not([readonly]):not([focused]):hover) .ui5-file-uploader-display-elements, |
| 151 | +:host([value-state="Information"]:not([readonly])[focused][opened]:hover) .ui5-file-uploader-display-elements, |
| 152 | +:host([value-state="Information"][focused]:not([opened]):not([readonly])) .ui5-file-uploader-display-elements{ |
57 | 153 | background-color: var(--sapField_Hover_Background);
|
58 |
| - box-shadow: var(--sapField_Hover_InformationShadow); |
59 | 154 | }
|
60 | 155 |
|
61 |
| -:host(:not([disabled]):active) [ui5-button] { |
62 |
| - background-color: var(--sapButton_Active_Background); |
63 |
| - border-color: var(--sapButton_Active_BorderColor); |
64 |
| - color: var(--sapButton_Active_TextColor); |
65 |
| - text-shadow: none; |
| 156 | +/* Value state focus styles */ |
| 157 | +:host([focused][hide-input]) .ui5-file-uploader-root:has(.ui5-file-uploader-native-input:focus)::after, |
| 158 | +:host([focused]) .ui5-file-uploader-root:has(.ui5-file-uploader-native-input:focus) .ui5-file-uploader-display-elements::after { |
| 159 | + content: var(--ui5_input_focus_pseudo_element_content); |
| 160 | + position: absolute; |
| 161 | + pointer-events: none; |
| 162 | + z-index: 2; |
| 163 | + border: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--_ui5_input_focus_outline_color); |
| 164 | + border-radius: var(--_ui5_input_focus_border_radius); |
| 165 | + top: var(--_ui5_input_focus_offset); |
| 166 | + bottom: var(--_ui5_input_focus_offset); |
| 167 | + left: var(--_ui5_input_focus_offset); |
| 168 | + right: var(--_ui5_input_focus_offset); |
| 169 | +} |
| 170 | + |
| 171 | +:host([focused]:not([opened]):not([readonly]):not([hide-input])) |
| 172 | + .ui5-file-uploader-root:has(.ui5-file-uploader-native-input:focus) .ui5-file-uploader-display-elements::after { |
| 173 | + border-color: var(--ui5_value_state-focus-outline, var(--_ui5_input_focus_outline_color)); |
66 | 174 | }
|
0 commit comments