mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
chore: add more prop annotations
This commit is contained in:
parent
8c1ffd4cb0
commit
773b18d314
75 changed files with 877 additions and 137 deletions
|
@ -1,6 +1,20 @@
|
|||
<script>
|
||||
/**
|
||||
* Set the feedback text shown after clicking the button
|
||||
* @type {string} [feedback="Copied!"]
|
||||
*/
|
||||
export let feedback = "Copied!";
|
||||
|
||||
/**
|
||||
* Set the timeout duration (ms) to display feedback text
|
||||
* @type {number} [feedbackTimeout=2000]
|
||||
*/
|
||||
export let feedbackTimeout = 2000;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the button HTML element
|
||||
* @type {null | HTMLElement} [ref=null]
|
||||
*/
|
||||
export let ref = null;
|
||||
|
||||
import { onMount } from "svelte";
|
||||
|
@ -8,8 +22,6 @@
|
|||
let animation = undefined;
|
||||
let timeout = undefined;
|
||||
|
||||
$: showFeedback = timeout !== undefined;
|
||||
|
||||
onMount(() => {
|
||||
return () => {
|
||||
clearTimeout(timeout);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue