styling updates

This commit is contained in:
Martin McKeaveney 2020-01-30 21:00:19 +00:00
parent a724247f08
commit 96c61a5a7d
4 changed files with 25 additions and 19 deletions

View File

@ -20,7 +20,7 @@
} }
.action-button:disabled { .action-button:disabled {
color: #163057; color: rgba(22, 48, 87, 0.2);
cursor: default; cursor: default;
background: transparent; background: transparent;
} }

View File

@ -37,6 +37,7 @@ $: {
.uk-modal-dialog { .uk-modal-dialog {
border-radius: .3rem; border-radius: .3rem;
width: 60%; width: 60%;
height: 80vh;
} }
</style> </style>

View File

@ -6,6 +6,7 @@
import PlusButton from "../../common/PlusButton.svelte"; import PlusButton from "../../common/PlusButton.svelte";
import Select from "../../common/Select.svelte"; import Select from "../../common/Select.svelte";
import Input from "../../common/Input.svelte"; import Input from "../../common/Input.svelte";
import getIcon from "../../common/icon";
import { EVENT_TYPE_MEMBER_NAME } from "../../common/eventHandlers"; import { EVENT_TYPE_MEMBER_NAME } from "../../common/eventHandlers";
@ -70,8 +71,9 @@
h5 { h5 {
color: rgba(22, 48, 87, 0.6); color: rgba(22, 48, 87, 0.6);
font-size: 16px; font-size: 15px;
margin-bottom: 5px; margin-bottom: 5px;
margin-top: 20px;
} }
.event-options { .event-options {
@ -80,12 +82,13 @@
grid-gap: 10px; grid-gap: 10px;
} }
.actions { .actions, header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center;
} }
p { a {
color: rgba(22, 48, 87, 0.6); color: rgba(22, 48, 87, 0.6);
font-size: 12px; font-size: 12px;
margin-top: 0; margin-top: 0;
@ -93,13 +96,16 @@
</style> </style>
<Modal bind:isOpen={open} onClosed={onClose}> <Modal bind:isOpen={open} onClosed={onClose}>
<h2>{eventData.name || 'Create a New Component Event'}</h2> <h2>{eventData.name ? `${eventData.name} Event` : 'Create a New Component Event'}</h2>
<p>Click here to learn more about component events</p> <a href="https://docs.budibase.com/" target="_blank" >Click here to learn more about component events</a>
<div class="event-options"> <div class="event-options">
<div> <div>
<header>
<h5>Event Type</h5> <h5>Event Type</h5>
<Select bind:value={eventType}> {@html getIcon('info')}
</header>
<Select :value={eventType}>
{#each eventOptions as option} {#each eventOptions as option}
<option value={option.name}>{option.name}</option> <option value={option.name}>{option.name}</option>
{/each} {/each}

View File

@ -31,7 +31,6 @@
}) })
); );
// TODO: refactor
$: { $: {
if (handler) { if (handler) {
handlerType = handler[EVENT_TYPE_MEMBER_NAME]; handlerType = handler[EVENT_TYPE_MEMBER_NAME];
@ -40,6 +39,7 @@
value value
})); }));
} else { } else {
// Empty Handler
handlerType = ""; handlerType = "";
parameters = []; parameters = [];
} }
@ -63,11 +63,11 @@
const handlerType = eventOptions.find( const handlerType = eventOptions.find(
handler => handler.name === e.target.value handler => handler.name === e.target.value
); );
// Set default params for handler
const defaultParams = handlerType.parameters.map(param => ({ const defaultParams = handlerType.parameters.map(param => ({
name: param, name: param,
value: "" value: ""
})); }));
handlerChanged(handlerType.name, defaultParams); handlerChanged(handlerType.name, defaultParams);
}; };
@ -93,10 +93,6 @@
flex-direction: column; flex-direction: column;
} }
.handler-option > div {
margin-bottom: 5px;
}
.new-handler { .new-handler {
background: #fff; background: #fff;
} }
@ -113,6 +109,7 @@
} }
span { span {
font-size: 12px;
margin-bottom: 5px; margin-bottom: 5px;
} }
</style> </style>
@ -131,7 +128,7 @@
{#if parameters} {#if parameters}
{#each parameters as param, idx} {#each parameters as param, idx}
<div class="handler-option"> <div class="handler-option">
<div>{param.name}</div> <span>{param.name}</span>
<StateBindingControl <StateBindingControl
onChanged={onParameterChanged(idx)} onChanged={onParameterChanged(idx)}
value={param.value} /> value={param.value} />
@ -140,10 +137,12 @@
{/if} {/if}
</div> </div>
<div class="event-action-button"> <div class="event-action-button">
{#if parameters.length > 0}
{#if newHandler} {#if newHandler}
<PlusButton on:click={onCreate} /> <PlusButton on:click={onCreate} />
{:else} {:else}
<IconButton icon="x" on:click={onRemoved} /> <IconButton icon="x" on:click={onRemoved} />
{/if} {/if}
{/if}
</div> </div>
</div> </div>