Refactor Button. Add icons. Fix EditDoc. (#2326)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov
2022-10-26 12:16:32 +07:00
committed by GitHub
parent cfe5972a11
commit 70e00dbb5f
12 changed files with 115 additions and 103 deletions
@@ -252,7 +252,7 @@
{icon}
{title}
{object}
isHeader={true}
isHeader={false}
isAside={true}
bind:panelWidth
bind:innerWidth
@@ -265,24 +265,6 @@
<UpDownNavigator element={object} />
</svelte:fragment>
<svelte:fragment slot="header">
<span class="fs-title flex-grow">
{#if mainEditor}
<Component
is={mainEditor}
props={{ object }}
on:open={(ev) => {
ignoreKeys = ev.detail.ignoreKeys
ignoreMixins = new Set(ev.detail.ignoreMixins)
allowedCollections = ev.detail.allowedCollections ?? []
collectionArrays = ev.detail.collectionArrays ?? []
getMixins(parentClass, object, showAllMixins)
updateKeys(showAllMixins)
}}
/>
{/if}
</span>
</svelte:fragment>
<svelte:fragment slot="tools">
<div class="p-1">
<Button icon={IconMoreH} kind={'transparent'} size={'medium'} on:click={showMenu} />
@@ -335,6 +317,20 @@
{/if}
</svelte:fragment>
{#if mainEditor}
<Component
is={mainEditor}
props={{ object }}
on:open={(ev) => {
ignoreKeys = ev.detail.ignoreKeys
ignoreMixins = new Set(ev.detail.ignoreMixins)
allowedCollections = ev.detail.allowedCollections ?? []
collectionArrays = ev.detail.collectionArrays ?? []
getMixins(parentClass, object, showAllMixins)
updateKeys(showAllMixins)
}}
/>
{/if}
{#each fieldEditors as collection}
{#if collection.editor}
<div class="mt-6 clear-mins">
@@ -156,7 +156,7 @@
{:else}
{#each values as value, i}
<button
class="menu-item"
class="menu-item no-focus"
on:click={() => {
toggle(value)
}}
@@ -167,7 +167,7 @@
<CheckBox checked={isSelected(value, filter.value)} primary />
</div>
{#if value}
<svelte:component this={attribute.presenter} {value} {...attribute.props} />
<svelte:component this={attribute.presenter} {value} {...attribute.props} isInteractive={false} />
{:else}
<Label label={ui.string.NotSelected} />
{/if}