@lemonadejs/tabs 2.0.0 → 2.0.2

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/dist/index.d.ts CHANGED
@@ -3,23 +3,42 @@
3
3
  * https://lemonadejs.net
4
4
  * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
5
  */
6
+ import Modal from "@lemonadejs/modal";
6
7
 
7
- interface Tabs {
8
- (): any
9
- [key: string]: any
10
- }
8
+ declare function Tabs(el: HTMLElement, options?: Tabs.Options): Tabs.Instance;
11
9
 
12
- interface options {
13
- data?: object[];
14
- selected?: number;
15
- position?: number;
16
- onopen?: (index: number) => void;
17
- }
10
+ declare namespace Tabs {
11
+
12
+ interface Items {
13
+ title: string,
14
+ content: string,
15
+ }
16
+
17
+ interface Options {
18
+ /** Programmatically content */
19
+ data?: Items[];
20
+ /** Selected tab */
21
+ selected?: number;
22
+ /** Tabs position */
23
+ position?: 'center' | undefined;
24
+ /** Activate round borders */
25
+ round?: boolean;
26
+ /** On open event */
27
+ onopen?: (index: number) => void;
28
+ }
18
29
 
19
- interface instance {
20
- data: object[];
21
- selected: number;
22
- position: number;
30
+ interface Instance {
31
+ /** Programmatically content */
32
+ data?: Items[];
33
+ /** Selected tab */
34
+ selected: number;
35
+ /** Tabs position */
36
+ position?: 'center' | undefined;
37
+ /** Activate round borders */
38
+ round?: boolean;
39
+ /** On open event */
40
+ onopen?: (index: number) => void;
41
+ }
23
42
  }
24
43
 
25
- export declare function Tabs(el: HTMLElement, options?: options): instance;
44
+ export default Tabs;
package/dist/index.js CHANGED
@@ -79,7 +79,7 @@ if (!lemonade && typeof (require) === 'function') {
79
79
  lemonade.render(Tabs, root, options, template)
80
80
  return options;
81
81
  } else {
82
- return Tabs.call(this, root)
82
+ return Tabs.call(this, root);
83
83
  }
84
84
  }
85
85
  })));
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Official Type definitions for the LemonadeJS plugins
3
+ * https://lemonadejs.net
4
+ * Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+ */
6
+ import Component from './index';
7
+
8
+ interface Tabs {
9
+ (): any
10
+ [key: string]: any
11
+ }
12
+
13
+ declare function Tabs<Tabs>(props: Component.Options): any;
14
+
15
+ export default Tabs;
package/package.json CHANGED
@@ -16,5 +16,5 @@
16
16
  "lemonadejs": "^4.0.7"
17
17
  },
18
18
  "main": "dist/index.js",
19
- "version": "2.0.0"
19
+ "version": "2.0.2"
20
20
  }
package/src/index.html DELETED
@@ -1,16 +0,0 @@
1
- <script src="https://cdn.jsdelivr.net/npm/lemonadejs@3.3.1/dist/lemonade.min.js"></script>
2
- <script src="../dist/index.js"></script>
3
- <link rel="stylesheet" href="../dist/style.css" />
4
-
5
- <div id="tabs">
6
- <div title="Tab 1">Content of the first tab</div>
7
- <div title="Tab 2">Content of the second tab</div>
8
- </div>
9
-
10
- <script>
11
- const root = document.getElementById("tabs");
12
-
13
- Tabs(root, {
14
- selected: 0
15
- });
16
- </script>