-
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 #3508 from IgniteUI/simeonoff/samples-18.1.x
refactor(*): update samples related to the 18.1.x release
- Loading branch information
Showing
17 changed files
with
181 additions
and
35 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
18 changes: 18 additions & 0 deletions
18
src/app/data-display/icon/icon-service-sample/icon-service-sample.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,18 @@ | ||
<div class="wrapper"> | ||
<igx-card> | ||
<igx-card-header> | ||
<igx-avatar> | ||
<igx-icon family="default" name="weather_status"></igx-icon> | ||
</igx-avatar> | ||
<h3 igxCardHeaderTitle>{{ status }}</h3> | ||
<h6 igxCardHeaderSubtitle>Current Weather</h6> | ||
</igx-card-header> | ||
<igx-card-actions> | ||
<button igxButton="contained" igxEnd (click)="updateWeather()"> | ||
<igx-icon name="sync" family="material"></igx-icon> | ||
<span>Refresh</span> | ||
</button> | ||
</igx-card-actions> | ||
<igx-icon family="default" name="weather_status" backdrop inert></igx-icon> | ||
</igx-card> | ||
</div> |
35 changes: 35 additions & 0 deletions
35
src/app/data-display/icon/icon-service-sample/icon-service-sample.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,35 @@ | ||
@use "../../../../variables" as *; | ||
|
||
.wrapper { | ||
display: flex; | ||
flex-flow: row wrap; | ||
margin: rem(16px) 0; | ||
} | ||
|
||
igx-card { | ||
position: relative; | ||
z-index: 0; | ||
min-width: rem(320px); | ||
} | ||
|
||
igx-avatar { | ||
z-index: 1; | ||
--ig-size: var(--ig-size-medium); | ||
--background: hsla(var(--ig-secondary-500), 6%); | ||
border: 1px solid hsl(var(--ig-secondary-500)); | ||
border-radius: rem(4px); | ||
|
||
igx-icon { | ||
--size: #{rem(48px)}; | ||
color: hsl(var(--ig-secondary-500)); | ||
} | ||
} | ||
|
||
igx-icon[backdrop] { | ||
--size: #{rem(128px)}; | ||
inset-block: rem(18px); | ||
inset-inline: calc(100% - var(--size)); | ||
z-index: -1; | ||
position: absolute; | ||
color: hsl(var(--ig-gray-300)); | ||
} |
47 changes: 47 additions & 0 deletions
47
src/app/data-display/icon/icon-service-sample/icon-service-sample.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,47 @@ | ||
import { Component } from '@angular/core'; | ||
import { IgxIconService } from 'igniteui-angular'; | ||
|
||
@Component({ | ||
selector: 'app-icon-service-sample', | ||
styleUrls: ['./icon-service-sample.component.scss'], | ||
templateUrl: './icon-service-sample.component.html' | ||
}) | ||
export class IconServiceSampleComponent { | ||
private weather = [{ | ||
icon: 'partly_cloudy', | ||
description: '18° Partly Cloudy' | ||
}, | ||
{ | ||
icon: 'sunny', | ||
description: '23° Sunny' | ||
}, | ||
{ | ||
icon: 'thunderstorms', | ||
description: '15° Thunderstorms' | ||
}]; | ||
|
||
protected get status() { | ||
return this.weather.at(0).description | ||
}; | ||
|
||
constructor(private iconService: IgxIconService) { | ||
// Add the SVG assets to the icon service collection | ||
this.iconService.addSvgIcon('partly_cloudy', 'assets/images/icons/partly_cloudy.svg', 'weather'); | ||
this.iconService.addSvgIcon('sunny', 'assets/images/icons/sunny.svg', 'weather'); | ||
this.iconService.addSvgIcon('thunderstorms', 'assets/images/icons/thunderstorms.svg', 'weather'); | ||
|
||
this.iconService.addIconRef('weather_status', 'default', { | ||
name: 'partly_cloudy', | ||
family: 'weather' | ||
}); | ||
} | ||
|
||
protected updateWeather() { | ||
this.weather.unshift(this.weather.pop()); | ||
|
||
this.iconService.setIconRef('weather_status', 'default', { | ||
name: this.weather.at(0).icon, | ||
family: 'weather' | ||
}); | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.