Compare commits
26 Commits
Author | SHA1 | Date | |
---|---|---|---|
01963447dd | |||
5d1d1ba4ba | |||
7885422033 | |||
fb48425c13 | |||
3792c5edf5 | |||
2abd91ab4a | |||
310910e8ee | |||
3301ad1556 | |||
0f8a7a5a7b | |||
f1a0c5741c | |||
cbf60db9fa | |||
34d5bda579 | |||
916ba68c94 | |||
46fc396772 | |||
0e77baf600 | |||
89fd8b5080 | |||
884f9725b5 | |||
48e093b1ba | |||
2b3875d738 | |||
279d1c2f3f | |||
29f2839d5b | |||
96683b4380 | |||
36fbf7f29e | |||
67d4c216ed | |||
9d51cdd480 | |||
d6679ca41f |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@designestate/dees-catalog",
|
||||
"version": "1.0.125",
|
||||
"version": "1.0.138",
|
||||
"private": false,
|
||||
"description": "website for lossless.com",
|
||||
"main": "dist_ts_web/index.js",
|
||||
@ -23,7 +23,7 @@
|
||||
"@fortawesome/free-regular-svg-icons": "^6.2.1",
|
||||
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
||||
"@pushrocks/smartpromise": "^3.1.7",
|
||||
"@tsclass/tsclass": "^4.0.28",
|
||||
"@tsclass/tsclass": "^4.0.29",
|
||||
"pdfjs-dist": "^2.15.349"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
579
pnpm-lock.yaml
generated
579
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@designestate/dees-catalog',
|
||||
version: '1.0.125',
|
||||
version: '1.0.138',
|
||||
description: 'website for lossless.com'
|
||||
}
|
||||
|
139
ts_web/elements/dees-contextmenu.ts
Normal file
139
ts_web/elements/dees-contextmenu.ts
Normal file
@ -0,0 +1,139 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import {
|
||||
customElement,
|
||||
html,
|
||||
DeesElement,
|
||||
property,
|
||||
TemplateResult,
|
||||
cssManager,
|
||||
css,
|
||||
unsafeCSS,
|
||||
} from '@designestate/dees-element';
|
||||
|
||||
import * as domtools from '@designestate/dees-domtools';
|
||||
import { DeesWindowLayer } from './dees-windowlayer.js';
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'dees-contextmenu': DeesContextmenu;
|
||||
}
|
||||
}
|
||||
|
||||
@customElement('dees-contextmenu')
|
||||
export class DeesContextmenu extends DeesElement {
|
||||
// DEMO
|
||||
public static demo = () => html`
|
||||
<style>
|
||||
.withMargin {
|
||||
display: block;
|
||||
margin: 20px;
|
||||
}
|
||||
</style>
|
||||
<dees-button @click=${() => {
|
||||
DeesContextmenu.openContextMenuWithOptions();
|
||||
}}>Hello</dees-button>
|
||||
<dees-contextmenu class="withMargin"></dees-contextmenu>
|
||||
<dees-contextmenu
|
||||
class="withMargin"
|
||||
.menuItems=${[
|
||||
{
|
||||
name: 'copy',
|
||||
iconName: 'copySolid',
|
||||
action: async () => {},
|
||||
},
|
||||
{
|
||||
name: 'edit',
|
||||
iconName: 'penToSquare',
|
||||
action: async () => {},
|
||||
},{
|
||||
name: 'paste',
|
||||
iconName: 'pasteSolid',
|
||||
action: async () => {},
|
||||
},
|
||||
] as plugins.tsclass.website.IMenuItem[]}
|
||||
></dees-contextmenu>
|
||||
`;
|
||||
|
||||
// STATIC
|
||||
public static openContextMenuWithOptions(eventArg, contextOptions: plugins.tsclass.website.IMenuItem[]) {
|
||||
const contextMenu = new DeesContextmenu();
|
||||
contextMenu.style.position = 'absolute';
|
||||
contextMenu;
|
||||
const windowLayer = new DeesWindowLayer();
|
||||
windowLayer.append(contextMenu);
|
||||
document.body.append(windowLayer);
|
||||
}
|
||||
|
||||
@property({
|
||||
type: Array,
|
||||
})
|
||||
public menuItems: plugins.tsclass.website.IMenuItem[] = [];
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
public static styles = [
|
||||
cssManager.defaultStyles,
|
||||
css`
|
||||
:host {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mainbox {
|
||||
color: ${cssManager.bdTheme('#222', '#ccc')};
|
||||
font-size: 14px;
|
||||
width: 200px;
|
||||
border: 1px solid #444;
|
||||
min-height: 40px;
|
||||
border-radius: 3px;
|
||||
background: #222;
|
||||
box-shadow: 0px 1px 4px #000;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.mainbox .menuitem {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.mainbox .menuitem dees-icon {
|
||||
display: inline-block;
|
||||
margin-right: 8px;
|
||||
width: 14px;
|
||||
transform: translateY(2px);
|
||||
}
|
||||
|
||||
.mainbox .menuitem:hover {
|
||||
cursor: pointer;
|
||||
background: #ffffff10;
|
||||
}
|
||||
|
||||
.mainbox .menuitem:active {
|
||||
cursor: pointer;
|
||||
background: #ffffff05;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
public render(): TemplateResult {
|
||||
return html`
|
||||
<div class="mainbox">
|
||||
${this.menuItems.map((menuItemArg) => {
|
||||
return html`
|
||||
<div class="menuitem">
|
||||
<dees-icon .iconFA=${(menuItemArg.iconName as any) || 'minus'}></dees-icon
|
||||
>${menuItemArg.name}
|
||||
</div>
|
||||
`;
|
||||
})}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
public async firstUpdated() {
|
||||
if (!this.menuItems || this.menuItems.length === 0) {
|
||||
const mainbox = this.shadowRoot.querySelector('.mainbox');
|
||||
mainbox.textContent = 'no menu items present';
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,11 @@
|
||||
import { DeesElement, html, property, customElement } from '@designestate/dees-element';
|
||||
import {
|
||||
DeesElement,
|
||||
html,
|
||||
property,
|
||||
customElement,
|
||||
cssManager,
|
||||
css,
|
||||
} from '@designestate/dees-element';
|
||||
|
||||
import * as domtools from '@designestate/dees-domtools';
|
||||
|
||||
@ -15,35 +22,76 @@ import {
|
||||
} from '@fortawesome/free-brands-svg-icons';
|
||||
|
||||
import {
|
||||
faCopy as faCopyRegular,
|
||||
faMessage as faMessageRegular,
|
||||
faPaste as faPasteRegular,
|
||||
faSun as faSunRegular,
|
||||
} from '@fortawesome/free-regular-svg-icons';
|
||||
import {
|
||||
faArrowRight as faArrowRightSolid,
|
||||
faArrowUpRightFromSquare as faArrowUpRightFromSquareSolid,
|
||||
faBell as faBellSolid,
|
||||
faBug as faBugSolid,
|
||||
faBuilding as faBuildingSolid,
|
||||
faCaretLeft as faCaretLeftSolid,
|
||||
faCaretRight as faCaretRightSolid,
|
||||
faCheck as faCheckSolid,
|
||||
faCircleInfo as faCircleInfoSolid,
|
||||
faCopy as faCopySolid,
|
||||
faDesktop as faDesktopSolid,
|
||||
faGrip as faGripSolid,
|
||||
faMessage as faMessageSolid,
|
||||
faMinus as faMinusSolid,
|
||||
faPaste as faPasteSolid,
|
||||
faPenToSquare as faPenToSquareSolid,
|
||||
faRss as faRssSolid,
|
||||
faUsers as faUsersSolid,
|
||||
faShare as faShareSolid,
|
||||
faSun as faSunSolid,
|
||||
faGrip as faGripSolid,
|
||||
faXmark as faXmarkSolid,
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
export const faIcons = {
|
||||
// normal
|
||||
arrowRight: faArrowRightSolid,
|
||||
arrowUpRightFromSquare: faArrowUpRightFromSquareSolid,
|
||||
arrowUpRightFromSquareSolid: faArrowUpRightFromSquareSolid,
|
||||
bell: faBellSolid,
|
||||
bellSolid: faBellSolid,
|
||||
bug: faBugSolid,
|
||||
bugSolid: faBugSolid,
|
||||
building: faBuildingSolid,
|
||||
buildingSolid: faBuildingSolid,
|
||||
caretLeft: faCaretLeftSolid,
|
||||
caretLeftSolid: faCaretLeftSolid,
|
||||
caretRight: faCaretRightSolid,
|
||||
caretRightSolid: faCaretRightSolid,
|
||||
check: faCheckSolid,
|
||||
checkSolid: faCheckSolid,
|
||||
circleinfo: faCircleInfoSolid,
|
||||
circleinfoSolid: faCircleInfoSolid,
|
||||
copy: faCopyRegular,
|
||||
copySolid: faCopySolid,
|
||||
desktop: faDesktopSolid,
|
||||
desktopSolid: faDesktopSolid,
|
||||
grip: faGripSolid,
|
||||
gripSolid: faGripSolid,
|
||||
message: faMessageRegular,
|
||||
messageSolid: faMessageRegular,
|
||||
messageSolid: faMessageSolid,
|
||||
minus: faMinusSolid,
|
||||
minusSolid: faMinusSolid,
|
||||
paste: faPasteRegular,
|
||||
pasteSolid: faPasteSolid,
|
||||
penToSquare: faPenToSquareSolid,
|
||||
penToSquareSolid: faPenToSquareSolid,
|
||||
rss: faRssSolid,
|
||||
rssSolid: faRssSolid,
|
||||
share: faShareSolid,
|
||||
shareSolid: faShareSolid,
|
||||
sun: faSunRegular,
|
||||
sunSolid: faSunSolid,
|
||||
xmark: faXmarkSolid,
|
||||
xmarkSolid: faXmarkSolid,
|
||||
// brands
|
||||
facebook: faFacebook,
|
||||
google: faGoogle,
|
||||
@ -66,37 +114,58 @@ declare global {
|
||||
export class DeesIcon extends DeesElement {
|
||||
public static demo = () => html`
|
||||
<dees-icon iconName="visibility"></dees-icon>
|
||||
<div style="background: #fff; padding: 10px; font-size: 24px">
|
||||
<dees-icon iconFA="message"></dees-icon>
|
||||
<dees-icon iconFA="sun"></dees-icon>
|
||||
<dees-icon iconFA="sunSolid"></dees-icon>
|
||||
<dees-icon iconFA="facebook"></dees-icon>
|
||||
<div style="background: #fff; padding: 10px; font-size: 30px">
|
||||
<style>
|
||||
dees-icon {
|
||||
transition: color 0.05s;
|
||||
}
|
||||
dees-icon:hover {
|
||||
color: #e4002b;
|
||||
}
|
||||
</style>
|
||||
<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()
|
||||
public iconSize: number = 20;
|
||||
public iconSize: number;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
domtools.elementBasic.setup();
|
||||
}
|
||||
|
||||
public static styles = [
|
||||
cssManager.defaultStyles,
|
||||
css`
|
||||
:host {
|
||||
display: block;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
* {
|
||||
transition: inherit !important;
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
public render() {
|
||||
return html`
|
||||
${domtools.elementBasic.styles}
|
||||
<style>
|
||||
:host {
|
||||
display: block;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
#iconContainer svg {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
height: ${this.iconSize}px;
|
||||
}
|
||||
</style>
|
||||
@ -105,6 +174,9 @@ export class DeesIcon extends DeesElement {
|
||||
}
|
||||
|
||||
public async firstUpdated() {
|
||||
if (!this.iconSize) {
|
||||
this.iconSize = parseInt(globalThis.getComputedStyle(this).fontSize.replace(/\D/g,''));
|
||||
}
|
||||
if (this.iconFA) {
|
||||
this.shadowRoot.querySelector('#iconContainer').innerHTML = this.iconFA
|
||||
? icon(faIcons[this.iconFA]).html[0]
|
||||
|
@ -23,6 +23,8 @@ export class DeesSpinner extends DeesElement {
|
||||
<dees-spinner></dees-spinner>
|
||||
<dees-spinner status="success"></dees-spinner>
|
||||
<dees-spinner status="error"></dees-spinner>
|
||||
<dees-spinner size=${64} status="success"></dees-spinner>
|
||||
<dees-spinner .size=${64} status="error"></dees-spinner>
|
||||
`;
|
||||
|
||||
@property({
|
||||
@ -45,6 +47,7 @@ export class DeesSpinner extends DeesElement {
|
||||
}
|
||||
|
||||
#loading {
|
||||
position: relative;
|
||||
transition: none;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@ -58,16 +61,12 @@ export class DeesSpinner extends DeesElement {
|
||||
}
|
||||
|
||||
#loading.success {
|
||||
border: 0px solid rgba(255, 255, 255, 0);
|
||||
background: #8bc34a;
|
||||
border-radius: 50%;
|
||||
animation: none;
|
||||
-webkit-animation: none;
|
||||
}
|
||||
|
||||
#loading.error {
|
||||
border: 0px solid rgba(255, 255, 255, 0);
|
||||
background: #e64a19;
|
||||
border-radius: 50%;
|
||||
animation: none;
|
||||
-webkit-animation: none;
|
||||
@ -84,36 +83,18 @@ export class DeesSpinner extends DeesElement {
|
||||
}
|
||||
}
|
||||
|
||||
#loading .checkmark {
|
||||
display: inline-block;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
-ms-transform: rotate(45deg); /* IE 9 */
|
||||
-webkit-transform: rotate(45deg); /* Chrome, Safari, Opera */
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
#loading .checkmark_stem {
|
||||
dees-icon {
|
||||
position: absolute;
|
||||
width: 3px;
|
||||
height: 9px;
|
||||
background-color: #fff;
|
||||
left: 9px;
|
||||
top: 5px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#loading .checkmark_kick {
|
||||
position: absolute;
|
||||
width: 3px;
|
||||
height: 3px;
|
||||
background-color: #fff;
|
||||
left: 6px;
|
||||
top: 11px;
|
||||
#loading.success dees-icon {
|
||||
color: #8bc34a;
|
||||
}
|
||||
|
||||
#loading.disabled .checkmark_stem,
|
||||
#loading.disabled .checkmark_kick {
|
||||
background-color: ${cssManager.bdTheme('#333', '#fff')};
|
||||
#loading.error dees-icon {
|
||||
color: #e64a19;
|
||||
}
|
||||
`,
|
||||
];
|
||||
@ -125,16 +106,24 @@ export class DeesSpinner extends DeesElement {
|
||||
width: ${this.size}px;
|
||||
height: ${this.size}px;
|
||||
}
|
||||
#loading.success {
|
||||
border: ${Math.round(this.size * 0.08)}px solid ${cssManager.bdTheme(`#8bc34a`, '#8bc34a')}
|
||||
}
|
||||
#loading.error {
|
||||
border: ${Math.round(this.size * 0.1)}px solid ${cssManager.bdTheme(`#e64a19`, '#e64a19')}
|
||||
}
|
||||
dees-icon {
|
||||
font-size: ${Math.round(this.size * 0.6)}px;
|
||||
}
|
||||
</style>
|
||||
<div class="${this.status}" id="loading">
|
||||
${this.status === 'success' || this.status === 'error'
|
||||
? html`
|
||||
<span class="checkmark">
|
||||
<div class="checkmark_stem"></div>
|
||||
<div class="checkmark_kick"></div>
|
||||
</span>
|
||||
`
|
||||
: null}
|
||||
${(() => {
|
||||
if (this.status === 'success') {
|
||||
return html`<dees-icon style="transform: translateX(1%) translateY(3%);" .iconFA=${'check' as any}></dees-icon>`;
|
||||
} else if (this.status === 'error') {
|
||||
return html`<dees-icon .iconFA=${'xmark' as any}></dees-icon>`;
|
||||
}
|
||||
})()}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
1
ts_web/elements/dees-tooltip.ts
Normal file
1
ts_web/elements/dees-tooltip.ts
Normal file
@ -0,0 +1 @@
|
||||
import {} from '@designestate/dees-element';
|
@ -1,6 +1,7 @@
|
||||
export * from './dees-button-exit.js';
|
||||
export * from './dees-button.js';
|
||||
export * from './dees-chips.js';
|
||||
export * from './dees-contextmenu.js';
|
||||
export * from './dees-form.js';
|
||||
export * from './dees-form-submit.js';
|
||||
export * from './dees-icon.js';
|
||||
|
Reference in New Issue
Block a user