2020-07-11 04:13:11 +03:00
|
|
|
<template>
|
2022-03-20 20:11:14 +02:00
|
|
|
<XColumn :func="{ handler: func, title: $ts.editWidgets }" :naked="true" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)">
|
2021-04-20 17:22:59 +03:00
|
|
|
<template #header><i class="fas fa-window-maximize" style="margin-right: 8px;"></i>{{ column.name }}</template>
|
2020-07-11 04:13:11 +03:00
|
|
|
|
|
|
|
<div class="wtdtxvec">
|
2022-05-17 19:34:30 +03:00
|
|
|
<XWidgets :edit="edit" :widgets="column.widgets" @add-widget="addWidget" @remove-widget="removeWidget" @update-widget="updateWidget" @update-widgets="updateWidgets" @exit="edit = false"/>
|
2020-07-11 04:13:11 +03:00
|
|
|
</div>
|
2020-10-17 14:12:00 +03:00
|
|
|
</XColumn>
|
2020-07-11 04:13:11 +03:00
|
|
|
</template>
|
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2021-11-11 19:02:25 +02:00
|
|
|
import XWidgets from '@/components/widgets.vue';
|
2020-07-11 04:13:11 +03:00
|
|
|
import XColumn from './column.vue';
|
2022-03-20 20:11:14 +02:00
|
|
|
import { addColumnWidget, Column, removeColumnWidget, setColumnWidgets, updateColumnWidget } from './deck-store';
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
const props = defineProps<{
|
|
|
|
column: Column;
|
|
|
|
isStacked: boolean;
|
|
|
|
}>();
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
const emit = defineEmits<{
|
2022-05-19 11:35:43 +03:00
|
|
|
(ev: 'parent-focus', direction: 'up' | 'down' | 'left' | 'right'): void;
|
2022-03-20 20:11:14 +02:00
|
|
|
}>();
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
let edit = $ref(false);
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
function addWidget(widget) {
|
|
|
|
addColumnWidget(props.column.id, widget);
|
|
|
|
}
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
function removeWidget(widget) {
|
|
|
|
removeColumnWidget(props.column.id, widget);
|
|
|
|
}
|
2020-12-19 03:55:52 +02:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
function updateWidget({ id, data }) {
|
|
|
|
updateColumnWidget(props.column.id, id, data);
|
|
|
|
}
|
2020-12-28 04:56:42 +02:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
function updateWidgets(widgets) {
|
|
|
|
setColumnWidgets(props.column.id, widgets);
|
|
|
|
}
|
2021-02-16 15:17:13 +02:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
function func() {
|
|
|
|
edit = !edit;
|
|
|
|
}
|
2020-07-11 04:13:11 +03:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.wtdtxvec {
|
2021-02-16 15:17:13 +02:00
|
|
|
--margin: 8px;
|
2021-07-27 15:37:32 +03:00
|
|
|
--panelBorder: none;
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2021-02-16 15:17:13 +02:00
|
|
|
padding: 0 var(--margin);
|
2020-07-11 04:13:11 +03:00
|
|
|
}
|
|
|
|
</style>
|