@hkdigital/lib-sveltekit 0.1.31 → 0.1.32

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,7 +5,7 @@
5
5
  * a time.
6
6
  */
7
7
 
8
- /** @typedef {{text: string, disabled?: boolean, props?: Object}} ButtonDef */
8
+ /** @typedef {{text?: string, value?: any, props?: Object}} ButtonDef */
9
9
 
10
10
  /**
11
11
  * @type {{
@@ -34,7 +34,7 @@
34
34
  * Handle button selection
35
35
  */
36
36
  function handleSelect(index) {
37
- if (!buttons[index].disabled) {
37
+ if (!buttons[index].props?.disabled) {
38
38
  selectedIndex = index;
39
39
  selected = buttons[selectedIndex] ?? null;
40
40
  }
@@ -53,8 +53,7 @@
53
53
  text: button.text,
54
54
  props: {
55
55
  ...(button.props || {}),
56
- disabled: button.disabled,
57
- active: index === selectedIndex,
56
+ selected: index === selectedIndex,
58
57
  onclick: () => handleSelect(index)
59
58
  }
60
59
  })}
@@ -5,13 +5,13 @@ declare const ButtonGroup: import("svelte").Component<{
5
5
  bg?: string;
6
6
  classes?: string;
7
7
  buttons: Array<{
8
- text: string;
9
- disabled?: boolean;
8
+ text?: string;
9
+ value?: any;
10
10
  props?: any;
11
11
  }>;
12
12
  selected?: ({
13
- text: string;
14
- disabled?: boolean;
13
+ text?: string;
14
+ value?: any;
15
15
  props?: any;
16
16
  } | null);
17
17
  buttonSnippet: import("svelte").Snippet<[{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-sveltekit",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"