From 01054c4065e1a7a1aecbdb835ec2afb73fb9d575 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Wed, 2 Feb 2022 19:04:31 -0800 Subject: [PATCH] Run "yarn build:docs" --- COMPONENT_INDEX.md | 41 +++++++++++++-------------- docs/src/COMPONENT_API.json | 15 ++-------- types/TextInput/TextInput.svelte.d.ts | 13 ++++----- 3 files changed, 27 insertions(+), 42 deletions(-) diff --git a/COMPONENT_INDEX.md b/COMPONENT_INDEX.md index 8272c01d..0f1991e9 100644 --- a/COMPONENT_INDEX.md +++ b/COMPONENT_INDEX.md @@ -4167,27 +4167,26 @@ None. ### Props -| Prop name | Kind | Reactive | Type | Default value | Description | -| :---------- | :--------------- | :------- | :---------------------------------------- | ------------------------------------------------ | --------------------------------------------- | -| ref | let | Yes | null | HTMLInputElement | null | Obtain a reference to the input HTML element | -| value | let | Yes | number | string | "" | Specify the input value | -| size | let | No | "sm" | "xl" | undefined | Set the size of the input | -| type | let | No | string | "" | Specify the input type | -| placeholder | let | No | string | "" | Specify the placeholder text | -| light | let | No | boolean | false | Set to `true` to enable the light variant | -| disabled | let | No | boolean | false | Set to `true` to disable the input | -| helperText | let | No | string | "" | Specify the helper text | -| id | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the input element | -| name | let | No | string | undefined | Specify a name attribute for the input | -| labelText | let | No | string | "" | Specify the label text | -| hideLabel | let | No | boolean | false | Set to `true` to visually hide the label text | -| invalid | let | No | boolean | false | Set to `true` to indicate an invalid state | -| invalidText | let | No | string | "" | Specify the invalid state text | -| warn | let | No | boolean | false | Set to `true` to indicate an warning state | -| warnText | let | No | string | "" | Specify the warning state text | -| required | let | No | boolean | false | Set to `true` to mark the field as required | -| inline | let | No | boolean | false | Set to `true` to use the inline variant | -| readonly | let | No | boolean | false | Set to `true` to use the read-only variant | +| Prop name | Kind | Reactive | Type | Default value | Description | +| :---------- | :--------------- | :------- | :-------------------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- | +| ref | let | Yes | null | HTMLInputElement | null | Obtain a reference to the input HTML element | +| value | let | Yes | null | number | string | "" | Specify the input value.

`value` will be set to `null` if type="number"
and the value is empty. | +| size | let | No | "sm" | "xl" | undefined | Set the size of the input | +| placeholder | let | No | string | "" | Specify the placeholder text | +| light | let | No | boolean | false | Set to `true` to enable the light variant | +| disabled | let | No | boolean | false | Set to `true` to disable the input | +| helperText | let | No | string | "" | Specify the helper text | +| id | let | No | string | "ccs-" + Math.random().toString(36) | Set an id for the input element | +| name | let | No | string | undefined | Specify a name attribute for the input | +| labelText | let | No | string | "" | Specify the label text | +| hideLabel | let | No | boolean | false | Set to `true` to visually hide the label text | +| invalid | let | No | boolean | false | Set to `true` to indicate an invalid state | +| invalidText | let | No | string | "" | Specify the invalid state text | +| warn | let | No | boolean | false | Set to `true` to indicate an warning state | +| warnText | let | No | string | "" | Specify the warning state text | +| required | let | No | boolean | false | Set to `true` to mark the field as required | +| inline | let | No | boolean | false | Set to `true` to use the inline variant | +| readonly | let | No | boolean | false | Set to `true` to use the read-only variant | ### Slots diff --git a/docs/src/COMPONENT_API.json b/docs/src/COMPONENT_API.json index 8983f063..ae2f0bae 100644 --- a/docs/src/COMPONENT_API.json +++ b/docs/src/COMPONENT_API.json @@ -11571,25 +11571,14 @@ { "name": "value", "kind": "let", - "description": "Specify the input value", - "type": "number | string", + "description": "Specify the input value.\n\n`value` will be set to `null` if type=\"number\"\nand the value is empty.", + "type": "null | number | string", "value": "\"\"", "isFunction": false, "isFunctionDeclaration": false, "constant": false, "reactive": true }, - { - "name": "type", - "kind": "let", - "description": "Specify the input type", - "type": "string", - "value": "\"\"", - "isFunction": false, - "isFunctionDeclaration": false, - "constant": false, - "reactive": false - }, { "name": "placeholder", "kind": "let", diff --git a/types/TextInput/TextInput.svelte.d.ts b/types/TextInput/TextInput.svelte.d.ts index 511dab39..592ee0e0 100644 --- a/types/TextInput/TextInput.svelte.d.ts +++ b/types/TextInput/TextInput.svelte.d.ts @@ -10,16 +10,13 @@ export interface TextInputProps size?: "sm" | "xl"; /** - * Specify the input value + * Specify the input value. + * + * `value` will be set to `null` if type="number" + * and the value is empty. * @default "" */ - value?: number | string; - - /** - * Specify the input type - * @default "" - */ - type?: string; + value?: null | number | string; /** * Specify the placeholder text