-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3446 from IgniteUI/didimmova/calendar-orientation
feat(calendar): create calendar orientation sample
- Loading branch information
Showing
8 changed files
with
135 additions
and
2 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
31 changes: 31 additions & 0 deletions
31
src/app/scheduling/calendar/calendar-sample-9/calendar-sample-9.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,31 @@ | ||
<div class="preview__sample"> | ||
<article class="calendar-wrapper"> | ||
<igx-calendar [monthsViewNumber]="2" [headerOrientation]="headerOrientation" [orientation]="orientation"></igx-calendar> | ||
</article> | ||
|
||
<div class="preview__settings"> | ||
<small>Header orientation</small> | ||
<igx-buttongroup selectionMode="singleRequired"> | ||
<button | ||
igxButton | ||
(click)="setHeaderOrientation(ho)" | ||
*ngFor="let ho of orientations" | ||
[selected]="ho === headerOrientation" | ||
> | ||
{{ ho }} | ||
</button> | ||
</igx-buttongroup> | ||
|
||
<small>View orientation</small> | ||
<igx-buttongroup selectionMode="singleRequired"> | ||
<button | ||
igxButton | ||
(click)="setOrientation(vo)" | ||
*ngFor="let vo of orientations" | ||
[selected]="vo === orientation" | ||
> | ||
{{ vo }} | ||
</button> | ||
</igx-buttongroup> | ||
</div> | ||
</div> |
51 changes: 51 additions & 0 deletions
51
src/app/scheduling/calendar/calendar-sample-9/calendar-sample-9.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,51 @@ | ||
$padding: 2rem; | ||
|
||
:host { | ||
display: flex; | ||
flex-direction: column; | ||
height: calc(100vh - 90px); | ||
overflow: hidden; | ||
} | ||
|
||
small { | ||
&:not(:first-child) { | ||
margin-block-start: 1rem; | ||
} | ||
} | ||
|
||
.calendar-wrapper { | ||
flex-basis: 100px; | ||
display: flex; | ||
flex-direction: column; | ||
flex-grow: 1; | ||
margin: 20px; | ||
} | ||
|
||
.igx-calendar{ | ||
box-shadow: 0 1px 3px 0 rgba(0,0,0,.26), | ||
0 1px 1px 0 rgba(0,0,0,.12), | ||
0 2px 1px -1px rgba(0,0,0,.08); | ||
} | ||
|
||
.preview { | ||
display: flex; | ||
overflow: hidden; | ||
height: 100%; | ||
|
||
&__sample { | ||
display: flex; | ||
flex-wrap: wrap; | ||
overflow: auto; | ||
flex: 1; | ||
} | ||
|
||
&__settings { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
background: hsla(var(--ig-gray-50)); | ||
border-left: 1px solid hsla(var(--ig-gray-300)); | ||
padding: $padding; | ||
overflow-x: auto; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/app/scheduling/calendar/calendar-sample-9/calendar-sample-9.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,28 @@ | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { | ||
IgxButtonGroupComponent} | ||
from 'igniteui-angular'; | ||
|
||
const orientations = ["horizontal", "vertical"] as const; | ||
type Orientation = (typeof orientations)[number]; | ||
|
||
@Component({ | ||
selector: 'app-calendar', | ||
styleUrls: ['./calendar-sample-9.component.scss'], | ||
templateUrl: './calendar-sample-9.component.html' | ||
}) | ||
|
||
export class CalendarSample9Component { | ||
@ViewChild(IgxButtonGroupComponent, { static: true }) public buttonGroup: IgxButtonGroupComponent; | ||
protected orientations = Array.from(orientations, (o) => o); | ||
protected headerOrientation: Orientation = "horizontal"; | ||
protected orientation: Orientation = "horizontal"; | ||
|
||
protected setHeaderOrientation(orientation: Orientation) { | ||
this.headerOrientation = orientation; | ||
} | ||
|
||
protected setOrientation(orientation: Orientation) { | ||
this.orientation = orientation; | ||
} | ||
} |
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