Compare commits

...

8 Commits

Author SHA1 Message Date
c76d364071 1.0.191 2023-09-12 13:44:07 +02:00
760e0085f7 fix(core): update 2023-09-12 13:44:07 +02:00
6890ca1f1f 1.0.190 2023-09-12 13:42:56 +02:00
9ca000cf06 fix(core): update 2023-09-12 13:42:55 +02:00
1c0f5129a9 1.0.189 2023-09-09 13:34:46 +02:00
69e17949f4 fix(core): update 2023-09-09 13:34:46 +02:00
bcfd3495dd 1.0.188 2023-09-08 11:44:04 +02:00
03a46a72c5 fix(core): update 2023-09-08 11:44:03 +02:00
13 changed files with 536 additions and 256 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@design.estate/dees-catalog", "name": "@design.estate/dees-catalog",
"version": "1.0.187", "version": "1.0.191",
"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",
@ -15,7 +15,7 @@
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@design.estate/dees-domtools": "^2.0.39", "@design.estate/dees-domtools": "^2.0.40",
"@design.estate/dees-element": "^2.0.27", "@design.estate/dees-element": "^2.0.27",
"@design.estate/dees-wcctools": "^1.0.78", "@design.estate/dees-wcctools": "^1.0.78",
"@fortawesome/fontawesome-svg-core": "^6.4.2", "@fortawesome/fontawesome-svg-core": "^6.4.2",
@ -35,7 +35,7 @@
"@gitzone/tswatch": "^2.0.7", "@gitzone/tswatch": "^2.0.7",
"@push.rocks/projectinfo": "^5.0.2", "@push.rocks/projectinfo": "^5.0.2",
"@push.rocks/tapbundle": "^5.0.15", "@push.rocks/tapbundle": "^5.0.15",
"@types/node": "^20.5.9" "@types/node": "^20.6.0"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",

281
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@design.estate/dees-catalog', name: '@design.estate/dees-catalog',
version: '1.0.187', version: '1.0.191',
description: 'website for lossless.com' description: 'website for lossless.com'
} }

View File

@ -0,0 +1,57 @@
import { html } from '@design.estate/dees-element';
import * as plugins from './plugins.js';
import { DeesContextmenu } from './dees-contextmenu.js';
export const demoFunc = () => 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>
`;

View File

@ -1,3 +1,4 @@
import { demoFunc } from './dees-contextmenu.demo.js';
import * as plugins from './plugins.js'; import * as plugins from './plugins.js';
import { import {
customElement, customElement,
@ -23,62 +24,12 @@ declare global {
@customElement('dees-contextmenu') @customElement('dees-contextmenu')
export class DeesContextmenu extends DeesElement { export class DeesContextmenu extends DeesElement {
// DEMO // DEMO
public static demo = () => html` public static demo = demoFunc
<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 // STATIC
public static async openContextMenuWithOptions(eventArg: MouseEvent, menuItemsArg: plugins.tsclass.website.IMenuItem[]) { public static async openContextMenuWithOptions(eventArg: MouseEvent, menuItemsArg: plugins.tsclass.website.IMenuItem[]) {
eventArg.preventDefault(); eventArg.preventDefault();
eventArg.stopPropagation();
const contextMenu = new DeesContextmenu(); const contextMenu = new DeesContextmenu();
contextMenu.style.position = 'absolute'; contextMenu.style.position = 'absolute';
contextMenu.style.zIndex = '2000'; contextMenu.style.zIndex = '2000';
@ -121,7 +72,7 @@ export class DeesContextmenu extends DeesElement {
font-size: 14px; font-size: 14px;
width: 200px; width: 200px;
border: 1px solid #444; border: 1px solid #444;
min-height: 40px; min-height: 34px;
border-radius: 3px; border-radius: 3px;
background: #222; background: #222;
box-shadow: 0px 1px 4px #000; box-shadow: 0px 1px 4px #000;
@ -162,15 +113,20 @@ export class DeesContextmenu extends DeesElement {
</div> </div>
`; `;
})} })}
${this.menuItems.length === 0 ? html`
<div class="menuitem" @click=${() => {
alert('No menu items...')
}}>
<dees-icon .iconFA=${'xmark'}></dees-icon
>No menu item present...
</div>
` : html``}
</div> </div>
`; `;
} }
public async firstUpdated() { 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) { public async handleClick(menuItem: plugins.tsclass.website.IMenuItem) {

View File

@ -0,0 +1,5 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<dees-simple-appdash>Hello there</dees-simple-appdash>
`;

View File

@ -0,0 +1,74 @@
import { demoFunc } from './dees-simple-appdash.demo.js';
import {
customElement,
html,
DeesElement,
property,
type TemplateResult,
cssManager,
css,
unsafeCSS,
type CSSResult,
state,
} from '@design.estate/dees-element';
declare global {
interface HTMLElementTagNameMap {
'dees-simple-appdash': DeesSimpleAppDash;
}
}
@customElement('dees-simple-appdash')
export class DeesSimpleAppDash extends DeesElement {
// STATIC
public static demo = demoFunc;
// INSTANCE
@property()
public title = 'Dees Simple Login';
public static styles = [
cssManager.defaultStyles,
css`
:host {
color: ${cssManager.bdTheme('#333', '#fff')};
user-select: none;
}
.appbar {
position: absolute;
top: 0;
height: 40px;
width: 100%;
background: ${cssManager.bdTheme('#eeeeeb', '#000')};
border-bottom: 1px solid ${cssManager.bdTheme('#ccc', '#333')};
font-size: 14px;
line-height: 40px;
font-family: 'Hubot Sans', 'Inter', sans-serif;
padding: 0px 16px;
}
.appcontent {
position: absolute;
top: 40px;
bottom: 0;
width: 100%;
background: ${cssManager.bdTheme('#eeeeeb', '#000')};
}
`,
];
public render(): TemplateResult {
return html`
<div class="appbar">
configvault v1.2.3
</div>
<div class="appcontent">
<slot></slot>
</div>
`;
}
public async firstUpdated(_changedProperties): Promise<void> {
const domtools = await this.domtoolsPromise;
super.firstUpdated(_changedProperties);
}
}

View File

@ -0,0 +1,3 @@
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html` <dees-simple-login> Hello there </dees-simple-login> `;

View File

@ -1,3 +1,5 @@
import { demoFunc } from './dees-simple-login.demo.js';
import { import {
customElement, customElement,
html, html,
@ -20,11 +22,7 @@ declare global {
@customElement('dees-simple-login') @customElement('dees-simple-login')
export class DeesSimpleLogin extends DeesElement { export class DeesSimpleLogin extends DeesElement {
// STATIC // STATIC
public static demo = () => html` public static demo = demoFunc
<dees-simple-login>
Hello there
</dees-simple-login>
`;
// INSTANCE // INSTANCE
@property() @property()

View File

@ -0,0 +1,113 @@
import { type ITableAction } from './dees-table.js';
import * as plugins from './plugins.js';
import { html } from '@design.estate/dees-element';
export const demoFunc = () => html`
<style>
.demoWrapper {
box-sizing: border-box;
position: absolute;
width: 100%;
height: 100%;
padding: 20px;
background: #000000;
}
</style>
<div class="demoWrapper">
<dees-table
heading1="Current Account Statement"
heading2="Bunq - Payment Account 2 - April 2021"
.data=${[
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Printing Paper (Office Supplies) - STAPLES BREMEN',
},
{
date: '2021-04-02',
amount: '165.65 €',
description: 'Logitech Mouse (Hardware) - logi.com OnlineShop',
},
{
date: '2021-04-03',
amount: '2999,00 €',
description: 'Macbook Pro 16inch (Hardware) - Apple.de OnlineShop',
},
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Office-Supplies - STAPLES BREMEN',
},
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Office-Supplies - STAPLES BREMEN',
},
]}
dataName="transactions"
.dataActions="${[
{
name: 'upload',
iconName: 'bell',
useTableBehaviour: 'upload',
type: ['inRow'],
actionFunc: async (itemArg: any) => {
alert(itemArg.amount);
},
},
{
name: 'visibility',
iconName: 'copy',
type: ['inRow'],
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'create new',
iconName: 'instagram',
type: ['header'],
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'to gallery',
iconName: 'message',
type: ['footer'],
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'copy',
iconName: 'copySolid',
type: ['contextmenu', 'inRow'],
action: async () => {
return null;
},
},
{
name: 'edit (from demo)',
iconName: 'penToSquare',
type: ['contextmenu'],
action: async () => {
return null;
},
},
{
name: 'paste',
iconName: 'pasteSolid',
type: ['contextmenu'],
action: async () => {
return null;
},
},
] as ITableAction[]}"
.displayFunction=${(itemArg) => {
return {
...itemArg,
onlyDisplayProp: 'onlyDisplay',
};
}}
>This is a slotted Text</dees-table
>
</div>
`;

View File

@ -1,3 +1,5 @@
import * as plugins from './plugins.js';
import { demoFunc } from './dees-table.demo.js';
import { import {
customElement, customElement,
html, html,
@ -12,7 +14,7 @@ import {
resolveExec, resolveExec,
} from '@design.estate/dees-element'; } from '@design.estate/dees-element';
import { DeesContextmenu } from './dees-contextmenu.js' import { DeesContextmenu } from './dees-contextmenu.js';
import * as domtools from '@design.estate/dees-domtools'; import * as domtools from '@design.estate/dees-domtools';
import { type TIconKey } from './dees-icon.js'; import { type TIconKey } from './dees-icon.js';
@ -24,7 +26,7 @@ declare global {
} }
// interfaces // interfaces
export interface IDataAction<T = any> { export interface ITableAction<T = any> {
name: string; name: string;
iconName: TIconKey; iconName: TIconKey;
/** /**
@ -35,7 +37,7 @@ export interface IDataAction<T = any> {
/** /**
* the type of the action * the type of the action
*/ */
type: 'inRow' | 'rightClick' | 'footer' | 'header' | 'preview' | 'keyCombination'; type: ('inRow' | 'contextmenu' | 'footer' | 'header' | 'preview' | 'keyCombination')[];
/** /**
* allows to check if the action is relevant for the given item * allows to check if the action is relevant for the given item
* @param itemArg * @param itemArg
@ -55,91 +57,7 @@ export type TDisplayFunction<T = any> = (itemArg: T) => object;
// the table implementation // the table implementation
@customElement('dees-table') @customElement('dees-table')
export class DeesTable<T> extends DeesElement { export class DeesTable<T> extends DeesElement {
public static demo = () => html` public static demo = demoFunc;
<style>
.demoWrapper {
box-sizing: border-box;
position: absolute;
width: 100%;
height: 100%;
padding: 20px;
background: #000000;
}
</style>
<div class="demoWrapper">
<dees-table
heading1="Current Account Statement"
heading2="Bunq - Payment Account 2 - April 2021"
.data=${[
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Printing Paper (Office Supplies) - STAPLES BREMEN',
},
{
date: '2021-04-02',
amount: '165.65 €',
description: 'Logitech Mouse (Hardware) - logi.com OnlineShop',
},
{
date: '2021-04-03',
amount: '2999,00 €',
description: 'Macbook Pro 16inch (Hardware) - Apple.de OnlineShop',
},
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Office-Supplies - STAPLES BREMEN',
},
{
date: '2021-04-01',
amount: '2464.65 €',
description: 'Office-Supplies - STAPLES BREMEN',
},
]}
dataName="transactions"
.dataActions="${[
{
name: 'upload',
iconName: 'bell',
useTableBehaviour: 'upload',
type: 'inRow',
actionFunc: async (itemArg: any) => {
alert(itemArg.amount);
},
},
{
name: 'visibility',
iconName: 'copy',
type: 'inRow',
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'create new',
iconName: 'instagram',
type: 'header',
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
{
name: 'to gallery',
iconName: 'message',
type: 'footer',
useTableBehaviour: 'preview',
actionFunc: async (itemArg: any) => {},
},
] as IDataAction[]}"
.displayFunction=${(itemArg) => {
return {
...itemArg,
onlyDisplayProp: 'onlyDisplay',
};
}}
>This is a slotted Text</dees-table
>
</div>
`;
// INSTANCE // INSTANCE
@property({ @property({
@ -166,7 +84,7 @@ export class DeesTable<T> extends DeesElement {
@property({ @property({
type: Array, type: Array,
}) })
public dataActions: IDataAction[] = []; public dataActions: ITableAction[] = [];
@property({ @property({
attribute: false, attribute: false,
@ -367,7 +285,7 @@ export class DeesTable<T> extends DeesElement {
${resolveExec(async () => { ${resolveExec(async () => {
const resultArray: TemplateResult[] = []; const resultArray: TemplateResult[] = [];
for (const action of this.dataActions) { for (const action of this.dataActions) {
if (action.type !== 'header') continue; if (!action.type.includes('header')) continue;
resultArray.push( resultArray.push(
html`<div html`<div
class="headerAction" class="headerAction"
@ -465,28 +383,17 @@ export class DeesTable<T> extends DeesElement {
} }
}} }}
@contextmenu=${async (eventArg: MouseEvent) => { @contextmenu=${async (eventArg: MouseEvent) => {
DeesContextmenu.openContextMenuWithOptions(eventArg, [ DeesContextmenu.openContextMenuWithOptions(eventArg, this.getActionsForType('contextmenu').map(action => {
{ const menuItem: plugins.tsclass.website.IMenuItem = {
name: 'copy', name: action.name,
iconName: 'copySolid', iconName: action.iconName as any,
action: async () => { action: async () => {
await action.actionFunc(itemArg);
return null; return null;
}, }
}, }
{ return menuItem;
name: 'edit', }));
iconName: 'penToSquare',
action: async () => {
return null;
},
},{
name: 'paste',
iconName: 'pasteSolid',
action: async () => {
return null;
},
},
])
}} }}
class="${itemArg === this.selectedDataRow ? 'selected' : ''}" class="${itemArg === this.selectedDataRow ? 'selected' : ''}"
> >
@ -502,25 +409,18 @@ export class DeesTable<T> extends DeesElement {
return html` return html`
<td> <td>
<div class="innerCellContainer"> <div class="innerCellContainer">
${(() => { ${this.getActionsForType('inRow').map(
const actions: TemplateResult[] = []; (actionArg) => html`<div
for (const action of this.dataActions) { class="action"
if (action.type !== 'inRow') continue; @click=${() => actionArg.actionFunc(itemArg)}
actions.push( >
html`<div ${actionArg.iconName
class="action" ? html`
@click=${() => action.actionFunc(itemArg)} <dees-icon .iconFA=${actionArg.iconName}></dees-icon>
> `
${action.iconName : actionArg.name}
? html` </div>`
<dees-icon .iconFA=${action.iconName}></dees-icon> )}
`
: action.name}
</div>`
);
}
return actions;
})()}
</div> </div>
</td> </td>
`; `;
@ -543,7 +443,7 @@ export class DeesTable<T> extends DeesElement {
${resolveExec(async () => { ${resolveExec(async () => {
const resultArray: TemplateResult[] = []; const resultArray: TemplateResult[] = [];
for (const action of this.dataActions) { for (const action of this.dataActions) {
if (action.type !== 'footer') continue; if (!action.type.includes('footer')) continue;
resultArray.push( resultArray.push(
html`<div html`<div
class="footerAction" class="footerAction"
@ -567,4 +467,13 @@ export class DeesTable<T> extends DeesElement {
} }
public async firstUpdated() {} public async firstUpdated() {}
getActionsForType(typeArg: ITableAction['type'][0]) {
const actions: ITableAction[] = [];
for (const action of this.dataActions) {
if (!action.type.includes(typeArg)) continue;
actions.push(action);
}
return actions;
}
} }

View File

@ -15,6 +15,7 @@ export * from './dees-input-radio.js';
export * from './dees-input-text.js'; export * from './dees-input-text.js';
export * from './dees-mobilenavigation.js'; export * from './dees-mobilenavigation.js';
export * from './dees-pdf.js'; export * from './dees-pdf.js';
export * from './dees-simple-appdash.js';
export * from './dees-simple-login.js'; export * from './dees-simple-login.js';
export * from './dees-speechbubble.js'; export * from './dees-speechbubble.js';
export * from './dees-spinner.js'; export * from './dees-spinner.js';

View File

@ -5,7 +5,8 @@
"target": "ES2022", "target": "ES2022",
"module": "ES2022", "module": "ES2022",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"esModuleInterop": true "esModuleInterop": true,
"verbatimModuleSyntax": true
}, },
"exclude": [ "exclude": [
"dist_*/**/*.d.ts" "dist_*/**/*.d.ts"