@enact/ui 4.6.0 → 4.6.1

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 (65) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/FloatingLayer/package.json +3 -0
  3. package/IconButton/IconButton.js +7 -2
  4. package/RadioDecorator/RadioControllerDecorator.js +6 -0
  5. package/RadioDecorator/RadioDecorator.js +5 -0
  6. package/Scroller/UiScrollerBase.js +6 -0
  7. package/SlotItem/SlotItem.js +6 -2
  8. package/ToggleItem/ToggleItem.js +6 -2
  9. package/Touchable/Pinch.js +185 -0
  10. package/Touchable/Touch.js +34 -11
  11. package/Touchable/Touchable.js +63 -4
  12. package/Touchable/config.js +19 -2
  13. package/Touchable/tests/Touchable-specs.js +96 -6
  14. package/Touchable/useTouch.js +41 -32
  15. package/VirtualList/UiVirtualListBase.js +6 -0
  16. package/package.json +2 -2
  17. package/AnnounceDecorator/AnnounceDecorator.d.ts +0 -64
  18. package/BodyText/BodyText.d.ts +0 -66
  19. package/Button/Button.d.ts +0 -125
  20. package/Cancelable/Cancelable.d.ts +0 -64
  21. package/Changeable/Changeable.d.ts +0 -54
  22. package/ComponentOverride/ComponentOverride.d.ts +0 -52
  23. package/ForwardRef/ForwardRef.d.ts +0 -22
  24. package/GridListImageItem/GridListImageItem.d.ts +0 -85
  25. package/Group/Group.d.ts +0 -107
  26. package/Heading/Heading.d.ts +0 -90
  27. package/Icon/Icon.d.ts +0 -88
  28. package/IconButton/IconButton.d.ts +0 -115
  29. package/Image/Image.d.ts +0 -113
  30. package/ImageItem/ImageItem.d.ts +0 -83
  31. package/Item/Item.d.ts +0 -64
  32. package/LabeledIcon/LabeledIcon.d.ts +0 -130
  33. package/Layout/Layout.d.ts +0 -247
  34. package/Marquee/index.d.ts +0 -258
  35. package/Measurable/Measurable.d.ts +0 -26
  36. package/Media/Media.d.ts +0 -99
  37. package/Placeholder/index.d.ts +0 -53
  38. package/ProgressBar/ProgressBar.d.ts +0 -92
  39. package/RadioDecorator/RadioDecorator.d.ts +0 -35
  40. package/Repeater/Repeater.d.ts +0 -83
  41. package/Resizable/Resizable.d.ts +0 -31
  42. package/Routable/Routable.d.ts +0 -148
  43. package/Scrollable/Scrollable.d.ts +0 -0
  44. package/Scroller/Scroller.d.ts +0 -276
  45. package/Skinnable/Skinnable.d.ts +0 -94
  46. package/Slider/Slider.d.ts +0 -202
  47. package/SlotItem/SlotItem.d.ts +0 -118
  48. package/Slottable/Slottable.d.ts +0 -22
  49. package/Spinner/Spinner.d.ts +0 -95
  50. package/ToggleIcon/ToggleIcon.d.ts +0 -90
  51. package/ToggleItem/ToggleItem.d.ts +0 -134
  52. package/Toggleable/Toggleable.d.ts +0 -103
  53. package/Touchable/Touchable.d.ts +0 -175
  54. package/Transition/Transition.d.ts +0 -196
  55. package/ViewManager/ViewManager.d.ts +0 -191
  56. package/VirtualList/VirtualList.d.ts +0 -530
  57. package/index.d.ts +0 -0
  58. package/internal/IdProvider/IdProvider.d.ts +0 -0
  59. package/internal/Pure/Pure.d.ts +0 -0
  60. package/internal/localized-fonts/localized-fonts.d.ts +0 -53
  61. package/internal/selection/selection.d.ts +0 -0
  62. package/internal/validators/validators.d.ts +0 -0
  63. package/resolution/index.d.ts +0 -187
  64. package/useControlledState/useControlledState.d.ts +0 -0
  65. package/useScroll/useScroll.d.ts +0 -0
@@ -1,530 +0,0 @@
1
- // Type definitions for ui/VirtualList
2
-
3
- import * as React from "react";
4
-
5
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
6
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
7
-
8
- /**
9
- * The shape for the grid list item size
10
- in a list for .
11
- */
12
- export interface gridListItemSizeShape {
13
- /**
14
- * The minimum width of the grid list item.
15
- */
16
- minWidth: number
17
- /**
18
- * The minimum height of the grid list item.
19
- */;
20
- minHeight: number;
21
- }
22
- export interface VirtualListProps extends VirtualListBasicProps {
23
- /**
24
- * A callback function that receives a reference to the `scrollTo` feature.
25
- *
26
- * Once received, the `scrollTo` method can be called as an imperative interface.
27
- *
28
- * The `scrollTo` function accepts the following parameters:
29
- * * {position: {x, y}} - Pixel value for x and/or y position
30
- * * {align} - Where the scroll area should be aligned. Values are:
31
- `'left'` , `'right'` , `'top'` , `'bottom'` ,
32
- `'topleft'` , `'topright'` , `'bottomleft'` , and `'bottomright'` .
33
- * * {index} - Index of specific item. ( `0` or positive integer)
34
- This option is available for only `VirtualList` kind.
35
- * * {node} - Node to scroll into view
36
- * * {animate} - When `true` , scroll occurs with animation. When `false` , no
37
- animation occurs.
38
- * * {focus} - When `true` , attempts to focus item after scroll. Only valid when scrolling
39
- by `index` or `node` .
40
- *
41
- * Note: Only specify one of: `position` , `align` , `index` or `node`
42
- *
43
- * Example:
44
- * ```
45
- // If you set cbScrollTo prop like below;
46
- cbScrollTo: (fn) => {this.scrollTo = fn;}
47
- // You can simply call like below;
48
- this.scrollTo({align: 'top'}); // scroll to the top
49
- ```
50
- */
51
- cbScrollTo?: Function;
52
- /**
53
- * The layout direction of the list.
54
- *
55
- * Valid values are:
56
- * * `'horizontal'` , and
57
- * * `'vertical'` .
58
- */
59
- direction?: string;
60
- /**
61
- * Specifies how to show horizontal scrollbar.
62
- *
63
- * Valid values are:
64
- * * `'auto'` ,
65
- * * `'visible'` , and
66
- * * `'hidden'` .
67
- */
68
- horizontalScrollbar?: string;
69
- /**
70
- * Prevents scroll by wheeling on the list.
71
- */
72
- noScrollByWheel?: boolean;
73
- /**
74
- * Called when scrolling.
75
- *
76
- * Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
77
- It is not recommended to set this prop since it can cause performance degradation.
78
- Use `onScrollStart` or `onScrollStop` instead.
79
- */
80
- onScroll?: Function;
81
- /**
82
- * Called when scroll starts.
83
- *
84
- * Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
85
- You can get firstVisibleIndex and lastVisibleIndex from VirtualList with `moreInfo` .
86
- *
87
- * Example:
88
- * ```
89
- onScrollStart = ({scrollLeft, scrollTop, moreInfo}) => {
90
- const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
91
- // do something with firstVisibleIndex and lastVisibleIndex
92
- }
93
-
94
- render = () => (
95
- <VirtualList
96
- ...
97
- onScrollStart={this.onScrollStart}
98
- ...
99
- />
100
- )
101
- ```
102
- */
103
- onScrollStart?: Function;
104
- /**
105
- * Called when scroll stops.
106
- *
107
- * Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
108
- You can get firstVisibleIndex and lastVisibleIndex from VirtualList with `moreInfo` .
109
- *
110
- * Example:
111
- * ```
112
- onScrollStop = ({scrollLeft, scrollTop, moreInfo}) => {
113
- const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
114
- // do something with firstVisibleIndex and lastVisibleIndex
115
- }
116
-
117
- render = () => (
118
- <VirtualList
119
- ...
120
- onScrollStop={this.onScrollStop}
121
- ...
122
- />
123
- )
124
- ```
125
- */
126
- onScrollStop?: Function;
127
- /**
128
- * The ARIA role for the list.
129
- */
130
- role?: string;
131
- /**
132
- * Specifies how to scroll.
133
- *
134
- * Valid values are:
135
- * * `'translate'` ,
136
- * * `'native'` .
137
- */
138
- scrollMode?: string;
139
- /**
140
- * Specifies how to show vertical scrollbar.
141
- *
142
- * Valid values are:
143
- * * `'auto'` ,
144
- * * `'visible'` , and
145
- * * `'hidden'` .
146
- */
147
- verticalScrollbar?: string;
148
- }
149
- /**
150
- * An unstyled scrollable virtual list component with touch support.
151
- */
152
-
153
- export class VirtualList extends React.Component<
154
- Merge<React.HTMLProps<HTMLElement>, VirtualListProps>
155
- > {}
156
-
157
- /**
158
- * The shape for the list different item size
159
- in a list for .
160
- */
161
- export interface itemSizesShape {
162
- /**
163
- * The minimum size of the list item.
164
- */
165
- minSize: number
166
- /**
167
- * An array of the list item size. If it is not defined, the list items will render with the `minSize` size.
168
- */;
169
- size: number[];
170
- }
171
- export interface VirtualListBasicProps {
172
- /**
173
- * The rendering function called for each item in the list.
174
- *
175
- * Note : The list does not always render a component whenever its render function is called
176
- *
177
- * due to performance optimization.
178
- *
179
- * Example:
180
- * ```
181
- renderItem = ({index, ...rest}) => {
182
-
183
- return (
184
- <MyComponent index={index} {...rest} />
185
- );
186
- }
187
- ```
188
- */
189
- itemRenderer: Function;
190
- /**
191
- * Additional props included in the object passed to the `itemRenderer` callback.
192
- */
193
- childProps?: object;
194
- /**
195
- * Client size of the list; valid values are an object that has `clientWidth` and `clientHeight` .
196
- */
197
- clientSize?: object;
198
- /**
199
- * The number of items of data the list contains.
200
- */
201
- dataSize?: number;
202
- /**
203
- * The layout direction of the list.
204
- *
205
- * Valid values are:
206
- * * `'horizontal'` , and
207
- * * `'vertical'` .
208
- */
209
- direction?: string;
210
- /**
211
- * The ARIA role for the list.
212
- */
213
- role?: string;
214
- /**
215
- * Specifies how to scroll.
216
- *
217
- * Valid values are:
218
- * * `'translate'` ,
219
- * * `'native'` .
220
- */
221
- scrollMode?: string;
222
- /**
223
- * The spacing between items.
224
- */
225
- spacing?: number;
226
- }
227
- /**
228
- * A basic base component for
229
- and .
230
- */
231
-
232
- export class VirtualListBasic extends React.Component<
233
- Merge<React.HTMLProps<HTMLElement>, VirtualListBasicProps>
234
- > {}
235
-
236
- export interface VirtualListBaseProps {
237
- /**
238
- * The rendering function called for each item in the list.
239
- *
240
- * Note : The list does not always render a component whenever its render function is called
241
- *
242
- * due to performance optimization.
243
- *
244
- * Example:
245
- * ```
246
- renderItem = ({index, ...rest}) => {
247
- delete rest.data;
248
-
249
- return (
250
- <MyComponent index={index} {...rest} />
251
- );
252
- }
253
- ```
254
- */
255
- itemRenderer: Function;
256
- /**
257
- * A callback function that receives a reference to the `scrollTo` feature.
258
- *
259
- * Once received, the `scrollTo` method can be called as an imperative interface.
260
- *
261
- * The `scrollTo` function accepts the following parameters:
262
- * * {position: {x, y}} - Pixel value for x and/or y position
263
- * * {align} - Where the scroll area should be aligned. Values are:
264
- `'left'` , `'right'` , `'top'` , `'bottom'` ,
265
- `'topleft'` , `'topright'` , `'bottomleft'` , and `'bottomright'` .
266
- * * {index} - Index of specific item. ( `0` or positive integer)
267
- This option is available for only `VirtualList` kind.
268
- * * {node} - Node to scroll into view
269
- * * {animate} - When `true` , scroll occurs with animation. When `false` , no
270
- animation occurs.
271
- * * {focus} - When `true` , attempts to focus item after scroll. Only valid when scrolling
272
- by `index` or `node` .
273
- *
274
- * Note: Only specify one of: `position` , `align` , `index` or `node`
275
- *
276
- * Example:
277
- * ```
278
- // If you set cbScrollTo prop like below;
279
- cbScrollTo: (fn) => {this.scrollTo = fn;}
280
- // You can simply call like below;
281
- this.scrollTo({align: 'top'}); // scroll to the top
282
- ```
283
- */
284
- cbScrollTo?: Function;
285
- /**
286
- * Additional props included in the object passed to the `itemsRenderer` callback.
287
- */
288
- childProps?: object;
289
- /**
290
- * Client size of the list; valid values are an object that has `clientWidth` and `clientHeight` .
291
- */
292
- clientSize?: object;
293
- /**
294
- * The number of items of data the list contains.
295
- */
296
- dataSize?: number;
297
- /**
298
- * The layout direction of the list.
299
- *
300
- * Valid values are:
301
- * * `'horizontal'` , and
302
- * * `'vertical'` .
303
- */
304
- direction?: string;
305
- /**
306
- * The spacing between items.
307
- */
308
- spacing?: number;
309
- /**
310
- * Specifies how to show horizontal scrollbar.
311
- *
312
- * Valid values are:
313
- * * `'auto'` ,
314
- * * `'visible'` , and
315
- * * `'hidden'` .
316
- */
317
- horizontalScrollbar?: string;
318
- /**
319
- * Prevents scroll by wheeling on the list.
320
- */
321
- noScrollByWheel?: boolean;
322
- /**
323
- * Called when scrolling.
324
- *
325
- * Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
326
- It is not recommended to set this prop since it can cause performance degradation.
327
- Use `onScrollStart` or `onScrollStop` instead.
328
- */
329
- onScroll?: Function;
330
- /**
331
- * Called when scroll starts.
332
- *
333
- * Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
334
- You can get firstVisibleIndex and lastVisibleIndex from VirtualList with `moreInfo` .
335
- *
336
- * Example:
337
- * ```
338
- onScrollStart = ({scrollLeft, scrollTop, moreInfo}) => {
339
- const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
340
- // do something with firstVisibleIndex and lastVisibleIndex
341
- }
342
-
343
- render = () => (
344
- <VirtualList
345
- ...
346
- onScrollStart={this.onScrollStart}
347
- ...
348
- />
349
- )
350
- ```
351
- */
352
- onScrollStart?: Function;
353
- /**
354
- * Called when scroll stops.
355
- *
356
- * Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
357
- You can get firstVisibleIndex and lastVisibleIndex from VirtualList with `moreInfo` .
358
- *
359
- * Example:
360
- * ```
361
- onScrollStop = ({scrollLeft, scrollTop, moreInfo}) => {
362
- const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
363
- // do something with firstVisibleIndex and lastVisibleIndex
364
- }
365
-
366
- render = () => (
367
- <VirtualList
368
- ...
369
- onScrollStop={this.onScrollStop}
370
- ...
371
- />
372
- )
373
- ```
374
- */
375
- onScrollStop?: Function;
376
- /**
377
- * Specifies how to show vertical scrollbar.
378
- *
379
- * Valid values are:
380
- * * `'auto'` ,
381
- * * `'visible'` , and
382
- * * `'hidden'` .
383
- */
384
- verticalScrollbar?: string;
385
- }
386
- /**
387
- * A basic base component for
388
- and .
389
- */
390
-
391
- export class VirtualListBase extends React.Component<
392
- Merge<React.HTMLProps<HTMLElement>, VirtualListBaseProps>
393
- > {}
394
-
395
- export interface VirtualGridListProps extends VirtualListBasicProps {
396
- /**
397
- * A callback function that receives a reference to the `scrollTo` feature.
398
- *
399
- * Once received, the `scrollTo` method can be called as an imperative interface.
400
- *
401
- * The `scrollTo` function accepts the following parameters:
402
- * * {position: {x, y}} - Pixel value for x and/or y position
403
- * * {align} - Where the scroll area should be aligned. Values are:
404
- `'left'` , `'right'` , `'top'` , `'bottom'` ,
405
- `'topleft'` , `'topright'` , `'bottomleft'` , and `'bottomright'` .
406
- * * {index} - Index of specific item. ( `0` or positive integer)
407
- This option is available for only `VirtualList` kind.
408
- * * {node} - Node to scroll into view
409
- * * {animate} - When `true` , scroll occurs with animation. When `false` , no
410
- animation occurs.
411
- * * {focus} - When `true` , attempts to focus item after scroll. Only valid when scrolling
412
- by `index` or `node` .
413
- *
414
- * Note: Only specify one of: `position` , `align` , `index` or `node`
415
- *
416
- * Example:
417
- * ```
418
- // If you set cbScrollTo prop like below;
419
- cbScrollTo: (fn) => {this.scrollTo = fn;}
420
- // You can simply call like below;
421
- this.scrollTo({align: 'top'}); // scroll to the top
422
- ```
423
- */
424
- cbScrollTo?: Function;
425
- /**
426
- * The layout direction of the list.
427
- *
428
- * Valid values are:
429
- * * `'horizontal'` , and
430
- * * `'vertical'` .
431
- */
432
- direction?: string;
433
- /**
434
- * Specifies how to show horizontal scrollbar.
435
- *
436
- * Valid values are:
437
- * * `'auto'` ,
438
- * * `'visible'` , and
439
- * * `'hidden'` .
440
- */
441
- horizontalScrollbar?: string;
442
- /**
443
- * Prevents scroll by wheeling on the list.
444
- */
445
- noScrollByWheel?: boolean;
446
- /**
447
- * Called when scrolling.
448
- *
449
- * Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
450
- It is not recommended to set this prop since it can cause performance degradation.
451
- Use `onScrollStart` or `onScrollStop` instead.
452
- */
453
- onScroll?: Function;
454
- /**
455
- * Called when scroll starts.
456
- *
457
- * Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
458
- You can get firstVisibleIndex and lastVisibleIndex from VirtualGridList with `moreInfo` .
459
- *
460
- * Example:
461
- * ```
462
- onScrollStart = ({scrollLeft, scrollTop, moreInfo}) => {
463
- const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
464
- // do something with firstVisibleIndex and lastVisibleIndex
465
- }
466
-
467
- render = () => (
468
- <VirtualGridList
469
- ...
470
- onScrollStart={this.onScrollStart}
471
- ...
472
- />
473
- )
474
- ```
475
- */
476
- onScrollStart?: Function;
477
- /**
478
- * Called when scroll stops.
479
- *
480
- * Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
481
- You can get firstVisibleIndex and lastVisibleIndex from VirtualList with `moreInfo` .
482
- *
483
- * Example:
484
- * ```
485
- onScrollStop = ({scrollLeft, scrollTop, moreInfo}) => {
486
- const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
487
- // do something with firstVisibleIndex and lastVisibleIndex
488
- }
489
-
490
- render = () => (
491
- <VirtualGridList
492
- ...
493
- onScrollStop={this.onScrollStop}
494
- ...
495
- />
496
- )
497
- ```
498
- */
499
- onScrollStop?: Function;
500
- /**
501
- * The ARIA role for the list.
502
- */
503
- role?: string;
504
- /**
505
- * Specifies how to scroll.
506
- *
507
- * Valid values are:
508
- * * `'translate'` ,
509
- * * `'native'` .
510
- */
511
- scrollMode?: string;
512
- /**
513
- * Specifies how to show vertical scrollbar.
514
- *
515
- * Valid values are:
516
- * * `'auto'` ,
517
- * * `'visible'` , and
518
- * * `'hidden'` .
519
- */
520
- verticalScrollbar?: string;
521
- }
522
- /**
523
- * An unstyled scrollable virtual grid list component with touch support.
524
- */
525
-
526
- export class VirtualGridList extends React.Component<
527
- Merge<React.HTMLProps<HTMLElement>, VirtualGridListProps>
528
- > {}
529
-
530
- export default VirtualList;
package/index.d.ts DELETED
File without changes
File without changes
File without changes
@@ -1,53 +0,0 @@
1
- /**
2
- * Generates locale-specific font rules allowing any locale to have its own custom font. Each
3
- locale-font from the configuration block (defined in this file) is generated at run-time. If the
4
- locale you're currently in is in the locale-font list an additional `@font-face` rule will be
5
- generated that will override the standard font.
6
- *
7
- * In addition to the standard override-font being generated, named region-specific fonts are also
8
- generated. This lets you incorporate language specific fonts when you're outside of one of those
9
- regions; useful in a language list context where you want the name of each language to be
10
- represented by that language's designated font.
11
- *
12
- * Below is example genarated-output of the Urdu ("ur") locale-font.
13
- * ```
14
- &#64;font-face {
15
- font-family: 'Custom Font ur';
16
- font-weight: 500;
17
- src: local('CustomFont_Urdu');
18
- unicode-range: U+0600-U+06FF, U+FE70-U+FEFE, U+FB50-U+FDFF;
19
- }
20
- &#64;font-face {
21
- font-family: 'Custom Font ur Bold';
22
- font-weight: 700;
23
- src: local('CustomFont_Urdu');
24
- unicode-range: U+0600-U+06FF, U+FE70-U+FEFE, U+FB50-U+FDFF;
25
- }
26
- &#64;font-face {
27
- font-family: 'Custom Font ur Light';
28
- font-weight: 300;
29
- src: local('CustomFont_Urdu');
30
- unicode-range: U+0600-U+06FF, U+FE70-U+FEFE, U+FB50-U+FDFF;
31
- }
32
- ```
33
- */
34
- function generateFontRules(locale: string): string;
35
- /**
36
- * Adds a localed font to the font map
37
- * ```
38
- addLocalizedFont('My Theme Font', {
39
- 'ur': {
40
- regular: 'My Theme Urdu',
41
- unicodeRange:
42
- 'U+600-6FF,' +
43
- 'U+FE70-FEFE,' +
44
- 'U+FB50-FDFF'
45
- }
46
- })
47
- ```
48
- */
49
- function addLocalizedFont(name: string, fonts: object): void;
50
- /**
51
- * Removes a localized font from the font map
52
- */
53
- function removeLocalizedFont(name: string): void;
File without changes
File without changes