mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
feat(accordion): add disabled prop
This commit is contained in:
parent
cb80c7d15b
commit
ebf882cff4
5 changed files with 81 additions and 2 deletions
|
@ -11,13 +11,27 @@
|
|||
*/
|
||||
export let size = undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the accordion
|
||||
* @type {boolean} [disabled=false]
|
||||
*/
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to display the skeleton state
|
||||
* @type {boolean} [skeleton=false]
|
||||
*/
|
||||
export let skeleton = false;
|
||||
|
||||
import { setContext } from "svelte";
|
||||
import { writable } from "svelte/store";
|
||||
import AccordionSkeleton from "./Accordion.Skeleton.svelte";
|
||||
|
||||
const disableItems = writable(disabled);
|
||||
|
||||
$: disableItems.set(disabled);
|
||||
|
||||
setContext("Accordion", { disableItems });
|
||||
</script>
|
||||
|
||||
{#if skeleton}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue