@operato/property-editor 10.29.8 → 10.29.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/coverage/lcov-report/index.html +5 -5
- package/coverage/lcov.info +92 -89
- package/dist/src/ox-property-editor-number-map.d.ts +13 -4
- package/dist/src/ox-property-editor-number-map.js +192 -22
- package/dist/src/ox-property-editor-number-map.js.map +1 -1
- package/dist/test/number-map.test.js +21 -1
- package/dist/test/number-map.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/test/number-map.test.ts +25 -1
package/test/number-map.test.ts
CHANGED
|
@@ -15,7 +15,7 @@ describe('number-map', () => {
|
|
|
15
15
|
]
|
|
16
16
|
const make = () =>
|
|
17
17
|
fixture<OxPropertyEditorNumberMap>(html`<ox-property-editor-number-map name="designInputs" .property=${{ entries }} .value=${{ pitch: 150 }}></ox-property-editor-number-map>`)
|
|
18
|
-
const field = (el: OxPropertyEditorNumberMap, key: string) => el.renderRoot.querySelector(`input[data-key="${key}"]`) as HTMLInputElement
|
|
18
|
+
const field = (el: OxPropertyEditorNumberMap, key: string) => el.renderRoot.querySelector(`input[type=number][data-key="${key}"]`) as HTMLInputElement
|
|
19
19
|
|
|
20
20
|
it('shows each value, or its default, with its range', async () => {
|
|
21
21
|
const el = await make()
|
|
@@ -59,4 +59,28 @@ describe('number-map', () => {
|
|
|
59
59
|
expect(el.value).to.deep.equal({ pitch: 150 })
|
|
60
60
|
expect(input.value).to.equal('10')
|
|
61
61
|
})
|
|
62
|
+
|
|
63
|
+
it('★ a ranged entry has a slider: every step of a drag is told, and the number follows', async () => {
|
|
64
|
+
const el = await make()
|
|
65
|
+
const slider = el.renderRoot.querySelector('input[type=range][data-key="gap"]') as HTMLInputElement
|
|
66
|
+
let told = 0
|
|
67
|
+
el.addEventListener('change', () => told++)
|
|
68
|
+
slider.value = '30'
|
|
69
|
+
slider.dispatchEvent(new Event('input', { bubbles: true }))
|
|
70
|
+
expect(field(el, 'gap').value).to.equal('30')
|
|
71
|
+
expect(told).to.equal(1)
|
|
72
|
+
expect(el.value).to.deep.equal({ pitch: 150, gap: 30 })
|
|
73
|
+
slider.value = '40'
|
|
74
|
+
slider.dispatchEvent(new Event('input', { bubbles: true }))
|
|
75
|
+
expect(told).to.equal(2)
|
|
76
|
+
expect(el.value).to.deep.equal({ pitch: 150, gap: 40 })
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it('an entry without a range has no slider; its field takes the room', async () => {
|
|
80
|
+
const el = await fixture<OxPropertyEditorNumberMap>(
|
|
81
|
+
html`<ox-property-editor-number-map name="clips" .property=${{ entries: [{ key: 'run', label: 'run', min: 0 }] }}></ox-property-editor-number-map>`
|
|
82
|
+
)
|
|
83
|
+
expect(el.renderRoot.querySelector('input[type=range]')).to.equal(null)
|
|
84
|
+
expect(field(el, 'run').hasAttribute('wide')).to.equal(true)
|
|
85
|
+
})
|
|
62
86
|
})
|