Update after directives move to components change
parent
3e7739b1e7
commit
a255bd1778
|
@ -59,7 +59,7 @@
|
||||||
</Accordion>
|
</Accordion>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel value="2">
|
<TabPanel value="2">
|
||||||
<form @keydown="onKeyDown">
|
<form v-if="isComponentRoute" @keydown="onKeyDown">
|
||||||
<DesignComponent />
|
<DesignComponent />
|
||||||
</form>
|
</form>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
|
@ -101,10 +101,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isComponentRoute() {
|
isComponentRoute() {
|
||||||
const components = this.$appState.designer.theme.preset.components;
|
return this.$appState.designer.theme.preset?.components[this.$route.name] != null;
|
||||||
const directives = this.$appState.designer.theme.preset.directives;
|
|
||||||
|
|
||||||
return components[this.$route.name] != null || directives[this.$route.name];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -117,7 +117,7 @@ export default {
|
||||||
return colorScheme;
|
return colorScheme;
|
||||||
},
|
},
|
||||||
transfer(event) {
|
transfer(event) {
|
||||||
let tokens = this.$appState.designer.theme.preset.components[this.componentKey] || this.$appState.designer.theme.preset.directives[this.componentKey];
|
let tokens = this.$appState.designer.theme.preset.components[this.componentKey];
|
||||||
const colorSchemePrefix = 'colorScheme.';
|
const colorSchemePrefix = 'colorScheme.';
|
||||||
|
|
||||||
if (this.path.startsWith(colorSchemePrefix)) {
|
if (this.path.startsWith(colorSchemePrefix)) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<section v-if="isComponentRoute">
|
<section>
|
||||||
<div class="text-lg font-semibold capitalize mb-2">{{ componentKey }}</div>
|
<div class="text-lg font-semibold capitalize mb-2">{{ componentKey }}</div>
|
||||||
<Fieldset legend="Common" :toggleable="true" class="mb-3">
|
<Fieldset legend="Common" :toggleable="true" class="mb-3">
|
||||||
<div class="flex flex-col gap-3">
|
<div class="flex flex-col gap-3">
|
||||||
|
@ -38,14 +38,8 @@ export default {
|
||||||
componentKey() {
|
componentKey() {
|
||||||
return this.$route.name;
|
return this.$route.name;
|
||||||
},
|
},
|
||||||
isComponentRoute() {
|
|
||||||
const components = this.$appState.designer.theme.preset.components;
|
|
||||||
const directives = this.$appState.designer.theme.preset.directives;
|
|
||||||
|
|
||||||
return components[this.componentKey] != null || directives[this.componentKey] != null;
|
|
||||||
},
|
|
||||||
tokens() {
|
tokens() {
|
||||||
return this.$appState.designer.theme.preset.components[this.componentKey] || this.$appState.designer.theme.preset.directives[this.componentKey];
|
return this.$appState.designer.theme.preset.components[this.componentKey];
|
||||||
},
|
},
|
||||||
lightTokens() {
|
lightTokens() {
|
||||||
return this.tokens.colorScheme?.light;
|
return this.tokens.colorScheme?.light;
|
||||||
|
|
|
@ -66,7 +66,7 @@ export default {
|
||||||
.join(' ');
|
.join(' ');
|
||||||
},
|
},
|
||||||
tokens() {
|
tokens() {
|
||||||
const source = this.$appState.designer.theme.preset.components[this.componentKey] || this.$appState.designer.theme.preset.directives[this.componentKey];
|
const source = this.$appState.designer.theme.preset.components[this.componentKey];
|
||||||
|
|
||||||
return this.getObjectProperty(source, this.path);
|
return this.getObjectProperty(source, this.path);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue