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 | | 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;` | | 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 | | 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 ### Slots

View file

@ -9950,6 +9950,17 @@
"constant": false, "constant": false,
"reactive": 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", "name": "ref",
"kind": "let", "kind": "let",

View file

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

View file

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

4472
yarn.lock

File diff suppressed because it is too large Load diff