mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
Run "yarn build:docs"
This commit is contained in:
parent
c62808165e
commit
7bbf774ec0
3 changed files with 41 additions and 9 deletions
|
@ -921,6 +921,8 @@ None.
|
|||
|
||||
| Prop name | Kind | Reactive | Type | Default value | Description |
|
||||
| :-------------- | :--------------- | :------- | :---------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
||||
| feedback | <code>let</code> | No | <code>string</code> | <code>"Copied!"</code> | Set the feedback text shown after clicking the button |
|
||||
| feedbackTimeout | <code>let</code> | No | <code>number</code> | <code>2000</code> | Set the timeout duration (ms) to display feedback text |
|
||||
| iconDescription | <code>let</code> | No | <code>string</code> | <code>"Copy to clipboard"</code> | Set the title and ARIA label for the copy button |
|
||||
| text | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify the text to copy |
|
||||
| copy | <code>let</code> | No | <code>(text: string) => void</code> | <code>async (text) => { try { await navigator.clipboard.writeText(text); } catch (e) { console.log(e); } }</code> | Override the default copy behavior of using the navigator.clipboard.writeText API to copy text |
|
||||
|
|
|
@ -2180,6 +2180,28 @@
|
|||
"moduleName": "CopyButton",
|
||||
"filePath": "src/CopyButton/CopyButton.svelte",
|
||||
"props": [
|
||||
{
|
||||
"name": "feedback",
|
||||
"kind": "let",
|
||||
"description": "Set the feedback text shown after clicking the button",
|
||||
"type": "string",
|
||||
"value": "\"Copied!\"",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "feedbackTimeout",
|
||||
"kind": "let",
|
||||
"description": "Set the timeout duration (ms) to display feedback text",
|
||||
"type": "number",
|
||||
"value": "2000",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "iconDescription",
|
||||
"kind": "let",
|
||||
|
@ -2216,16 +2238,12 @@
|
|||
"moduleExports": [],
|
||||
"slots": [],
|
||||
"events": [
|
||||
{ "type": "forwarded", "name": "click", "element": "Copy" },
|
||||
{ "type": "forwarded", "name": "animationend", "element": "Copy" },
|
||||
{ "type": "forwarded", "name": "click", "element": "button" },
|
||||
{ "type": "forwarded", "name": "animationend", "element": "button" },
|
||||
{ "type": "dispatched", "name": "copy" }
|
||||
],
|
||||
"typedefs": [],
|
||||
"rest_props": { "type": "InlineComponent", "name": "Copy" },
|
||||
"extends": {
|
||||
"interface": "CopyProps",
|
||||
"import": "\"../Copy/Copy.svelte\""
|
||||
}
|
||||
"rest_props": { "type": "Element", "name": "button" }
|
||||
},
|
||||
{
|
||||
"moduleName": "DataTable",
|
||||
|
|
16
types/CopyButton/CopyButton.svelte.d.ts
vendored
16
types/CopyButton/CopyButton.svelte.d.ts
vendored
|
@ -1,8 +1,20 @@
|
|||
/// <reference types="svelte" />
|
||||
import { SvelteComponentTyped } from "svelte";
|
||||
import { CopyProps } from "../Copy/Copy.svelte";
|
||||
|
||||
export interface CopyButtonProps extends CopyProps {
|
||||
export interface CopyButtonProps
|
||||
extends svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["button"]> {
|
||||
/**
|
||||
* Set the feedback text shown after clicking the button
|
||||
* @default "Copied!"
|
||||
*/
|
||||
feedback?: string;
|
||||
|
||||
/**
|
||||
* Set the timeout duration (ms) to display feedback text
|
||||
* @default 2000
|
||||
*/
|
||||
feedbackTimeout?: number;
|
||||
|
||||
/**
|
||||
* Set the title and ARIA label for the copy button
|
||||
* @default "Copy to clipboard"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue