@enact/ui 4.7.9 → 4.7.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.
Files changed (120) hide show
  1. package/AnnounceDecorator/Announce.js +2 -2
  2. package/AnnounceDecorator/AnnounceDecorator.js +2 -2
  3. package/BodyText/BodyText.js +2 -2
  4. package/BodyText/tests/BodyText-specs.js +2 -2
  5. package/Button/Button.js +16 -16
  6. package/CHANGELOG.md +20 -0
  7. package/Cancelable/Cancelable.js +14 -14
  8. package/Cancelable/tests/Cancelable-specs.js +2 -2
  9. package/Changeable/Changeable.js +14 -14
  10. package/ComponentOverride/ComponentOverride.js +3 -3
  11. package/FloatingLayer/FloatingLayer.js +11 -11
  12. package/FloatingLayer/FloatingLayerContainer.js +2 -2
  13. package/FloatingLayer/FloatingLayerDecorator.js +2 -2
  14. package/FloatingLayer/Scrim.js +2 -2
  15. package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +2 -2
  16. package/ForwardRef/ForwardRef.js +12 -12
  17. package/GridListImageItem/GridListImageItem.js +2 -2
  18. package/Group/Group.js +2 -2
  19. package/Group/GroupItem.js +16 -17
  20. package/Group/tests/Group-specs.js +2 -2
  21. package/Heading/Heading.js +21 -21
  22. package/Icon/Icon.js +2 -2
  23. package/Icon/tests/Icon-specs.js +2 -2
  24. package/IconButton/IconButton.js +2 -2
  25. package/Image/Image.js +2 -2
  26. package/Image/tests/Image-specs.js +2 -2
  27. package/ImageItem/ImageItem.js +2 -2
  28. package/ImageItem/tests/ImageItem-specs.js +4 -4
  29. package/Item/Item.js +2 -2
  30. package/LabeledIcon/LabeledIcon.js +2 -2
  31. package/Layout/Cell.js +2 -2
  32. package/Layout/Layout.js +154 -154
  33. package/Layout/tests/Layout-specs.js +4 -4
  34. package/Marquee/MarqueeBase.js +2 -2
  35. package/Marquee/MarqueeController.js +2 -3
  36. package/Marquee/MarqueeDecorator.js +2 -2
  37. package/Marquee/tests/Marquee-specs.js +2 -2
  38. package/Measurable/Measurable.js +13 -15
  39. package/Measurable/tests/Measurable-specs.js +4 -4
  40. package/Media/Media.js +31 -31
  41. package/Placeholder/PlaceholderControllerDecorator.js +8 -8
  42. package/Placeholder/PlaceholderDecorator.js +8 -8
  43. package/ProgressBar/ProgressBar.js +14 -15
  44. package/README.md +1 -1
  45. package/RadioDecorator/RadioControllerDecorator.js +2 -2
  46. package/RadioDecorator/RadioDecorator.js +14 -14
  47. package/Repeater/Repeater.js +15 -15
  48. package/Repeater/tests/Repeater-specs.js +4 -4
  49. package/Resizable/Resizable.js +12 -12
  50. package/Resizable/tests/Resizable-specs.js +2 -2
  51. package/Resizable/tests/useResize-specs.js +2 -2
  52. package/Resizable/useResize.js +3 -2
  53. package/Routable/Link.js +2 -2
  54. package/Routable/Routable.js +15 -15
  55. package/Routable/Router.js +2 -2
  56. package/Routable/tests/Routable-specs.js +2 -2
  57. package/Scrollable/ScrollAnimator.js +2 -2
  58. package/Scrollable/ScrollThumb.js +9 -9
  59. package/Scrollable/Scrollable.js +12 -12
  60. package/Scrollable/ScrollableNative.js +4 -5
  61. package/Scrollable/Scrollbar.js +2 -2
  62. package/Scroller/Scroller.js +9 -9
  63. package/Scroller/ScrollerBasic.js +9 -9
  64. package/Scroller/UiScrollerBase.js +12 -12
  65. package/Skinnable/Skinnable.js +2 -2
  66. package/Skinnable/tests/Skinnable-specs.js +2 -2
  67. package/Skinnable/tests/useSkins-specs.js +2 -2
  68. package/Slider/Knob.js +2 -2
  69. package/Slider/PositionDecorator.js +2 -2
  70. package/Slider/Slider.js +17 -17
  71. package/SlotItem/SlotItem.js +2 -2
  72. package/Slottable/Slottable.js +15 -15
  73. package/Slottable/useSlots.js +2 -2
  74. package/Spinner/Spinner.js +2 -2
  75. package/ToggleIcon/ToggleIcon.js +2 -2
  76. package/ToggleItem/ToggleItem.js +2 -2
  77. package/ToggleItem/tests/ToggleItem-specs.js +4 -4
  78. package/Toggleable/Toggle.js +2 -2
  79. package/Toggleable/Toggleable.js +15 -16
  80. package/Toggleable/useToggle.js +1 -0
  81. package/Touchable/ClickAllow.js +2 -2
  82. package/Touchable/Drag.js +2 -2
  83. package/Touchable/Flick.js +2 -2
  84. package/Touchable/Hold.js +2 -2
  85. package/Touchable/Pinch.js +2 -2
  86. package/Touchable/Touch.js +2 -2
  87. package/Touchable/Touchable.js +2 -2
  88. package/Touchable/config.js +2 -2
  89. package/Touchable/tests/useTouch-specs.js +2 -2
  90. package/Touchable/useTouch.js +3 -2
  91. package/Transition/Transition.js +18 -18
  92. package/Transition/tests/Transition-specs.js +4 -4
  93. package/ViewManager/Arranger.js +5 -5
  94. package/ViewManager/TransitionGroup.js +6 -5
  95. package/ViewManager/View.js +4 -4
  96. package/ViewManager/ViewManager.js +4 -4
  97. package/ViewManager/tests/ViewManager-specs.js +2 -3
  98. package/VirtualList/UiVirtualListBase.js +2 -2
  99. package/VirtualList/VirtualList.js +12 -12
  100. package/VirtualList/VirtualListBasic.js +2 -2
  101. package/VirtualList/tests/VirtualGridList-native-specs.js +2 -2
  102. package/VirtualList/tests/VirtualGridList-specs.js +2 -2
  103. package/VirtualList/tests/VirtualList-native-specs.js +2 -2
  104. package/VirtualList/tests/VirtualList-specs.js +2 -2
  105. package/internal/IdProvider/IdProvider.js +7 -7
  106. package/internal/IdProvider/Provider.js +2 -2
  107. package/internal/IdProvider/tests/IdProvider-specs.js +2 -2
  108. package/internal/IdProvider/tests/useId-specs.js +2 -2
  109. package/internal/IdProvider/useId.js +1 -0
  110. package/internal/Pure/Pure.js +12 -12
  111. package/internal/Pure/tests/Pure-specs.js +2 -2
  112. package/internal/localized-fonts/tests/localized-fonts-specs.js +0 -1
  113. package/package.json +2 -2
  114. package/resolution/ResolutionDecorator.js +11 -11
  115. package/resolution/index.js +2 -2
  116. package/resolution/tests/resolution-specs.js +503 -13
  117. package/useScroll/ScrollAnimator.js +2 -2
  118. package/useScroll/Scrollbar.js +2 -2
  119. package/useScroll/ScrollbarTrack.js +2 -2
  120. package/useScroll/useScroll.js +2 -4
@@ -25,30 +25,514 @@ describe('Resolution Specs', function () {
25
25
  pxPerRem: 24,
26
26
  width: 1920,
27
27
  height: 1080,
28
- aspectRatioName: 'hdtv',
29
- base: true
28
+ aspectRatioName: 'hdtv'
30
29
  }, {
31
30
  name: 'uw-uxga',
32
31
  pxPerRem: 24,
33
32
  width: 2560,
34
33
  height: 1080,
35
34
  aspectRatioName: 'cinema'
35
+ }, {
36
+ name: 'qhd',
37
+ pxPerRem: 32,
38
+ width: 2560,
39
+ height: 1440,
40
+ aspectRatioName: 'hdtv'
41
+ }, {
42
+ name: 'wqhd',
43
+ pxPerRem: 32,
44
+ width: 3440,
45
+ height: 1440,
46
+ aspectRatioName: 'cinema'
36
47
  }, {
37
48
  name: 'uhd',
38
49
  pxPerRem: 48,
39
50
  width: 3840,
40
51
  height: 2160,
52
+ aspectRatioName: 'hdtv',
53
+ base: true
54
+ }, {
55
+ name: 'uhd2',
56
+ pxPerRem: 96,
57
+ width: 7680,
58
+ height: 4320,
41
59
  aspectRatioName: 'hdtv'
42
60
  }];
43
- test('should select screen type whose dimensions are greater than but nearest to the screen', function () {
44
- var overHD = {
45
- height: 721,
46
- width: 1281
47
- };
48
- (0, _resolution.defineScreenTypes)(screenTypes);
49
- var expected = 'fhd';
50
- var actual = (0, _resolution.getScreenType)(overHD);
51
- expect(actual).toBe(expected);
61
+ var VGA = {
62
+ width: 640,
63
+ height: 480
64
+ };
65
+ var XGA = {
66
+ width: 1024,
67
+ height: 768
68
+ };
69
+ var HD = {
70
+ width: 1280,
71
+ height: 720
72
+ };
73
+ var FHD = {
74
+ width: 1920,
75
+ height: 1080
76
+ };
77
+ var UWUXGA = {
78
+ width: 2560,
79
+ height: 1080
80
+ };
81
+ var QHD = {
82
+ width: 2560,
83
+ height: 1440
84
+ };
85
+ var WQHD = {
86
+ width: 3440,
87
+ height: 1440
88
+ };
89
+ var UHD = {
90
+ width: 3840,
91
+ height: 2160
92
+ };
93
+ var UHD2 = {
94
+ width: 7680,
95
+ height: 4320
96
+ };
97
+ (0, _resolution.defineScreenTypes)(screenTypes);
98
+ describe('Matching Screen Types', function () {
99
+ test('should select screen type whose dimensions are same with the screen if exist', function () {
100
+ expect((0, _resolution.getScreenType)(VGA)).toBe('vga');
101
+ expect((0, _resolution.getScreenType)(XGA)).toBe('xga');
102
+ expect((0, _resolution.getScreenType)(HD)).toBe('hd');
103
+ expect((0, _resolution.getScreenType)(FHD)).toBe('fhd');
104
+ expect((0, _resolution.getScreenType)(UWUXGA)).toBe('uw-uxga');
105
+ expect((0, _resolution.getScreenType)(QHD)).toBe('qhd');
106
+ expect((0, _resolution.getScreenType)(WQHD)).toBe('wqhd');
107
+ expect((0, _resolution.getScreenType)(UHD)).toBe('uhd');
108
+ expect((0, _resolution.getScreenType)(UHD2)).toBe('uhd2');
109
+ });
110
+ test('should select screen type whose height and width are both smaller than or same with the screen if `matchSmallerScreenType` true', function () {
111
+ _resolution.config.matchSmallerScreenType = true;
112
+
113
+ // if width or height of screen is smaller than the smallest screen type, select the smallest screen type
114
+ expect((0, _resolution.getScreenType)({
115
+ width: VGA.width - 1,
116
+ height: VGA.height - 1
117
+ })).toBe('vga');
118
+ expect((0, _resolution.getScreenType)({
119
+ width: VGA.width + 1,
120
+ height: VGA.height - 1
121
+ })).toBe('vga');
122
+ expect((0, _resolution.getScreenType)({
123
+ width: VGA.width - 1,
124
+ height: VGA.height + 1
125
+ })).toBe('vga');
126
+
127
+ // VGA
128
+ expect((0, _resolution.getScreenType)({
129
+ width: VGA.width + 1,
130
+ height: VGA.height + 1
131
+ })).toBe('vga');
132
+ expect((0, _resolution.getScreenType)({
133
+ width: XGA.width - 1,
134
+ height: XGA.height - 1
135
+ })).toBe('vga');
136
+ expect((0, _resolution.getScreenType)({
137
+ width: XGA.width + 1,
138
+ height: XGA.height - 1
139
+ })).toBe('vga');
140
+ expect((0, _resolution.getScreenType)({
141
+ width: XGA.width - 1,
142
+ height: XGA.height + 1
143
+ })).toBe('vga');
144
+ expect((0, _resolution.getScreenType)({
145
+ width: HD.width - 1,
146
+ height: HD.height - 1
147
+ })).toBe('vga');
148
+ expect((0, _resolution.getScreenType)({
149
+ width: HD.width + 1,
150
+ height: HD.height - 1
151
+ })).toBe('vga');
152
+ expect((0, _resolution.getScreenType)({
153
+ width: HD.width - 1,
154
+ height: HD.height + 1
155
+ })).toBe('vga');
156
+ expect((0, _resolution.getScreenType)({
157
+ width: XGA.width,
158
+ height: HD.height
159
+ })).toBe('vga');
160
+ expect((0, _resolution.getScreenType)({
161
+ width: XGA.width - 1,
162
+ height: HD.height - 1
163
+ })).toBe('vga');
164
+ expect((0, _resolution.getScreenType)({
165
+ width: XGA.width + 1,
166
+ height: HD.height - 1
167
+ })).toBe('vga');
168
+ expect((0, _resolution.getScreenType)({
169
+ width: XGA.width - 1,
170
+ height: HD.height + 1
171
+ })).toBe('vga');
172
+ expect((0, _resolution.getScreenType)({
173
+ width: XGA.width + 1,
174
+ height: HD.height + 1
175
+ })).toBe('vga');
176
+ expect((0, _resolution.getScreenType)({
177
+ width: HD.width - 1,
178
+ height: XGA.height - 1
179
+ })).toBe('vga');
180
+
181
+ // XGA
182
+ expect((0, _resolution.getScreenType)({
183
+ width: XGA.width + 1,
184
+ height: XGA.height + 1
185
+ })).toBe('xga');
186
+ expect((0, _resolution.getScreenType)({
187
+ width: HD.width - 1,
188
+ height: XGA.height + 1
189
+ })).toBe('xga');
190
+
191
+ // HD
192
+ expect((0, _resolution.getScreenType)({
193
+ width: HD.width + 1,
194
+ height: HD.height + 1
195
+ })).toBe('hd');
196
+ expect((0, _resolution.getScreenType)({
197
+ width: HD.width,
198
+ height: XGA.height
199
+ })).toBe('hd');
200
+ expect((0, _resolution.getScreenType)({
201
+ width: HD.width + 1,
202
+ height: XGA.height - 1
203
+ })).toBe('hd');
204
+ expect((0, _resolution.getScreenType)({
205
+ width: HD.width + 1,
206
+ height: XGA.height + 1
207
+ })).toBe('hd');
208
+ expect((0, _resolution.getScreenType)({
209
+ width: FHD.width - 1,
210
+ height: FHD.height - 1
211
+ })).toBe('hd');
212
+ expect((0, _resolution.getScreenType)({
213
+ width: FHD.width + 1,
214
+ height: FHD.height - 1
215
+ })).toBe('hd');
216
+ expect((0, _resolution.getScreenType)({
217
+ width: FHD.width - 1,
218
+ height: FHD.height + 1
219
+ })).toBe('hd');
220
+ expect((0, _resolution.getScreenType)({
221
+ width: UWUXGA.width - 1,
222
+ height: UWUXGA.height - 1
223
+ })).toBe('hd'); // {height: FHD.height - 1, width: UWUXGA.width - 1}
224
+ expect((0, _resolution.getScreenType)({
225
+ width: UWUXGA.width + 1,
226
+ height: UWUXGA.height - 1
227
+ })).toBe('hd'); // {height: FHD.height - 1, width: UWUXGA.width + 1}
228
+
229
+ // FHD
230
+ expect((0, _resolution.getScreenType)({
231
+ width: FHD.width + 1,
232
+ height: FHD.height + 1
233
+ })).toBe('fhd');
234
+ expect((0, _resolution.getScreenType)({
235
+ width: UWUXGA.width - 1,
236
+ height: UWUXGA.height + 1
237
+ })).toBe('fhd'); // {height: FHD.height + 1, width: UWUXGA.width - 1}
238
+
239
+ expect((0, _resolution.getScreenType)({
240
+ width: QHD.width - 1,
241
+ height: QHD.height - 1
242
+ })).toBe('fhd'); // {height: QHD.height - 1, width: UWUXGA.width - 1}
243
+ expect((0, _resolution.getScreenType)({
244
+ width: QHD.width - 1,
245
+ height: QHD.height + 1
246
+ })).toBe('fhd'); // {height: QHD.height + 1, width: UWUXGA.width - 1}
247
+
248
+ // UWUXGA
249
+ expect((0, _resolution.getScreenType)({
250
+ width: UWUXGA.width + 1,
251
+ height: UWUXGA.height + 1
252
+ })).toBe('uw-uxga'); // {height: FHD.height + 1, width: UWUXGA.width + 1}
253
+
254
+ expect((0, _resolution.getScreenType)({
255
+ width: QHD.width + 1,
256
+ height: QHD.height - 1
257
+ })).toBe('uw-uxga'); // {height: QHD.height - 1, width: UWUXGA.width + 1}
258
+
259
+ expect((0, _resolution.getScreenType)({
260
+ width: WQHD.width - 1,
261
+ height: WQHD.height - 1
262
+ })).toBe('uw-uxga'); // {height: QHD.height - 1, width: WQHD.width - 1}
263
+ expect((0, _resolution.getScreenType)({
264
+ width: WQHD.width + 1,
265
+ height: WQHD.height - 1
266
+ })).toBe('uw-uxga'); // {height: QHD.height - 1, width: WQHD.width + 1}
267
+
268
+ // QHD
269
+ expect((0, _resolution.getScreenType)({
270
+ width: QHD.width + 1,
271
+ height: QHD.height + 1
272
+ })).toBe('qhd'); // {height: QHD.height + 1, width: UWUXGA.width + 1}
273
+
274
+ expect((0, _resolution.getScreenType)({
275
+ width: WQHD.width - 1,
276
+ height: WQHD.height + 1
277
+ })).toBe('qhd'); // {height: QHD.height + 1, width: WQHD.width - 1}
278
+
279
+ // WQHD
280
+ expect((0, _resolution.getScreenType)({
281
+ width: WQHD.width + 1,
282
+ height: WQHD.height + 1
283
+ })).toBe('wqhd'); // {height: QHD.height + 1, width: WQHD.width + 1}
284
+
285
+ expect((0, _resolution.getScreenType)({
286
+ width: UHD.width - 1,
287
+ height: UHD.height - 1
288
+ })).toBe('wqhd');
289
+ expect((0, _resolution.getScreenType)({
290
+ width: UHD.width + 1,
291
+ height: UHD.height - 1
292
+ })).toBe('wqhd');
293
+ expect((0, _resolution.getScreenType)({
294
+ width: UHD.width - 1,
295
+ height: UHD.height + 1
296
+ })).toBe('wqhd');
297
+
298
+ // UHD
299
+ expect((0, _resolution.getScreenType)({
300
+ width: UHD.width + 1,
301
+ height: UHD.height + 1
302
+ })).toBe('uhd');
303
+ expect((0, _resolution.getScreenType)({
304
+ width: UHD2.width - 1,
305
+ height: UHD2.height - 1
306
+ })).toBe('uhd');
307
+ expect((0, _resolution.getScreenType)({
308
+ width: UHD2.width + 1,
309
+ height: UHD2.height - 1
310
+ })).toBe('uhd');
311
+ expect((0, _resolution.getScreenType)({
312
+ width: UHD2.width - 1,
313
+ height: UHD2.height + 1
314
+ })).toBe('uhd');
315
+
316
+ // UHD2
317
+ expect((0, _resolution.getScreenType)({
318
+ width: UHD2.width + 1,
319
+ height: UHD2.height + 1
320
+ })).toBe('uhd2');
321
+ });
322
+ test('should select screen type whose height and width are both bigger than or same with the screen if `matchSmallerScreenType` false', function () {
323
+ _resolution.config.matchSmallerScreenType = false;
324
+
325
+ // VGA
326
+ expect((0, _resolution.getScreenType)({
327
+ width: VGA.width - 1,
328
+ height: VGA.height - 1
329
+ })).toBe('vga');
330
+
331
+ // XGA
332
+ expect((0, _resolution.getScreenType)({
333
+ width: VGA.width + 1,
334
+ height: VGA.height - 1
335
+ })).toBe('xga');
336
+ expect((0, _resolution.getScreenType)({
337
+ width: VGA.width - 1,
338
+ height: VGA.height + 1
339
+ })).toBe('xga');
340
+ expect((0, _resolution.getScreenType)({
341
+ width: VGA.width + 1,
342
+ height: VGA.height + 1
343
+ })).toBe('xga');
344
+ expect((0, _resolution.getScreenType)({
345
+ width: XGA.width - 1,
346
+ height: XGA.height - 1
347
+ })).toBe('xga');
348
+ expect((0, _resolution.getScreenType)({
349
+ width: XGA.width,
350
+ height: HD.height
351
+ })).toBe('xga');
352
+ expect((0, _resolution.getScreenType)({
353
+ width: XGA.width - 1,
354
+ height: HD.height - 1
355
+ })).toBe('xga');
356
+ expect((0, _resolution.getScreenType)({
357
+ width: XGA.width - 1,
358
+ height: HD.height + 1
359
+ })).toBe('xga');
360
+
361
+ // HD
362
+ expect((0, _resolution.getScreenType)({
363
+ width: XGA.width + 1,
364
+ height: HD.height - 1
365
+ })).toBe('hd');
366
+ expect((0, _resolution.getScreenType)({
367
+ width: HD.width - 1,
368
+ height: HD.height - 1
369
+ })).toBe('hd');
370
+
371
+ // FHD
372
+ expect((0, _resolution.getScreenType)({
373
+ width: XGA.width + 1,
374
+ height: XGA.height - 1
375
+ })).toBe('fhd');
376
+ expect((0, _resolution.getScreenType)({
377
+ width: XGA.width - 1,
378
+ height: XGA.height + 1
379
+ })).toBe('fhd');
380
+ expect((0, _resolution.getScreenType)({
381
+ width: XGA.width + 1,
382
+ height: XGA.height + 1
383
+ })).toBe('fhd');
384
+ expect((0, _resolution.getScreenType)({
385
+ width: HD.width,
386
+ height: XGA.height
387
+ })).toBe('fhd');
388
+ expect((0, _resolution.getScreenType)({
389
+ width: HD.width - 1,
390
+ height: XGA.height - 1
391
+ })).toBe('fhd');
392
+ expect((0, _resolution.getScreenType)({
393
+ width: HD.width + 1,
394
+ height: XGA.height - 1
395
+ })).toBe('fhd');
396
+ expect((0, _resolution.getScreenType)({
397
+ width: HD.width - 1,
398
+ height: XGA.height + 1
399
+ })).toBe('fhd');
400
+ expect((0, _resolution.getScreenType)({
401
+ width: HD.width + 1,
402
+ height: XGA.height + 1
403
+ })).toBe('fhd');
404
+ expect((0, _resolution.getScreenType)({
405
+ width: XGA.width + 1,
406
+ height: HD.height + 1
407
+ })).toBe('fhd');
408
+ expect((0, _resolution.getScreenType)({
409
+ width: HD.width + 1,
410
+ height: HD.height - 1
411
+ })).toBe('fhd');
412
+ expect((0, _resolution.getScreenType)({
413
+ width: HD.width - 1,
414
+ height: HD.height + 1
415
+ })).toBe('fhd');
416
+ expect((0, _resolution.getScreenType)({
417
+ width: HD.width + 1,
418
+ height: HD.height + 1
419
+ })).toBe('fhd');
420
+ expect((0, _resolution.getScreenType)({
421
+ width: FHD.width - 1,
422
+ height: FHD.height - 1
423
+ })).toBe('fhd');
424
+
425
+ // UWUXGA
426
+ expect((0, _resolution.getScreenType)({
427
+ width: UWUXGA.width - 1,
428
+ height: UWUXGA.height - 1
429
+ })).toBe('uw-uxga'); // {height: FHD.height - 1, width: UWUXGA.width - 1}
430
+
431
+ expect((0, _resolution.getScreenType)({
432
+ width: FHD.width + 1,
433
+ height: FHD.height - 1
434
+ })).toBe('uw-uxga');
435
+
436
+ // QHD
437
+ expect((0, _resolution.getScreenType)({
438
+ width: UWUXGA.width - 1,
439
+ height: UWUXGA.height + 1
440
+ })).toBe('qhd'); // {height: FHD.height + 1, width: UWUXGA.width - 1}
441
+
442
+ expect((0, _resolution.getScreenType)({
443
+ width: QHD.width - 1,
444
+ height: QHD.height - 1
445
+ })).toBe('qhd'); // {height: QHD.height - 1, width: UWUXGA.width - 1}
446
+
447
+ expect((0, _resolution.getScreenType)({
448
+ width: FHD.width - 1,
449
+ height: FHD.height + 1
450
+ })).toBe('qhd');
451
+ expect((0, _resolution.getScreenType)({
452
+ width: FHD.width + 1,
453
+ height: FHD.height + 1
454
+ })).toBe('qhd');
455
+
456
+ // WQHD
457
+ expect((0, _resolution.getScreenType)({
458
+ width: UWUXGA.width + 1,
459
+ height: UWUXGA.height - 1
460
+ })).toBe('wqhd'); // {height: FHD.height - 1, width: UWUXGA.width + 1}
461
+ expect((0, _resolution.getScreenType)({
462
+ width: UWUXGA.width + 1,
463
+ height: UWUXGA.height + 1
464
+ })).toBe('wqhd'); // {height: FHD.height + 1, width: UWUXGA.width + 1}
465
+
466
+ expect((0, _resolution.getScreenType)({
467
+ width: QHD.width + 1,
468
+ height: QHD.height - 1
469
+ })).toBe('wqhd'); // {height: QHD.height - 1, width: UWUXGA.width + 1}
470
+
471
+ expect((0, _resolution.getScreenType)({
472
+ width: WQHD.width - 1,
473
+ height: WQHD.height - 1
474
+ })).toBe('wqhd'); // {height: QHD.height - 1, width: WQHD.width - 1}
475
+
476
+ // UHD
477
+ expect((0, _resolution.getScreenType)({
478
+ width: QHD.width - 1,
479
+ height: QHD.height + 1
480
+ })).toBe('uhd'); // {height: QHD.height + 1, width: UWUXGA.width - 1}
481
+ expect((0, _resolution.getScreenType)({
482
+ width: QHD.width + 1,
483
+ height: QHD.height + 1
484
+ })).toBe('uhd'); // {height: QHD.height + 1, width: UWUXGA.width + 1}
485
+
486
+ expect((0, _resolution.getScreenType)({
487
+ width: WQHD.width + 1,
488
+ height: WQHD.height - 1
489
+ })).toBe('uhd'); // {height: QHD.height - 1, width: WQHD.width + 1}
490
+ expect((0, _resolution.getScreenType)({
491
+ width: WQHD.width - 1,
492
+ height: WQHD.height + 1
493
+ })).toBe('uhd'); // {height: QHD.height + 1, width: WQHD.width - 1}
494
+ expect((0, _resolution.getScreenType)({
495
+ width: WQHD.width + 1,
496
+ height: WQHD.height + 1
497
+ })).toBe('uhd'); // {height: QHD.height + 1, width: WQHD.width + 1}
498
+
499
+ expect((0, _resolution.getScreenType)({
500
+ width: UHD.width - 1,
501
+ height: UHD.height - 1
502
+ })).toBe('uhd');
503
+
504
+ // UHD2
505
+ expect((0, _resolution.getScreenType)({
506
+ width: UHD.width + 1,
507
+ height: UHD.height - 1
508
+ })).toBe('uhd2');
509
+ expect((0, _resolution.getScreenType)({
510
+ width: UHD.width - 1,
511
+ height: UHD.height + 1
512
+ })).toBe('uhd2');
513
+ expect((0, _resolution.getScreenType)({
514
+ width: UHD.width + 1,
515
+ height: UHD.height + 1
516
+ })).toBe('uhd2');
517
+ expect((0, _resolution.getScreenType)({
518
+ width: UHD2.width - 1,
519
+ height: UHD2.height - 1
520
+ })).toBe('uhd2');
521
+
522
+ // if width or height of screen is bigger than the biggest screen type, select the biggest screen type
523
+ expect((0, _resolution.getScreenType)({
524
+ width: UHD2.width + 1,
525
+ height: UHD2.height - 1
526
+ })).toBe('uhd2');
527
+ expect((0, _resolution.getScreenType)({
528
+ width: UHD2.width - 1,
529
+ height: UHD2.height + 1
530
+ })).toBe('uhd2');
531
+ expect((0, _resolution.getScreenType)({
532
+ width: UHD2.width + 1,
533
+ height: UHD2.height + 1
534
+ })).toBe('uhd2');
535
+ });
52
536
  });
53
537
  test('should detect portrait orientation', function () {
54
538
  var fhdPortrait = {
@@ -61,17 +545,23 @@ describe('Resolution Specs', function () {
61
545
  expect(actual).toBe(expected);
62
546
  });
63
547
  test('should calculate the base font size for the given screen type', function () {
548
+ var expectedUHD = '48px';
549
+ var actualUHD = (0, _resolution.calculateFontSize)('uhd');
550
+ var expectedQHD = '32px';
551
+ var actualQHD = (0, _resolution.calculateFontSize)('qhd');
64
552
  var expectedFHD = '24px';
65
553
  var actualFHD = (0, _resolution.calculateFontSize)('fhd');
66
554
  var expectedHD = '16px';
67
555
  var actualHD = (0, _resolution.calculateFontSize)('hd');
556
+ expect(actualUHD).toBe(expectedUHD);
557
+ expect(actualQHD).toBe(expectedQHD);
68
558
  expect(actualFHD).toBe(expectedFHD);
69
559
  expect(actualHD).toBe(expectedHD);
70
560
  });
71
561
  test('should scale pixel measurements for the current screen', function () {
72
- var expectedFHD = 24 / 3;
562
+ var expectedFHD = 24 / 6;
73
563
  var actualFHD = (0, _resolution.scale)(24);
74
- var expectedHD = 16 / 3;
564
+ var expectedHD = 16 / 6;
75
565
  var actualHD = (0, _resolution.scale)(16);
76
566
  expect(actualFHD).toBe(expectedFHD);
77
567
  expect(actualHD).toBe(expectedHD);
@@ -10,8 +10,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
10
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
11
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
12
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
14
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
14
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
15
  var
16
16
  // Use eases library
17
17
  timingFunctions = {
@@ -24,8 +24,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
24
24
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
25
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
26
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
28
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
27
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
28
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
29
29
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
30
30
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
31
31
  var scrollbarTrackHidingDelay = 900; // 900ms + 100ms(fade out duration) = 1000ms.
@@ -22,8 +22,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
22
22
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
23
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
24
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
26
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
25
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
26
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
27
27
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
28
28
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
29
29
  var ScrollbarTrack = exports.ScrollbarTrackBase = exports.ScrollbarTrack = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
@@ -46,8 +46,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
46
46
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
47
47
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
48
48
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
49
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
50
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
49
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
50
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
51
51
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
52
52
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
53
53
  var constants = exports.constants = {
@@ -641,7 +641,6 @@ var useScrollBase = exports.useScrollBase = function useScrollBase(props) {
641
641
  targetY: mutableRef.current.scrollTop + (isVerticalFlick ? -ev.velocityY : 0) * overscrollVelocityFactor // 'vertical' or 'both'
642
642
  };
643
643
  }
644
-
645
644
  if (props.onFlick) {
646
645
  (0, _handle.forward)('onFlick', ev, props);
647
646
  }
@@ -1460,7 +1459,6 @@ var useScrollBase = exports.useScrollBase = function useScrollBase(props) {
1460
1459
  onFlick: onFlick,
1461
1460
  onTouchStart: scrollMode === 'native' ? onTouchStart : null // scrollMode 'native'
1462
1461
  }));
1463
-
1464
1462
  var scrollContentProps = props.itemRenderer ?
1465
1463
  // If the child component is a VirtualList
1466
1464
  {