-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update select dropdown to match multiselect one
- Loading branch information
Showing
16 changed files
with
256 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 18 additions & 1 deletion
19
libs/ui/catalog/src/lib/organisations-sort/organisations-sort.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 63 additions & 19 deletions
82
libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,71 @@ | ||
<div class="flex flex-col items-start sm:flex-row sm:items-center relative"> | ||
<label | ||
<div | ||
class="flex items-start flex-col sm:flex-row sm:items-center relative w-full" | ||
> | ||
<span | ||
*ngIf="showTitle" | ||
class="tracking-wide text-sm mb-2 sm:mb-0 sm:mr-2 whitespace-nowrap" | ||
[attr.for]="id" | ||
> | ||
{{ title }} | ||
</label> | ||
<select | ||
[id]="id" | ||
(change)="this.selectValue.emit($event.target.value)" | ||
class="w-full min-w-[66px] truncate text-main bg-white border border-gray-300 py-[10px] px-2 rounded-[0.25em] cursor-pointer leading-tight focus:outline-none hover:text-primary-darker hover:border-primary-lighter focus:ring-primary-lightest focus:ring-4" | ||
[ngClass]="extraClass" | ||
[class.w-full]="!showTitle" | ||
</span> | ||
<gn-ui-button | ||
type="outline" | ||
class="grow min-w-0" | ||
style="min-width: {{ minWidth }}" | ||
extraClass="w-full !p-[8px] !pl-[16px] {{ extraBtnClass }}" | ||
[title]="title" | ||
[attr.aria-owns]="id" | ||
(buttonClick)="openOverlay()" | ||
cdkOverlayOrigin | ||
#overlayOrigin="cdkOverlayOrigin" | ||
> | ||
<option | ||
<div class="grow flex items-center mr-2 gap-2 overflow-hidden"> | ||
<div class="text-left font-medium truncate py-1"> | ||
{{ getChoiceLabel() | translate }} | ||
</div> | ||
</div> | ||
<mat-icon class="shrink-0 opacity-40"> | ||
<ng-container *ngIf="overlayOpen">expand_less</ng-container> | ||
<ng-container *ngIf="!overlayOpen">expand_more</ng-container> | ||
</mat-icon> | ||
</gn-ui-button> | ||
</div> | ||
|
||
<ng-template | ||
cdkConnectedOverlay | ||
cdkConnectedOverlayHasBackdrop | ||
cdkConnectedOverlayBackdropClass="cdk-overlay-transparent-backdrop" | ||
[cdkConnectedOverlayOrigin]="overlayOrigin" | ||
[cdkConnectedOverlayOpen]="overlayOpen" | ||
[cdkConnectedOverlayPositions]="overlayPositions" | ||
[cdkConnectedOverlayFlexibleDimensions]="true" | ||
(backdropClick)="closeOverlay()" | ||
(detach)="closeOverlay()" | ||
> | ||
<div | ||
class="bg-white border border-gray-300 rounded shadow-lg py-2 w-full overflow-x-hidden overflow-y-auto overlay-container" | ||
[style.max-height]="overlayMaxHeight" | ||
[style.width]="overlayWidth" | ||
role="listbox" | ||
tabindex="-1" | ||
[attr.id]="id" | ||
[attr.aria-multiselectable]="true" | ||
[attr.aria-label]="title" | ||
> | ||
<label | ||
*ngFor="let choice of choices" | ||
[value]="choice.value" | ||
[selected]="isSelected(choice)" | ||
[title]="choice.label" | ||
class="flex px-5 py-1 w-full text-gray-900 cursor-pointer hover:text-primary-darkest hover:bg-gray-50 focus-within:text-primary-darkest focus-within:bg-gray-50 transition-colors" | ||
> | ||
{{ choice.label | translate }} | ||
</option> | ||
</select> | ||
<div | ||
class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-800" | ||
></div> | ||
</div> | ||
<input | ||
class="w-[0px] h-[18px] align-text-top shrink-0" | ||
type="text" | ||
[checked]="isSelected(choice)" | ||
(click)="onSelectValue(choice)" | ||
/> | ||
<span class="text-[14px]"> | ||
{{ choice.label | translate }} | ||
</span> | ||
</label> | ||
</div> | ||
</ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.