Skip to content

Commit

Permalink
feat: changes on range dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Jul 12, 2024
1 parent e52e0b0 commit 56c2536
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
<button
class="mel-primary-button gap-0 rounded-none w-52"
class="mel-primary-button gap-0 rounded-none w-52 justify-between"
[attr.aria-owns]="id"
(click)="openOverlay()"
cdkOverlayOrigin
#overlayOrigin="cdkOverlayOrigin"
>
<span>{{ title }}</span>
<div class="grow flex items-center mr-2 gap-2 overflow-hidden">
@if(hasSelectedChoices){
<div
class="shrink-0 rounded-full text-primary bg-white font-bold text-[12px] w-5 h-5 flex items-center justify-center mr-1 selected-count ml-2"
>
{{ selected['length'] }}
</div>
}
</div>
<button class="h-6 w-6" data-cy="clearSelection">
@if(hasSelectedChoices && !overlayOpen){
<mat-icon
Expand Down Expand Up @@ -78,6 +69,7 @@
(valueChange)="highValue = $event"
[value]="highValue"
[hint]="'mel.datahub.search.filters.maxValue' | translate"
(keyup.enter)="onValidate()"
></gn-ui-text-input>
</div>
<mel-datahub-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ export class MelDatahubDropdownRangeComponent {
return true
})
.map((choice) => choice.value)
if (this.selected.length === 0) {
// If no value is selected, we keep the low and high values to display nothing
this.selected.push(lowValue, highValue)
}
this.selectValues.emit(this.selected)
}
}

0 comments on commit 56c2536

Please sign in to comment.