-
Notifications
You must be signed in to change notification settings - Fork 5
Filter menu shell #1867
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
Open
edlu77
wants to merge
21
commits into
develop
Choose a base branch
from
tune-menu-shell
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Filter menu shell #1867
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
5d79307
Add more features to tune menu
edlu77 9368424
Merge branch 'develop' of https://github.com/hubmapconsortium/hra-ui …
edlu77 eb6245b
Merge branch 'develop' of https://github.com/hubmapconsortium/hra-ui …
edlu77 091a5fb
Rename to filter menu and other updates
edlu77 31b9f70
Merge branch 'develop' of https://github.com/hubmapconsortium/hra-ui …
edlu77 aa4a51a
Add filter container from design system to menu
edlu77 7bfc6d3
Documentation
edlu77 9929865
Merge branch 'develop' of https://github.com/hubmapconsortium/hra-ui …
edlu77 2364ceb
Update filter list flyout
edlu77 737db90
Merge branch 'develop' of https://github.com/hubmapconsortium/hra-ui …
edlu77 72f5213
Merge branch 'develop' of https://github.com/hubmapconsortium/hra-ui …
edlu77 c65dc18
Fixes and updates
edlu77 972bff3
Update index.ts
edlu77 be3e962
Update stories for filter menu
edlu77 ff0236b
Filter menu story styling updates
edlu77 c9127d1
Fixes
edlu77 81fda5b
Merge branch 'develop' into tune-menu-shell
edlu77 d1ea9fe
Merge branch 'develop' into tune-menu-shell
edlu77 5071965
Merge branch 'develop' of https://github.com/hubmapconsortium/hra-ui …
edlu77 757aeae
Merge branch 'tune-menu-shell' of https://github.com/hubmapconsortium…
edlu77 1e4c985
Add search list to filter container
edlu77 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "lib": { | ||
| "entryFile": "src/index.ts" | ||
| } | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from './lib/tune-menu.component'; |
91 changes: 91 additions & 0 deletions
91
libs/design-system/tune-menu/src/lib/tune-menu.component.html
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| @if (!menuOptions().hideHeaderSection) { | ||
| <div hraFeature="filters" class="header-section"> | ||
| <div class="drawer-header"> | ||
| <span class="drawer-title">{{ menuOptions().headline }}</span> | ||
| <div class="filler"></div> | ||
| @if (!isWideScreen() || !menuOptions().hideCloseButton) { | ||
| <button | ||
axdanbol marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| hraFeature="toggle" | ||
| [hraClickEvent]="{ opened: formClosed() }" | ||
| hraHoverEvent | ||
| mat-icon-button | ||
| (click)="toggleForm.emit()" | ||
| aria-label="Open or close tune menu" | ||
| > | ||
| <hra-icon class="menu-icon" fontIcon="close" /> | ||
| </button> | ||
| } | ||
| </div> | ||
| <div class="header-subtext">{{ menuOptions().subtext }}</div> | ||
| </div> | ||
| } | ||
| <ng-scrollbar hraScrollOverflowFade> | ||
| <form> | ||
| @if (!menuOptions().hideCustomizeSection) { | ||
axdanbol marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <div class="customize-section" [formGroup]="form().controls.customize"> | ||
| <div class="customize-header"> | ||
| <hra-icon class="customize-icon" fontIcon="tune" /> | ||
| <span class="customize-title">Customize</span> | ||
| </div> | ||
| @let categories = menuOptions().toggleCategories; | ||
| @if (categories) { | ||
| <mat-button-toggle-group | ||
| formControlName="toggle" | ||
| [value]="form().value.customize?.toggle" | ||
| class="toggle-group" | ||
| > | ||
| @for (category of categories; track category.id) { | ||
| <mat-button-toggle hraClickEvent [hraFeature]="category.id" [value]="category"> | ||
| {{ category.label }} | ||
| </mat-button-toggle> | ||
| } | ||
| </mat-button-toggle-group> | ||
| } | ||
| @if (menuOptions().viewAsOptions) { | ||
| <mat-form-field subscriptSizing="dynamic"> | ||
| <hra-icon class="select-icon" matPrefix>table_view</hra-icon> | ||
| <mat-label>View as</mat-label> | ||
| <mat-select formControlName="viewAs"> | ||
| @for (option of menuOptions().viewAsOptions; track option) { | ||
| <mat-option [value]="option.id">{{ option.label }}</mat-option> | ||
| } | ||
| </mat-select> | ||
| </mat-form-field> | ||
| } | ||
|
|
||
| <mat-form-field subscriptSizing="dynamic"> | ||
| <hra-icon class="select-icon" matPrefix>sort</hra-icon> | ||
| <mat-label>Sort by</mat-label> | ||
| <mat-select formControlName="sortBy"> | ||
| @for (option of menuOptions().sortByOptions; track option) { | ||
| <mat-option [value]="option.id">{{ option.label }}</mat-option> | ||
| } | ||
| </mat-select> | ||
| </mat-form-field> | ||
|
|
||
| <mat-form-field subscriptSizing="dynamic"> | ||
| <hra-icon class="select-icon" matPrefix>category</hra-icon> | ||
| <mat-label>Group by</mat-label> | ||
| <mat-select formControlName="groupBy"> | ||
| @for (option of menuOptions().groupByOptions; track option) { | ||
| <mat-option [value]="option.id">{{ option.label }}</mat-option> | ||
| } | ||
| </mat-select> | ||
| </mat-form-field> | ||
| </div> | ||
| } | ||
| <div class="filters-section"> | ||
| <div class="filters-header"> | ||
| <hra-icon class="filter-icon" fontIcon="filter_list" /> | ||
| <span class="filters-title">Filters</span> | ||
| </div> | ||
| @for (value of formValues(); track $index) { | ||
| @if ($index > 0) { | ||
| <mat-divider /> | ||
| } | ||
| <div class="placeholder">{{ value[0] }}</div> | ||
| } | ||
| </div> | ||
| <div class="menu-content"></div> | ||
| </form> | ||
| </ng-scrollbar> | ||
121 changes: 121 additions & 0 deletions
121
libs/design-system/tune-menu/src/lib/tune-menu.component.scss
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| @use '@angular/material' as mat; | ||
| @use '../../../styles/utils'; | ||
| @use '../../../styles/vars'; | ||
|
|
||
| :host { | ||
| display: flex; | ||
| flex-direction: column; | ||
| color: vars.$secondary; | ||
| padding: 1.5rem; | ||
| height: 100%; | ||
|
|
||
| .header-section { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 0.25rem; | ||
| padding-bottom: 1.5rem; | ||
|
|
||
| .filler { | ||
| flex-grow: 1; | ||
| } | ||
|
|
||
| .header-subtext { | ||
| @include utils.use-font(body, medium); | ||
| color: vars.$primary; | ||
| } | ||
| } | ||
|
|
||
| .drawer-title, | ||
| .customize-title, | ||
| .filters-title { | ||
| @include utils.use-font(title, small); | ||
| padding: 0.5rem 0; | ||
| } | ||
|
|
||
| .customize-header, | ||
| .drawer-header, | ||
| .filters-header { | ||
| display: flex; | ||
| align-items: center; | ||
| } | ||
|
|
||
| .filters-header { | ||
| margin-bottom: 1rem; | ||
| } | ||
|
|
||
| .filter-icon, | ||
| .customize-icon { | ||
| padding: 0.5rem; | ||
| } | ||
|
|
||
| .menu-icon, | ||
| .menu-content { | ||
| transition: 0.3s; | ||
| } | ||
|
|
||
| .menu-content { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 0.25rem; | ||
| opacity: 1; | ||
| } | ||
|
|
||
| ng-scrollbar { | ||
| padding-top: 1rem; | ||
| } | ||
|
|
||
| mat-button-toggle-group { | ||
| width: fit-content; | ||
| } | ||
|
|
||
| .customize-section { | ||
| padding-bottom: 2.5rem; | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 1rem; | ||
| } | ||
|
|
||
| .select-icon { | ||
| padding-left: 0.75rem; | ||
| padding-right: 0.5rem; | ||
| } | ||
|
|
||
| &.closed { | ||
| .menu-icon { | ||
| transform: rotate(180deg); | ||
| } | ||
|
|
||
| .menu-content { | ||
| pointer-events: none; | ||
| opacity: 0; | ||
| } | ||
|
|
||
| ng-scrollbar { | ||
| overflow-y: hidden; | ||
| } | ||
|
|
||
| ::ng-deep scrollbars { | ||
| display: none; | ||
| } | ||
|
|
||
| ::ng-deep .ng-scroll-content { | ||
| --_viewport-padding-right: 0.75rem; | ||
| } | ||
| } | ||
|
|
||
| mat-label { | ||
| @include utils.use-font(label, medium); | ||
| } | ||
|
|
||
| mat-divider { | ||
| border-top-color: vars.$outline-variant; | ||
| } | ||
|
|
||
| .placeholder { | ||
| height: 2.5rem; | ||
| @include utils.use-font(label, medium); | ||
| padding: 0.25rem 0.75rem; | ||
| align-content: center; | ||
| pointer-events: none; | ||
| } | ||
| } |
21 changes: 21 additions & 0 deletions
21
libs/design-system/tune-menu/src/lib/tune-menu.component.spec.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
| import { TuneMenuComponent } from './tune-menu.component'; | ||
|
|
||
| describe('TuneMenuComponent', () => { | ||
| let component: TuneMenuComponent; | ||
| let fixture: ComponentFixture<TuneMenuComponent>; | ||
|
|
||
| beforeEach(async () => { | ||
| await TestBed.configureTestingModule({ | ||
| imports: [TuneMenuComponent], | ||
| }).compileComponents(); | ||
|
|
||
| fixture = TestBed.createComponent(TuneMenuComponent); | ||
| component = fixture.componentInstance; | ||
| fixture.detectChanges(); | ||
| }); | ||
|
|
||
| it('should create', () => { | ||
| expect(component).toBeTruthy(); | ||
| }); | ||
| }); |
25 changes: 25 additions & 0 deletions
25
libs/design-system/tune-menu/src/lib/tune-menu.component.stories.ts
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import { type Meta, type StoryObj } from '@storybook/angular'; | ||
|
|
||
| import { TuneMenuComponent } from './tune-menu.component'; | ||
|
|
||
| const meta: Meta<TuneMenuComponent> = { | ||
| component: TuneMenuComponent, | ||
| title: 'Design System / Tune Menu', | ||
| parameters: { | ||
| design: { | ||
| type: 'figma', | ||
| url: 'https://www.figma.com/design/gQEMLugLjweDvbsNNUVffD/HRA-Design-System-Repository?node-id=12494-166042&t=U6WxS9uCkPILoojn-4', | ||
| }, | ||
| }, | ||
| }; | ||
| export default meta; | ||
| export const Primary: StoryObj<TuneMenuComponent> = { | ||
| render: () => ({ | ||
| styles: [ | ||
| `.hra-app { | ||
| margin: -1rem; | ||
| height: 100vh; | ||
| }`, | ||
| ], | ||
| }), | ||
| }; |
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.
Uh oh!
There was an error while loading. Please reload this page.