Compare commits
60 Commits
Author | SHA1 | Date | |
---|---|---|---|
ab0219d3e4 | |||
7cefd9cba5 | |||
4cf5ca2d7f | |||
a9791220fb | |||
4aed14c7a2 | |||
49d1cba3fd | |||
9bacca3070 | |||
42e7ae6d6b | |||
a8b244520c | |||
9879a2cb6a | |||
e2a54c6f18 | |||
dfd13e641a | |||
2284159b72 | |||
1de86c6bfa | |||
62087a686a | |||
572deb990e | |||
719c63a092 | |||
9d9700214f | |||
bc82e110ef | |||
fe15ebe82d | |||
1b8577d300 | |||
ef4cfb81d8 | |||
abea5942b7 | |||
a6274e9a2d | |||
8b3752f586 | |||
c8e1d24224 | |||
dbd7748ac0 | |||
68984d5702 | |||
5237439f88 | |||
c3df73616f | |||
a03b095d14 | |||
9a18658e09 | |||
2910757e8c | |||
a00bacd4ff | |||
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 |
16
package.json
16
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-catalog",
|
"name": "@designestate/dees-catalog",
|
||||||
"version": "1.0.125",
|
"version": "1.0.155",
|
||||||
"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",
|
||||||
@ -16,14 +16,14 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@designestate/dees-domtools": "^2.0.28",
|
"@designestate/dees-domtools": "^2.0.28",
|
||||||
"@designestate/dees-element": "^2.0.18",
|
"@designestate/dees-element": "^2.0.19",
|
||||||
"@designestate/dees-wcctools": "^1.0.76",
|
"@designestate/dees-wcctools": "^1.0.76",
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.2.1",
|
"@fortawesome/fontawesome-svg-core": "^6.3.0",
|
||||||
"@fortawesome/free-brands-svg-icons": "^6.2.1",
|
"@fortawesome/free-brands-svg-icons": "^6.3.0",
|
||||||
"@fortawesome/free-regular-svg-icons": "^6.2.1",
|
"@fortawesome/free-regular-svg-icons": "^6.3.0",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
"@fortawesome/free-solid-svg-icons": "^6.3.0",
|
||||||
"@pushrocks/smartpromise": "^3.1.7",
|
"@pushrocks/smartpromise": "^3.1.7",
|
||||||
"@tsclass/tsclass": "^4.0.28",
|
"@tsclass/tsclass": "^4.0.34",
|
||||||
"pdfjs-dist": "^2.15.349"
|
"pdfjs-dist": "^2.15.349"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -33,7 +33,7 @@
|
|||||||
"@gitzone/tswatch": "^2.0.5",
|
"@gitzone/tswatch": "^2.0.5",
|
||||||
"@pushrocks/projectinfo": "^5.0.1",
|
"@pushrocks/projectinfo": "^5.0.1",
|
||||||
"@pushrocks/tapbundle": "^5.0.4",
|
"@pushrocks/tapbundle": "^5.0.4",
|
||||||
"@types/node": "^18.11.18"
|
"@types/node": "^18.15.9"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
1033
pnpm-lock.yaml
generated
1033
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@designestate/dees-catalog',
|
name: '@designestate/dees-catalog',
|
||||||
version: '1.0.125',
|
version: '1.0.155',
|
||||||
description: 'website for lossless.com'
|
description: 'website for lossless.com'
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,12 @@ export class DeesButton extends DeesElement {
|
|||||||
<p><dees-button disabled status="error">Error Status</dees-button></p>
|
<p><dees-button disabled status="error">Error Status</dees-button></p>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@property()
|
@property({
|
||||||
|
reflect: true,
|
||||||
|
hasChanged() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
})
|
||||||
public text: string;
|
public text: string;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
@ -81,8 +86,8 @@ export class DeesButton extends DeesElement {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: ${cssManager.bdTheme('#eee', '#333')};
|
background: ${cssManager.bdTheme('#fff', '#333')};
|
||||||
box-shadow: ${cssManager.bdTheme('0px 0px 5px rgba(0,0,0,0.1)', 'none')};
|
box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')};
|
||||||
border: 1px solid ${cssManager.bdTheme('#eee', '#333')};
|
border: 1px solid ${cssManager.bdTheme('#eee', '#333')};
|
||||||
border-top: ${cssManager.bdTheme('1px solid #eee', '1px solid #444')};
|
border-top: ${cssManager.bdTheme('1px solid #eee', '1px solid #444')};
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -181,7 +186,7 @@ export class DeesButton extends DeesElement {
|
|||||||
@click="${this.dispatchClick}"
|
@click="${this.dispatchClick}"
|
||||||
>
|
>
|
||||||
${this.status === 'normal' ? html``: html`
|
${this.status === 'normal' ? html``: html`
|
||||||
<dees-spinner status="${this.status}"></dees-spinner>
|
<dees-spinner .bnw=${true} status="${this.status}"></dees-spinner>
|
||||||
`}
|
`}
|
||||||
<div class="textbox">${this.text ? this.text : this.textContent}</div>
|
<div class="textbox">${this.text ? this.text : this.textContent}</div>
|
||||||
</div>
|
</div>
|
||||||
|
180
ts_web/elements/dees-contextmenu.ts
Normal file
180
ts_web/elements/dees-contextmenu.ts
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
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 @contextmenu=${(eventArg) => {
|
||||||
|
DeesContextmenu.openContextMenuWithOptions(eventArg, [
|
||||||
|
{
|
||||||
|
name: 'copy',
|
||||||
|
iconName: 'copySolid',
|
||||||
|
action: async () => {
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'edit',
|
||||||
|
iconName: 'penToSquare',
|
||||||
|
action: async () => {
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
},{
|
||||||
|
name: 'paste',
|
||||||
|
iconName: 'pasteSolid',
|
||||||
|
action: async () => {
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}}>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 async openContextMenuWithOptions(eventArg: MouseEvent, menuItemsArg: plugins.tsclass.website.IMenuItem[]) {
|
||||||
|
eventArg.preventDefault();
|
||||||
|
const contextMenu = new DeesContextmenu();
|
||||||
|
contextMenu.style.position = 'absolute';
|
||||||
|
contextMenu.style.top = `${eventArg.clientY.toString()}px`;
|
||||||
|
contextMenu.style.left = `${eventArg.clientX.toString()}px`;
|
||||||
|
contextMenu.style.opacity = '0';
|
||||||
|
contextMenu.style.transform = 'scale(0.95,0.95)';
|
||||||
|
contextMenu.style.transformOrigin = 'top left';
|
||||||
|
contextMenu.menuItems = menuItemsArg;
|
||||||
|
document.body.append(contextMenu);
|
||||||
|
await domtools.plugins.smartdelay.delayFor(0);
|
||||||
|
contextMenu.style.opacity = '1';
|
||||||
|
contextMenu.style.transform = 'scale(1,1)';
|
||||||
|
}
|
||||||
|
|
||||||
|
@property({
|
||||||
|
type: Array,
|
||||||
|
})
|
||||||
|
public menuItems: plugins.tsclass.website.IMenuItem[] = [];
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static styles = [
|
||||||
|
cssManager.defaultStyles,
|
||||||
|
css`
|
||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
transition: all 0.1s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.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" @click=${() => this.handleClick(menuItemArg)}>
|
||||||
|
<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';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async handleClick(menuItem: plugins.tsclass.website.IMenuItem) {
|
||||||
|
menuItem.action();
|
||||||
|
await this.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async destroy() {
|
||||||
|
this.style.opacity = '0';
|
||||||
|
this.style.transform = 'scale(0.95,0,95)';
|
||||||
|
await domtools.plugins.smartdelay.delayFor(100);
|
||||||
|
this.parentElement.removeChild(this);
|
||||||
|
}
|
||||||
|
}
|
@ -41,8 +41,7 @@ export class DeesFormSubmit extends DeesElement {
|
|||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
return html`
|
return html`
|
||||||
<dees-button status=${this.status} @click=${this.submit} .disabled=${this.disabled}>
|
<dees-button status=${this.status} @click=${this.submit} .disabled=${this.disabled} .text=${this.text ? this.text : this.textContent}>
|
||||||
${this.text ? this.text : html`<slot></slot>`}
|
|
||||||
</dees-button>
|
</dees-button>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -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';
|
import * as domtools from '@designestate/dees-domtools';
|
||||||
|
|
||||||
@ -15,35 +22,93 @@ import {
|
|||||||
} from '@fortawesome/free-brands-svg-icons';
|
} from '@fortawesome/free-brands-svg-icons';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
faCopy as faCopyRegular,
|
||||||
|
faCircleCheck as faCircleCheckRegular,
|
||||||
|
faCircleXmark as faCircleXmarkRegular,
|
||||||
faMessage as faMessageRegular,
|
faMessage as faMessageRegular,
|
||||||
|
faPaste as faPasteRegular,
|
||||||
faSun as faSunRegular,
|
faSun as faSunRegular,
|
||||||
} from '@fortawesome/free-regular-svg-icons';
|
} from '@fortawesome/free-regular-svg-icons';
|
||||||
import {
|
import {
|
||||||
|
faArrowRight as faArrowRightSolid,
|
||||||
|
faArrowUpRightFromSquare as faArrowUpRightFromSquareSolid,
|
||||||
faBell as faBellSolid,
|
faBell as faBellSolid,
|
||||||
faBug as faBugSolid,
|
faBug as faBugSolid,
|
||||||
|
faBuilding as faBuildingSolid,
|
||||||
|
faCaretLeft as faCaretLeftSolid,
|
||||||
|
faCaretRight as faCaretRightSolid,
|
||||||
|
faCheck as faCheckSolid,
|
||||||
|
faCircleInfo as faCircleInfoSolid,
|
||||||
|
faCircleCheck as faCircleCheckSolid,
|
||||||
|
faCircleXmark as faCircleXmarkSolid,
|
||||||
|
faCopy as faCopySolid,
|
||||||
faDesktop as faDesktopSolid,
|
faDesktop as faDesktopSolid,
|
||||||
|
faEye as faEyeSolid,
|
||||||
|
faEyeSlash as faEyeSlashSolid,
|
||||||
|
faGrip as faGripSolid,
|
||||||
|
faMessage as faMessageSolid,
|
||||||
|
faMugHot as faMugHotSolid,
|
||||||
|
faMinus as faMinusSolid,
|
||||||
|
faPaste as faPasteSolid,
|
||||||
|
faPenToSquare as faPenToSquareSolid,
|
||||||
faRss as faRssSolid,
|
faRss as faRssSolid,
|
||||||
faUsers as faUsersSolid,
|
faUsers as faUsersSolid,
|
||||||
|
faShare as faShareSolid,
|
||||||
faSun as faSunSolid,
|
faSun as faSunSolid,
|
||||||
faGrip as faGripSolid,
|
faXmark as faXmarkSolid,
|
||||||
} from '@fortawesome/free-solid-svg-icons';
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
export const faIcons = {
|
export const faIcons = {
|
||||||
// normal
|
// normal
|
||||||
|
arrowRight: faArrowRightSolid,
|
||||||
|
arrowUpRightFromSquare: faArrowUpRightFromSquareSolid,
|
||||||
|
arrowUpRightFromSquareSolid: faArrowUpRightFromSquareSolid,
|
||||||
bell: faBellSolid,
|
bell: faBellSolid,
|
||||||
bellSolid: faBellSolid,
|
bellSolid: faBellSolid,
|
||||||
bug: faBugSolid,
|
bug: faBugSolid,
|
||||||
bugSolid: faBugSolid,
|
bugSolid: faBugSolid,
|
||||||
|
building: faBuildingSolid,
|
||||||
|
buildingSolid: faBuildingSolid,
|
||||||
|
caretLeft: faCaretLeftSolid,
|
||||||
|
caretLeftSolid: faCaretLeftSolid,
|
||||||
|
caretRight: faCaretRightSolid,
|
||||||
|
caretRightSolid: faCaretRightSolid,
|
||||||
|
check: faCheckSolid,
|
||||||
|
checkSolid: faCheckSolid,
|
||||||
|
circleInfo: faCircleInfoSolid,
|
||||||
|
circleInfoSolid: faCircleInfoSolid,
|
||||||
|
circleCheck: faCircleCheckRegular,
|
||||||
|
circleCheckSolid: faCircleCheckSolid,
|
||||||
|
circleXmark: faCircleXmarkRegular,
|
||||||
|
circleXmarkSolid: faCircleXmarkSolid,
|
||||||
|
copy: faCopyRegular,
|
||||||
|
copySolid: faCopySolid,
|
||||||
desktop: faDesktopSolid,
|
desktop: faDesktopSolid,
|
||||||
desktopSolid: faDesktopSolid,
|
desktopSolid: faDesktopSolid,
|
||||||
|
eye: faEyeSolid,
|
||||||
|
eyeSolid: faEyeSolid,
|
||||||
|
eyeSlash: faEyeSlashSolid,
|
||||||
|
eyeSlashSolid: faEyeSlashSolid,
|
||||||
grip: faGripSolid,
|
grip: faGripSolid,
|
||||||
gripSolid: faGripSolid,
|
gripSolid: faGripSolid,
|
||||||
message: faMessageRegular,
|
message: faMessageRegular,
|
||||||
messageSolid: faMessageRegular,
|
messageSolid: faMessageSolid,
|
||||||
|
mugHot: faMugHotSolid,
|
||||||
|
faMugHotSolid: faMugHotSolid,
|
||||||
|
minus: faMinusSolid,
|
||||||
|
minusSolid: faMinusSolid,
|
||||||
|
paste: faPasteRegular,
|
||||||
|
pasteSolid: faPasteSolid,
|
||||||
|
penToSquare: faPenToSquareSolid,
|
||||||
|
penToSquareSolid: faPenToSquareSolid,
|
||||||
rss: faRssSolid,
|
rss: faRssSolid,
|
||||||
rssSolid: faRssSolid,
|
rssSolid: faRssSolid,
|
||||||
|
share: faShareSolid,
|
||||||
|
shareSolid: faShareSolid,
|
||||||
sun: faSunRegular,
|
sun: faSunRegular,
|
||||||
sunSolid: faSunSolid,
|
sunSolid: faSunSolid,
|
||||||
|
xmark: faXmarkSolid,
|
||||||
|
xmarkSolid: faXmarkSolid,
|
||||||
// brands
|
// brands
|
||||||
facebook: faFacebook,
|
facebook: faFacebook,
|
||||||
google: faGoogle,
|
google: faGoogle,
|
||||||
@ -66,37 +131,58 @@ declare global {
|
|||||||
export class DeesIcon extends DeesElement {
|
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: 24px">
|
<div style="background: #fff; padding: 10px; font-size: 30px">
|
||||||
<dees-icon iconFA="message"></dees-icon>
|
<style>
|
||||||
<dees-icon iconFA="sun"></dees-icon>
|
dees-icon {
|
||||||
<dees-icon iconFA="sunSolid"></dees-icon>
|
transition: color 0.05s;
|
||||||
<dees-icon iconFA="facebook"></dees-icon>
|
}
|
||||||
|
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>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@property()
|
@property({
|
||||||
|
type: String
|
||||||
|
})
|
||||||
public iconFA: keyof typeof faIcons;
|
public iconFA: keyof typeof faIcons;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public iconSize: number = 20;
|
public iconSize: number;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
domtools.elementBasic.setup();
|
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() {
|
public render() {
|
||||||
return html`
|
return html`
|
||||||
${domtools.elementBasic.styles}
|
${domtools.elementBasic.styles}
|
||||||
<style>
|
<style>
|
||||||
:host {
|
|
||||||
display: block;
|
|
||||||
margin: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
#iconContainer svg {
|
#iconContainer svg {
|
||||||
display: inline-block;
|
display: block;
|
||||||
height: ${this.iconSize}px;
|
height: ${this.iconSize}px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -104,7 +190,10 @@ export class DeesIcon extends DeesElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async firstUpdated() {
|
public async updated() {
|
||||||
|
if (!this.iconSize) {
|
||||||
|
this.iconSize = parseInt(globalThis.getComputedStyle(this).fontSize.replace(/\D/g,''));
|
||||||
|
}
|
||||||
if (this.iconFA) {
|
if (this.iconFA) {
|
||||||
this.shadowRoot.querySelector('#iconContainer').innerHTML = this.iconFA
|
this.shadowRoot.querySelector('#iconContainer').innerHTML = this.iconFA
|
||||||
? icon(faIcons[this.iconFA]).html[0]
|
? icon(faIcons[this.iconFA]).html[0]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { customElement, DeesElement, TemplateResult, property, html } from '@designestate/dees-element';
|
import { customElement, DeesElement, TemplateResult, property, html, css, cssManager } from '@designestate/dees-element';
|
||||||
import * as domtools from '@designestate/dees-domtools';
|
import * as domtools from '@designestate/dees-domtools';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
@ -9,7 +9,15 @@ declare global {
|
|||||||
|
|
||||||
@customElement('dees-input-dropdown')
|
@customElement('dees-input-dropdown')
|
||||||
export class DeesInputDropdown extends DeesElement {
|
export class DeesInputDropdown extends DeesElement {
|
||||||
public static demo = () => html`<dees-input-dropdown></dees-input-dropdown>`
|
public static demo = () => html`
|
||||||
|
<dees-input-dropdown
|
||||||
|
.options=${[
|
||||||
|
{option: 'option 1', key: 'option1'},
|
||||||
|
{option: 'option 2', key: 'option2'},
|
||||||
|
{option: 'option 3', key: 'option3'}
|
||||||
|
]}
|
||||||
|
></dees-input-dropdown>
|
||||||
|
`
|
||||||
|
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
public changeSubject = new domtools.rxjs.Subject();
|
public changeSubject = new domtools.rxjs.Subject();
|
||||||
@ -40,11 +48,10 @@ export class DeesInputDropdown extends DeesElement {
|
|||||||
})
|
})
|
||||||
public disabled: boolean = false;
|
public disabled: boolean = false;
|
||||||
|
|
||||||
public render(): TemplateResult {
|
public static styles = [
|
||||||
return html`
|
cssManager.defaultStyles,
|
||||||
${domtools.elementBasic.styles}
|
css`
|
||||||
<style>
|
* {
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +59,7 @@ export class DeesInputDropdown extends DeesElement {
|
|||||||
position: relative;
|
position: relative;
|
||||||
display: block;
|
display: block;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
|
color: ${cssManager.bdTheme('#222', '#fff')};
|
||||||
}
|
}
|
||||||
|
|
||||||
.maincontainer {
|
.maincontainer {
|
||||||
@ -68,41 +76,68 @@ export class DeesInputDropdown extends DeesElement {
|
|||||||
position: relative;
|
position: relative;
|
||||||
max-width: 420px;
|
max-width: 420px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border: 1px solid #CCC;
|
line-height: 40px;
|
||||||
padding: 12px;
|
padding: 0px 8px;
|
||||||
z-index: 0px;
|
z-index: 0px;
|
||||||
|
background: ${cssManager.bdTheme('#ffffff', '#333333')};
|
||||||
|
box-shadow: ${cssManager.bdTheme('0px 1px 4px rgba(0,0,0,0.3)', 'none')};
|
||||||
|
border-radius: 3px;
|
||||||
|
border-top: 1px solid #CCCCCC00;
|
||||||
|
border-bottom: 1px solid #66666600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.selectedBox.show {
|
||||||
|
border-top: 1px solid ${cssManager.bdTheme('#ffffff', '#666666')};
|
||||||
|
border-bottom: 1px solid ${cssManager.bdTheme('#fafafa', '#222222')};
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectionBox {
|
.selectionBox {
|
||||||
|
will-change:transform;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #ffffff;
|
background: ${cssManager.bdTheme('#ffffff', '#222222')};
|
||||||
max-width: 420px;
|
max-width: 420px;
|
||||||
box-shadow: 0px 0px 5px rgba(0,0,0,0.2);
|
box-shadow: 0px 0px 5px rgba(0,0,0,0.2);
|
||||||
height: 40px;
|
min-height: 40px;
|
||||||
margin-top: -40px;
|
margin-top: -40px;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
|
border-radius: 3px;
|
||||||
|
padding: 4px;
|
||||||
|
transform: scale(0.99,0.99);
|
||||||
}
|
}
|
||||||
|
|
||||||
.selectionBox.show {
|
.selectionBox.show {
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
min-height: 160px;
|
transform: scale(1,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.option {
|
.option {
|
||||||
padding: 12px;
|
transition: all 0.1s;
|
||||||
|
line-height: 40px;
|
||||||
|
padding: 0px 4px;
|
||||||
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.option:hover {
|
.option:hover {
|
||||||
background: #fafafa;
|
color: #fff;
|
||||||
|
padding-left: 8px;
|
||||||
|
background: #0277bd;
|
||||||
}
|
}
|
||||||
|
`
|
||||||
|
]
|
||||||
|
|
||||||
|
public render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
${domtools.elementBasic.styles}
|
||||||
|
<style>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<div class="maincontainer">
|
<div class="maincontainer">
|
||||||
<div class="selectedBox" @click="${event => {this.toggleSelectionBox();}}">
|
<div class="selectedBox show" @click="${event => {this.toggleSelectionBox();}}">
|
||||||
${this.selectedOption?.option}
|
${this.selectedOption?.option}
|
||||||
</div>
|
</div>
|
||||||
<div class="selectionBox">
|
<div class="selectionBox">
|
||||||
@ -132,6 +167,7 @@ export class DeesInputDropdown extends DeesElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public toggleSelectionBox() {
|
public toggleSelectionBox() {
|
||||||
|
this.shadowRoot.querySelector('.selectedBox').classList.toggle('show');
|
||||||
this.shadowRoot.querySelector('.selectionBox').classList.toggle('show');
|
this.shadowRoot.querySelector('.selectionBox').classList.toggle('show');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,15 +9,19 @@ declare global {
|
|||||||
|
|
||||||
@customElement('dees-input-text')
|
@customElement('dees-input-text')
|
||||||
export class DeesInputText extends DeesElement {
|
export class DeesInputText extends DeesElement {
|
||||||
public static demo = () => html`<dees-input-text></dees-input-text>`;
|
public static demo = () => html`
|
||||||
|
<dees-input-text .label=${'this is a label'}></dees-input-text>
|
||||||
|
<dees-input-text .isPasswordBool=${true}></dees-input-text>
|
||||||
|
`;
|
||||||
|
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
public changeSubject = new domtools.rxjs.Subject();
|
public changeSubject = new domtools.rxjs.Subject<DeesInputText>();
|
||||||
|
public valueChangeSubject = new domtools.rxjs.Subject<string>();
|
||||||
|
|
||||||
@property({
|
@property({
|
||||||
type: String
|
type: String
|
||||||
})
|
})
|
||||||
public label: string = 'Label';
|
public label: string;
|
||||||
|
|
||||||
@property({
|
@property({
|
||||||
type: String
|
type: String
|
||||||
@ -39,6 +43,18 @@ export class DeesInputText extends DeesElement {
|
|||||||
})
|
})
|
||||||
public disabled: boolean = false;
|
public disabled: boolean = false;
|
||||||
|
|
||||||
|
@property({
|
||||||
|
type: Boolean,
|
||||||
|
reflect: true,
|
||||||
|
})
|
||||||
|
public isPasswordBool = false;
|
||||||
|
|
||||||
|
@property({
|
||||||
|
type: Boolean,
|
||||||
|
reflect: true,
|
||||||
|
})
|
||||||
|
public showPasswordBool = false;
|
||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
return html `
|
return html `
|
||||||
<style>
|
<style>
|
||||||
@ -77,7 +93,8 @@ export class DeesInputText extends DeesElement {
|
|||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
outline: none;
|
outline: none;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-family: Inter;
|
font-family: ${this.isPasswordBool ? 'monospace': 'Inter'};
|
||||||
|
letter-spacing: ${this.isPasswordBool ? '1px': 'normal'};
|
||||||
color: ${this.goBright ? '#333' : '#ccc'};
|
color: ${this.goBright ? '#333' : '#ccc'};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,10 +109,30 @@ export class DeesInputText extends DeesElement {
|
|||||||
outline: none;
|
outline: none;
|
||||||
border-bottom: 1px solid #e4002b;
|
border-bottom: 1px solid #e4002b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.showPassword {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 8px;
|
||||||
|
right: 10px;
|
||||||
|
border: 1px dashed #444;
|
||||||
|
border-radius: 7px;
|
||||||
|
padding: 8px 0px;
|
||||||
|
width: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.showPassword:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
background: #333;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="maincontainer">
|
<div class="maincontainer">
|
||||||
<div class="label">${this.label}</div>
|
${this.label ? html`<div class="label">${this.label}</div>` : html``}
|
||||||
<input type="text" value=${this.value} @input="${this.updateValue}" .disabled=${this.disabled} />
|
<input type="${this.isPasswordBool && !this.showPasswordBool ? 'password' : 'text'}" value=${this.value} @input="${this.updateValue}" .disabled=${this.disabled} />
|
||||||
|
${this.isPasswordBool ? html`
|
||||||
|
<div class="showPassword" @click=${this.togglePasswordView}>
|
||||||
|
<dees-icon .iconFA=${this.showPasswordBool ? 'eye' : 'eyeSlash'}></dees-icon>
|
||||||
|
</div>
|
||||||
|
` : html``}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@ -104,6 +141,7 @@ export class DeesInputText extends DeesElement {
|
|||||||
const target: any = eventArg.target;
|
const target: any = eventArg.target;
|
||||||
this.value = target.value;
|
this.value = target.value;
|
||||||
this.changeSubject.next(this);
|
this.changeSubject.next(this);
|
||||||
|
this.valueChangeSubject.next(this.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async freeze() {
|
public async freeze() {
|
||||||
@ -113,4 +151,15 @@ export class DeesInputText extends DeesElement {
|
|||||||
public async unfreeze() {
|
public async unfreeze() {
|
||||||
this.disabled = false;
|
this.disabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async togglePasswordView () {
|
||||||
|
const domtools = await this.domtoolsPromise;
|
||||||
|
this.showPasswordBool = !this.showPasswordBool;
|
||||||
|
console.log(`this.showPasswordBool is: ${this.showPasswordBool}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
public async focus() {
|
||||||
|
const textInput = this.shadowRoot.querySelector('input');
|
||||||
|
textInput.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ export class DeesSpeechbubble extends DeesElement {
|
|||||||
return html`
|
return html`
|
||||||
<div class="maincontainer" @click=${this.handleClick}>
|
<div class="maincontainer" @click=${this.handleClick}>
|
||||||
<div class="arrow"></div>
|
<div class="arrow"></div>
|
||||||
<div class="speechbubble"><span class="wave">👋</span> Hey! We are API-driven.</div>
|
<div class="speechbubble"><span class="wave">👋</span> We build with launch.sh, and you can too.</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ export class DeesSpeechbubble extends DeesElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
globalThis.location.href = "https://api.global"
|
globalThis.location.href = "https://launch.sh"
|
||||||
}
|
}
|
||||||
|
|
||||||
public async firstUpdated() {
|
public async firstUpdated() {
|
||||||
|
@ -23,6 +23,8 @@ export class DeesSpinner extends DeesElement {
|
|||||||
<dees-spinner></dees-spinner>
|
<dees-spinner></dees-spinner>
|
||||||
<dees-spinner status="success"></dees-spinner>
|
<dees-spinner status="success"></dees-spinner>
|
||||||
<dees-spinner status="error"></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({
|
@property({
|
||||||
@ -30,6 +32,11 @@ export class DeesSpinner extends DeesElement {
|
|||||||
})
|
})
|
||||||
public size = 20;
|
public size = 20;
|
||||||
|
|
||||||
|
@property({
|
||||||
|
type: String,
|
||||||
|
})
|
||||||
|
public bnw: boolean = false;
|
||||||
|
|
||||||
@property()
|
@property()
|
||||||
public status: 'normal' | 'pending' | 'success' | 'error' = 'normal';
|
public status: 'normal' | 'pending' | 'success' | 'error' = 'normal';
|
||||||
|
|
||||||
@ -45,6 +52,7 @@ export class DeesSpinner extends DeesElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#loading {
|
#loading {
|
||||||
|
position: relative;
|
||||||
transition: none;
|
transition: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -58,16 +66,14 @@ export class DeesSpinner extends DeesElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#loading.success {
|
#loading.success {
|
||||||
border: 0px solid rgba(255, 255, 255, 0);
|
border: none;
|
||||||
background: #8bc34a;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
animation: none;
|
animation: none;
|
||||||
-webkit-animation: none;
|
-webkit-animation: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#loading.error {
|
#loading.error {
|
||||||
border: 0px solid rgba(255, 255, 255, 0);
|
border: none;
|
||||||
background: #e64a19;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
animation: none;
|
animation: none;
|
||||||
-webkit-animation: none;
|
-webkit-animation: none;
|
||||||
@ -84,36 +90,10 @@ export class DeesSpinner extends DeesElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#loading .checkmark {
|
dees-icon {
|
||||||
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 {
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 3px;
|
height: 100%;
|
||||||
height: 9px;
|
width: 100%;
|
||||||
background-color: #fff;
|
|
||||||
left: 9px;
|
|
||||||
top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loading .checkmark_kick {
|
|
||||||
position: absolute;
|
|
||||||
width: 3px;
|
|
||||||
height: 3px;
|
|
||||||
background-color: #fff;
|
|
||||||
left: 6px;
|
|
||||||
top: 11px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#loading.disabled .checkmark_stem,
|
|
||||||
#loading.disabled .checkmark_kick {
|
|
||||||
background-color: ${cssManager.bdTheme('#333', '#fff')};
|
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
@ -125,16 +105,25 @@ export class DeesSpinner extends DeesElement {
|
|||||||
width: ${this.size}px;
|
width: ${this.size}px;
|
||||||
height: ${this.size}px;
|
height: ${this.size}px;
|
||||||
}
|
}
|
||||||
|
#loading.success {
|
||||||
|
color: ${cssManager.bdTheme(this.bnw ? '#333': `#8bc34a`, this.bnw ? '#fff' : `#8bc34a`)};
|
||||||
|
|
||||||
|
}
|
||||||
|
#loading.error {
|
||||||
|
color: ${cssManager.bdTheme(this.bnw ? '#333': `#e64a19`, this.bnw ? '#fff' : `#e64a19`)};
|
||||||
|
}
|
||||||
|
dees-icon {
|
||||||
|
font-size: ${this.size}px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="${this.status}" id="loading">
|
<div class="${this.status}" id="loading">
|
||||||
${this.status === 'success' || this.status === 'error'
|
${(() => {
|
||||||
? html`
|
if (this.status === 'success') {
|
||||||
<span class="checkmark">
|
return html`<dees-icon style="transform: translateX(1%) translateY(3%);" .iconFA=${'circleCheck' as any}></dees-icon>`;
|
||||||
<div class="checkmark_stem"></div>
|
} else if (this.status === 'error') {
|
||||||
<div class="checkmark_kick"></div>
|
return html`<dees-icon .iconFA=${'circleXmark' as any}></dees-icon>`;
|
||||||
</span>
|
}
|
||||||
`
|
})()}
|
||||||
: null}
|
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -143,10 +143,11 @@ export class DeesTable<T> extends DeesElement {
|
|||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: 50px;
|
min-height: 50px;
|
||||||
background: ${cssManager.bdTheme('#fafafa', '#333333')};
|
background: ${cssManager.bdTheme('#ffffff', '#333333')};
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
border-top: 1px solid ${cssManager.bdTheme('#fff', '#444')};
|
border-top: 1px solid ${cssManager.bdTheme('#fff', '#444')};
|
||||||
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.3);
|
box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.3);
|
||||||
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
.headingSeparation {
|
.headingSeparation {
|
||||||
margin-top: 7px;
|
margin-top: 7px;
|
||||||
|
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-exit.js';
|
||||||
export * from './dees-button.js';
|
export * from './dees-button.js';
|
||||||
export * from './dees-chips.js';
|
export * from './dees-chips.js';
|
||||||
|
export * from './dees-contextmenu.js';
|
||||||
export * from './dees-form.js';
|
export * from './dees-form.js';
|
||||||
export * from './dees-form-submit.js';
|
export * from './dees-form-submit.js';
|
||||||
export * from './dees-icon.js';
|
export * from './dees-icon.js';
|
||||||
|
Reference in New Issue
Block a user