Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf5cd37ebc | |||
| 88554396a4 | |||
| 2f13311098 | |||
| 5407b158d0 | |||
| b171eaf3fc | |||
| 5585d7e304 | |||
| 02119a1ce4 | |||
| 222f06bda7 |
2255
package-lock.json
generated
2255
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-catalog",
|
"name": "@designestate/dees-catalog",
|
||||||
"version": "1.0.21",
|
"version": "1.0.25",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "website for lossless.com",
|
"description": "website for lossless.com",
|
||||||
"main": "dist_ts_web/index.js",
|
"main": "dist_ts_web/index.js",
|
||||||
@@ -13,10 +13,14 @@
|
|||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@designestate/dees-domtools": "^1.0.47",
|
"@designestate/dees-domtools": "^1.0.79",
|
||||||
"@designestate/dees-wcctools": "^1.0.37",
|
"@designestate/dees-wcctools": "^1.0.49",
|
||||||
|
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
||||||
|
"@fortawesome/free-brands-svg-icons": "^5.15.1",
|
||||||
|
"@fortawesome/free-regular-svg-icons": "^5.15.1",
|
||||||
|
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
||||||
"lit-element": "^2.4.0",
|
"lit-element": "^2.4.0",
|
||||||
"typescript": "^4.0.2"
|
"typescript": "^4.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.25",
|
"@gitzone/tsbuild": "^2.1.25",
|
||||||
|
|||||||
@@ -2,13 +2,63 @@ import { LitElement, html, property, customElement } from 'lit-element';
|
|||||||
|
|
||||||
import * as domtools from '@designestate/dees-domtools';
|
import * as domtools from '@designestate/dees-domtools';
|
||||||
|
|
||||||
|
import { icon, IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
||||||
|
import {
|
||||||
|
faFacebook,
|
||||||
|
faGoogle,
|
||||||
|
faLinkedin,
|
||||||
|
faMedium,
|
||||||
|
faSlack,
|
||||||
|
faTwitter,
|
||||||
|
} from '@fortawesome/free-brands-svg-icons';
|
||||||
|
|
||||||
|
import {} from '@fortawesome/free-regular-svg-icons';
|
||||||
|
import { faDesktop, faRss, faUsers } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
|
type TFontAwesomeIcon =
|
||||||
|
// normal
|
||||||
|
| 'desktop'
|
||||||
|
| 'rss'
|
||||||
|
// brands
|
||||||
|
| 'facebook'
|
||||||
|
| 'google'
|
||||||
|
| 'twitter'
|
||||||
|
| 'linkedin'
|
||||||
|
| 'medium'
|
||||||
|
| 'slack'
|
||||||
|
| 'users';
|
||||||
|
const faIcons: { [key: string]: IconDefinition } = {
|
||||||
|
// normal
|
||||||
|
desktop: faDesktop,
|
||||||
|
rss: faRss,
|
||||||
|
// brands
|
||||||
|
facebook: faFacebook,
|
||||||
|
google: faGoogle,
|
||||||
|
linkedin: faLinkedin,
|
||||||
|
medium: faMedium,
|
||||||
|
slack: faSlack,
|
||||||
|
twitter: faTwitter,
|
||||||
|
users: faUsers,
|
||||||
|
};
|
||||||
|
|
||||||
@customElement('dees-icon')
|
@customElement('dees-icon')
|
||||||
export class DeesIcon extends LitElement {
|
export class DeesIcon extends LitElement {
|
||||||
public static demo = () => html`<dees-icon iconName="visibility"></dees-icon>`;
|
public static demo = () => html`
|
||||||
|
<div style="background: #fff; padding: 10px;">
|
||||||
|
<dees-icon iconName="visibility"></dees-icon>
|
||||||
|
<dees-icon brandName="facebook"></dees-icon>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public iconName: string;
|
public iconName: string;
|
||||||
|
|
||||||
|
@property()
|
||||||
|
public brandName: TFontAwesomeIcon;
|
||||||
|
|
||||||
|
@property()
|
||||||
|
public svgSize: number = 20;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
domtools.elementBasic.setup();
|
domtools.elementBasic.setup();
|
||||||
@@ -23,6 +73,10 @@ export class DeesIcon extends LitElement {
|
|||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
}
|
}
|
||||||
|
#iconContainer svg {
|
||||||
|
display: inline-block;
|
||||||
|
height: ${this.svgSize}px;
|
||||||
|
}
|
||||||
.material-icons {
|
.material-icons {
|
||||||
font-family: 'Material Icons';
|
font-family: 'Material Icons';
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
@@ -49,7 +103,16 @@ export class DeesIcon extends LitElement {
|
|||||||
font-feature-settings: 'liga';
|
font-feature-settings: 'liga';
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<i class="material-icons">${this.iconName}</i>
|
${this.iconName ? html`<i class="material-icons">${this.iconName}</i>` : html``}
|
||||||
|
${this.brandName ? html`<div id="iconContainer"></div>` : html``}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
firstUpdated() {
|
||||||
|
if (this.brandName && !this.iconName) {
|
||||||
|
this.shadowRoot.querySelector('#iconContainer').innerHTML = icon(
|
||||||
|
faIcons[this.brandName]
|
||||||
|
).html[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user