fix(core): update

This commit is contained in:
Philipp Kunz 2023-01-12 18:14:59 +01:00
parent cbf60db9fa
commit f1a0c5741c
3 changed files with 112 additions and 6 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@designestate/dees-catalog',
version: '1.0.133',
version: '1.0.134',
description: 'website for lossless.com'
}

View File

@ -0,0 +1,100 @@
import {
customElement,
html,
DeesElement,
property,
TemplateResult,
cssManager,
css,
unsafeCSS,
} from '@designestate/dees-element';
import * as domtools from '@designestate/dees-domtools';
declare global {
interface HTMLElementTagNameMap {
'dees-contextmenu': DeesContextmenu;
}
}
@customElement('dees-contextmenu')
export class DeesContextmenu extends DeesElement {
public static demo = () => html`
<dees-contextmenu
></dees-contextmenu>
<dees-contextmenu
></dees-contextmenu>
`;
@property()
public selectionMode: 'single' | 'multiple' = 'single';
@property({
type: Array,
})
public selectableChips: string[] = [];
@property()
public selectedChip: string = null;
@property({
type: Array,
})
public selectedChips: string[] = [];
constructor() {
super();
}
public static styles = [
cssManager.defaultStyles,
css`
:host {
display: block;
box-sizing: border-box;
}
.mainbox {
}
`,
];
public render(): TemplateResult {
return html`
<div class="mainbox">
</div>
`;
}
public async firstUpdated() {
if (!this.textContent) {
this.textContent = 'Button';
this.performUpdate();
}
}
public async selectChip(chipArg: string) {
if (this.selectionMode === 'single') {
if (this.selectedChip === chipArg) {
this.selectedChip = null;
this.selectedChips = [];
} else {
this.selectedChip = chipArg;
this.selectedChips = [chipArg];
}
} else if (this.selectionMode === 'multiple') {
if (this.selectedChips.includes(chipArg)) {
this.selectedChips = this.selectedChips.filter((chipArg2) => chipArg !== chipArg2);
} else {
this.selectedChips.push(chipArg);
}
this.requestUpdate();
}
console.log(this.selectedChips);
}
}

View File

@ -26,6 +26,7 @@ import {
faSun as faSunRegular,
} from '@fortawesome/free-regular-svg-icons';
import {
faArrowUpRightFromSquare as faArrowUpRightFromSquareSolid,
faBell as faBellSolid,
faBug as faBugSolid,
faBuilding as faBuildingSolid,
@ -43,6 +44,8 @@ import {
export const faIcons = {
// normal
arrowUpRightFromSquare: faArrowUpRightFromSquareSolid,
arrowUpRightFromSquareSolid: faArrowUpRightFromSquareSolid,
bell: faBellSolid,
bellSolid: faBellSolid,
bug: faBugSolid,
@ -90,14 +93,17 @@ export class DeesIcon extends DeesElement {
public static demo = () => html`
<dees-icon iconName="visibility"></dees-icon>
<div style="background: #fff; padding: 10px; font-size: 30px">
<dees-icon iconFA="messageSolid"></dees-icon>
<dees-icon iconFA="sun"></dees-icon>
<dees-icon iconFA="sunSolid"></dees-icon>
<dees-icon iconFA="facebook"></dees-icon>
<dees-icon .iconFA=${'messageSolid'}></dees-icon>
<dees-icon .iconFA=${'sun'}></dees-icon>
<dees-icon .iconFA=${'sunSolid'}></dees-icon>
<dees-icon .iconFA=${'facebook'}></dees-icon>
<dees-icon .iconFA=${'arrowUpRightFromSquare'}></dees-icon>
</div>
`;
@property()
@property({
type: String
})
public iconFA: keyof typeof faIcons;
@property()