primevue-mirror/src/AppConfigurator.vue

373 lines
19 KiB
Vue
Raw Normal View History

2019-12-20 13:49:40 +00:00
<template>
<div :class="containerClass">
<div class="layout-config-content-wrapper">
<a href="#" class="layout-config-button" @click="toggleConfigurator">
<i class="pi pi-cog"></i>
</a>
<a href="#" class="layout-config-close" @click="hideConfigurator">
<i class="pi pi-times"></i>
</a>
<div class="layout-config-content">
2020-06-19 09:41:05 +00:00
<div>
2020-06-17 19:29:33 +00:00
<h4>Component Scale</h4>
2020-05-14 08:37:01 +00:00
<div class="config-scale">
2020-06-25 13:04:00 +00:00
<Button icon="pi pi-minus" @click="decrementScale()" class="p-button-text" :disabled="scale === scales[0]"/>
2020-05-14 08:37:01 +00:00
<i class="pi pi-circle-on" v-for="s of scales" :class="{'scale-active': s === scale}" :key="s"/>
2020-06-25 13:04:00 +00:00
<Button icon="pi pi-plus" @click="incrementScale()" class="p-button-text" :disabled="scale === scales[scales.length - 1]" />
2020-05-14 08:37:01 +00:00
</div>
2020-06-20 09:40:01 +00:00
<AppInputStyleSwitch />
2020-06-25 13:04:00 +00:00
<h4>Ripple Effect</h4>
<InputSwitch :value="rippleActive" @input="onRippleChange" />
2020-06-17 19:29:33 +00:00
<h4>Free Themes</h4>
2019-12-22 09:59:34 +00:00
<p>Built-in component themes created by the <a href="https://www.primefaces.org/designer/primevue">PrimeVue Theme Designer</a>.</p>
2020-05-07 19:16:41 +00:00
2020-06-19 09:16:03 +00:00
<h5>Bootstrap</h5>
2020-06-19 09:41:05 +00:00
<div class="p-grid free-themes">
2020-06-25 09:49:23 +00:00
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/bootstrap4-light-blue.svg" alt="Bootstrap Light Blue" @click="changeTheme($event, 'bootstrap4-light-blue')"/>
2020-06-25 09:49:23 +00:00
</button>
2020-06-26 13:37:03 +00:00
<span>Blue</span>
2020-06-25 09:49:23 +00:00
</div>
<div class="p-col-3">
2020-06-19 09:16:03 +00:00
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/bootstrap4-light-purple.svg" alt="Bootstrap Light Blue" @click="changeTheme($event, 'bootstrap4-light-purple')"/>
2020-06-19 09:16:03 +00:00
</button>
2020-06-26 13:37:03 +00:00
<span>Purple</span>
2020-06-19 09:16:03 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/bootstrap4-dark-blue.svg" alt="Bootstrap Dark Blue" @click="changeTheme($event, 'bootstrap4-dark-blue', true)"/>
2020-06-19 09:16:03 +00:00
</button>
2020-06-26 13:37:03 +00:00
<span>Blue</span>
2020-06-25 09:49:23 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/bootstrap4-dark-purple.svg" alt="Bootstrap Dark Blue" @click="changeTheme($event, 'bootstrap4-dark-purple', true)"/>
2020-06-25 09:49:23 +00:00
</button>
2020-06-26 13:37:03 +00:00
<span>Purple</span>
2020-06-19 09:16:03 +00:00
</div>
</div>
2020-06-25 09:49:23 +00:00
<h5>Material Design</h5>
2020-06-19 09:41:05 +00:00
<div class="p-grid free-themes">
2020-06-19 09:16:03 +00:00
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/md-light-indigo.svg" alt="Material Light Indigo" @click="changeTheme($event, 'md-light-indigo')"/>
2020-06-19 09:16:03 +00:00
</button>
2020-06-26 12:24:56 +00:00
<span>Indigo</span>
2020-06-19 09:16:03 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/md-light-deeppurple.svg" alt="Material Light Deep Purple" @click="changeTheme($event, 'md-light-deeppurple')"/>
2020-06-19 09:16:03 +00:00
</button>
2020-06-26 12:24:56 +00:00
<span>Deep Purple</span>
2020-06-25 09:19:23 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/md-dark-indigo.svg" alt="Material Dark Indigo" @click="changeTheme($event, 'md-dark-indigo', true)"/>
2020-06-25 09:19:23 +00:00
</button>
2020-06-26 12:24:56 +00:00
<span>Indigo</span>
2020-06-25 09:19:23 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/md-dark-deeppurple.svg" alt="Material Dark Deep Purple" @click="changeTheme($event, 'md-dark-deeppurple', true)"/>
2020-06-25 09:19:23 +00:00
</button>
2020-06-26 12:24:56 +00:00
<span>Deep Purple</span>
2020-06-25 09:19:23 +00:00
</div>
</div>
2020-06-25 09:49:23 +00:00
<h5>Material Design Compact</h5>
2020-06-25 09:19:23 +00:00
<div class="p-grid free-themes">
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/md-light-indigo.svg" alt="Material Compact Light Indigo" @click="changeTheme($event, 'mdc-light-indigo')"/>
2020-06-25 09:19:23 +00:00
</button>
2020-06-26 12:24:56 +00:00
<span>Indigo</span>
2020-06-25 09:19:23 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/md-light-deeppurple.svg" alt="Material Compact Deep Purple" @click="changeTheme($event, 'mdc-light-deeppurple')"/>
2020-06-25 09:19:23 +00:00
</button>
2020-06-26 12:24:56 +00:00
<span>Deep Purple</span>
2020-06-25 09:19:23 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/md-dark-indigo.svg" alt="Material Compact Dark Indigo" @click="changeTheme($event, 'mdc-dark-indigo', true)"/>
2020-06-25 09:19:23 +00:00
</button>
2020-06-26 12:24:56 +00:00
<span>Indigo</span>
2020-06-25 09:19:23 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/md-dark-deeppurple.svg" alt="Material Compact Dark Deep Purple" @click="changeTheme($event, 'mdc-dark-deeppurple', true)"/>
2020-06-25 09:19:23 +00:00
</button>
2020-06-26 12:24:56 +00:00
<span>Deep Purple</span>
2020-06-19 09:16:03 +00:00
</div>
</div>
<h5>PrimeOne Design</h5>
2020-06-19 09:41:05 +00:00
<div class="p-grid free-themes">
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/saga-blue.png" alt="Saga Blue" @click="changeTheme($event, 'saga-blue')"/>
</button>
2020-05-12 22:46:48 +00:00
<span>Saga Blue</span>
</div>
2020-05-08 10:30:55 +00:00
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/saga-green.png" alt="Saga Green" @click="changeTheme($event, 'saga-green')"/>
</button>
2020-05-12 22:46:48 +00:00
<span>Saga Green</span>
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/saga-orange.png" alt="Saga Orange" @click="changeTheme($event, 'saga-orange')"/>
</button>
2020-05-12 22:46:48 +00:00
<span>Saga Orange</span>
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/saga-purple.png" alt="Saga Purple" @click="changeTheme($event, 'saga-purple')"/>
2020-05-08 10:30:55 +00:00
</button>
2020-05-12 22:46:48 +00:00
<span>Saga Purple</span>
2020-05-08 10:30:55 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/vela-blue.png" alt="Vela Blue" @click="changeTheme($event, 'vela-blue', true)"/>
</button>
2020-05-12 22:46:48 +00:00
<span>Vela Blue</span>
</div>
2020-05-08 10:30:55 +00:00
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/vela-green.png" alt="Vela Green" @click="changeTheme($event, 'vela-green', true)"/>
</button>
2020-05-12 22:46:48 +00:00
<span>Vela Green</span>
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/vela-orange.png" alt="Vela Orange" @click="changeTheme($event, 'vela-orange', true)"/>
</button>
2020-05-12 22:46:48 +00:00
<span>Vela Orange</span>
</div>
2020-05-08 10:30:55 +00:00
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/vela-purple.png" alt="Vela Purple" @click="changeTheme($event, 'vela-purple', true)"/>
2020-05-08 10:30:55 +00:00
</button>
2020-05-12 22:46:48 +00:00
<span>Vela Purple</span>
2020-05-08 10:30:55 +00:00
</div>
2020-06-17 14:09:39 +00:00
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/arya-blue.png" alt="Arya Blue" @click="changeTheme($event, 'arya-blue', true)"/>
2020-06-17 14:09:39 +00:00
</button>
2020-06-18 09:01:31 +00:00
<span>Arya Blue</span>
2020-06-17 14:09:39 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/arya-green.png" alt="Arya Green" @click="changeTheme($event, 'arya-green', true)"/>
2020-06-17 14:09:39 +00:00
</button>
2020-06-18 09:01:31 +00:00
<span>Arya Green</span>
2020-06-17 14:09:39 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/arya-orange.png" alt="Arya Orange" @click="changeTheme($event, 'arya-orange', true)"/>
2020-06-17 14:09:39 +00:00
</button>
2020-06-18 09:01:31 +00:00
<span>Arya Orange</span>
2020-06-17 14:09:39 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-06-26 16:05:42 +00:00
<img src="demo/images/themes/arya-purple.png" alt="Arya Purple" @click="changeTheme($event, 'arya-purple', true)"/>
2020-06-17 14:09:39 +00:00
</button>
2020-06-18 09:01:31 +00:00
<span>Arya Purple</span>
2020-06-17 14:09:39 +00:00
</div>
2020-06-19 09:16:03 +00:00
</div>
<h5>Legacy</h5>
2020-06-19 09:41:05 +00:00
<div class="p-grid free-themes">
2019-12-20 13:49:40 +00:00
<div class="p-col-3">
<button class="p-link">
2020-05-16 08:09:06 +00:00
<img src="./assets/images/layouts/themeswitcher-nova.png" alt="Nova" @click="changeTheme($event, 'nova')"/>
2019-12-20 13:49:40 +00:00
</button>
2020-05-16 08:13:09 +00:00
<span>Nova</span>
2019-12-20 13:49:40 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-05-16 08:09:06 +00:00
<img src="./assets/images/layouts/themeswitcher-nova-alt.png" alt="Nova Alt" @click="changeTheme($event, 'nova-alt')"/>
2019-12-20 13:49:40 +00:00
</button>
2020-05-16 08:13:09 +00:00
<span>Nova Alt</span>
2019-12-20 13:49:40 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-05-16 08:09:06 +00:00
<img src="./assets/images/layouts/themeswitcher-nova-accent.png" alt="Nova Accent" @click="changeTheme($event, 'nova-accent')"/>
2019-12-20 13:49:40 +00:00
</button>
2020-05-16 08:13:09 +00:00
<span>Nova Accent</span>
2019-12-20 13:49:40 +00:00
</div>
2019-12-20 14:22:50 +00:00
<div class="p-col-3">
<button class="p-link">
2020-05-13 12:25:03 +00:00
<img src="./assets/images/layouts/themeswitcher-nova-vue.png" alt="Nova Colored" @click="changeTheme($event, 'nova-vue')"/>
2019-12-20 14:22:50 +00:00
</button>
2020-05-12 22:46:48 +00:00
<span>Nova Vue</span>
2019-12-20 14:22:50 +00:00
</div>
2019-12-20 13:49:40 +00:00
<div class="p-col-3">
<button class="p-link">
2020-05-13 12:25:03 +00:00
<img src="./assets/images/layouts/themeswitcher-luna-blue.png" alt="Luna Blue" @click="changeTheme($event, 'luna-blue', true)"/>
2019-12-20 13:49:40 +00:00
</button>
2020-05-12 22:46:48 +00:00
<span>Luna Blue</span>
2019-12-20 13:49:40 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-05-13 12:25:03 +00:00
<img src="./assets/images/layouts/themeswitcher-luna-green.png" alt="Luna Green" @click="changeTheme($event, 'luna-green', true)"/>
2019-12-20 13:49:40 +00:00
</button>
2020-05-12 22:46:48 +00:00
<span>Luna Green</span>
2019-12-20 13:49:40 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-05-13 12:25:03 +00:00
<img src="./assets/images/layouts/themeswitcher-luna-amber.png" alt="Luna Amber" @click="changeTheme($event, 'luna-amber', true)" target="_blank"/>
2019-12-20 13:49:40 +00:00
</button>
2020-05-12 22:46:48 +00:00
<span>Luna Amber</span>
2019-12-20 13:49:40 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
2020-05-13 12:25:03 +00:00
<img src="./assets/images/layouts/themeswitcher-luna-pink.png" alt="Luna Pink" @click="changeTheme($event, 'luna-pink', true)" target="_blank"/>
2019-12-20 13:49:40 +00:00
</button>
2020-05-12 22:46:48 +00:00
<span>Luna Pink</span>
2019-12-20 13:49:40 +00:00
</div>
<div class="p-col-3">
<button class="p-link">
<img src="./assets/images/layouts/themeswitcher-rhea.png" alt="Rhea" @click="changeTheme($event, 'rhea', false)" target="_blank"/>
</button>
<span>Rhea</span>
</div>
</div>
2020-06-19 09:41:05 +00:00
2020-06-19 09:16:03 +00:00
<h4>Premium Vue-CLI Templates</h4>
2019-12-22 10:02:19 +00:00
<p>Beautifully crafted premium <a href="https://cli.vuejs.org">Vue CLI</a> application templates by the PrimeTek design team.</p>
2020-06-19 09:41:05 +00:00
<div class="p-grid premium-themes">
2020-03-23 12:31:25 +00:00
<div class="p-col-12 p-md-6">
<a href="https://www.primefaces.org/layouts/ultima-vue">
<img alt="Ultima" src="./assets/images/layouts/ultima-vue.jpg">
</a>
</div>
2020-02-28 09:35:04 +00:00
<div class="p-col-12 p-md-6">
2019-12-20 13:49:40 +00:00
<a href="https://www.primefaces.org/layouts/sapphire-vue">
2020-02-28 09:35:04 +00:00
<img alt="Sapphire" src="./assets/images/layouts/sapphire-vue.jpg">
2019-12-20 13:49:40 +00:00
</a>
</div>
2020-02-28 09:35:04 +00:00
<div class="p-col-12 p-md-6">
2020-01-10 11:56:46 +00:00
<a href="https://www.primefaces.org/layouts/serenity-vue">
2020-02-28 09:35:04 +00:00
<img alt="Serenity" src="./assets/images/layouts/serenity-vue.jpg">
2020-01-10 11:56:46 +00:00
</a>
</div>
2020-02-28 09:35:04 +00:00
<div class="p-col-12 p-md-6">
2019-12-20 13:49:40 +00:00
<a href="https://www.primefaces.org/layouts/babylon-vue">
2020-02-28 09:35:04 +00:00
<img alt="Babylon" src="./assets/images/layouts/babylon-vue.jpg">
2019-12-20 13:49:40 +00:00
</a>
</div>
2020-02-28 09:35:04 +00:00
<div class="p-col-12 p-md-6">
2019-12-20 13:49:40 +00:00
<a href="https://www.primefaces.org/layouts/avalon-vue">
2020-02-28 09:35:04 +00:00
<img alt="Avalon" src="./assets/images/layouts/avalon-vue.jpg">
2019-12-20 13:49:40 +00:00
</a>
</div>
2020-02-28 09:35:04 +00:00
<div class="p-col-12 p-md-6">
2019-12-24 08:45:43 +00:00
<a href="https://www.primefaces.org/layouts/apollo-vue">
2020-02-28 09:35:04 +00:00
<img alt="Apollo" src="./assets/images/layouts/apollo-vue.jpg">
2019-12-24 08:45:43 +00:00
</a>
</div>
2020-02-28 09:35:04 +00:00
<div class="p-col-12 p-md-6">
2020-01-07 15:38:02 +00:00
<a href="https://www.primefaces.org/layouts/roma-vue">
2020-02-28 09:35:04 +00:00
<img alt="Roma" src="./assets/images/layouts/roma-vue.jpg">
2020-01-07 15:38:02 +00:00
</a>
</div>
2019-12-20 13:49:40 +00:00
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
2020-06-20 09:40:01 +00:00
theme: String,
inputStyle: String
},
2019-12-20 13:49:40 +00:00
data() {
return {
2020-05-14 08:37:01 +00:00
active: false,
scale: 14,
scales: [12,13,14,15,16]
2019-12-20 13:49:40 +00:00
}
},
outsideClickListener: null,
watch: {
$route() {
if (this.active) {
this.active = false;
this.unbindOutsideClickListener();
}
}
},
computed: {
containerClass() {
return ['layout-config', {'layout-config-active': this.active}];
2020-06-25 13:04:00 +00:00
},
rippleActive() {
return this.$appState.ripple;
2019-12-20 13:49:40 +00:00
}
},
methods: {
toggleConfigurator(event) {
this.active = !this.active;
event.preventDefault();
if (this.active)
this.bindOutsideClickListener();
else
this.unbindOutsideClickListener();
},
hideConfigurator(event) {
this.active = false;
this.unbindOutsideClickListener();
event.preventDefault();
},
changeTheme(event, theme, dark) {
this.$emit('change-theme', {theme: theme, dark: dark});
2019-12-20 13:49:40 +00:00
event.preventDefault();
},
bindOutsideClickListener() {
if (!this.outsideClickListener) {
this.outsideClickListener = (event) => {
if (this.active && this.isOutsideClicked(event)) {
this.active = false;
}
};
document.addEventListener('click', this.outsideClickListener);
}
},
unbindOutsideClickListener() {
if (this.outsideClickListener) {
document.removeEventListener('click', this.outsideClickListener);
this.outsideClickListener = null;
}
},
isOutsideClicked(event) {
return !(this.$el.isSameNode(event.target) || this.$el.contains(event.target));
2020-05-14 08:37:01 +00:00
},
decrementScale() {
this.scale--;
document.documentElement.style.fontSize = this.scale + 'px';
},
incrementScale() {
this.scale++;
document.documentElement.style.fontSize = this.scale + 'px';
2020-06-25 13:04:00 +00:00
},
onRippleChange(value) {
this.$appState.ripple = value;
}
2019-12-20 13:49:40 +00:00
}
}
2019-12-20 14:22:50 +00:00
</script>