@design.estate/dees-catalog 1.0.212 → 1.0.214

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design.estate/dees-catalog",
3
- "version": "1.0.212",
3
+ "version": "1.0.214",
4
4
  "private": false,
5
5
  "description": "website for lossless.com",
6
6
  "main": "dist_ts_web/index.js",
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@design.estate/dees-catalog',
6
- version: '1.0.212',
6
+ version: '1.0.214',
7
7
  description: 'website for lossless.com'
8
8
  }
@@ -58,8 +58,8 @@ export const demoFunc = () => html`
58
58
  iconName: 'bell',
59
59
  useTableBehaviour: 'upload',
60
60
  type: ['inRow'],
61
- actionFunc: async (itemArg) => {
62
- alert(itemArg.amount);
61
+ actionFunc: async (optionsArg) => {
62
+ alert(optionsArg.item.amount);
63
63
  },
64
64
  },
65
65
  {
@@ -112,7 +112,7 @@ export const demoFunc = () => html`
112
112
  type: ['doubleClick', 'contextmenu'],
113
113
  iconName: 'eye',
114
114
  actionFunc: async (itemArg) => {
115
- alert(itemArg.amount);
115
+ alert(itemArg.item.amount);
116
116
  return null;
117
117
  },
118
118
  }
@@ -57,7 +57,12 @@ export interface ITableAction<T = any> {
57
57
  * @param itemArg
58
58
  * @returns
59
59
  */
60
- actionFunc: (itemArg: T) => Promise<any>;
60
+ actionFunc: (actionDataArg: ITableActionDataArg<T>) => Promise<any>;
61
+ }
62
+
63
+ export interface ITableActionDataArg<T> {
64
+ item: T,
65
+ dataArray: T[],
61
66
  }
62
67
 
63
68
  export type TDisplayFunction<T = any> = (itemArg: T) => object;
@@ -339,7 +344,10 @@ export class DeesTable<T> extends DeesElement {
339
344
  html`<div
340
345
  class="headerAction"
341
346
  @click=${() => {
342
- action.actionFunc(this.selectedDataRow);
347
+ action.actionFunc({
348
+ item: this.selectedDataRow,
349
+ dataArray: this.data
350
+ });
343
351
  }}
344
352
  >
345
353
  ${action.iconName
@@ -439,7 +447,10 @@ export class DeesTable<T> extends DeesElement {
439
447
  name: action.name,
440
448
  iconName: action.iconName as any,
441
449
  action: async () => {
442
- await action.actionFunc(itemArg);
450
+ await action.actionFunc({
451
+ item: itemArg,
452
+ dataArray: this.data
453
+ });
443
454
  return null;
444
455
  },
445
456
  };
@@ -460,7 +471,10 @@ export class DeesTable<T> extends DeesElement {
460
471
  actionArg.type.includes('doubleClick')
461
472
  );
462
473
  if (wantedAction) {
463
- wantedAction.actionFunc(itemArg);
474
+ wantedAction.actionFunc({
475
+ item: itemArg,
476
+ dataArray: this.data
477
+ });
464
478
  }
465
479
  }
466
480
  }}
@@ -477,7 +491,10 @@ export class DeesTable<T> extends DeesElement {
477
491
  ${this.getActionsForType('inRow').map(
478
492
  (actionArg) => html`<div
479
493
  class="action"
480
- @click=${() => actionArg.actionFunc(itemArg)}
494
+ @click=${() => actionArg.actionFunc({
495
+ item: itemArg,
496
+ dataArray: this.data
497
+ })}
481
498
  >
482
499
  ${actionArg.iconName
483
500
  ? html`
@@ -513,7 +530,10 @@ export class DeesTable<T> extends DeesElement {
513
530
  html`<div
514
531
  class="footerAction"
515
532
  @click=${() => {
516
- action.actionFunc(this.selectedDataRow);
533
+ action.actionFunc({
534
+ item: this.selectedDataRow,
535
+ dataArray: this.data
536
+ });
517
537
  }}
518
538
  >
519
539
  ${action.iconName