mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
feat(kit): render the remaining ranges with UiSlider
UiSlider merges a caller's own input, change and blur handlers with its own, leaves the input alone on a null model, and gains unstyled for a range drawn as the browser's own. The rail card setting, observation timeline, imagery opacity, Street Level date and Bhote Koshi split and progress ranges now render through it. The timeline and the setting ranges put the handle back once their owner has answered, since a drag that ends where the slider last rendered leaves its model unchanged. The radio tuner keeps its own input: its owner moves the handle back to the selected station without changing the slot.
This commit is contained in:
1 parent
b9ecb9b9f5
commit
2e43bd9985
12 files changed
+200
-54
No files matched your search
@@ -123,6 +123,46 @@ test('footer buttons retain focus and current callbacks; links use safe new tabs
|
||||
button.click();
|
||||
assert.deepEqual(calls, [2]);
|
||||
});
|
||||
test('a live setting range whose owner clamps shows the clamped value', async () => {
|
||||
const f = railFixture();
|
||||
const model = (value) => ({
|
||||
...card,
|
||||
blocks: [
|
||||
{
|
||||
id: 'settings',
|
||||
type: 'settings',
|
||||
settings: [
|
||||
{
|
||||
id: 'image',
|
||||
label: 'IMAGE',
|
||||
range: {
|
||||
id: 'gain',
|
||||
param: 'gain',
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 1,
|
||||
value,
|
||||
ariaLabel: 'Gain',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
// The owner takes at most 80 and answers at once.
|
||||
const view = createRailCards({
|
||||
...f,
|
||||
onParams: (_id, params) => view.update([model(Math.min(80, params.gain))]),
|
||||
});
|
||||
view.update([model(80)]);
|
||||
await nextTick();
|
||||
const slider = f.find((node) => node.dataset.rangeId === 'gain');
|
||||
slider.value = '95';
|
||||
slider.dispatchEvent(new Event('input'));
|
||||
await nextTick();
|
||||
assert.equal(slider.value, '80');
|
||||
view.destroy();
|
||||
});
|
||||
test('setting ranges stay below presets and commit expensive filters on release', async () => {
|
||||
const f = railFixture();
|
||||
const calls = [];
|
||||
|
||||
Reference in new issue
Block a user