@onsvisual/svelte-components 0.1.40 → 0.1.41

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.
@@ -3,6 +3,7 @@
3
3
  /** @typedef {typeof __propDef.slots} TabsSlots */
4
4
  export default class Tabs extends SvelteComponentTyped<{
5
5
  compact?: boolean;
6
+ selected?: string;
6
7
  border?: boolean;
7
8
  }, {
8
9
  [evt: string]: CustomEvent<any>;
@@ -17,6 +18,7 @@ import { SvelteComponentTyped } from "svelte";
17
18
  declare const __propDef: {
18
19
  props: {
19
20
  compact?: boolean;
21
+ selected?: string;
20
22
  border?: boolean;
21
23
  };
22
24
  events: {
@@ -11,15 +11,20 @@
11
11
  * @type {boolean}
12
12
  */
13
13
  export let border = false;
14
+ /**
15
+ * The ID of selected tab (for binding)
16
+ * @type {string}
17
+ */
18
+ export let selected = "";
14
19
 
15
20
  const sections = writable([]);
16
21
  setContext("sections", sections);
17
22
 
18
- const selected = writable(null);
19
- setContext("selected", selected);
23
+ const _selected = writable(selected);
24
+ setContext("selected", _selected);
20
25
 
21
26
  function showSection(id) {
22
- $selected = id;
27
+ $_selected = selected = id;
23
28
  [...$sections].forEach(
24
29
  (s) =>
25
30
  (s.el.className =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onsvisual/svelte-components",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://onsvisual.github.io/svelte-components",