1
0
Fork 0
mirror of synced 2024-10-03 19:43:32 +13:00

styling updates

This commit is contained in:
Martin McKeaveney 2020-01-30 21:00:19 +00:00
parent 7baa9d443d
commit 5325e0d0a9
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>
<h5>Event Type</h5> <header>
<Select bind:value={eventType}> <h5>Event Type</h5>
{@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 newHandler} {#if parameters.length > 0}
<PlusButton on:click={onCreate} /> {#if newHandler}
{:else} <PlusButton on:click={onCreate} />
<IconButton icon="x" on:click={onRemoved} /> {:else}
<IconButton icon="x" on:click={onRemoved} />
{/if}
{/if} {/if}
</div> </div>
</div> </div>