mirror of https://github.com/Lissy93/dashy.git
🚚 Refactor form elemts
This commit is contained in:
parent
11d9ea535b
commit
848b661c76
|
@ -1,5 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<button @click="click()" :disabled="disabled" :class="disallow ? 'disallowed': ''">
|
<button
|
||||||
|
@click="click ? click() : () => null"
|
||||||
|
:disabled="disabled"
|
||||||
|
:class="disallow ? 'disallowed': ''"
|
||||||
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<slot name="text"></slot>
|
<slot name="text"></slot>
|
||||||
<slot name="icon"></slot>
|
<slot name="icon"></slot>
|
||||||
|
|
|
@ -273,8 +273,9 @@ export default {
|
||||||
&:focus {
|
&:focus {
|
||||||
outline: 2px solid var(--primary);
|
outline: 2px solid var(--primary);
|
||||||
}
|
}
|
||||||
&.short {
|
&.short:not(.size-large) {
|
||||||
height: 18px;
|
height: 2rem;
|
||||||
|
.tile-title { overflow: visible; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,3 +11,17 @@ export const asciiHash = (input) => {
|
||||||
const shortened = asciiSum.slice(0, 30) + asciiSum.slice(asciiSum.length - 30);
|
const shortened = asciiSum.slice(0, 30) + asciiSum.slice(asciiSum.length - 30);
|
||||||
return window.btoa(shortened);
|
return window.btoa(shortened);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Encode potentially malicious characters from string */
|
||||||
|
export const sanitize = (string) => {
|
||||||
|
const map = {
|
||||||
|
'&': '&',
|
||||||
|
'<': '<',
|
||||||
|
'>': '>',
|
||||||
|
'"': '"',
|
||||||
|
"'": ''',
|
||||||
|
'/': '/',
|
||||||
|
};
|
||||||
|
const reg = /[&<>"'/]/ig;
|
||||||
|
return string.replace(reg, (match) => (map[match]));
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue