mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
chore: v11 NumberInput
For better compatibility with existing codebases size `xl` is still supported.
This commit is contained in:
parent
c23782b161
commit
9f32d57353
5 changed files with 8 additions and 10 deletions
|
@ -2488,7 +2488,7 @@ export type NumberInputTranslationId = "increment" | "decrement";
|
|||
| :-------------- | :------- | :----------------- | :------- | --------------------------------------------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------- |
|
||||
| ref | No | <code>let</code> | Yes | <code>null | HTMLInputElement</code> | <code>null</code> | Obtain a reference to the input HTML element |
|
||||
| value | No | <code>let</code> | Yes | <code>null | number</code> | <code>null</code> | Specify the input value.<br />Use `null` to denote "no value" |
|
||||
| size | No | <code>let</code> | No | <code>"sm" | "xl"</code> | <code>undefined</code> | Set the size of the input |
|
||||
| size | No | <code>let</code> | No | <code>"sm" | "lg"</code> | <code>undefined</code> | Set the size of the input |
|
||||
| step | No | <code>let</code> | No | <code>number</code> | <code>1</code> | Specify the step increment |
|
||||
| max | No | <code>let</code> | No | <code>number</code> | <code>undefined</code> | Specify the maximum value |
|
||||
| min | No | <code>let</code> | No | <code>number</code> | <code>undefined</code> | Specify the minimum value |
|
||||
|
|
|
@ -7580,7 +7580,7 @@
|
|||
"name": "size",
|
||||
"kind": "let",
|
||||
"description": "Set the size of the input",
|
||||
"type": "\"sm\" | \"xl\"",
|
||||
"type": "\"sm\" | \"lg\"",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
|
|
|
@ -51,9 +51,9 @@ Set `value` to `null` to denote "no value."
|
|||
|
||||
<NumberInput readonly label="Clusters" value={0} />
|
||||
|
||||
## Extra-large size
|
||||
## Large size
|
||||
|
||||
<NumberInput size="xl" label="Clusters" value={0} />
|
||||
<NumberInput size="lg" label="Clusters" value={0} />
|
||||
|
||||
## Small size
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
/**
|
||||
* Set the size of the input
|
||||
* @type {"sm" | "xl"}
|
||||
* @type {"sm" | "lg"}
|
||||
*/
|
||||
export let size = undefined;
|
||||
|
||||
|
@ -171,7 +171,7 @@
|
|||
class:bx--number--nolabel="{hideLabel}"
|
||||
class:bx--number--nosteppers="{hideSteppers}"
|
||||
class:bx--number--sm="{size === 'sm'}"
|
||||
class:bx--number--xl="{size === 'xl'}"
|
||||
class:bx--number--lg="{size === 'lg' || size === 'xl'}"
|
||||
>
|
||||
{#if $$slots.label || label}
|
||||
<label
|
||||
|
@ -212,9 +212,7 @@
|
|||
on:blur
|
||||
on:paste
|
||||
/>
|
||||
{#if readonly}
|
||||
<EditOff class="bx--text-input__readonly-icon" />
|
||||
{:else}
|
||||
{#if !readonly}
|
||||
{#if invalid}
|
||||
<WarningFilled class="bx--number__invalid" />
|
||||
{/if}
|
||||
|
|
2
types/NumberInput/NumberInput.svelte.d.ts
vendored
2
types/NumberInput/NumberInput.svelte.d.ts
vendored
|
@ -10,7 +10,7 @@ export interface NumberInputProps extends RestProps {
|
|||
* Set the size of the input
|
||||
* @default undefined
|
||||
*/
|
||||
size?: "sm" | "xl";
|
||||
size?: "sm" | "lg";
|
||||
|
||||
/**
|
||||
* Specify the input value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue