2020-07-10 20:13:11 -05:00
|
|
|
<template>
|
2020-12-27 20:56:42 -06:00
|
|
|
<XColumn :func="{ handler: func, title: $ts.editWidgets }" :naked="true" :column="column" :is-stacked="isStacked">
|
2021-04-20 09:22:59 -05:00
|
|
|
<template #header><i class="fas fa-window-maximize" style="margin-right: 8px;"></i>{{ column.name }}</template>
|
2020-07-10 20:13:11 -05:00
|
|
|
|
|
|
|
<div class="wtdtxvec">
|
2021-02-16 07:17:13 -06:00
|
|
|
<XWidgets :edit="edit" :widgets="column.widgets" @add-widget="addWidget" @remove-widget="removeWidget" @update-widget="updateWidget" @update-widgets="updateWidgets" @exit="edit = false"/>
|
2020-07-10 20:13:11 -05:00
|
|
|
</div>
|
2020-10-17 06:12:00 -05:00
|
|
|
</XColumn>
|
2020-07-10 20:13:11 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 06:12:00 -05:00
|
|
|
import { defineComponent, defineAsyncComponent } from 'vue';
|
2021-11-11 11:02:25 -06:00
|
|
|
import XWidgets from '@/components/widgets.vue';
|
2020-07-10 20:13:11 -05:00
|
|
|
import XColumn from './column.vue';
|
2020-12-18 19:55:52 -06:00
|
|
|
import { addColumnWidget, removeColumnWidget, setColumnWidgets, updateColumnWidget } from './deck-store';
|
2020-07-10 20:13:11 -05:00
|
|
|
|
2020-10-17 06:12:00 -05:00
|
|
|
export default defineComponent({
|
2020-07-10 20:13:11 -05:00
|
|
|
components: {
|
|
|
|
XColumn,
|
2021-02-16 07:17:13 -06:00
|
|
|
XWidgets,
|
2020-07-10 20:13:11 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
props: {
|
|
|
|
column: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
isStacked: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
edit: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2021-02-16 07:17:13 -06:00
|
|
|
addWidget(widget) {
|
|
|
|
addColumnWidget(this.column.id, widget);
|
2020-07-10 20:13:11 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
removeWidget(widget) {
|
2020-12-18 19:55:52 -06:00
|
|
|
removeColumnWidget(this.column.id, widget);
|
2020-07-10 20:13:11 -05:00
|
|
|
},
|
2020-12-18 19:55:52 -06:00
|
|
|
|
2021-02-16 07:17:13 -06:00
|
|
|
updateWidget({ id, data }) {
|
2020-12-18 19:55:52 -06:00
|
|
|
updateColumnWidget(this.column.id, id, data);
|
2020-12-27 20:56:42 -06:00
|
|
|
},
|
|
|
|
|
2021-02-16 07:17:13 -06:00
|
|
|
updateWidgets(widgets) {
|
|
|
|
setColumnWidgets(this.column.id, widgets);
|
|
|
|
},
|
|
|
|
|
2020-12-27 20:56:42 -06:00
|
|
|
func() {
|
|
|
|
this.edit = !this.edit;
|
2020-12-18 19:55:52 -06:00
|
|
|
}
|
2020-07-10 20:13:11 -05:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.wtdtxvec {
|
2021-02-16 07:17:13 -06:00
|
|
|
--margin: 8px;
|
2021-07-27 07:37:32 -05:00
|
|
|
--panelBorder: none;
|
2020-07-10 20:13:11 -05:00
|
|
|
|
2021-02-16 07:17:13 -06:00
|
|
|
padding: 0 var(--margin);
|
2020-07-10 20:13:11 -05:00
|
|
|
}
|
|
|
|
</style>
|