fix(core): update

This commit is contained in:
Philipp Kunz 2023-09-15 17:27:35 +02:00
parent a55db621ef
commit f64da93cf9
3 changed files with 16 additions and 3 deletions

View File

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

View File

@ -106,6 +106,15 @@ export const demoFunc = () => html`
return null;
},
},
{
name: 'preview',
type: ['doubleClick', 'contextmenu'],
iconName: 'eye',
actionFunc: async (itemArg) => {
alert(itemArg.amount);
return null;
},
}
] as (ITableAction<ITableDemoData>)[] as any}"
.displayFunction=${(itemArg) => {
return {

View File

@ -37,7 +37,7 @@ export interface ITableAction<T = any> {
/**
* the type of the action
*/
type: ('inRow' | 'contextmenu' | 'footer' | 'header' | 'preview' | 'keyCombination')[];
type: ('inRow' | 'contextmenu' | 'doubleClick' | 'footer' | 'header' | 'preview' | 'keyCombination')[];
/**
* allows to check if the action is relevant for the given item
* @param itemArg
@ -399,7 +399,11 @@ export class DeesTable<T> extends DeesElement {
>
${headings.map(
(headingArg) => html`
<td>
<td @dblclick=${() => {
const wantedAction = this.dataActions.find((actionArg) => actionArg.type.includes('doubleClick'));
if (!wantedAction) return;
wantedAction.actionFunc(itemArg);
}}>
<div class="innerCellContainer">${transformedItem[headingArg]}</div>
</td>
`