Files
portal/app/resources/js/components/ui/DensityToggle.vue
T
Дмитрий cb05657f30 chore(format): prettier --write across 37 .vue/.ts files
Phase 1B audit found 48 files failing `prettier --check`. Auto-apply
via `npx prettier --write resources/js/**/*.{ts,vue,css}` produced
style-only changes:
- consistent quote style
- trailing comma normalization
- spaces around : in v-card style="position: relative" attrs
- explicit ; insertion

No semantic changes. No code-behavior changes. Production-code only;
test files batched separately into `test(frontend):` commit.

Verification:
- npx vitest run → 79/79 files, 614/614 + 3 skipped (no regression).
- npx vue-tsc --noEmit → 0 errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 20:24:33 +03:00

61 lines
1.6 KiB
Vue

<script setup lang="ts">
import { useDensity, type Density } from '../../composables/useDensity';
const { density, setDensity } = useDensity();
const emit = defineEmits<{ change: [Density] }>();
function pick(d: Density): void {
setDensity(d);
emit('change', d);
}
</script>
<template>
<div class="ld-density-toggle" role="group" aria-label="Плотность таблицы">
<button
type="button"
class="ld-density-toggle__btn"
:class="{ 'ld-density-toggle__btn--active': density === 'compact' }"
@click="pick('compact')"
>
Компакт
</button>
<button
type="button"
class="ld-density-toggle__btn"
:class="{ 'ld-density-toggle__btn--active': density === 'comfortable' }"
@click="pick('comfortable')"
>
Комфорт
</button>
</div>
</template>
<style scoped>
.ld-density-toggle {
display: inline-flex;
background: var(--liderra-surface);
border: 1px solid var(--liderra-line);
border-radius: var(--radius-8);
padding: 2px;
}
.ld-density-toggle__btn {
background: transparent;
border: none;
padding: 5px 10px;
border-radius: var(--radius-6);
font-size: 11px;
color: var(--liderra-muted);
cursor: pointer;
font-family: inherit;
transition:
background 200ms cubic-bezier(0.16, 1, 0.3, 1),
color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ld-density-toggle__btn--active {
background: rgba(1, 32, 25, 0.08);
color: var(--liderra-noir);
}
</style>