fix(progress-bar): export id prop #731

Fixes #731
This commit is contained in:
Eric Y Liu 2021-07-07 09:44:01 -07:00
commit a2b12dc609
4 changed files with 27 additions and 8 deletions

View file

@ -2838,13 +2838,14 @@ None.
### Props
| Prop name | Kind | Reactive | Type | Default value | Description |
| :--------- | :--------------- | :------- | :------------------- | ------------------ | --------------------------------------------- |
| value | <code>let</code> | No | <code>number</code> | -- | Specify the current value |
| max | <code>let</code> | No | <code>number</code> | <code>100</code> | Specify the maximum value |
| labelText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text |
| hideLabel | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to visually hide the label text |
| helperText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the helper text |
| Prop name | Kind | Reactive | Type | Default value | Description |
| :--------- | :--------------- | :------- | :------------------- | ------------------------------------------------ | --------------------------------------------- |
| value | <code>let</code> | No | <code>number</code> | -- | Specify the current value |
| max | <code>let</code> | No | <code>number</code> | <code>100</code> | Specify the maximum value |
| labelText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the label text |
| hideLabel | <code>let</code> | No | <code>boolean</code> | <code>false</code> | Set to `true` to visually hide the label text |
| helperText | <code>let</code> | No | <code>string</code> | <code>""</code> | Specify the helper text |
| id | <code>let</code> | No | <code>string</code> | <code>"ccs-" + Math.random().toString(36)</code> | Set an id for the progress bar element |
### Slots

View file

@ -7441,6 +7441,16 @@
"isFunction": false,
"constant": false,
"reactive": false
},
{
"name": "id",
"kind": "let",
"description": "Set an id for the progress bar element",
"type": "string",
"value": "\"ccs-\" + Math.random().toString(36)",
"isFunction": false,
"constant": false,
"reactive": false
}
],
"slots": [

View file

@ -17,7 +17,9 @@
/** Specify the helper text */
export let helperText = "";
let id = "ccs-" + Math.random().toString(36);
/** Set an id for the progress bar element */
export let id = "ccs-" + Math.random().toString(36);
let helperId = "ccs-" + Math.random().toString(36);
$: indeterminate = value === undefined;

View file

@ -31,6 +31,12 @@ export interface ProgressBarProps
* @default ""
*/
helperText?: string;
/**
* Set an id for the progress bar element
* @default "ccs-" + Math.random().toString(36)
*/
id?: string;
}
export default class ProgressBar extends SvelteComponentTyped<