grav-svelte 0.0.69 → 0.0.71

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.
@@ -5,6 +5,7 @@
5
5
  export let id = 1;
6
6
  export let buttonsConfig: ButtonConfig[];
7
7
  export let align: "left" | "right" | "center" = "center";
8
+ export let row: any = undefined;
8
9
 
9
10
  $: visibleButtons = buttonsConfig.filter((btn) => btn.show ?? true);
10
11
  </script>
@@ -15,7 +16,7 @@
15
16
  <Tooltip text={button.tooltip}>
16
17
  <button
17
18
  aria-label={button.tooltip}
18
- on:click={() => button.action(id)}
19
+ on:click={() => button.action(id, row)}
19
20
  type="button"
20
21
  class="action-buttons-group {visibleButtons.length === 1
21
22
  ? 'rounded-left rounded-right'
@@ -5,6 +5,7 @@ declare const __propDef: {
5
5
  id?: number;
6
6
  buttonsConfig: ButtonConfig[];
7
7
  align?: "left" | "right" | "center";
8
+ row?: any;
8
9
  };
9
10
  events: {
10
11
  [evt: string]: CustomEvent<any>;
@@ -50,6 +50,7 @@
50
50
  id={item[header.campo]}
51
51
  buttonsConfig={header.buttonsConfig ?? []}
52
52
  align={header.align ?? "center"}
53
+ row={item}
53
54
  />
54
55
  {:else if header.tipo == "DynamicButton"}
55
56
  <DynamicButtonCell {item} {header} {idField} />
@@ -12,7 +12,7 @@
12
12
  <div style="display: inline-flex; {alignStyle}">
13
13
  <button
14
14
  type="button"
15
- class="dynamic-button {item[header.colorField ?? ''] ?? ''}"
15
+ class="{item[header.colorField ?? ''] ?? ''} dynamic-button "
16
16
  on:click={() => {
17
17
  if (header.onButtonClick) {
18
18
  header.onButtonClick(item[idField], item);
@@ -1,7 +1,7 @@
1
1
  export interface ButtonConfig {
2
2
  icon: string;
3
3
  color: string;
4
- action: (id: number) => void;
4
+ action: (id: number, row?: any) => void;
5
5
  tooltip: string;
6
6
  /**
7
7
  * When set to false the button will not be rendered. Defaults to true.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "grav-svelte",
3
- "version": "0.0.69",
3
+ "version": "0.0.71",
4
4
  "description": "A collection of Svelte components",
5
5
  "license": "MIT",
6
6
  "scripts": {