-
Notifications
You must be signed in to change notification settings - Fork 42
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
17152 Menu UI improvements #635
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,15 @@ | |
item-value="[group,value]" | ||
:menu-props="{ bottom: true, offsetY: true, maxHeight: 423 }" | ||
@change="setClearErrors(null); onRequestActionChange($event)" | ||
return-object | ||
> | ||
<template v-slot:item="{ item }"> | ||
<!-- FUTURE: use "selection" slot to format the selected business --> | ||
<!-- <template #selection="{ item }"> | ||
<div class="font-weight-bold text-truncate">{{ item.text }}</div> | ||
<div class="text-subtitle-1">{{ item.subtext }}</div> | ||
</template> --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
<template #item="{ item }"> | ||
<v-list-item-content | ||
v-if="item.isHeader" | ||
class="group-header px-4 py-5" | ||
|
@@ -32,9 +39,12 @@ | |
</div> | ||
</v-list-item-content> | ||
|
||
<!-- render but conditionally hide disabled list items, so that the v-select | ||
continues to display the current selection even when a different group is active --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the item is not in the list then the v-select sometimes shows a blank selection (ticket 17044). |
||
<v-list-item-content | ||
v-else | ||
class="group-item pl-8 pr-4 py-4" | ||
:class="{ 'hide-me': item.disabled }" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't just use |
||
> | ||
<div class="font-weight-bold">{{ item.text }}</div> | ||
<div>{{ item.subtext }}</div> | ||
|
@@ -404,19 +414,20 @@ export default class Search extends Mixins(CommonMixin) { | |
} | ||
/** The request action items to display. */ | ||
get requestActions () { | ||
return RequestActions.filter(action => { | ||
// always show header action | ||
if (action.isHeader) return true | ||
// show item action if group is open | ||
if (action.group === this.activeActionGroup) return true | ||
// don't show this action | ||
return false | ||
get requestActions (): RequestActionsI[] { | ||
return RequestActions.filter(item => { | ||
// always include header items | ||
if (item.isHeader) return true | ||
// include but disable items not in active group | ||
// (they will be hidden via CSS) | ||
item['disabled'] = (item.group !== this.activeActionGroup) | ||
return true | ||
}) | ||
} | ||
/** If current group is active, deactivates it, otherwise activates group. */ | ||
toggleActionGroup (group: number) { | ||
toggleActionGroup (group: number): void { | ||
this.activeActionGroup = (this.activeActionGroup === group) ? NaN : group | ||
} | ||
|
@@ -543,8 +554,8 @@ export default class Search extends Mixins(CommonMixin) { | |
} | ||
/** Called when Request Action menu item is changed. */ | ||
onRequestActionChange (text: string): void { | ||
this.request = RequestActions.find(request => request.text === text) | ||
onRequestActionChange (request: RequestActionsI): void { | ||
this.request = request | ||
// clear Jurisdiction and Entity Type | ||
this.setLocation(null) | ||
|
@@ -598,8 +609,12 @@ export default class Search extends Mixins(CommonMixin) { | |
padding: 20px 8px !important; | ||
} | ||
// set content colour when hovering over list items | ||
// hide disabled list items | ||
::v-deep .v-list-item:has(.v-list-item__content.hide-me) { | ||
JazzarKarim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
display: none; | ||
} | ||
// set content colour when hovering over list items | ||
.v-list-item:hover .v-list-item__content, | ||
.list-item:hover { | ||
color: $app-blue !important; | ||
|
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.
This returns the entire item object (in
$event
) instead of just its value.