Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Commit

Permalink
feat(Tabs): added ripple option
Browse files Browse the repository at this point in the history
  • Loading branch information
TheComputerM committed Oct 21, 2020
1 parent db7ca74 commit 314e0d0
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/api-generator/dist/index.js

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions packages/api-generator/src/Tab.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,45 @@
"visibility": "public",
"description": null,
"keywords": [],
"name": "activeClass",
"name": "value",
"kind": "let",
"static": false,
"readonly": false,
"type": {
"kind": "type",
"text": "string",
"type": "string"
},
"defaultValue": ""
"text": "any",
"type": "any"
}
},
{
"visibility": "public",
"description": null,
"keywords": [],
"name": "disabled",
"name": "activeClass",
"kind": "let",
"static": false,
"readonly": false,
"type": {
"kind": "type",
"text": "object",
"type": "object"
"text": "string",
"type": "string"
},
"defaultValue": null
"defaultValue": ""
},
{
"visibility": "public",
"description": null,
"keywords": [],
"name": "value",
"name": "disabled",
"kind": "let",
"static": false,
"readonly": false,
"type": {
"kind": "type",
"text": "any",
"type": "any"
}
"text": "object",
"type": "object"
},
"defaultValue": null
}
],
"computed": [],
Expand Down
28 changes: 28 additions & 0 deletions packages/api-generator/src/Tabs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
"version": 3,
"name": "Tabs",
"data": [
{
"visibility": "public",
"description": null,
"keywords": [],
"name": "TABS",
"kind": "const",
"static": false,
"readonly": true,
"type": {
"kind": "type",
"text": "any",
"type": "any"
}
},
{
"visibility": "public",
"description": null,
Expand Down Expand Up @@ -172,6 +186,20 @@
},
"defaultValue": ""
},
{
"visibility": "public",
"description": null,
"keywords": [],
"name": "ripple",
"kind": "let",
"static": false,
"readonly": false,
"type": {
"kind": "type",
"text": "any",
"type": "any"
}
},
{
"visibility": "public",
"description": null,
Expand Down
6 changes: 4 additions & 2 deletions packages/svelte-materialify/src/components/Tabs/Tab.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@
import { getContext } from 'svelte';
import { SLIDE_GROUP } from '../SlideGroup/SlideGroup.svelte';
import { ITEM_GROUP } from '../ItemGroup/ItemGroup.svelte';
import { TABS } from './Tabs.svelte';
import Class from '../../internal/Class';
import Ripple from '../../actions/Ripple';
const click = getContext(SLIDE_GROUP);
const { select, register, index } = getContext(ITEM_GROUP);
const { ripple } = getContext(TABS);
let klass = '';
export { klass as class };
export let value = index();
export let activeClass = '';
export let disabled = null;
export let value = index();
let active;
register((values) => {
Expand All @@ -39,6 +41,6 @@
class:active
use:Class={[active && activeClass]}
on:click={selectTab}
use:Ripple>
use:Ripple={ripple}>
<slot />
</button>
9 changes: 8 additions & 1 deletion packages/svelte-materialify/src/components/Tabs/Tabs.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<script context="module">
export const TABS = {};
</script>

<script>
import SlideGroup from '../SlideGroup';
import Window from '../Window';
import { onMount } from 'svelte';
import { onMount, setContext } from 'svelte';
let sliderElement;
let windowComponent;
Expand All @@ -20,8 +24,11 @@
export let icons = false;
export let slider = true;
export let sliderClass = '';
export let ripple = {};
export let vertical = false;
setContext(TABS, { ripple });
function moveSlider({ detail }) {
if (slider) {
const activeTab = tabs[detail[0]];
Expand Down

0 comments on commit 314e0d0

Please sign in to comment.