fix(core): update

This commit is contained in:
Philipp Kunz 2023-09-22 19:04:02 +02:00
parent 53ac03507d
commit c68b0c5090
3 changed files with 28 additions and 10 deletions

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.212', version: '1.0.213',
description: 'website for lossless.com' description: 'website for lossless.com'
} }

View File

@ -58,8 +58,8 @@ export const demoFunc = () => html`
iconName: 'bell', iconName: 'bell',
useTableBehaviour: 'upload', useTableBehaviour: 'upload',
type: ['inRow'], type: ['inRow'],
actionFunc: async (itemArg) => { actionFunc: async (optionsArg) => {
alert(itemArg.amount); alert(optionsArg.item.amount);
}, },
}, },
{ {
@ -112,7 +112,7 @@ export const demoFunc = () => html`
type: ['doubleClick', 'contextmenu'], type: ['doubleClick', 'contextmenu'],
iconName: 'eye', iconName: 'eye',
actionFunc: async (itemArg) => { actionFunc: async (itemArg) => {
alert(itemArg.amount); alert(itemArg.item.amount);
return null; return null;
}, },
} }

View File

@ -57,7 +57,10 @@ export interface ITableAction<T = any> {
* @param itemArg * @param itemArg
* @returns * @returns
*/ */
actionFunc: (itemArg: T) => Promise<any>; actionFunc: (optionsArg: {
item: T,
dataArray: T[],
}) => Promise<any>;
} }
export type TDisplayFunction<T = any> = (itemArg: T) => object; export type TDisplayFunction<T = any> = (itemArg: T) => object;
@ -339,7 +342,10 @@ export class DeesTable<T> extends DeesElement {
html`<div html`<div
class="headerAction" class="headerAction"
@click=${() => { @click=${() => {
action.actionFunc(this.selectedDataRow); action.actionFunc({
item: this.selectedDataRow,
dataArray: this.data
});
}} }}
> >
${action.iconName ${action.iconName
@ -439,7 +445,10 @@ export class DeesTable<T> extends DeesElement {
name: action.name, name: action.name,
iconName: action.iconName as any, iconName: action.iconName as any,
action: async () => { action: async () => {
await action.actionFunc(itemArg); await action.actionFunc({
item: itemArg,
dataArray: this.data
});
return null; return null;
}, },
}; };
@ -460,7 +469,10 @@ export class DeesTable<T> extends DeesElement {
actionArg.type.includes('doubleClick') actionArg.type.includes('doubleClick')
); );
if (wantedAction) { if (wantedAction) {
wantedAction.actionFunc(itemArg); wantedAction.actionFunc({
item: itemArg,
dataArray: this.data
});
} }
} }
}} }}
@ -477,7 +489,10 @@ export class DeesTable<T> extends DeesElement {
${this.getActionsForType('inRow').map( ${this.getActionsForType('inRow').map(
(actionArg) => html`<div (actionArg) => html`<div
class="action" class="action"
@click=${() => actionArg.actionFunc(itemArg)} @click=${() => actionArg.actionFunc({
item: itemArg,
dataArray: this.data
})}
> >
${actionArg.iconName ${actionArg.iconName
? html` ? html`
@ -513,7 +528,10 @@ export class DeesTable<T> extends DeesElement {
html`<div html`<div
class="footerAction" class="footerAction"
@click=${() => { @click=${() => {
action.actionFunc(this.selectedDataRow); action.actionFunc({
item: this.selectedDataRow,
dataArray: this.data
});
}} }}
> >
${action.iconName ${action.iconName