mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
refactor(components): convert const to reactive where appropriate
- Inline class assignments to avoid script-level clutter - Ignore a11y-missing-attribute instead of redundant href
This commit is contained in:
parent
4ed754c549
commit
c446fc74f4
94 changed files with 469 additions and 598 deletions
|
@ -2,21 +2,19 @@
|
|||
let className = undefined;
|
||||
export { className as class };
|
||||
export let border = false;
|
||||
export let rowCount = 5;
|
||||
export let rows = 5;
|
||||
export let style = undefined;
|
||||
|
||||
import { cx, fillArray } from '../../lib';
|
||||
|
||||
const _class = cx(
|
||||
'--skeleton',
|
||||
'--structured-list',
|
||||
border && '--structured-list--border',
|
||||
className
|
||||
);
|
||||
const rows = fillArray(rowCount - 1);
|
||||
</script>
|
||||
|
||||
<section on:click on:mouseover on:mouseenter on:mouseleave class={_class} {style}>
|
||||
<section
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
class={cx('--skeleton', '--structured-list', border && '--structured-list--border', className)}
|
||||
{style}>
|
||||
<div class={cx('--structured-list-thead')}>
|
||||
<div class={cx('--structured-list-row', '--structured-list-row--header-row')}>
|
||||
<div class={cx('--structured-list-th')}>
|
||||
|
@ -31,7 +29,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class={cx('--structured-list-tbody')}>
|
||||
{#each rows as row, i (row)}
|
||||
{#each fillArray(rows) as row, i (row)}
|
||||
<div class={cx('--structured-list-row')}>
|
||||
<div class={cx('--structured-list-td')} />
|
||||
<div class={cx('--structured-list-td')} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue