svelte-tabs-scrollable
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "svelte-tabs-scrollable", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "a simple svelte scrollable tabs with a lot of additional features and with fully supporting of RTL mode", | ||
"author": "Mohammed Aliwi", | ||
"license": "MIT", | ||
"repository": "Mohammed Aliwi/svelte-tabs-scrollable", | ||
"main": "dist/index.js", | ||
"module": "dist/index.modern.js", | ||
"source": "src/index.js", | ||
"keywords": [ | ||
"svelte", | ||
"svelte-tabs", | ||
"tabs", | ||
"scrollable", | ||
"rtl", | ||
"menu", | ||
"tab", | ||
"scroll", | ||
"navigation" | ||
], | ||
"homepage": "https://github.com/Mood-al/svelte-tabs-scrollable#readme", | ||
"bugs": { | ||
"url": "https://github.com/Mood-al/svelte-tabs-scrollable/issues", | ||
"email": "aliwi299@gmail.com" | ||
}, | ||
"funding": "https://www.buymeacoffee.com/Mooder", | ||
"devDependencies": { | ||
@@ -8,2 +32,3 @@ "@sveltejs/adapter-auto": "next", | ||
"@sveltejs/package": "^1.0.0-next.1", | ||
"@sveltejs/adapter-node": "next", | ||
"eslint": "^8.16.0", | ||
@@ -29,2 +54,3 @@ "eslint-config-prettier": "^8.3.0", | ||
"./utils/animate": "./utils/animate.js", | ||
"./utils/debounce": "./utils/debounce.js", | ||
"./utils/getNormalizedScrollLeft": "./utils/getNormalizedScrollLeft.js", | ||
@@ -34,2 +60,2 @@ "./utils/scroll": "./utils/scroll.js" | ||
"svelte": "./index.js" | ||
} | ||
} |
@@ -1,38 +0,54 @@ | ||
# create-svelte | ||
# usage | ||
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte). | ||
```javascript | ||
<script> | ||
// @ts-nocheck | ||
## Creating a project | ||
import Tabs from '$lib/Tabs.svelte'; | ||
import Tab from '$lib/Tab.svelte'; | ||
If you're seeing this, you've probably already done this step. Congrats! | ||
let isRTL = false; | ||
const onClick = () => { | ||
isRTL = !isRTL; | ||
}; | ||
let activeTab = 13; | ||
const onTabClick = (e, index) => { | ||
console.log(e, index); | ||
}; | ||
$: { | ||
if (typeof window !== 'undefined') { | ||
const body = window.document.body; | ||
isRTL ? (body.dir = 'rtl') : (body.dir = 'ltr'); | ||
} | ||
} | ||
let goToEnd; | ||
let goToStart; | ||
</script> | ||
```bash | ||
# create a new project in the current directory | ||
npm create svelte@latest | ||
<Tabs {activeTab} {onTabClick} bind:goToEnd bind:goToStart {isRTL}> | ||
{#each [...Array(33).keys()] as item} | ||
<Tab> | ||
tab {item} | ||
</Tab> | ||
{/each} | ||
</Tabs> | ||
# create a new project in my-app | ||
npm create svelte@latest my-app | ||
``` | ||
<button on:click={() => goToEnd()}>go to end</button> | ||
<button on:click={() => goToStart()}>go to start</button> | ||
<button on:click={onClick}>{isRTL ? 'rtl' : 'ltr'}</button> | ||
## Developing | ||
<h3> | ||
I'm working now on the demo and on adding the API to the component. if you want to see demos on | ||
react-tabs-scrollable please visit this <a nopo href="https://react-tabs-scrollable.vercel.app/" | ||
><h2>Website</h2></a | ||
> until i can finish the svelte one, they both have the same features and functionality. | ||
</h3> | ||
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: | ||
```bash | ||
npm run dev | ||
# or start the server and open the app in a new browser tab | ||
npm run dev -- --open | ||
``` | ||
## Building | ||
## installation | ||
To create a production version of your app: | ||
```bash | ||
npm run build | ||
# create a new project in the current directory | ||
npm i svelte-tabs-scroll-tabs | ||
``` | ||
You can preview the production build with `npm run preview`. | ||
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. |
@@ -5,3 +5,3 @@ /** @typedef {typeof __propDef.props} TabProps */ | ||
export default class Tab extends SvelteComponentTyped<{ | ||
dd: any; | ||
[x: string]: never; | ||
}, { | ||
@@ -19,3 +19,3 @@ [evt: string]: CustomEvent<any>; | ||
props: { | ||
dd: any; | ||
[x: string]: never; | ||
}; | ||
@@ -22,0 +22,0 @@ events: { |
@@ -8,8 +8,11 @@ /** @typedef {typeof __propDef.props} TabsProps */ | ||
onTabClick: any; | ||
scrollSelectedToCenterOfView?: boolean; | ||
scrollSelectedToEndOfView?: boolean; | ||
tabsScrollAmount?: number; | ||
goToStart?: () => void; | ||
goToEnd?: () => void; | ||
}, { | ||
[evt: string]: CustomEvent<any>; | ||
}, { | ||
default: { | ||
dd: string; | ||
}; | ||
default: {}; | ||
}> { | ||
@@ -26,2 +29,7 @@ } | ||
onTabClick: any; | ||
scrollSelectedToCenterOfView?: boolean; | ||
scrollSelectedToEndOfView?: boolean; | ||
tabsScrollAmount?: number; | ||
goToStart?: () => void; | ||
goToEnd?: () => void; | ||
}; | ||
@@ -32,7 +40,5 @@ events: { | ||
slots: { | ||
default: { | ||
dd: string; | ||
}; | ||
default: {}; | ||
}; | ||
}; | ||
export {}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
spdx disjunction for an artifact's license information
Licensespdx disjunction for an artifact's license information
Found 1 instance in 1 package
spdx disjunction for an artifact's license information
Licensespdx disjunction for an artifact's license information
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
17331
18
1
250
0
1
55
15