add name prop to Search component

This commit is contained in:
Tee Ming 2022-10-13 16:06:43 +08:00
commit 90d983216d
5 changed files with 2975 additions and 1522 deletions

View file

@ -3097,6 +3097,7 @@ None.
| labelText | No | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text |
| icon | No | <code>let</code> | No | <code>typeof import("svelte").SvelteComponent</code> | <code>undefined</code> | Specify the icon to render.<br />Defaults to `&lt;Search /&gt;` |
| id | No | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the input element |
| name | No | <code>let</code> | No | <code>string</code> | <code>undefined</code> | Specify a name attribute for the input |
### Slots

View file

@ -9950,6 +9950,17 @@
"constant": false,
"reactive": false
},
{
"name": "name",
"kind": "let",
"description": "Specify a name attribute for the input",
"type": "string",
"isFunction": false,
"isFunctionDeclaration": false,
"isRequired": false,
"constant": false,
"reactive": false
},
{
"name": "ref",
"kind": "let",

View file

@ -62,6 +62,12 @@
/** Set an id for the input element */
export let id = "ccs-" + Math.random().toString(36);
/**
* Specify a name attribute for the input
* @type {string}
*/
export let name = undefined;
/** Obtain a reference to the input HTML element */
export let ref = null;
@ -126,6 +132,7 @@
autocomplete="{autocomplete}"
disabled="{disabled}"
id="{id}"
name="{name}"
placeholder="{placeholder}"
{...$$restProps}
on:change

View file

@ -93,6 +93,12 @@ export interface SearchProps {
*/
id?: string;
/**
* Specify a name attribute for the input
* @default undefined
*/
name?: string;
/**
* Obtain a reference to the input HTML element
* @default null

4472
yarn.lock

File diff suppressed because it is too large Load diff