formatting

This commit is contained in:
Joe 2020-06-02 20:56:16 +01:00
parent 63882727de
commit a416ecc789
8 changed files with 43 additions and 33 deletions

View File

@ -30,8 +30,8 @@
.alert { .alert {
color: white; color: white;
background: #E26D69; background: #e26d69;
border: solid 1px #E26D69; border: solid 1px #e26d69;
} }
.cancel { .cancel {

View File

@ -18,11 +18,19 @@
onChange(_value) onChange(_value)
} }
$: displayValue = suffix && value && value.endsWith(suffix) ? value.replace(new RegExp(`${suffix}$`), "") : (value || "") $: displayValue =
suffix && value && value.endsWith(suffix)
? value.replace(new RegExp(`${suffix}$`), "")
: value || ""
</script> </script>
<input class:centerPlaceholder type="text" value={displayValue} {placeholder} {style} on:change={e => handleChange(e.target.value)} /> <input
class:centerPlaceholder
type="text"
value={displayValue}
{placeholder}
{style}
on:change={e => handleChange(e.target.value)} />
<style> <style>
input { input {

View File

@ -13,7 +13,9 @@
value.splice(idx, 1, val !== "auto" ? val + suffix : val) value.splice(idx, 1, val !== "auto" ? val + suffix : val)
value = value value = value
let _value = value.map(v => (!v.endsWith(suffix) && v !== "auto" ? v + suffix : v)) let _value = value.map(v =>
!v.endsWith(suffix) && v !== "auto" ? v + suffix : v
)
onChange(_value) onChange(_value)
} }
@ -44,5 +46,4 @@
.inputs-group { .inputs-group {
flex: 1; flex: 1;
} }
</style> </style>

View File

@ -160,6 +160,4 @@
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
} }
</style> </style>

View File

@ -12,15 +12,20 @@
$: useIcon = !!icon $: useIcon = !!icon
</script> </script>
<div class="flatbutton" {style} class:selected on:click={() => onClick(value || text)}> <div
class="flatbutton"
{style}
class:selected
on:click={() => onClick(value || text)}>
{#if useIcon} {#if useIcon}
<i class={icon} /> <i class={icon} />
{:else} {:else}
<span>{@html text}</span> <span>
{@html text}
</span>
{/if} {/if}
</div> </div>
<style> <style>
.flatbutton { .flatbutton {
cursor: pointer; cursor: pointer;

View File

@ -28,10 +28,8 @@
onChange(val) onChange(val)
} }
const checkSelected = val => const checkSelected = val =>
isMultiSelect ? value.includes(val) : value === val isMultiSelect ? value.includes(val) : value === val
</script> </script>
<div class="flatbutton-group"> <div class="flatbutton-group">

View File

@ -214,10 +214,10 @@
height: auto; height: auto;
padding: 5px 0px; padding: 5px 0px;
cursor: pointer; cursor: pointer;
padding-left: 10px padding-left: 10px;
} }
li:hover { li:hover {
background-color:#e6e6e6 background-color: #e6e6e6;
} }
</style> </style>