File tree Expand file tree Collapse file tree 5 files changed +59
-9
lines changed Expand file tree Collapse file tree 5 files changed +59
-9
lines changed Original file line number Diff line number Diff line change @@ -3208,12 +3208,14 @@ None.
3208
3208
3209
3209
### Props
3210
3210
3211
- | Prop name | Required | Kind | Reactive | Type | Default value | Description |
3212
- | :-------- | :------- | :--------------- | :------- | --------------------------------- | ------------------ | ----------------------------------- |
3213
- | value | No | <code >let</code > | No | <code >string | ; number</code > | <code >""</code > | Specify the option value |
3214
- | text | No | <code >let</code > | No | <code >string</code > | <code >""</code > | Specify the option text |
3215
- | hidden | No | <code >let</code > | No | <code >boolean</code > | <code >false</code > | Set to ` true ` to hide the option |
3216
- | disabled | No | <code >let</code > | No | <code >boolean</code > | <code >false</code > | Set to ` true ` to disable the option |
3211
+ | Prop name | Required | Kind | Reactive | Type | Default value | Description |
3212
+ | :-------- | :------- | :--------------- | :------- | --------------------------------- | ---------------------- | ----------------------------------------- |
3213
+ | value | No | <code >let</code > | No | <code >string | ; number</code > | <code >""</code > | Specify the option value |
3214
+ | text | No | <code >let</code > | No | <code >string</code > | <code >""</code > | Specify the option text |
3215
+ | hidden | No | <code >let</code > | No | <code >boolean</code > | <code >false</code > | Set to ` true ` to hide the option |
3216
+ | disabled | No | <code >let</code > | No | <code >boolean</code > | <code >false</code > | Set to ` true ` to disable the option |
3217
+ | class | No | <code >let</code > | No | <code >string</code > | <code >undefined</code > | Specify the class of the ` option ` element |
3218
+ | style | No | <code >let</code > | No | <code >string</code > | <code >undefined</code > | Specify the style of the ` option ` element |
3217
3219
3218
3220
### Slots
3219
3221
Original file line number Diff line number Diff line change 10452
10452
"isRequired" : false ,
10453
10453
"constant" : false ,
10454
10454
"reactive" : false
10455
+ },
10456
+ {
10457
+ "name" : " class" ,
10458
+ "kind" : " let" ,
10459
+ "description" : " Specify the class of the `option` element" ,
10460
+ "type" : " string" ,
10461
+ "isFunction" : false ,
10462
+ "isFunctionDeclaration" : false ,
10463
+ "isRequired" : false ,
10464
+ "constant" : false ,
10465
+ "reactive" : false
10466
+ },
10467
+ {
10468
+ "name" : " style" ,
10469
+ "kind" : " let" ,
10470
+ "description" : " Specify the style of the `option` element" ,
10471
+ "type" : " string" ,
10472
+ "isFunction" : false ,
10473
+ "isFunctionDeclaration" : false ,
10474
+ "isRequired" : false ,
10475
+ "constant" : false ,
10476
+ "reactive" : false
10455
10477
}
10456
10478
],
10457
10479
"moduleExports" : [],
Original file line number Diff line number Diff line change 14
14
/** Set to `true` to disable the option */
15
15
export let disabled = false ;
16
16
17
+ let className = undefined ;
18
+
19
+ /**
20
+ * Specify the class of the `option` element
21
+ * @type {string}
22
+ */
23
+ export { className as class };
24
+
25
+ /**
26
+ * Specify the style of the `option` element
27
+ * @type {string}
28
+ */
29
+ export let style = undefined ;
30
+
17
31
import { getContext , onMount } from " svelte" ;
18
32
19
33
const id = " ccs-" + Math .random ().toString (36 );
38
52
hidden= " {hidden}"
39
53
selected= " {selected}"
40
54
class : bx-- select- option= " {true}"
41
- class = " {$$restProps.class }"
42
- style= " {$$restProps. style}"
55
+ class = " {className }"
56
+ style= " {style}"
43
57
>
44
58
{text || value}
45
59
< / option>
Original file line number Diff line number Diff line change 8
8
</script >
9
9
10
10
<Select labelText =" Carbon theme" selected =" g10" >
11
- <SelectItem value =" white" text =" White" />
11
+ <SelectItem value =" white" text =" White" class = " " style = " " />
12
12
<SelectItem value =" g10" text =" Gray 10" />
13
13
<SelectItem value =" g90" text =" Gray 90" />
14
14
<SelectItem value =" g100" text =" Gray 100" />
Original file line number Diff line number Diff line change @@ -24,6 +24,18 @@ export interface SelectItemProps {
24
24
* @default false
25
25
*/
26
26
disabled ?: boolean ;
27
+
28
+ /**
29
+ * Specify the class of the `option` element
30
+ * @default undefined
31
+ */
32
+ class ?: string ;
33
+
34
+ /**
35
+ * Specify the style of the `option` element
36
+ * @default undefined
37
+ */
38
+ style ?: string ;
27
39
}
28
40
29
41
export default class SelectItem extends SvelteComponentTyped <
You can’t perform that action at this time.
0 commit comments