mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 02:02:21 +00:00
Every hand-written <button> in the locale picker, phone tab bar, globe actions (Clear, Share, Reset) and compass, imagery divider handle, scene sharing dialog, layer group index, title logo, Exit clean view, the HUD's cockpit entry, News card face, rail card header, layer row toggle, credits line's Data attribution and the camera calibration chips is a ghost UiButton keeping its id, classes, data-*, aria-* and listeners. Their Material Symbols spans (tab icons, globe actions, compass needle, cockpit entry, celestial ring sun and moon) are UiIcons with :size="null". The Omnibar guide's extra rings, one per further target of a step, are now drawn by OmnibarGuide.vue from view.subRings instead of being built in script; startGuide() still reads them from the rendered tree and sets their boxes each frame. A UiButton's slot renders inside the button, so under an owner that patches synchronously (News cards, rail cards, the credits line, the Omnibar guide's Skip, Offer and Next) a change the button's attributes do not carry would land a tick late. Those slots are given under a named condition that is always true (v-if="redrawWithView"), which Vue redraws with the view. src/ui/kit/smallSurfacesControls.test.mjs pins it; docs/VUE-MIGRATION.md describes the surface and the conditional slot. Co-authored-by: Manjunath Paparaju <[email protected]>
107 lines
3.9 KiB
Vue
107 lines
3.9 KiB
Vue
<script setup>
|
|
import RailChips from '../rail/RailChips.vue';
|
|
import RailRowList from '../rail/RailRowList.vue';
|
|
import RowRange from './RowRange.vue';
|
|
import RowSlider from './RowSlider.vue';
|
|
import RowSwitch from './RowSwitch.vue';
|
|
import RowText from './RowText.vue';
|
|
import UiButton from '../kit/UiButton.vue';
|
|
import { vClassToggle } from '../rail/classToggle.js';
|
|
|
|
// The data layer rows under their group headings. LayerPanel presents every
|
|
// value; clicks reach it with the layer id, and it re-reads the live
|
|
// descriptor before acting.
|
|
defineProps({
|
|
items: { type: Array, required: true },
|
|
onToggle: { type: Function, default: () => {} },
|
|
onChip: { type: Function, default: () => {} },
|
|
onListItem: { type: Function, default: () => {} },
|
|
onSlider: { type: Function, default: () => {} },
|
|
onRange: { type: Function, default: () => {} },
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<template v-for="item in items" :key="item.key"
|
|
><h3
|
|
v-if="item.heading"
|
|
class="data-layer-group-heading"
|
|
:data-group="item.key"
|
|
>{{ item.heading }}</h3
|
|
><div
|
|
v-else
|
|
class="data-toggle-row"
|
|
v-class-toggle="{
|
|
'data-toggle-row--count-line': item.count?.countLine,
|
|
}"
|
|
:data-layer-id="item.id"
|
|
:data-layer-name="item.englishName"
|
|
:data-library-entry="item.libraryEntry || undefined"
|
|
><div class="data-toggle-top"
|
|
><div class="data-toggle-left"
|
|
><span class="data-icon" aria-hidden="true">{{ item.icon }}</span
|
|
><RowText class="data-name" :text="item.name" /></div
|
|
><div class="data-toggle-right"
|
|
><RowText
|
|
v-if="item.count"
|
|
:class="['data-count', { 'data-count-empty': item.count.empty }]"
|
|
:text="item.count.text"
|
|
/><UiButton
|
|
:class="['data-toggle-btn', item.toggle.classes]"
|
|
:data-feed-state="item.toggle.feedState"
|
|
:aria-disabled="String(item.toggle.ariaDisabled)"
|
|
:aria-busy="String(item.toggle.ariaBusy)"
|
|
:title="item.toggle.title"
|
|
:aria-label="item.toggle.ariaLabel"
|
|
@click="onToggle(item.id)"
|
|
>{{ item.toggle.text }}</UiButton
|
|
></div
|
|
></div
|
|
><RowText tag="div" class="data-toggle-meta" :text="item.meta" /><template
|
|
v-if="item.controls"
|
|
><div class="data-toggle-controls" :hidden="item.controls.hidden"
|
|
><RailChips
|
|
:chips="item.controls.chips"
|
|
:on-select="(chip) => onChip(item.id, chip.id)"
|
|
/><RowSwitch
|
|
v-if="item.controls.segmented"
|
|
:segmented="item.controls.segmented"
|
|
:on-select="(optionId) => onChip(item.id, optionId)"
|
|
/><RowSlider
|
|
v-if="item.controls.slider"
|
|
:slider="item.controls.slider"
|
|
:on-input="
|
|
(value) => onSlider(item.id, item.controls.slider.id, value)
|
|
"
|
|
/><RowRange
|
|
v-if="item.controls.range"
|
|
:range="item.controls.range"
|
|
:on-select="
|
|
(end, value) =>
|
|
onRange(item.id, item.controls.range.id, end, value)
|
|
"
|
|
/><span
|
|
v-for="(entry, index) in item.controls.legend"
|
|
:key="index"
|
|
class="data-toggle-legend-item"
|
|
:title="entry.blurb || undefined"
|
|
><span
|
|
class="data-toggle-legend-swatch"
|
|
:style="{ background: entry.color }"
|
|
></span
|
|
><span>{{ entry.text }}</span></span
|
|
><div
|
|
v-if="item.controls.info"
|
|
class="data-toggle-controls-info"
|
|
:title="item.controls.info.title"
|
|
:hidden="!item.controls.info.text"
|
|
>{{ item.controls.info.text }}</div
|
|
></div
|
|
><RailRowList
|
|
:list="item.controls.list"
|
|
:on-select="
|
|
(entry) => onListItem(item.id, entry.id)
|
|
" /></template></div
|
|
></template>
|
|
</template>
|