mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
refactor(form): move reactive assignments
This commit is contained in:
parent
d9c951f332
commit
81cf0680fa
2 changed files with 4 additions and 9 deletions
|
@ -4,10 +4,8 @@
|
|||
export let style = undefined;
|
||||
|
||||
import { cx } from '../../lib';
|
||||
|
||||
$: _class = cx('--form', className);
|
||||
</script>
|
||||
|
||||
<form on:click on:mouseover on:mouseenter on:mouseleave class={_class} {style}>
|
||||
<form on:click on:mouseover on:mouseenter on:mouseleave class={cx('--form', className)} {style}>
|
||||
<slot />
|
||||
</form>
|
||||
|
|
|
@ -8,20 +8,17 @@
|
|||
export let style = undefined;
|
||||
|
||||
import { cx } from '../../lib';
|
||||
|
||||
$: _class = cx('--fieldset', className);
|
||||
$: _legendClass = cx('--label', className);
|
||||
</script>
|
||||
|
||||
<fieldset
|
||||
data-invalid={invalid ? '' : undefined}
|
||||
data-invalid={invalid || undefined}
|
||||
class={cx('--fieldset', className)}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
class={_class}
|
||||
{style}>
|
||||
<legend class={_legendClass}>{legendText}</legend>
|
||||
<legend class={cx('--label', className)}>{legendText}</legend>
|
||||
<slot />
|
||||
{#if message}
|
||||
<div class={cx('--form__requirements')}>{messageText}</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue