Compare commits

..

No commits in common. "main" and "1.0.0" have entirely different histories.
main ... 1.0.0

2 changed files with 21 additions and 27 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@tp/tp-tabs", "name": "@tp/tp-tabs",
"version": "1.3.0", "version": "1.0.0",
"description": "", "description": "",
"main": "tp-tabs.js", "main": "tp-tabs.js",
"scripts": { "scripts": {
@ -13,7 +13,7 @@
"author": "trading_peter", "author": "trading_peter",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"lit": "^2.8.0", "lit": "^2.2.0",
"@tp/helpers": "^2.1.0" "@tp/helpers": "^1.0.0"
} }
} }

View File

@ -5,37 +5,31 @@ This program is available under Apache License Version 2.0
*/ */
import { closest } from '@tp/helpers'; import { closest } from '@tp/helpers';
import { LitElement, html, css } from 'lit'; import { LitElement, html, css } from 'lit-element';
class TpTabs extends LitElement { class TpTabs extends LitElement {
static get styles() {
return css`
:host {
display: block;
}
:host([orientation="vertical"]) .tabs {
flex-direction: column;
}
.tabs {
display: flex;
flex-direction: row;
}
slot::slotted(.tab) {
cursor: pointer;
padding: 8px;
}
`;
}
static get properties() { static get properties() {
return { return {
orientation: { type: String, reflect: true } orientation: { type: String, reflect: true }
}; };
} }
static get styles() {
return css`
:host([orientation="vertical"]) .tabs {
flex-direction: column;
}
.tabs {
display: flex;
flex-direction: row;
}
.tab {
cursor: pointer;
padding: 8px;
}
`;
}
constructor() { constructor() {
super(); super();
this.orientation = 'horizontal'; this.orientation = 'horizontal';
@ -43,7 +37,7 @@ class TpTabs extends LitElement {
render() { render() {
return html` return html`
<div class="tabs" part="wrap" @click="${this.selectTab}"> <div class="tabs" @click="${this.selectTab}">
<slot></slot> <slot></slot>
</div> </div>
`; `;