fix(core): update
This commit is contained in:
parent
cbf60db9fa
commit
f1a0c5741c
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@designestate/dees-catalog',
|
name: '@designestate/dees-catalog',
|
||||||
version: '1.0.133',
|
version: '1.0.134',
|
||||||
description: 'website for lossless.com'
|
description: 'website for lossless.com'
|
||||||
}
|
}
|
||||||
|
100
ts_web/elements/dees-contextmenu.ts
Normal file
100
ts_web/elements/dees-contextmenu.ts
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
@ -26,6 +26,7 @@ import {
|
|||||||
faSun as faSunRegular,
|
faSun as faSunRegular,
|
||||||
} from '@fortawesome/free-regular-svg-icons';
|
} from '@fortawesome/free-regular-svg-icons';
|
||||||
import {
|
import {
|
||||||
|
faArrowUpRightFromSquare as faArrowUpRightFromSquareSolid,
|
||||||
faBell as faBellSolid,
|
faBell as faBellSolid,
|
||||||
faBug as faBugSolid,
|
faBug as faBugSolid,
|
||||||
faBuilding as faBuildingSolid,
|
faBuilding as faBuildingSolid,
|
||||||
@ -43,6 +44,8 @@ import {
|
|||||||
|
|
||||||
export const faIcons = {
|
export const faIcons = {
|
||||||
// normal
|
// normal
|
||||||
|
arrowUpRightFromSquare: faArrowUpRightFromSquareSolid,
|
||||||
|
arrowUpRightFromSquareSolid: faArrowUpRightFromSquareSolid,
|
||||||
bell: faBellSolid,
|
bell: faBellSolid,
|
||||||
bellSolid: faBellSolid,
|
bellSolid: faBellSolid,
|
||||||
bug: faBugSolid,
|
bug: faBugSolid,
|
||||||
@ -90,14 +93,17 @@ export class DeesIcon extends DeesElement {
|
|||||||
public static demo = () => html`
|
public static demo = () => html`
|
||||||
<dees-icon iconName="visibility"></dees-icon>
|
<dees-icon iconName="visibility"></dees-icon>
|
||||||
<div style="background: #fff; padding: 10px; font-size: 30px">
|
<div style="background: #fff; padding: 10px; font-size: 30px">
|
||||||
<dees-icon iconFA="messageSolid"></dees-icon>
|
<dees-icon .iconFA=${'messageSolid'}></dees-icon>
|
||||||
<dees-icon iconFA="sun"></dees-icon>
|
<dees-icon .iconFA=${'sun'}></dees-icon>
|
||||||
<dees-icon iconFA="sunSolid"></dees-icon>
|
<dees-icon .iconFA=${'sunSolid'}></dees-icon>
|
||||||
<dees-icon iconFA="facebook"></dees-icon>
|
<dees-icon .iconFA=${'facebook'}></dees-icon>
|
||||||
|
<dees-icon .iconFA=${'arrowUpRightFromSquare'}></dees-icon>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@property()
|
@property({
|
||||||
|
type: String
|
||||||
|
})
|
||||||
public iconFA: keyof typeof faIcons;
|
public iconFA: keyof typeof faIcons;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
|
Loading…
Reference in New Issue
Block a user