2024-02-13 01:19:24 +01:00
|
|
|
import {css} from 'lit';
|
|
|
|
|
|
|
|
export default css`
|
|
|
|
.form-control .form-control__label {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control .form-control__help-text {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
2024-09-18 16:11:25 +02:00
|
|
|
.form-control-input {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
2024-02-13 01:19:24 +01:00
|
|
|
/* Label */
|
|
|
|
|
|
|
|
.form-control--has-label .form-control__label {
|
|
|
|
display: inline-block;
|
|
|
|
color: var(--sl-input-label-color);
|
|
|
|
margin-bottom: var(--sl-spacing-3x-small);
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control--has-label.form-control--small .form-control__label {
|
|
|
|
font-size: var(--sl-input-label-font-size-small);
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control--has-label.form-control--medium .form-control__label {
|
|
|
|
font-size: var(--sl-input-label-font-size-medium);
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-control--has-label.form-control--large .form-control__label {
|
|
|
|
font-size: var(--sl-input-label-font-size-large);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Help text */
|
|
|
|
|
|
|
|
.form-control--has-help-text .form-control__help-text {
|
|
|
|
display: block;
|
|
|
|
color: var(--sl-input-help-text-color);
|
|
|
|
margin-top: var(--sl-spacing-3x-small);
|
|
|
|
}
|
|
|
|
|
2024-09-18 16:11:25 +02:00
|
|
|
.tree-dropdown__value-input {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
opacity: 0;
|
|
|
|
z-index: -1;
|
|
|
|
}
|
2024-02-13 01:19:24 +01:00
|
|
|
.tree-dropdown__combobox {
|
2024-08-26 22:12:36 +02:00
|
|
|
min-height: calc(var(--sl-input-height-medium) - 2 * var(--sl-input-border-width));
|
2024-09-18 18:08:36 +02:00
|
|
|
flex: 1 1 auto;
|
|
|
|
|
2024-02-13 01:19:24 +01:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
2024-02-13 18:40:00 +01:00
|
|
|
flex-wrap: nowrap;
|
2024-09-18 16:11:25 +02:00
|
|
|
align-items: center;
|
2024-02-13 18:40:00 +01:00
|
|
|
justify-content: space-between;
|
2024-09-18 16:11:25 +02:00
|
|
|
vertical-align: middle;
|
2024-02-13 01:19:24 +01:00
|
|
|
|
|
|
|
background-color: var(--sl-input-background-color);
|
|
|
|
border: solid var(--sl-input-border-width) var(--sl-input-border-color);
|
|
|
|
|
|
|
|
border-radius: var(--sl-input-border-radius-medium);
|
|
|
|
font-size: var(--sl-input-font-size-medium);
|
|
|
|
overflow-y: auto;
|
2024-02-13 18:40:00 +01:00
|
|
|
overflow-x: hidden;
|
2024-02-13 01:19:24 +01:00
|
|
|
padding-block: 0;
|
|
|
|
padding-inline: var(--sl-input-spacing-medium);
|
|
|
|
|
|
|
|
transition: var(--sl-transition-fast) color, var(--sl-transition-fast) border, var(--sl-transition-fast) box-shadow,
|
|
|
|
var(--sl-transition-fast) background-color;
|
2024-09-18 16:11:25 +02:00
|
|
|
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
:host([multiple]) .tree-dropdown__combobox {
|
|
|
|
align-items: flex-start
|
2024-02-13 01:19:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.tree-dropdown--disabled {
|
|
|
|
background-color: var(--sl-input-background-color-disabled);
|
|
|
|
border-color: var(--sl-input-border-color-disabled);
|
|
|
|
color: var(--sl-input-color-disabled);
|
|
|
|
opacity: 0.5;
|
|
|
|
cursor: not-allowed;
|
|
|
|
outline: none;
|
|
|
|
}
|
|
|
|
|
2024-02-13 17:33:07 +01:00
|
|
|
:not(.tree-dropdown--disabled).tree-dropdown--open .tree-dropdown__combobox,
|
|
|
|
:not(.tree-dropdown--disabled).tree-dropdown--focused .tree-dropdown__combobox {
|
2024-02-13 01:19:24 +01:00
|
|
|
background-color: var(--sl-input-background-color-focus);
|
|
|
|
border-color: var(--sl-input-border-color-focus);
|
|
|
|
box-shadow: 0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color);
|
|
|
|
}
|
|
|
|
|
2024-07-26 18:16:49 +02:00
|
|
|
:host([required]) .tree-dropdown__combobox {
|
|
|
|
background-color: var(--background-required);
|
|
|
|
}
|
|
|
|
|
2024-02-13 01:19:24 +01:00
|
|
|
/* Trigger */
|
|
|
|
|
2024-02-13 18:40:00 +01:00
|
|
|
.tree-dropdown__expand-icon {
|
2024-08-26 22:12:36 +02:00
|
|
|
height: var(--sl-input-height-small);
|
2024-08-29 21:54:47 +02:00
|
|
|
margin-top: var(--sl-spacing-small);
|
2024-02-13 18:40:00 +01:00
|
|
|
flex: 0 0 auto;
|
2024-02-13 01:19:24 +01:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2024-02-13 18:40:00 +01:00
|
|
|
transition: var(--sl-transition-medium) rotate ease;
|
|
|
|
rotate: 0;
|
|
|
|
margin-inline-start: var(--sl-spacing-small);
|
2024-09-18 16:11:25 +02:00
|
|
|
order: 99;
|
2024-02-13 18:40:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.tree-dropdown--open .tree-dropdown__expand-icon {
|
|
|
|
rotate: -180deg;
|
2024-02-13 01:19:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* End trigger */
|
|
|
|
|
|
|
|
.tree-dropdown__prefix {
|
|
|
|
order: 1;
|
|
|
|
}
|
|
|
|
|
2024-09-18 16:11:25 +02:00
|
|
|
/* Single */
|
|
|
|
|
2024-09-18 18:08:36 +02:00
|
|
|
.tree-dropdown__combobox > et2-image {
|
|
|
|
padding-right: var(--sl-spacing-medium);
|
|
|
|
}
|
2024-09-18 16:11:25 +02:00
|
|
|
|
|
|
|
/* End single */
|
|
|
|
|
2024-02-13 18:40:00 +01:00
|
|
|
/* Tags */
|
|
|
|
|
|
|
|
.tree-dropdown__tags {
|
2024-09-18 16:11:25 +02:00
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tree-dropdown--multiple.tree-dropdown--has-value:not(.tree-dropdown--placeholder-visible) .tree-dropdown__tags {
|
2024-02-13 18:40:00 +01:00
|
|
|
display: flex;
|
2024-02-23 19:01:06 +01:00
|
|
|
flex: 2 1 auto;
|
2024-02-13 18:40:00 +01:00
|
|
|
flex-wrap: wrap;
|
2024-02-27 00:54:07 +01:00
|
|
|
align-content: center;
|
2024-02-14 01:15:23 +01:00
|
|
|
gap: 0.1rem 0.5rem;
|
2024-08-26 22:12:36 +02:00
|
|
|
padding-top: var(--sl-spacing-3x-small);
|
2024-02-14 01:15:23 +01:00
|
|
|
max-height: calc(var(--height, 5) * var(--sl-input-height-medium));
|
2024-08-29 21:54:47 +02:00
|
|
|
min-width: 0px;
|
2024-09-09 17:46:43 +02:00
|
|
|
}
|
2024-09-05 22:53:34 +02:00
|
|
|
|
2024-09-18 16:11:25 +02:00
|
|
|
|
2024-09-09 17:46:43 +02:00
|
|
|
/* Limit tag size */
|
2024-09-05 22:53:34 +02:00
|
|
|
|
2024-09-09 17:46:43 +02:00
|
|
|
.tree_tag {
|
|
|
|
max-width: 25em;
|
|
|
|
overflow: hidden;
|
2024-02-13 18:40:00 +01:00
|
|
|
}
|
|
|
|
|
2024-09-09 19:57:52 +02:00
|
|
|
:host(:not([multiple])) .tree_tag::part(base) {
|
|
|
|
border-color: transparent;
|
|
|
|
background-color: transparent;
|
|
|
|
}
|
|
|
|
|
2024-02-13 18:40:00 +01:00
|
|
|
/* End tags */
|
|
|
|
|
2024-02-13 01:19:24 +01:00
|
|
|
/* Search box */
|
|
|
|
|
|
|
|
.tree-dropdown__search {
|
2024-02-13 18:40:00 +01:00
|
|
|
flex: 1 1 7em;
|
2024-02-13 01:19:24 +01:00
|
|
|
order: 10;
|
2024-08-29 21:54:47 +02:00
|
|
|
min-width: 2em;
|
2024-02-13 01:19:24 +01:00
|
|
|
border: none;
|
|
|
|
outline: none;
|
|
|
|
|
2024-09-18 16:11:25 +02:00
|
|
|
color: var(--sl-input-color);
|
2024-02-13 01:19:24 +01:00
|
|
|
font-size: var(--sl-input-font-size-medium);
|
|
|
|
padding-block: 0;
|
2024-09-18 16:11:25 +02:00
|
|
|
cursor: inherit;
|
2024-02-13 01:19:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
.form-control--medium .tree-dropdown__search {
|
|
|
|
/* Input same size as tags */
|
|
|
|
height: calc(var(--sl-input-height-medium) * 0.8);
|
|
|
|
}
|
|
|
|
|
2024-09-18 16:11:25 +02:00
|
|
|
:host([open]) .tree-dropdown__search {
|
|
|
|
cursor: text;
|
2024-02-13 01:19:24 +01:00
|
|
|
}
|
|
|
|
|
2024-09-18 16:11:25 +02:00
|
|
|
:host(:not([open])) .tree-dropdown--has-value.tree-dropdown--multiple .tree-dropdown__search {
|
|
|
|
visibility: hidden;
|
2024-02-13 01:19:24 +01:00
|
|
|
}
|
|
|
|
|
2024-09-18 16:11:25 +02:00
|
|
|
.tree-dropdown--disabled .tree-dropdown__search {
|
|
|
|
cursor: not-allowed;
|
2024-02-27 00:54:07 +01:00
|
|
|
}
|
|
|
|
|
2024-09-18 16:11:25 +02:00
|
|
|
.tree-dropdown--readonly .tree-dropdown__search {
|
|
|
|
cursor: default;
|
2024-02-27 00:54:07 +01:00
|
|
|
}
|
|
|
|
|
2024-02-13 01:19:24 +01:00
|
|
|
.tree-dropdown__suffix {
|
|
|
|
order: 20;
|
|
|
|
}
|
|
|
|
|
2024-02-22 22:33:22 +01:00
|
|
|
.search__results {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tree-dropdown--searching .search__results {
|
|
|
|
display: initial;;
|
|
|
|
}
|
|
|
|
|
2024-02-13 01:19:24 +01:00
|
|
|
/* Tree */
|
2024-09-05 22:53:34 +02:00
|
|
|
.tree-dropdown--searching et2-tree {
|
|
|
|
display: none;
|
|
|
|
}
|
2024-02-13 01:19:24 +01:00
|
|
|
|
|
|
|
sl-popup::part(popup) {
|
|
|
|
font-size: var(--sl-font-size-medium);
|
|
|
|
font-weight: var(--sl-font-weight-normal);
|
|
|
|
box-shadow: var(--sl-shadow-large);
|
|
|
|
background: var(--sl-panel-background-color);
|
|
|
|
border: solid var(--sl-panel-border-width) var(--sl-panel-border-color);
|
|
|
|
border-radius: var(--sl-border-radius-medium);
|
|
|
|
padding-block: var(--sl-spacing-x-small);
|
|
|
|
padding-inline: 0;
|
2024-02-14 01:15:23 +01:00
|
|
|
overflow-y: auto;
|
2024-02-13 01:19:24 +01:00
|
|
|
overscroll-behavior: none;
|
|
|
|
z-index: var(--sl-z-index-dropdown);
|
|
|
|
|
|
|
|
/* Make sure it adheres to the popup's auto size */
|
2024-02-14 01:15:23 +01:00
|
|
|
height: auto;
|
2024-02-13 01:19:24 +01:00
|
|
|
max-width: var(--auto-size-available-width);
|
2024-02-14 01:15:23 +01:00
|
|
|
}
|
|
|
|
|
2024-09-05 22:53:34 +02:00
|
|
|
et2-tree {
|
|
|
|
&::part(item) {
|
|
|
|
font-family: var(--sl-font-sans);
|
|
|
|
font-weight: var(--sl-font-weight-normal);
|
|
|
|
line-height: var(--sl-line-height-normal);
|
|
|
|
letter-spacing: var(--sl-letter-spacing-normal);
|
|
|
|
color: var(--sl-color-neutral-700);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
&::part(item-item) {
|
|
|
|
padding: var(--sl-spacing-x-small) var(--sl-spacing-medium) var(--sl-spacing-x-small) var(--sl-spacing-x-small);
|
|
|
|
transition: var(--sl-transition-fast) fill;
|
|
|
|
}
|
|
|
|
|
|
|
|
&::part(item-item):hover {
|
|
|
|
background-color: var(--sl-color-neutral-100);
|
|
|
|
color: var(--sl-color-neutral-1000);
|
|
|
|
}
|
|
|
|
|
|
|
|
&::part(checkbox) {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&::part(label) {
|
|
|
|
flex: 1 0 auto;
|
|
|
|
display: contents;
|
|
|
|
overflow: unset;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&::part(label_text) {
|
|
|
|
white-space: normal;
|
|
|
|
overflow: unset;
|
|
|
|
padding-right: var(--sl-spacing-medium);
|
|
|
|
max-width: 30em;
|
|
|
|
}
|
2024-02-22 22:33:22 +01:00
|
|
|
}
|
2024-02-13 01:19:24 +01:00
|
|
|
`;
|