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

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
Signed-off-by: Florian-Schoenherr <florian.schoenherr99@gmail.com>
  • Loading branch information
Florian-Schoenherr committed Mar 21, 2021
1 parent a7d2cb5 commit 62d5087
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion packages/docs/src/components/doc/Playground.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
SlideGroup,
SlideItem,
Ripple,
ListItem,
} from 'svelte-materialify/src';
import { mdiInvertColors } from '@mdi/js';
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/playground/Chip.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
icon: {
type: 'select',
items,
format: (val) => items.find((i) => i.value == val) ? items.find((i) => i.value == val).name : '', // eslint-disable-line eqeqeq
format: (val) => (items.find((i) => i.value == val) ? items.find((i) => i.value == val).name : ''), // eslint-disable-line eqeqeq
},
size: {
type: 'select',
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/playground/Icon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
icon: {
type: 'select',
items,
format: (val) => items.find((i) => i.value == val) ? items.find((i) => i.value == val).name : '', // eslint-disable-line eqeqeq
format: (val) => (items.find((i) => i.value == val) ? items.find((i) => i.value == val).name : ''), // eslint-disable-line eqeqeq
},
color: { type: 'select', items: ['red', 'green', 'blue', 'indigo', 'purple'] },
};
Expand Down
10 changes: 5 additions & 5 deletions packages/svelte-materialify/src/components/Select/Select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
export let disabled = null;
export let closeOnClick = !multiple;
export let emptyString = '';
export let format = (val) => Array.isArray(val) ? val.map(v => getSelectString(v)).join(', ') : getSelectString(val);
const getSelectString = (v) => {
if(typeof v !== Object) return v;
const item = items.find(item => item.value === v);
if (typeof v !== 'object') return v;
const item = items.find((i) => i.value === v);
return item ? item.name : emptyString;
}
};
export let format = (val) => (Array.isArray(val) ? val.map((v) => getSelectString(v)).join(', ') : getSelectString(val));
const dispatch = createEventDispatcher();
$: dispatch('change', value);
</script>
Expand Down

0 comments on commit 62d5087

Please sign in to comment.