Compare commits
	
		
			5 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 783795aa3e | |||
| 99468efa3f | |||
| 65f1e6808e | |||
| c16d2020ca | |||
| 1ce3fbc453 | 
| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "@tp/tp-tabs", | ||||
|   "version": "1.0.0", | ||||
|   "version": "1.3.0", | ||||
|   "description": "", | ||||
|   "main": "tp-tabs.js", | ||||
|   "scripts": { | ||||
| @@ -13,7 +13,7 @@ | ||||
|   "author": "trading_peter", | ||||
|   "license": "Apache-2.0", | ||||
|   "dependencies": { | ||||
|     "lit": "^2.2.0", | ||||
|     "@tp/helpers": "^1.0.0" | ||||
|     "lit": "^2.8.0", | ||||
|     "@tp/helpers": "^2.1.0" | ||||
|   } | ||||
| } | ||||
|   | ||||
							
								
								
									
										24
									
								
								tp-tabs.js
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								tp-tabs.js
									
									
									
									
									
								
							| @@ -5,31 +5,37 @@ This program is available under Apache License Version 2.0 | ||||
| */ | ||||
|  | ||||
| import { closest } from '@tp/helpers'; | ||||
| import { LitElement, html, css } from 'lit-element'; | ||||
| import { LitElement, html, css } from 'lit'; | ||||
|  | ||||
| class TpTabs extends LitElement { | ||||
|   static get properties() { | ||||
|     return { | ||||
|       orientation: { type: String, reflect: true } | ||||
|     }; | ||||
|   } | ||||
|  | ||||
|   static get styles() { | ||||
|     return css` | ||||
|       :host { | ||||
|         display: block; | ||||
|       } | ||||
|  | ||||
|       :host([orientation="vertical"]) .tabs { | ||||
|         flex-direction: column; | ||||
|       } | ||||
|  | ||||
|       .tabs { | ||||
|         display: flex; | ||||
|         flex-direction: row; | ||||
|       } | ||||
|       .tab { | ||||
|  | ||||
|       slot::slotted(.tab) { | ||||
|         cursor: pointer; | ||||
|         padding: 8px; | ||||
|       } | ||||
|     `; | ||||
|   } | ||||
|  | ||||
|   static get properties() { | ||||
|     return { | ||||
|       orientation: { type: String, reflect: true } | ||||
|     }; | ||||
|   } | ||||
|  | ||||
|   constructor() { | ||||
|     super(); | ||||
|     this.orientation = 'horizontal'; | ||||
| @@ -37,7 +43,7 @@ class TpTabs extends LitElement { | ||||
|  | ||||
|   render() { | ||||
|     return html` | ||||
|       <div class="tabs" @click="${this.selectTab}"> | ||||
|       <div class="tabs" part="wrap" @click="${this.selectTab}"> | ||||
|         <slot></slot> | ||||
|       </div> | ||||
|     `; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user