This repository was archived by the owner on Sep 26, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +18
-16
lines changed
svelte-materialify/src/components Expand file tree Collapse file tree 9 files changed +18
-16
lines changed Original file line number Diff line number Diff line change 29
29
visible: true ,
30
30
icon: false ,
31
31
coloredBorder: false ,
32
- border: [ ],
33
- color: [ ' primary ' ],
32
+ border: controls . border . items [ 0 ],
33
+ color: controls . color . items [ 0 ],
34
34
};
35
35
</script >
36
36
37
37
<Playground {variants } {controls } bind:values >
38
38
<Alert
39
- class =" {values .color [ 0 ] }- {textColor (values .variants ) ? ' text' : ' color' }"
39
+ class =" {values .color }- {textColor (values .variants ) ? ' text' : ' color' }"
40
40
dismissible ={values .dismissible }
41
41
bind:visible ={values .visible }
42
- border ={values .border [ 0 ] }
42
+ border ={values .border }
43
43
coloredBorder ={values .coloredBorder }
44
44
{...formatVariant (values .variants )}>
45
45
<span slot =" icon" >
Original file line number Diff line number Diff line change 17
17
let values = {
18
18
variants: [],
19
19
collapsed: false ,
20
- color: [ ],
20
+ color: controls . color . items [ 0 ],
21
21
};
22
22
</script >
23
23
24
24
<Playground {variants } {controls } bind:values >
25
25
<AppBar
26
- class =" {values .color [ 0 ] }-color"
26
+ class =" {values .color }-color"
27
27
collapsed ={values .collapsed }
28
28
{...formatVariant (values .variants )}>
29
29
<span slot =" icon" >
Original file line number Diff line number Diff line change 18
18
size: 48 ,
19
19
tile: false ,
20
20
icon: false ,
21
- color: [ ' primary' ] ,
21
+ color: ' primary' ,
22
22
};
23
23
</script >
24
24
25
25
<Playground {controls } bind:values >
26
- <Avatar tile ={values .tile } size =" {values .size }px" class =" {values .color [ 0 ] }-color" >
26
+ <Avatar tile ={values .tile } size =" {values .size }px" class =" {values .color }-color" >
27
27
{#if values .icon }
28
28
<Icon path ={mdiHome } />
29
29
{:else }MS{/if }
Original file line number Diff line number Diff line change 13
13
14
14
let values = {
15
15
large: false ,
16
- divider: [ ' /' ] ,
16
+ divider: ' /' ,
17
17
};
18
18
19
19
const items = [
Original file line number Diff line number Diff line change 35
35
active: true ,
36
36
avatar: false ,
37
37
icon: items[0 ].value ,
38
- size: [ ' default' ] ,
38
+ size: ' default' ,
39
39
};
40
40
</script >
41
41
42
42
<Playground {controls } {variants } bind:values >
43
43
<Chip
44
- size ={values .size [ 0 ] }
44
+ size ={values .size }
45
45
close ={values .close }
46
46
bind:active ={values .active }
47
47
{...formatVariant (values .variants )}>
Original file line number Diff line number Diff line change 23
23
let values = {
24
24
size: 24 ,
25
25
icon: mdiPlus,
26
- color: [] ,
26
+ color: ' purple ' ,
27
27
};
28
28
</script >
29
29
Original file line number Diff line number Diff line change 19
19
let values = {
20
20
mini: false ,
21
21
right: false ,
22
- color: [ ' teal' ] ,
22
+ color: ' teal' ,
23
23
};
24
24
</script >
25
25
Original file line number Diff line number Diff line change 14
14
export let path = null ;
15
15
export let label = null ;
16
16
export let style = null ;
17
+ $: {
18
+ width = size;
19
+ height = size;
20
+ }
17
21
</script >
18
22
19
23
<style type =" scss" src =" ./Icon.scss" global >
Original file line number Diff line number Diff line change 33
33
} else if (value .length < max) value = [... value, val];
34
34
} else if (value === val) {
35
35
if (! mandatory) value = null ;
36
- } else if (typeof (val) === ' number' ) {
37
- value = val;
38
- } else value = [val];
36
+ } else value = val;
39
37
},
40
38
register : (setValue ) => {
41
39
const u = valueStore .subscribe ((val ) => {
You can’t perform that action at this time.
0 commit comments