Containers support onClick
This commit is contained in:
parent
87e9a6940b
commit
844463b312
|
@ -219,6 +219,11 @@
|
|||
"showInBar": true,
|
||||
"barIcon": "ModernGridView",
|
||||
"barTitle": "Wrap"
|
||||
},
|
||||
{
|
||||
"type": "event",
|
||||
"label": "On Click",
|
||||
"key": "onClick"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -10,22 +10,30 @@
|
|||
export let size
|
||||
export let gap
|
||||
export let wrap
|
||||
export let onClick
|
||||
|
||||
$: directionClass = direction ? `valid-container direction-${direction}` : ""
|
||||
$: hAlignClass = hAlign ? `hAlign-${hAlign}` : ""
|
||||
$: vAlignClass = vAlign ? `vAlign-${vAlign}` : ""
|
||||
$: sizeClass = size ? `size-${size}` : ""
|
||||
$: gapClass = gap ? `gap-${gap}` : ""
|
||||
$: clickableClass = onClick ? "clickable" : ""
|
||||
$: classNames = [
|
||||
directionClass,
|
||||
hAlignClass,
|
||||
vAlignClass,
|
||||
sizeClass,
|
||||
gapClass,
|
||||
clickableClass,
|
||||
].join(" ")
|
||||
</script>
|
||||
|
||||
<div class={classNames} use:styleable={$component.styles} class:wrap>
|
||||
<div
|
||||
class={classNames}
|
||||
use:styleable={$component.styles}
|
||||
class:wrap
|
||||
on:click={onClick}
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
|
@ -104,4 +112,7 @@
|
|||
.wrap {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue