-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a separate theme config system
- Loading branch information
1 parent
86171bc
commit d3d5449
Showing
24 changed files
with
200 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {writable} from "svelte/store"; | ||
import { writable } from 'svelte/store'; | ||
|
||
export const sideMenuOpen = writable(true); | ||
export const sideMenuOpen = writable(false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import type { ComponentType } from 'svelte'; | ||
|
||
export type ThemeConfig = { | ||
dashboard: ComponentType; | ||
dataTable: ComponentType; | ||
adminLayout: ComponentType; | ||
crud: { | ||
view: ComponentType; | ||
new: ComponentType; | ||
list: ComponentType; | ||
edit: ComponentType; | ||
delete: ComponentType; | ||
form: ComponentType; | ||
viewField: ComponentType; | ||
formField: ComponentType; | ||
tabsForms: ComponentType; | ||
}; | ||
viewFields: { | ||
checkboxViewField: ComponentType; | ||
defaultViewField: ComponentType; | ||
tabsView: ComponentType; | ||
urlViewField: ComponentType; | ||
viewLabel: ComponentType; | ||
}; | ||
formFields: { | ||
checkbox: ComponentType; | ||
default: ComponentType; | ||
number: ComponentType; | ||
tabsField: ComponentType; | ||
textarea: ComponentType; | ||
text: ComponentType; | ||
toggle: ComponentType; | ||
url: ComponentType; | ||
}; | ||
menu: { | ||
sideMenu: ComponentType; | ||
topLeftMenu: ComponentType; | ||
topMenu: ComponentType; | ||
topRightMenu: ComponentType; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
<script lang="ts"> | ||
import type {ActionIcon} from "$lib/actions.ts"; | ||
import {SvelteComponent} from "svelte"; | ||
import type { ActionIcon } from '$lib/actions'; | ||
import { SvelteComponent } from 'svelte'; | ||
export let icon: ActionIcon; | ||
export let icon: ActionIcon; | ||
if (!(icon instanceof SvelteComponent) && typeof icon !== 'function' && typeof icon !== 'string') { | ||
console.error(`Wrong icon type: ${typeof icon}`); | ||
} | ||
if ( | ||
!(icon instanceof SvelteComponent) && | ||
typeof icon !== 'function' && | ||
typeof icon !== 'string' && | ||
typeof icon.$$render === 'undefined' | ||
) { | ||
console.error(`Wrong icon type: ${typeof icon}`, icon); | ||
} | ||
</script> | ||
|
||
{#if icon instanceof SvelteComponent || typeof icon === 'function'} | ||
<svelte:component this={icon} /> | ||
{#if icon instanceof SvelteComponent || typeof icon === 'function' || typeof icon.$$render !== 'undefined'} | ||
<svelte:component this={icon} /> | ||
{:else if typeof icon === 'string'} | ||
{icon} | ||
{icon} | ||
{:else} | ||
{icon.toString()} | ||
{icon.toString()} | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.