summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/grid/MkNumberCell.vue
blob: 674bba96bc21dabfa42e492abfc35745769cf897 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!--
SPDX-FileCopyrightText: syuilo and other misskey contributors
SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<div
	class="mk_grid_th"
	:class="[$style.cell]"
	:tabindex="-1"
	data-grid-cell
	:data-grid-cell-row="row?.index ?? -1"
	:data-grid-cell-col="-1"
>
	<div :class="[$style.root]">
		{{ content }}
	</div>
</div>
</template>

<script setup lang="ts">

import { GridRow } from '@/components/grid/row.js';

defineProps<{
	content: string,
	row?: GridRow,
}>();

</script>

<style module lang="scss">
$cellHeight: 28px;
$cellWidth: 34px;

.cell {
	overflow: hidden;
	white-space: nowrap;
	height: $cellHeight;
	max-height: $cellHeight;
	min-height: $cellHeight;
	min-width: $cellWidth;
	width: $cellWidth;
	cursor: pointer;
}

.root {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: center;
	box-sizing: border-box;
	padding: 0 8px;
	height: 100%;
	border: solid 0.5px transparent;

	&.selected {
		background-color: var(--MI_THEME-accentedBg);
	}
}
</style>