mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21: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
|
@ -12,25 +12,36 @@
|
|||
export let light = false;
|
||||
export let disabled = false;
|
||||
|
||||
export let labelText = "";
|
||||
export let hideLabel = false;
|
||||
|
||||
/**
|
||||
* Set an id for the input element
|
||||
* @type {string} [id]
|
||||
*/
|
||||
export let id = "ccs-" + Math.random().toString(36);
|
||||
export let name = undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to indicate an invalid state
|
||||
* @type {boolean} [invalid=false]
|
||||
*/
|
||||
export let invalid = false;
|
||||
export let invalidText = "Invalid time format.";
|
||||
export let labelText = "";
|
||||
export let hideLabel = false;
|
||||
|
||||
/**
|
||||
* Specify the invalid state text
|
||||
* @type {string} [invalidText="Invalid time format."]
|
||||
*/
|
||||
export let invalidText = "";
|
||||
</script>
|
||||
|
||||
<div
|
||||
class:bx--form-item={true}
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
{...$$restProps}>
|
||||
on:mouseleave>
|
||||
<div
|
||||
class:bx--time-picker={true}
|
||||
class:bx--time-picker--light={light}
|
||||
|
@ -47,6 +58,14 @@
|
|||
{/if}
|
||||
<input
|
||||
data-invalid={invalid || undefined}
|
||||
{pattern}
|
||||
{placeholder}
|
||||
{maxlength}
|
||||
{id}
|
||||
{name}
|
||||
{type}
|
||||
{value}
|
||||
{disabled}
|
||||
class:bx--time-picker__input-field={true}
|
||||
class:bx--text-input={true}
|
||||
class:bx--text-input--light={light}
|
||||
|
@ -57,15 +76,7 @@
|
|||
value = target.value;
|
||||
}}
|
||||
on:focus
|
||||
on:blur
|
||||
{pattern}
|
||||
{placeholder}
|
||||
{maxlength}
|
||||
{id}
|
||||
{name}
|
||||
{type}
|
||||
{value}
|
||||
{disabled} />
|
||||
on:blur />
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue