mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-30 03:43:40 +01:00
Fix some CSS / layout issues with labels
- Fix label nowrap stopped working - Fix et2-label-fixed stopped working
This commit is contained in:
parent
faf6a21836
commit
b34e6905ce
@ -108,6 +108,9 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
--icon-width: 20px;
|
||||
}
|
||||
|
||||
.form-control--has-label::part(form-control-label) {
|
||||
margin-right: var(--sl-spacing-medium);
|
||||
}
|
||||
|
||||
::slotted(img), img {
|
||||
vertical-align: middle;
|
||||
@ -1037,7 +1040,10 @@ export class Et2Select extends Et2WithSearchMixin(Et2WidgetWithSelect)
|
||||
return html`
|
||||
${this._styleTemplate()}
|
||||
<sl-select
|
||||
exportparts="prefix, tags, display-input, expand-icon, combobox, combobox:base, listbox, option"
|
||||
class=${classMap({
|
||||
"form-control--has-label": this.label !== ""
|
||||
})}
|
||||
exportparts="form-control-label, prefix, tags, display-input, expand-icon, combobox, combobox:base, listbox, option"
|
||||
label=${this.label}
|
||||
placeholder=${this.placeholder || (this.multiple && this.emptyLabel ? this.emptyLabel : "")}
|
||||
?multiple=${this.multiple}
|
||||
|
@ -112,45 +112,51 @@ const Et2WidgetMixin = <T extends Constructor>(superClass : T) =>
|
||||
}
|
||||
|
||||
/* CSS to align internal inputs according to box alignment */
|
||||
|
||||
:host([align="center"]) .input-group__input {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
:host([align="right"]) .input-group__input {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
/* Put widget label to the left of the widget */
|
||||
|
||||
::part(form-control) {
|
||||
::part(form-control), .form-control {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
::part(form-control-label) {
|
||||
::part(form-control-label), .form-control-label {
|
||||
flex: 0 0 auto;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
::part(form-control-input) {
|
||||
.form-control--has-label .form-control-label {
|
||||
margin-right: var(--sl-spacing-medium);
|
||||
}
|
||||
|
||||
::part(form-control-input), .form-control-input {
|
||||
flex: 1 1 auto;
|
||||
position: relative;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
::part(form-control-help-text) {
|
||||
::part(form-control-help-text), .form-control-help-text {
|
||||
flex-basis: 100%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Use .et2-label-fixed class to give fixed label size */
|
||||
|
||||
:host(.et2-label-fixed)::part(form-control-label) {
|
||||
:host(.et2-label-fixed)::part(form-control-label), :host(.et2-label-fixed) .form-control-label {
|
||||
width: initial;
|
||||
width: var(--label-width, 8em);
|
||||
}
|
||||
|
||||
:host(.et2-label-fixed)::part(form-control-help-text) {
|
||||
:host(.et2-label-fixed)::part(form-control-help-text), :host(.et2-label-fixed) .form-control-help-text {
|
||||
left: calc(var(--sl-spacing-medium) + var(--label-width, 8em));
|
||||
}
|
||||
`];
|
||||
|
Loading…
Reference in New Issue
Block a user