@lemonadejs/tabs 1.0.4 → 1.1.0
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/README.md +12 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -3
- package/dist/style.css +0 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -44,7 +44,11 @@ import "@lemonadejs/tabs/dist/style.css"
|
|
|
44
44
|
export default function Component() {
|
|
45
45
|
const self = this;
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
self.open = (index) => {
|
|
48
|
+
console.log(index)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return `<Tabs :onopen="self.open">
|
|
48
52
|
<div title="Tab 1">Content of the first tab</div>
|
|
49
53
|
<div title="Tab 2">Content of the second tab</div>
|
|
50
54
|
</Tabs>`;
|
|
@@ -59,11 +63,12 @@ You can configure things such as tabs titles, tabs contents and selected tab.
|
|
|
59
63
|
|
|
60
64
|
#### Tabs Properties
|
|
61
65
|
|
|
62
|
-
| Property
|
|
63
|
-
|
|
64
|
-
| data?
|
|
65
|
-
| selected? | number
|
|
66
|
-
| position? | string
|
|
66
|
+
| Property | Type | Description |
|
|
67
|
+
|-----------|----------|----------------------------------------------------------------------------------------------------------------------|
|
|
68
|
+
| data? | array | An optional alternative method to provide the title and content that will serve as the basis for rendering the tabs. |
|
|
69
|
+
| selected? | number | The index of the initially selected tab. Starts from 0. |
|
|
70
|
+
| position? | string | The position of the tabs bar within the parent element. Use 'center' to center-align the tabs. |
|
|
71
|
+
| onopen? | function | When a new tabs is opened. |
|
|
67
72
|
|
|
68
73
|
## License
|
|
69
74
|
|
|
@@ -72,4 +77,4 @@ The [LemonadeJS](https://lemonadejs.net) Tabs is released under the MIT.
|
|
|
72
77
|
## Other Tools
|
|
73
78
|
|
|
74
79
|
- [jSuites](https://jsuites.net/v4/)
|
|
75
|
-
- [Jspreadsheet](https://jspreadsheet.com)
|
|
80
|
+
- [Jspreadsheet Data Grid](https://jspreadsheet.com)
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
if (!lemonade && typeof
|
|
1
|
+
if (! lemonade && typeof(require) === 'function') {
|
|
2
2
|
var lemonade = require('lemonadejs');
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -46,6 +46,10 @@ if (!lemonade && typeof (require) === 'function') {
|
|
|
46
46
|
self.onchange = function (property) {
|
|
47
47
|
if (property === 'selected') {
|
|
48
48
|
select(self.selected);
|
|
49
|
+
|
|
50
|
+
if (typeof(self.onopen) === 'function') {
|
|
51
|
+
self.onopen.call(self, self.selected);
|
|
52
|
+
}
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
|
|
@@ -55,8 +59,8 @@ if (!lemonade && typeof (require) === 'function') {
|
|
|
55
59
|
}
|
|
56
60
|
}
|
|
57
61
|
|
|
58
|
-
return `<div class="lm-tabs" position="
|
|
59
|
-
<ul :ref="self.headers" :loop="self.tabs" onclick="self.click(e, this)"
|
|
62
|
+
return `<div class="lm-tabs" :position="self.position">
|
|
63
|
+
<ul :ref="self.headers" :loop="self.tabs" :selected="self.selected" onclick="self.click(e, this)"><li class="lm-tab-list-item">{{self.title}}</li></ul>
|
|
60
64
|
<div :ref="self.content" class="lm-tabs-content">${content}</div>
|
|
61
65
|
</div>`
|
|
62
66
|
}
|
package/dist/style.css
CHANGED