diff --git a/src/components.d.ts b/src/components.d.ts index 75305de..bf84984 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -52,6 +52,10 @@ export namespace Components { * @default 24 * 60 * 60 * 1000 */ "defaultTTL": number; + /** + * If this flag is set to true, the component will reset the cache and database on every load and disconnect. Already existing data will be deleted. + */ + "doNotCacheOrStoreInDatabase": boolean; /** * Determines whether components should be emphasized towards their surrounding by border and shadow. If set to true, border and shadows will be shown around the component. It not set, the component won't be surrounded by border and shadow. (optional) * @type {boolean} @@ -168,6 +172,10 @@ declare namespace LocalJSX { * @default 24 * 60 * 60 * 1000 */ "defaultTTL"?: number; + /** + * If this flag is set to true, the component will reset the cache and database on every load and disconnect. Already existing data will be deleted. + */ + "doNotCacheOrStoreInDatabase"?: boolean; /** * Determines whether components should be emphasized towards their surrounding by border and shadow. If set to true, border and shadows will be shown around the component. It not set, the component won't be surrounded by border and shadow. (optional) * @type {boolean} diff --git a/src/components/copy-button/copy-button.tsx b/src/components/copy-button/copy-button.tsx index 47eb567..e3d87cc 100644 --- a/src/components/copy-button/copy-button.tsx +++ b/src/components/copy-button/copy-button.tsx @@ -13,6 +13,19 @@ export class CopyButton { @Prop() value!: string; render() { + const normalClasses: string[] = [ + 'hover:bg-blue-200', + 'dark:hover:bg-blue-800', + 'hover:text-slate-900', + 'dark:hover:text-slate-100', + 'bg-white', + 'dark:bg-gray-800', + 'text-black', + 'dark:text-white', + ]; + + const highlightClasses: string[] = ['bg-green-200', 'dark:bg-green-800']; + /** * Copies the given value to the clipboard and changes the text of the button to "✓ Copied!" for 1.5 seconds. * @param event The event that triggered this function. @@ -46,15 +59,13 @@ export class CopyButton { function showSuccess() { const el = event.target as HTMLButtonElement; el.innerText = '✓ Copied!'; - el.classList.remove('hover:bg-blue-200'); - el.classList.remove('bg-white'); - el.classList.add('bg-green-200'); + el.classList.remove(...normalClasses); + el.classList.add(...highlightClasses); // Reset the button after 1.5 seconds. setTimeout(() => { - el.classList.remove('bg-green-200'); - el.classList.add('hover:bg-blue-200'); - el.classList.add('bg-white'); + el.classList.remove(...highlightClasses); + el.classList.add(...normalClasses); el.innerText = 'Copy'; }, 1500); } @@ -63,9 +74,7 @@ export class CopyButton { return (