Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
b171eaf3fc | |||
5585d7e304 | |||
02119a1ce4 | |||
222f06bda7 | |||
8ee99136cc | |||
faf35c3144 |
2239
package-lock.json
generated
2239
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-catalog",
|
"name": "@designestate/dees-catalog",
|
||||||
"version": "1.0.20",
|
"version": "1.0.23",
|
||||||
"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,12 @@
|
|||||||
"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",
|
||||||
"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",
|
||||||
|
89
ts_web/elements/dees-icon.ts
Normal file
89
ts_web/elements/dees-icon.ts
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
import { LitElement, html, property, customElement } from 'lit-element';
|
||||||
|
|
||||||
|
import * as domtools from '@designestate/dees-domtools';
|
||||||
|
|
||||||
|
import { icon, IconDefinition } from "@fortawesome/fontawesome-svg-core";
|
||||||
|
import { faFacebook, faTwitter, faLinkedin, faMedium } from '@fortawesome/free-brands-svg-icons';
|
||||||
|
|
||||||
|
type TBrand = 'facebook' | 'twitter' | 'linkedin' | 'medium';
|
||||||
|
const brandIcons: {[key: string]: IconDefinition} = {
|
||||||
|
facebook: faFacebook,
|
||||||
|
twitter: faTwitter,
|
||||||
|
linkedin: faLinkedin,
|
||||||
|
medium: faMedium
|
||||||
|
};
|
||||||
|
|
||||||
|
@customElement('dees-icon')
|
||||||
|
export class DeesIcon extends LitElement {
|
||||||
|
public static demo = () => html`
|
||||||
|
<div style="background: #fff; padding: 10px;">
|
||||||
|
<dees-icon iconName="visibility"></dees-icon>
|
||||||
|
<dees-icon brandName="facebook"></dees-icon>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
`;
|
||||||
|
|
||||||
|
@property()
|
||||||
|
public iconName: string;
|
||||||
|
|
||||||
|
@property()
|
||||||
|
public brandName: TBrand;
|
||||||
|
|
||||||
|
@property()
|
||||||
|
public svgSize: number = 20;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
domtools.elementBasic.setup();
|
||||||
|
}
|
||||||
|
|
||||||
|
public render() {
|
||||||
|
return html`
|
||||||
|
${domtools.elementBasic.styles}
|
||||||
|
<style>
|
||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
line-height: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
||||||
|
#iconContainer svg {
|
||||||
|
display: inline-block;
|
||||||
|
height: ${this.svgSize}px;
|
||||||
|
}
|
||||||
|
.material-icons {
|
||||||
|
font-family: 'Material Icons';
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
line-height: inherit;
|
||||||
|
font-size: inherit;
|
||||||
|
display: inline-block;
|
||||||
|
line-height: inherit;
|
||||||
|
text-transform: none;
|
||||||
|
letter-spacing: normal;
|
||||||
|
word-wrap: normal;
|
||||||
|
white-space: nowrap;
|
||||||
|
direction: ltr;
|
||||||
|
|
||||||
|
/* Support for all WebKit browsers. */
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
/* Support for Safari and Chrome. */
|
||||||
|
text-rendering: optimizeLegibility;
|
||||||
|
|
||||||
|
/* Support for Firefox. */
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
|
||||||
|
/* Support for IE. */
|
||||||
|
font-feature-settings: 'liga';
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
${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(brandIcons[this.brandName]).html[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
export * from './dees-button';
|
export * from './dees-button';
|
||||||
export * from './dees-form';
|
export * from './dees-form';
|
||||||
export * from './dees-form-submit';
|
export * from './dees-form-submit';
|
||||||
|
export * from './dees-icon';
|
||||||
export * from './dees-input-checkbox';
|
export * from './dees-input-checkbox';
|
||||||
export * from './dees-input-dropdown';
|
export * from './dees-input-dropdown';
|
||||||
export * from './dees-input-quantityselector';
|
export * from './dees-input-quantityselector';
|
||||||
|
Reference in New Issue
Block a user