Skip to content

Commit f4553af

Browse files
authored
Convert remaining range components to TS (#2732)
* convert remaining range components to TS * default props * update * more exports * EuiRangeSliderProps
1 parent c367190 commit f4553af

File tree

13 files changed

+362
-405
lines changed

13 files changed

+362
-405
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## [`master`](https://github.com/elastic/eui/tree/master)
22

3-
No public interface changes since `18.0.0`.
3+
- Converted `EuiRange` to TypeScript ([#2732](https://github.com/elastic/eui/pull/2732))
4+
- Converted `EuiDualRange` to TypeScript ([#2732](https://github.com/elastic/eui/pull/2732))
5+
- Converted `EuiRangeInput` to TypeScript ([#2732](https://github.com/elastic/eui/pull/2732))
46

57
## [`18.0.0`](https://github.com/elastic/eui/tree/v18.0.0)
68

src/components/form/form_control_layout/form_control_layout_delimited.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ import React, {
77
import classNames from 'classnames';
88

99
import { EuiText } from '../../text';
10-
import { EuiFormControlLayout } from './form_control_layout';
10+
import {
11+
EuiFormControlLayout,
12+
EuiFormControlLayoutProps,
13+
} from './form_control_layout';
1114

12-
type EuiFormControlLayoutDelimitedProps = Partial<EuiFormControlLayout> & {
15+
type EuiFormControlLayoutDelimitedProps = Partial<EuiFormControlLayoutProps> & {
1316
/**
1417
* Left side control
1518
*/

src/components/form/index.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { CommonProps } from '../common';
22
/// <reference path="./field_search/index.d.ts" />
33
/// <reference path="./form_row/index.d.ts" />
4-
/// <reference path="./range/index.d.ts" />
54
/// <reference path="./select/index.d.ts" />
65
/// <reference path="./super_select/index.d.ts" />
76

src/components/form/range/__snapshots__/dual_range.test.js.snap renamed to src/components/form/range/__snapshots__/dual_range.test.tsx.snap

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ exports[`EuiDualRange is rendered 1`] = `
7777
>
7878
<div
7979
class="euiRangeHighlight__progress"
80-
style="margin-left:0%;width:77.77777777777779%"
80+
style="margin-left:1%;width:7.000000000000001%"
8181
/>
8282
</div>
8383
<input
@@ -86,8 +86,8 @@ exports[`EuiDualRange is rendered 1`] = `
8686
class="euiRangeSlider euiRangeSlider--hasRange euiDualRange__slider"
8787
data-test-subj="test subject string"
8888
id="id"
89-
max="10"
90-
min="1"
89+
max="100"
90+
min="0"
9191
name="name"
9292
step="1"
9393
tabindex="-1"
@@ -115,7 +115,7 @@ exports[`EuiDualRange props compressed should render 1`] = `
115115
>
116116
<div
117117
class="euiRangeHighlight__progress"
118-
style="margin-left:0%;width:100%"
118+
style="margin-left:1%;width:7.000000000000001%"
119119
/>
120120
</div>
121121
<input
@@ -175,7 +175,7 @@ exports[`EuiDualRange props custom ticks should render 1`] = `
175175
>
176176
<div
177177
class="euiRangeHighlight__progress"
178-
style="margin-left:0%;width:100%"
178+
style="margin-left:20%;width:80%"
179179
/>
180180
</div>
181181
<input
@@ -210,7 +210,7 @@ exports[`EuiDualRange props disabled should render 1`] = `
210210
>
211211
<div
212212
class="euiRangeHighlight__progress"
213-
style="margin-left:0%;width:100%"
213+
style="margin-left:1%;width:7.000000000000001%"
214214
/>
215215
</div>
216216
<input
@@ -246,7 +246,7 @@ exports[`EuiDualRange props fullWidth should render 1`] = `
246246
>
247247
<div
248248
class="euiRangeHighlight__progress"
249-
style="margin-left:0%;width:100%"
249+
style="margin-left:1%;width:7.000000000000001%"
250250
/>
251251
</div>
252252
<input
@@ -280,10 +280,10 @@ exports[`EuiDualRange props inputs should render 1`] = `
280280
aria-label="aria-label"
281281
class="euiFieldNumber euiRangeInput euiRangeInput--min"
282282
max="8"
283-
min="1"
283+
min="0"
284284
name="name-minValue"
285285
step="1"
286-
style="width:3.6em"
286+
style="width:4.4em"
287287
type="number"
288288
value="1"
289289
/>
@@ -300,7 +300,7 @@ exports[`EuiDualRange props inputs should render 1`] = `
300300
>
301301
<div
302302
class="euiRangeHighlight__progress"
303-
style="margin-left:0%;width:77.77777777777779%"
303+
style="margin-left:1%;width:7.000000000000001%"
304304
/>
305305
</div>
306306
<input
@@ -309,8 +309,8 @@ exports[`EuiDualRange props inputs should render 1`] = `
309309
class="euiRangeSlider euiRangeSlider--hasRange euiDualRange__slider"
310310
data-test-subj="test subject string"
311311
id="id"
312-
max="10"
313-
min="1"
312+
max="100"
313+
min="0"
314314
name="name"
315315
step="1"
316316
tabindex="-1"
@@ -329,11 +329,11 @@ exports[`EuiDualRange props inputs should render 1`] = `
329329
<input
330330
aria-label="aria-label"
331331
class="euiFieldNumber euiRangeInput euiRangeInput--max"
332-
max="10"
332+
max="100"
333333
min="1"
334334
name="name-maxValue"
335335
step="1"
336-
style="width:3.6em"
336+
style="width:4.4em"
337337
type="number"
338338
value="8"
339339
/>
@@ -362,7 +362,7 @@ exports[`EuiDualRange props labels should render 1`] = `
362362
>
363363
<div
364364
class="euiRangeHighlight__progress"
365-
style="margin-left:0%;width:100%"
365+
style="margin-left:1%;width:7.000000000000001%"
366366
/>
367367
</div>
368368
<input
@@ -414,7 +414,7 @@ exports[`EuiDualRange props levels should render 1`] = `
414414
>
415415
<div
416416
class="euiRangeHighlight__progress"
417-
style="margin-left:0%;width:100%"
417+
style="margin-left:1%;width:7.000000000000001%"
418418
/>
419419
</div>
420420
<input
@@ -487,7 +487,7 @@ exports[`EuiDualRange props slider should display in popover 1`] = `
487487
aria-label="aria-label"
488488
class="euiFieldNumber euiFormControlLayoutDelimited__input"
489489
max="8"
490-
min="1"
490+
min="0"
491491
name="name-minValue"
492492
step="1"
493493
type="number"
@@ -505,7 +505,7 @@ exports[`EuiDualRange props slider should display in popover 1`] = `
505505
<input
506506
aria-label="aria-label"
507507
class="euiFieldNumber euiFormControlLayoutDelimited__input"
508-
max="10"
508+
max="100"
509509
min="1"
510510
name="name-maxValue"
511511
step="1"
@@ -594,7 +594,7 @@ exports[`EuiDualRange props ticks should render 1`] = `
594594
>
595595
<div
596596
class="euiRangeHighlight__progress"
597-
style="margin-left:0%;width:100%"
597+
style="margin-left:1%;width:7.000000000000001%"
598598
/>
599599
</div>
600600
<input

src/components/form/range/__snapshots__/range.test.js.snap renamed to src/components/form/range/__snapshots__/range.test.tsx.snap

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ exports[`EuiRange is rendered 1`] = `
6868
class="euiRangeSlider"
6969
data-test-subj="test subject string"
7070
id="id"
71-
max="10"
72-
min="1"
71+
max="100"
72+
min="0"
7373
name="name"
7474
step="1"
7575
type="range"
@@ -96,6 +96,7 @@ exports[`EuiRange props compressed should render 1`] = `
9696
min="0"
9797
step="1"
9898
type="range"
99+
value="8"
99100
/>
100101
</div>
101102
<div
@@ -143,6 +144,7 @@ exports[`EuiRange props custom ticks should render 1`] = `
143144
min="0"
144145
step="1"
145146
type="range"
147+
value="8"
146148
/>
147149
</div>
148150
<div
@@ -166,6 +168,7 @@ exports[`EuiRange props disabled should render 1`] = `
166168
min="0"
167169
step="1"
168170
type="range"
171+
value="8"
169172
/>
170173
</div>
171174
<div
@@ -188,6 +191,7 @@ exports[`EuiRange props fullWidth should render 1`] = `
188191
min="0"
189192
step="1"
190193
type="range"
194+
value="8"
191195
/>
192196
</div>
193197
<div
@@ -207,8 +211,8 @@ exports[`EuiRange props input should render 1`] = `
207211
aria-label="aria-label"
208212
class="euiRangeSlider"
209213
data-test-subj="test subject string"
210-
max="10"
211-
min="1"
214+
max="100"
215+
min="0"
212216
name="name"
213217
step="1"
214218
tabindex="-1"
@@ -230,11 +234,11 @@ exports[`EuiRange props input should render 1`] = `
230234
class="euiFieldNumber euiRangeInput euiRangeInput--max"
231235
data-test-subj="test subject string"
232236
id="id"
233-
max="10"
234-
min="1"
237+
max="100"
238+
min="0"
235239
name="name"
236240
step="1"
237-
style="width:3.6em"
241+
style="width:4.4em"
238242
type="number"
239243
value="8"
240244
/>
@@ -262,6 +266,7 @@ exports[`EuiRange props labels should render 1`] = `
262266
min="0"
263267
step="1"
264268
type="range"
269+
value="8"
265270
/>
266271
</div>
267272
<label
@@ -301,6 +306,7 @@ exports[`EuiRange props levels should render 1`] = `
301306
min="0"
302307
step="1"
303308
type="range"
309+
value="20"
304310
/>
305311
</div>
306312
<div
@@ -359,8 +365,8 @@ exports[`EuiRange props slider should display in popover 1`] = `
359365
class="euiFieldNumber euiRangeInput euiRangeInput--max"
360366
data-test-subj="test subject string"
361367
id="id"
362-
max="10"
363-
min="1"
368+
max="100"
369+
min="0"
364370
name="name"
365371
step="1"
366372
type="number"
@@ -447,6 +453,7 @@ exports[`EuiRange props ticks should render 1`] = `
447453
min="0"
448454
step="1"
449455
type="range"
456+
value="8"
450457
/>
451458
</div>
452459
<div

0 commit comments

Comments
 (0)