mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 19:01:05 +00:00
Align v10.53 (#1109)
* chore(deps): upgrade carbon-components to v10.53.0 * feat(text-area): add maxCount prop * docs(text-area): add maximum character count * feat(file-uploader): add disabled prop * docs(file-uploader): add disabled state example
This commit is contained in:
parent
8d3ac75170
commit
78072a1c66
12 changed files with 98 additions and 23 deletions
|
@ -11,6 +11,9 @@
|
|||
*/
|
||||
export let status = "uploading";
|
||||
|
||||
/** Set to `true` to disable the file uploader */
|
||||
export let disabled = false;
|
||||
|
||||
/**
|
||||
* Specify the accepted file types
|
||||
* @type {string[]}
|
||||
|
@ -99,9 +102,20 @@
|
|||
on:mouseenter
|
||||
on:mouseleave
|
||||
>
|
||||
<p class:bx--file--label="{true}">{labelTitle}</p>
|
||||
<p class:bx--label-description="{true}">{labelDescription}</p>
|
||||
<p
|
||||
class:bx--file--label="{true}"
|
||||
class:bx--label-description--disabled="{disabled}"
|
||||
>
|
||||
{labelTitle}
|
||||
</p>
|
||||
<p
|
||||
class:bx--label-description="{true}"
|
||||
class:bx--label-description--disabled="{disabled}"
|
||||
>
|
||||
{labelDescription}
|
||||
</p>
|
||||
<FileUploaderButton
|
||||
disabled="{disabled}"
|
||||
disableLabelChanges
|
||||
labelText="{buttonLabel}"
|
||||
accept="{accept}"
|
||||
|
|
|
@ -11,6 +11,12 @@
|
|||
/** Specify the number of rows */
|
||||
export let rows = 4;
|
||||
|
||||
/**
|
||||
* Specify the max character count
|
||||
* @type {number}
|
||||
*/
|
||||
export let maxCount = undefined;
|
||||
|
||||
/** Set to `true` to enable the light variant */
|
||||
export let light = false;
|
||||
|
||||
|
@ -61,16 +67,23 @@
|
|||
class:bx--form-item="{true}"
|
||||
>
|
||||
{#if (labelText || $$slots.labelText) && !hideLabel}
|
||||
<label
|
||||
for="{id}"
|
||||
class:bx--label="{true}"
|
||||
class:bx--visually-hidden="{hideLabel}"
|
||||
class:bx--label--disabled="{disabled}"
|
||||
>
|
||||
<slot name="labelText">
|
||||
{labelText}
|
||||
</slot>
|
||||
</label>
|
||||
<div class:bx--text-area__label-wrapper="{true}">
|
||||
<label
|
||||
for="{id}"
|
||||
class:bx--label="{true}"
|
||||
class:bx--visually-hidden="{hideLabel}"
|
||||
class:bx--label--disabled="{disabled}"
|
||||
>
|
||||
<slot name="labelText">
|
||||
{labelText}
|
||||
</slot>
|
||||
</label>
|
||||
{#if maxCount}
|
||||
<div class:bx--label="{true}" class:bx--label--disabled="{disabled}">
|
||||
{value.length}/{maxCount}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<div
|
||||
class:bx--text-area__wrapper="{true}"
|
||||
|
@ -94,6 +107,7 @@
|
|||
class:bx--text-area="{true}"
|
||||
class:bx--text-area--light="{light}"
|
||||
class:bx--text-area--invalid="{invalid}"
|
||||
maxlength="{maxCount ?? undefined}"
|
||||
{...$$restProps}
|
||||
on:change
|
||||
on:input
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue