2020-07-11 04:13:11 +03:00
|
|
|
<template>
|
2022-03-20 20:11:14 +02:00
|
|
|
<XColumn :func="{ handler: setList, title: $ts.selectList }" :column="column" :is-stacked="isStacked" @parent-focus="$event => emit('parent-focus', $event)">
|
2020-07-11 04:13:11 +03:00
|
|
|
<template #header>
|
2021-04-20 17:22:59 +03:00
|
|
|
<i class="fas fa-list-ul"></i><span style="margin-left: 8px;">{{ column.name }}</span>
|
2020-07-11 04:13:11 +03:00
|
|
|
</template>
|
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
<XTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId" @after="() => emit('loaded')"/>
|
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';
|
2020-07-11 04:13:11 +03:00
|
|
|
import XColumn from './column.vue';
|
2021-11-11 19:02:25 +02:00
|
|
|
import XTimeline from '@/components/timeline.vue';
|
|
|
|
import * as os from '@/os';
|
2022-03-20 20:11:14 +02:00
|
|
|
import { updateColumn, Column } from './deck-store';
|
|
|
|
import { i18n } from '@/i18n';
|
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: 'loaded'): void;
|
|
|
|
(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 timeline = $ref<InstanceType<typeof XTimeline>>();
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
if (props.column.listId == null) {
|
|
|
|
setList();
|
|
|
|
}
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
async function setList() {
|
|
|
|
const lists = await os.api('users/lists/list');
|
|
|
|
const { canceled, result: list } = await os.select({
|
|
|
|
title: i18n.ts.selectList,
|
|
|
|
items: lists.map(x => ({
|
|
|
|
value: x, text: x.name
|
|
|
|
})),
|
|
|
|
default: props.column.listId
|
|
|
|
});
|
|
|
|
if (canceled) return;
|
|
|
|
updateColumn(props.column.id, {
|
|
|
|
listId: list.id
|
|
|
|
});
|
|
|
|
}
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
/*
|
|
|
|
function focus() {
|
|
|
|
timeline.focus();
|
|
|
|
}
|
2020-07-11 04:13:11 +03:00
|
|
|
|
2022-03-20 20:11:14 +02:00
|
|
|
export default defineComponent({
|
|
|
|
watch: {
|
|
|
|
mediaOnly() {
|
|
|
|
(this.$refs.timeline as any).reload();
|
2020-07-11 04:13:11 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2022-03-20 20:11:14 +02:00
|
|
|
*/
|
2020-07-11 04:13:11 +03:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
</style>
|