-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: update select dropdown to match multiselect one #516
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
84 changes: 65 additions & 19 deletions
84
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,73 @@ | ||
<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" | ||
f-necas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> | ||
<span | ||
*ngIf="showTitle" | ||
class="tracking-wide text-sm mb-2 sm:mb-0 sm:mr-2 whitespace-nowrap" | ||
[attr.for]="id" | ||
> | ||
{{ title }} | ||
</label> | ||
<select | ||
f-necas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[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" | ||
extraClass="!p-[8px] !pl-[16px] flex flex-row w-full {{ extraBtnClass }}" | ||
[title]="title" | ||
[attr.aria-owns]="id" | ||
(buttonClick)="openOverlay()" | ||
cdkOverlayOrigin | ||
#overlayOrigin="cdkOverlayOrigin" | ||
(keydown)="handleTriggerKeydown($event)" | ||
> | ||
<option | ||
<div class="grow font-medium truncate py-1 mr-2 text-left"> | ||
{{ getChoiceLabel() | translate }} | ||
</div> | ||
<mat-icon class="material-symbols-outlined 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.min-width]="overlayWidth" | ||
role="listbox" | ||
tabindex="-1" | ||
[attr.id]="id" | ||
[attr.aria-multiselectable]="true" | ||
[attr.aria-label]="title" | ||
(keydown)="handleOverlayKeydown($event)" | ||
> | ||
<button | ||
#choiceInputs | ||
type="button" | ||
*ngFor="let choice of choices" | ||
[value]="choice.value" | ||
[selected]="isSelected(choice)" | ||
[title]="choice.label" | ||
class="flex px-5 py-1 w-full cursor-pointer transition-colors" | ||
[ngClass]=" | ||
isSelected(choice) | ||
? 'text-white bg-primary hover:text-white hover:bg-primary-darker focus:text-white focus:bg-primary-darker' | ||
: 'text-gray-900 hover:text-primary-darkest hover:bg-gray-50 focus:text-primary-darkest focus:bg-gray-50' | ||
" | ||
(click)="onSelectValue(choice)" | ||
(keydown)="selectIfEnter($event, choice)" | ||
> | ||
{{ 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> | ||
<span class="text-[14px]"> | ||
{{ choice.label | translate }} | ||
</span> | ||
</button> | ||
</div> | ||
</ng-template> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should import the UiInputs module here instead, as OverlayModule is an underlying dependency