Remove some old stuff and update binding icon

This commit is contained in:
Andrew Kingston 2021-04-21 11:42:25 +01:00
parent 06b438d585
commit 532b861bb0
6 changed files with 2 additions and 64 deletions

View File

@ -2,7 +2,6 @@
import "@spectrum-css/popover/dist/index-vars.css"
import Portal from "svelte-portal"
import { createEventDispatcher } from "svelte"
import buildStyle from "../utils/buildStyle"
import positionDropdown from "../Actions/position_dropdown"
import clickOutside from "../Actions/click_outside"
@ -10,7 +9,6 @@
export let anchor
export let align = "right"
export let borderColor = ""
export const show = () => {
dispatch("open")
@ -29,10 +27,6 @@
hide()
}
}
$: menuStyle = buildStyle({
borderColor,
})
</script>
{#if open}
@ -41,7 +35,6 @@
tabindex="0"
use:positionDropdown={{ anchor, align }}
use:clickOutside={hide}
style={menuStyle}
on:keydown={handleEscape}
class="spectrum-Popover is-open"
role="presentation">

View File

@ -1,33 +0,0 @@
<script>
import Input from "../Form/Input.svelte"
export let categories = [
{
name: "Customers List - Data Row",
items: [
{ name: "Name", id: "chjaHICHc82h2" },
{ name: "Created", id: "chjaHICgr56Hc82h2" },
{ name: "Status", id: "chjaHICHc8646462h2" },
],
},
{
name: "Home Screen Components",
items: [{ name: "Title", id: "chjaHICHc82h2" }],
},
]
</script>
<div class="container">
<Input thin placeholder="Search" />
{#each categories as { name, items }}
<div class="title">{name}</div>
<ul>
{#each items as { name, id }}
<li>{name}</li>
{/each}
</ul>
{/each}
</div>
<style>
</style>

View File

@ -1,8 +0,0 @@
<script>
import Search from "./Search.svelte";
import { View } from "svench";
</script>
<View name="Name">
<Search />
</View>

View File

@ -1,14 +0,0 @@
export default function buildStyle(styles) {
const convertCamel = str => {
return str.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)
}
let str = ""
for (let s in styles) {
if (styles[s]) {
let key = convertCamel(s)
str += `${key}: ${styles[s]}; `
}
}
return str
}

View File

@ -36,7 +36,7 @@
on:change={event => onChange(event.detail)}
{placeholder} />
<div class="icon" on:click={bindingDrawer.show}>
<Icon s name="Brackets" />
<Icon s name="FlashOn" />
</div>
</div>
<Drawer bind:this={bindingDrawer} {title}>

View File

@ -87,7 +87,7 @@
class="icon"
data-cy={`${key}-binding-button`}
on:click={bindingDrawer.show}>
<Icon s name="Brackets" />
<Icon s name="FlashOn" />
</div>
<Drawer bind:this={bindingDrawer} title={capitalise(key)}>
<div slot="description">