feat(ui): add thin horizontal single-value range rail

This commit is contained in:
Codex
2026-11-15 15:26:33 +03:00
parent 4390d1350d
commit d0648014f5
6 changed files with 39 additions and 1 deletions
+12
View File
@@ -117,3 +117,15 @@ test("both boundaries move, clamp independently, separate after coincidence and
assert.deepEqual(move([0, 10], 1, 7.3, 0, 10, .5), [0, 7.5]);
assert.deepEqual(move([0, 9], 1, 10.1, 0, 10.1, 3), [0, 10.1]);
});
test("horizontal thin rail has one native boundary and a formatted value, without field chrome", () => {
for(const disabled of [false,true]){
const markup=renderToStaticMarkup(createElement(RangeControl,{variant:"rail",label:"Скорость",value:5,min:.1,max:100,step:.1,disabled,formatValue:n=>`${n} м/с`,onChange(){}}));
assert.equal((markup.match(/type="range"/g)||[]).length,1);
assert.match(markup,/aria-label="Скорость" aria-orientation="horizontal"/);
assert.match(markup,/aria-valuetext="5 м\/с"/);
assert.match(markup,/nodedc-range-rail__value/);
assert.equal(markup.includes('disabled=""'),disabled);
assert.doesNotMatch(markup,/nodedc-range__label|nodedc-range__editor|nodedc-glass/);
}
});