mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
chore: add more type docs
This commit is contained in:
parent
773b18d314
commit
c3f924c25a
45 changed files with 517 additions and 50 deletions
|
@ -1,4 +1,8 @@
|
|||
<script>
|
||||
/**
|
||||
* Set to `true` to use the range variant
|
||||
* @type {boolean} [range=false]
|
||||
*/
|
||||
export let range = false;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<script>
|
||||
/**
|
||||
* Specify the element to append the calendar to
|
||||
* @type {HTMLElement} [appendTo=document.body]
|
||||
*/
|
||||
export let appendTo = document.body;
|
||||
export let dateFormat = "m/d/Y";
|
||||
export let datePickerType = "simple";
|
||||
|
@ -159,8 +163,8 @@
|
|||
class:bx--date-picker={true}
|
||||
class:bx--date-picker--short={short}
|
||||
class:bx--date-picker--light={light}
|
||||
class="{datePickerType && `--date-picker--${datePickerType}`}
|
||||
{datePickerType === 'range' && $labelTextEmpty && '--date-picker--nolabel'}">
|
||||
class="{datePickerType && `bx--date-picker--${datePickerType}`}
|
||||
{datePickerType === 'range' && $labelTextEmpty && 'bx--date-picker--nolabel'}">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,9 +1,23 @@
|
|||
<script>
|
||||
export let size = undefined; // "sm" | "xl"
|
||||
/**
|
||||
* Set the size of the input
|
||||
* @type {"sm" | "xl"} [size]
|
||||
*/
|
||||
export let size = undefined;
|
||||
export let type = "text";
|
||||
|
||||
/**
|
||||
* Specify the input placeholder text
|
||||
* @type {string} [placeholder=""]
|
||||
*/
|
||||
export let placeholder = "";
|
||||
export let pattern = "\\d{1,2}\\/\\d{1,2}\\/\\d{4}";
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Define the ARIA label for the calendar icon
|
||||
* @type {string} [iconDescription=""]
|
||||
*/
|
||||
export let iconDescription = "";
|
||||
|
||||
/**
|
||||
|
@ -13,8 +27,19 @@
|
|||
export let id = "ccs-" + Math.random().toString(36);
|
||||
export let labelText = "";
|
||||
export let hideLabel = false;
|
||||
|
||||
/**
|
||||
* Set to `true` to indicate an invalid state
|
||||
* @type {boolean} [invalid=false]
|
||||
*/
|
||||
export let invalid = false;
|
||||
|
||||
/**
|
||||
* Specify the invalid state text
|
||||
* @type {string} [invalidText=""]
|
||||
*/
|
||||
export let invalidText = "";
|
||||
|
||||
export let name = undefined;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue