convert ActionButton to new interface
This commit is contained in:
parent
bc6ce42252
commit
768dfef5a0
|
@ -10,11 +10,7 @@
|
||||||
export let disabled = false
|
export let disabled = false
|
||||||
export let icon = ""
|
export let icon = ""
|
||||||
|
|
||||||
export let xl = false
|
export let size = "M"
|
||||||
export let l = false
|
|
||||||
export let m = false
|
|
||||||
export let s = false
|
|
||||||
$: useDefault = ![xl, l, m, s].includes(true)
|
|
||||||
|
|
||||||
function longPress(element) {
|
function longPress(element) {
|
||||||
if (!longPressable) return
|
if (!longPressable) return
|
||||||
|
@ -42,11 +38,7 @@
|
||||||
class:spectrum-ActionButton--quiet={quiet}
|
class:spectrum-ActionButton--quiet={quiet}
|
||||||
class:spectrum-ActionButton--emphasized={emphasized}
|
class:spectrum-ActionButton--emphasized={emphasized}
|
||||||
class:is-selected={selected}
|
class:is-selected={selected}
|
||||||
class:spectrum-ActionButton--sizeS={s}
|
class="spectrum-ActionButton spectrum-ActionButton--size{size}"
|
||||||
class:spectrum-ActionButton--sizeM={m || useDefault}
|
|
||||||
class:spectrum-ActionButton--sizeL={l}
|
|
||||||
class:spectrum-ActionButton--sizeXL={xl}
|
|
||||||
class="spectrum-ActionButton"
|
|
||||||
{disabled}
|
{disabled}
|
||||||
on:longPress
|
on:longPress
|
||||||
on:click|preventDefault
|
on:click|preventDefault
|
||||||
|
@ -62,11 +54,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
{#if icon}
|
{#if icon}
|
||||||
<svg
|
<svg
|
||||||
class:spectrum-Icon--sizeS={s}
|
class="spectrum-Icon spectrum-Icon--size{size}"
|
||||||
class:spectrum-Icon--sizeM={m || useDefault}
|
|
||||||
class:spectrum-Icon--sizeL={l}
|
|
||||||
class:spectrum-Icon--sizeXL={xl}
|
|
||||||
class="spectrum-Icon"
|
|
||||||
focusable="false"
|
focusable="false"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
aria-label={icon}
|
aria-label={icon}
|
||||||
|
|
|
@ -13,5 +13,5 @@
|
||||||
<Checkbox value={selected} />
|
<Checkbox value={selected} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if allowEditRows}
|
{#if allowEditRows}
|
||||||
<ActionButton s on:click={onEdit}>Edit</ActionButton>
|
<ActionButton size="S" on:click={onEdit}>Edit</ActionButton>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<div bind:this={anchors[idx]}>
|
<div bind:this={anchors[idx]}>
|
||||||
<ActionButton
|
<ActionButton
|
||||||
quiet
|
quiet
|
||||||
s
|
size="S"
|
||||||
icon={tab.icon}
|
icon={tab.icon}
|
||||||
disabled={tab.disabled}
|
disabled={tab.disabled}
|
||||||
on:click={tab.disabled ? null : () => onChangeTab(idx)}>
|
on:click={tab.disabled ? null : () => onChangeTab(idx)}>
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<ActionGroup>
|
<ActionGroup>
|
||||||
{#each enrichedStructure as item, idx}
|
{#each enrichedStructure as item, idx}
|
||||||
<ActionMenu disabled={!item.isCategory}>
|
<ActionMenu disabled={!item.isCategory}>
|
||||||
<ActionButton icon={item.icon} xs primary quiet slot="button" on:click={() => onItemChosen(item, idx)}>
|
<ActionButton icon={item.icon} size="XS" primary quiet slot="button" on:click={() => onItemChosen(item, idx)}>
|
||||||
{item.name}
|
{item.name}
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
{#each item.children || [] as item}
|
{#each item.children || [] as item}
|
||||||
|
|
Loading…
Reference in New Issue