@neovici/cosmoz-tabs 8.9.1 → 8.10.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/package.json +1 -1
- package/src/next/use-tabs.d.ts +4 -4
- package/src/next/use-tabs.js +3 -2
package/package.json
CHANGED
package/src/next/use-tabs.d.ts
CHANGED
|
@@ -24,10 +24,10 @@ interface Result<T extends Tab> {
|
|
|
24
24
|
onActivate: (e: Event) => void;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export
|
|
28
|
-
Result<T>,
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
export interface RenderTabs<T extends Tab>
|
|
28
|
+
extends Pick<Result<T>, 'tabs' | 'active' | 'onActivate'> {
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
31
|
|
|
32
32
|
export declare const useTabs: <T extends Tab, P extends Options>(
|
|
33
33
|
tabs: T[],
|
package/src/next/use-tabs.js
CHANGED
|
@@ -48,15 +48,16 @@ export const useTabs = (tabs, { hashParam, onActivate }) => {
|
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
export const renderTabs = ({ tabs, active, onActivate }) =>
|
|
51
|
+
export const renderTabs = ({ tabs, active, onActivate, className }) =>
|
|
52
52
|
tabs.map((tab) => {
|
|
53
53
|
const title = invoke(tab.title);
|
|
54
54
|
return html`<cosmoz-tab-next
|
|
55
55
|
name=${tab.name}
|
|
56
|
+
class=${ifDefined(className)}
|
|
57
|
+
title=${ifDefined(typeof title === 'string' ? title : undefined)}
|
|
56
58
|
?active=${active.name === tab.name}
|
|
57
59
|
?hidden=${tab.hidden}
|
|
58
60
|
?disabled=${tab.disabled}
|
|
59
|
-
title=${ifDefined(typeof title === 'string' ? title : undefined)}
|
|
60
61
|
@click=${onActivate}
|
|
61
62
|
>${tab.content ?? title}</cosmoz-tab-next
|
|
62
63
|
>`;
|