File tree Expand file tree Collapse file tree 18 files changed +55
-15
lines changed Expand file tree Collapse file tree 18 files changed +55
-15
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ const {
15
15
subText,
16
16
disabled,
17
17
color,
18
- className
18
+ className,
19
+ ... rest
19
20
} = Astro .props
20
21
21
22
const classes = [
@@ -34,7 +35,12 @@ const style = color
34
35
<div class ={ styles .wrapper } slot =" wrapper" >
35
36
children
36
37
</div >
37
- <input type =" checkbox" checked ={ checked } disabled ={ disabled } />
38
+ <input
39
+ type =" checkbox"
40
+ checked ={ checked }
41
+ disabled ={ disabled }
42
+ {... rest }
43
+ />
38
44
<span class ={ styles .check } >
39
45
<Fragment set:html ={ check } />
40
46
</span >
Original file line number Diff line number Diff line change 39
39
checked ={checked }
40
40
disabled ={disabled }
41
41
on:click ={onClick }
42
+ {...$$restProps }
42
43
/>
43
44
<span class ={styles .check }>
44
45
{@html check }
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ const Checkbox = ({
16
16
disabled,
17
17
color,
18
18
className,
19
- onClick
19
+ onClick,
20
+ ...rest
20
21
} : ReactCheckboxProps ) => {
21
22
const classes = classNames ( [
22
23
styles . checkbox ,
@@ -43,6 +44,7 @@ const Checkbox = ({
43
44
defaultChecked = { checked }
44
45
disabled = { disabled }
45
46
onClick = { onClick }
47
+ { ...rest }
46
48
/>
47
49
< span
48
50
className = { styles . check }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ export type CheckboxProps = {
7
7
disabled ?: boolean
8
8
color ?: string
9
9
className ?: string
10
+ [ key : string ] : any
10
11
}
11
12
12
13
export type SvelteCheckboxProps = {
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ const {
12
12
items,
13
13
color,
14
14
inline,
15
- className
15
+ className,
16
+ ... rest
16
17
} = Astro .props
17
18
18
19
const classes = [
@@ -42,6 +43,7 @@ const style = color
42
43
value = { item .value }
43
44
checked = { item .selected }
44
45
disabled = { item .disabled }
46
+ { ... rest }
45
47
/>
46
48
<span class = { styles .icon } />
47
49
<span class = { styles .label } >
Original file line number Diff line number Diff line change 27
27
28
28
<div class ={classes } style ={style }>
29
29
{#each items as item }
30
- <label class ={[
30
+ <label class ={classNames ( [
31
31
item .subText && styles .col ,
32
32
item .disabled && styles .disabled
33
- ]. filter ( Boolean ). join ( ' ' )}
33
+ ])}
34
34
>
35
35
<ConditionalWrapper
36
36
condition ={!! (item .subText )}
44
44
checked ={item .selected }
45
45
disabled ={item .disabled }
46
46
on:change ={onChange }
47
+ {...$$restProps }
47
48
/>
48
49
<span class ={styles .icon } />
49
50
<span class ={styles .label }>
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ const Radio = ({
13
13
color,
14
14
inline,
15
15
className,
16
- onChange
16
+ onChange,
17
+ ...rest
17
18
} : ReactRadioProps ) => {
18
19
const classes = classNames ( [
19
20
styles . radio ,
@@ -28,10 +29,10 @@ const Radio = ({
28
29
return (
29
30
< div className = { classes } style = { style } >
30
31
{ items . map ( ( item , index ) => (
31
- < label className = { [
32
+ < label className = { classNames ( [
32
33
item . subText && styles . col ,
33
34
item . disabled && styles . disabled
34
- ] . filter ( Boolean ) . join ( ' ' ) } key = { index } >
35
+ ] ) } key = { index } >
35
36
< ConditionalWrapper
36
37
condition = { ! ! ( item . subText ) }
37
38
wrapper = { children => (
@@ -47,6 +48,7 @@ const Radio = ({
47
48
defaultChecked = { item . selected }
48
49
disabled = { item . disabled }
49
50
onChange = { onChange }
51
+ { ...rest }
50
52
/>
51
53
< span className = { styles . icon } />
52
54
< span
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ export type RadioProps = {
10
10
color ?: string
11
11
inline ?: boolean
12
12
className ?: string
13
+ [ key : string ] : any
13
14
}
14
15
15
16
export type SvelteRadioProps = {
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ const {
27
27
... rest
28
28
} = Astro .props
29
29
30
+ const inputRestProps = Object .fromEntries (
31
+ Object .entries (rest ).filter (([key ]) => key .includes (' data' ))
32
+ )
33
+
30
34
const classes = classNames ([
31
35
styles .select ,
32
36
disabled && styles .disabled ,
@@ -46,6 +50,7 @@ const classes = classNames([
46
50
data-no-update ={ ! updateValue ? ' true' : undefined }
47
51
data-position ={ position }
48
52
labelClassName ={ classes }
53
+ {... inputRestProps }
49
54
>
50
55
<Fragment set:html ={ ArrowDown } />
51
56
</Input >
Original file line number Diff line number Diff line change 42
42
styles .popover
43
43
])
44
44
45
+ const inputRestProps = Object .fromEntries (
46
+ Object .entries ($$restProps ).filter (([key ]) => key .includes (' data' ))
47
+ )
48
+
45
49
const select = (event : ListEventType ) => {
46
50
closePopover (` .w-options-${name } ` )
47
51
106
110
107
111
<Input
108
112
type =" text"
109
- value ={value }
113
+ value ={value || null }
110
114
readonly ={true }
111
115
disabled ={disabled }
112
- placeholder ={placeholder }
116
+ placeholder ={placeholder || null }
113
117
label ={label }
114
118
subText ={subText }
115
119
className ={` w-select-${name } ` }
116
120
labelClassName ={classes }
121
+ {...inputRestProps }
117
122
>
118
123
{@html ArrowDown }
119
124
</Input >
You can’t perform that action at this time.
0 commit comments