Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
.trigger-label:not(:last-child) {
margin-right: 8px;
}

&:hover {
background-color: $gray-2;
border-radius: 50%;
}

&.labeled:hover {
border-radius: 6px;
}
}

.dropdown-content {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { MenuItemComponent } from './menu-item/menu-item.component';
<ht-event-blocker event="click" [enabled]="true">
<ht-popover [closeOnClick]="true" [disabled]="this.disabled">
<ht-popover-trigger>
<div class="trigger-content" [ngClass]="{ disabled: this.disabled }">
<div class="trigger-content" [ngClass]="{ disabled: this.disabled, labeled: !!this.label }">
<ht-label *ngIf="this.label" class="trigger-label" [label]="this.label"> </ht-label>
<ht-icon *ngIf="this.icon" class="trigger-icon" [icon]="this.icon" size="${IconSize.Small}"></ht-icon>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,20 @@
cursor: pointer;
height: 34px;

&.open {
background-color: $gray-2;
}

&.icon-mode {
border: 1px solid transparent;
border-radius: 64px;
padding: 0 4px;

&.open {
background: $blue-2;
border-color: $blue-3;
}

&:hover {
color: $blue-5;
background: $blue-1;
Expand All @@ -57,6 +66,10 @@
margin-left: auto;
}
}

&:hover {
background-color: $gray-1;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { MultiSelectJustify } from './multi-select-justify';
<div
class="trigger-content"
[style.justify-content]="this.justify"
[ngClass]="this.triggerLabelDisplayMode"
[ngClass]="[this.triggerLabelDisplayMode, this.popoverOpen ? 'open' : '']"
#triggerContainer
>
<ht-icon *ngIf="this.icon" [icon]="this.icon" [size]="this.iconSize"> </ht-icon>
Expand Down
20 changes: 20 additions & 0 deletions projects/components/src/select/select.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
height: 100%;
}

&.open {
background-color: $gray-2;
border-radius: 6px;
}

&.border {
&.group-right {
border-radius: 0 2px 2px 0;
Expand Down Expand Up @@ -93,6 +98,11 @@
margin-left: auto;
color: $gray-7;
}

&:hover {
background-color: $gray-1;
border-radius: 6px;
}
}

.icon-only {
Expand All @@ -111,6 +121,16 @@
}
}

&.open {
background-color: white;

.icon {
background: $blue-2;
border: 1px solid $blue-3;
border-radius: 50%;
}
}

&.selected {
color: $blue-5;
}
Expand Down
9 changes: 7 additions & 2 deletions projects/components/src/select/select.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ import { SelectSize } from './select-size';
this.groupPosition,
selected ? selected.style.toString() : '',
this.showBorder ? 'border' : '',
this.disabled ? 'disabled' : ''
this.disabled ? 'disabled' : '',
this.popoverOpen ? 'open' : ''
]"
*htLetAsync="this.selected$ as selected"
>
<ht-popover
[disabled]="this.disabled"
[closeOnClick]="true"
class="select-container"
(popoverOpen)="this.popoverOpen = true"
(popoverClose)="this.popoverOpen = false"
[ngSwitch]="this.triggerDisplayMode"
>
<ht-popover-trigger>
Expand All @@ -61,7 +64,7 @@ import { SelectSize } from './select-size';
<div
*ngSwitchCase="'${SelectTriggerDisplayMode.Icon}'"
class="trigger-content icon-only"
[ngClass]="this.selected !== undefined ? 'selected' : ''"
[ngClass]="{ selected: this.selected !== undefined, open: this.popoverOpen }"
>
<ht-icon
class="icon"
Expand Down Expand Up @@ -168,6 +171,8 @@ export class SelectComponent<V> implements AfterContentInit, OnChanges {

public topControlItems$?: Observable<SelectControlOptionComponent<V>[]>;

public popoverOpen: boolean = false;

public get justifyClass(): string {
if (this.justify !== undefined) {
return this.justify;
Expand Down