-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d49a5ee
commit 1a29b29
Showing
15 changed files
with
298 additions
and
6 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
72 changes: 72 additions & 0 deletions
72
...ne-fitler/components/filter-with-overlay/spline-inline-filter-with-overlay.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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<!-- | ||
~ Copyright 2021 ABSA Group Limited | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
|
||
<spline-inline-filter [icon]="icon" | ||
[matMenuTriggerFor]="overlay" | ||
[label]="label"> | ||
{{ filterStringValues }} | ||
</spline-inline-filter> | ||
|
||
<mat-menu #overlay="matMenu" class="spline-inline-filter-overlay"> | ||
<ng-template matMenuContent> | ||
<div (click)="$event.stopPropagation()"> | ||
<div class="spline-inline-filter-overlay__content-wrapper"> | ||
<!-- VALUE CONTROL --> | ||
<ng-content></ng-content> | ||
<!-- VALUE CONTROL --> | ||
</div> | ||
|
||
<!-- ACTIONS --> | ||
<div class="spline-inline-filter-overlay__footer-wrapper"> | ||
<div class="spline-inline-filter-overlay__actions"> | ||
|
||
<div class="spline-inline-filter-overlay__actions-left"> | ||
<!-- CLEAR --> | ||
<button mat-button | ||
size="md" | ||
(click)="onClearBtnClicked()"> | ||
{{ 'COMMON.CLEAR' | translate }} | ||
</button> | ||
<!-- ./CLEAR --> | ||
</div> | ||
<div class="spline-inline-filter-overlay__actions-right"> | ||
<!-- CANCEL --> | ||
<button mat-button | ||
mat-raised-button | ||
size="md" | ||
(click)="onCancelBtnClicked($event)"> | ||
{{ 'COMMON.CANCEL' | translate }} | ||
</button> | ||
<!-- ./CANCEL --> | ||
|
||
<!-- APPLY --> | ||
<button mat-button | ||
mat-raised-button | ||
color="primary" | ||
size="md" | ||
[disabled]="applyBtnDisabled" | ||
(click)="onApplyBtnClicked($event)"> | ||
{{ 'COMMON.APPLY' | translate }} | ||
</button> | ||
<!-- ./APPLY --> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- ./ACTIONS --> | ||
</div> | ||
</ng-template> | ||
</mat-menu> |
66 changes: 66 additions & 0 deletions
66
...line-fitler/components/filter-with-overlay/spline-inline-filter-with-overlay.component.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2021 ABSA Group Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core' | ||
import { MatMenuTrigger } from '@angular/material/menu' | ||
|
||
import { SplineInlineFilterWithOverlay } from './spline-inline-filter-with-overlay.models' | ||
|
||
|
||
@Component({ | ||
selector: 'spline-inline-filter-with-overlay', | ||
templateUrl: './spline-inline-filter-with-overlay.component.html' | ||
}) | ||
export class SplineInlineFilterWithOverlayComponent { | ||
|
||
@Input() icon: string | ||
@Input() label: string | ||
@Input() filterStringValues: string[] = [] | ||
|
||
@Input() showActions = true | ||
@Input() applyBtnDisabled = false | ||
@Input() options: SplineInlineFilterWithOverlay.Options = SplineInlineFilterWithOverlay.getDefaultOptions() | ||
|
||
@Output() apply$ = new EventEmitter<void>() | ||
@Output() cancel$ = new EventEmitter<void>() | ||
@Output() reset$ = new EventEmitter<void>() | ||
@Output() panelClosed$ = new EventEmitter<void>() | ||
@Output() panelOpened$ = new EventEmitter<void>() | ||
|
||
@ViewChild(MatMenuTrigger, { static: false }) matMenuTrigger: MatMenuTrigger | ||
|
||
|
||
onClearBtnClicked(): void { | ||
this.reset$.emit() | ||
this.closePanel() | ||
} | ||
|
||
onCancelBtnClicked($event: MouseEvent): void { | ||
this.cancel$.emit() | ||
this.closePanel() | ||
} | ||
|
||
onApplyBtnClicked($event: MouseEvent): void { | ||
this.apply$.emit() | ||
this.closePanel() | ||
} | ||
|
||
private closePanel(): void { | ||
this.matMenuTrigger.closeMenu() | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
.../inline-fitler/components/filter-with-overlay/spline-inline-filter-with-overlay.models.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright 2021 ABSA Group Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
export namespace SplineInlineFilterWithOverlay { | ||
|
||
export type Options = {} | ||
|
||
export function getDefaultOptions(): Options { | ||
return {} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
ui/projects/spline-common/main/src/common/component/inline-fitler/components/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright 2021 ABSA Group Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { SplineInlineFilterWithOverlayComponent } from './filter-with-overlay/spline-inline-filter-with-overlay.component' | ||
import { SplineInlineFilterComponent } from './inline-filter/spline-inline-filter.component' | ||
|
||
|
||
export * from './public-api' | ||
|
||
export const splineInlineFiltersComponents = [ | ||
SplineInlineFilterWithOverlayComponent, | ||
SplineInlineFilterComponent | ||
] |
File renamed without changes.
File renamed without changes.
20 changes: 20 additions & 0 deletions
20
ui/projects/spline-common/main/src/common/component/inline-fitler/components/public-api.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Copyright 2021 ABSA Group Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
export * from './filter-with-overlay/spline-inline-filter-with-overlay.component' | ||
export * from './filter-with-overlay/spline-inline-filter-with-overlay.models' | ||
|
||
export * from './inline-filter/spline-inline-filter.component' |
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
49 changes: 49 additions & 0 deletions
49
...ne-common/main/styles/components/inline-filter/_inline-filter-with-overlay.component.scss
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*! | ||
* Copyright 2021 ABSA Group Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
@import 'vars'; | ||
@import 'mixins'; | ||
|
||
$min-width: 280px; | ||
|
||
|
||
.spline-inline-filter-overlay { | ||
&__content-wrapper { | ||
min-width: $min-width; | ||
padding: 8px; | ||
} | ||
|
||
&__footer-wrapper { | ||
|
||
} | ||
|
||
&__actions { | ||
display: flex; | ||
padding: 8px; | ||
width: 100%; | ||
|
||
|
||
&-right { | ||
flex-grow: 1; | ||
text-align: right; | ||
|
||
button { | ||
margin-left: 8px; | ||
} | ||
} | ||
} | ||
} | ||
|
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
ui/projects/spline-common/main/styles/components/inline-filter/index.scss
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright 2021 ABSA Group Limited | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
@import './inline-filter.component'; | ||
@import './inline-filter-with-overlay.component'; |
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