@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,187 +0,0 @@
1
- // Type definitions for ui/resolution
2
-
3
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
4
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
5
-
6
- export interface ResolutionDecoratorConfig extends Object {
7
- /**
8
- * Attaches an event listener to the window to listen for resize events.
9
- */
10
- dynamic?: boolean;
11
- /**
12
- * An array of objects containing declarations for screen types to add to the list of known
13
- screen types.
14
- */
15
- screenTypes?: object[];
16
- }
17
- export interface ResolutionDecoratorProps {}
18
- export function ResolutionDecorator<P>(
19
- config: ResolutionDecoratorConfig,
20
- Component: React.ComponentType<P> | string
21
- ): React.ComponentType<P & ResolutionDecoratorProps>;
22
-
23
- export function ResolutionDecorator<P>(
24
- Component: React.ComponentType<P> | string
25
- ): React.ComponentType<P & ResolutionDecoratorProps>;
26
-
27
- /**
28
- * Object that stores all of the pixel conversion factors to each keyed unit.
29
- */
30
- export declare const unitToPixelFactors: object;
31
- /**
32
- * Sets up screen resolution scaling capabilities by defining an array of all the screens
33
- being used.
34
- *
35
- * These should be listed in order from smallest to largest, according to
36
- width.
37
- *
38
- * The `name` , `pxPerRem` , `width` , and `aspectRatioName` properties are required for
39
- each screen type in the array. Setting `base: true` on a screen type marks it as the
40
- default resolution, upon which everything else will be based.
41
- *
42
- * Executing this method also initializes the rest of the resolution-independence code.
43
- *
44
- * Example:
45
- * ```
46
- import ri from 'enact/ui/resolution';
47
-
48
- ri.defineScreenTypes([
49
- {name: 'vga', pxPerRem: 8, width: 640, height: 480, aspectRatioName: 'standard'},
50
- {name: 'xga', pxPerRem: 16, width: 1024, height: 768, aspectRatioName: 'standard'},
51
- {name: 'hd', pxPerRem: 16, width: 1280, height: 720, aspectRatioName: 'hdtv'},
52
- {name: 'fhd', pxPerRem: 24, width: 1920, height: 1080, aspectRatioName: 'hdtv', base: true},
53
- {name: 'uw-uxga', pxPerRem: 24, width: 2560, height: 1080, aspectRatioName: 'cinema'},
54
- {name: 'uhd', pxPerRem: 48, width: 3840, height: 2160, aspectRatioName: 'hdtv'}
55
- ]);
56
- ```
57
- */
58
- export function defineScreenTypes(types: object[]): void;
59
- /**
60
- * Fetches the name of the screen type that best matches the current screen size.
61
- *
62
- * The best match is defined as the screen type that is the closest to the screen resolution without
63
- going over. ("The Price is Right" style.)
64
- */
65
- export function getScreenType(rez: object): string;
66
- /**
67
- * Calculate the base rem font size.
68
- *
69
- * This is how the magic happens. This accepts an optional `screenType` name. If one isn't provided,
70
- the currently detected screen type is used. This uses the config option `orientationHandling` ,
71
- which when set to "scale" and the screen is in portrait orientation, will dynamically calculate
72
- what the base font size should be, if the width were proportionally scaled down to fit in the portrait space.
73
- *
74
- * To use, put the following in your application code:
75
- * ```
76
- import ri from '@enact/ui/resolution';
77
-
78
- ri.config.orientationHandling = 'scale';
79
- ri.init();
80
- ```
81
-
82
- * This has no effect if the screen is in landscape, or if `orientationHandling` is unset.
83
- */
84
- export function calculateFontSize(type: string): string;
85
- /**
86
- * Returns the CSS classes for the given `type` .
87
- */
88
- export function getResolutionClasses(type: string): string;
89
- /**
90
- * Returns the ratio of pixels per rem for the given `type` to the pixels per rem for the base type.
91
- */
92
- export function getRiRatio(type: string): number;
93
- /**
94
- * Returns the pixels per rem for the given `type` .
95
- */
96
- export function getUnitToPixelFactors(type: string): number;
97
- /**
98
- * Calculates the aspect ratio of the specified screen type.
99
- *
100
- * If no screen type is provided, the current screen type is used.
101
- */
102
- export function getAspectRatio(type: string): number;
103
- /**
104
- * Returns the name of the aspect ratio for a specified screen type, or for the default
105
- screen type if none is provided.
106
- */
107
- export function getAspectRatioName(type: string): string;
108
- /**
109
- * Takes a provided pixel value and performs a scaling operation based on the current
110
- screen type.
111
- */
112
- export function scale(px: number): number;
113
- /**
114
- * Convert to various unit formats.
115
- *
116
- * Useful for converting pixels to a resolution-independent
117
- measurement method, like "rem". Other units are available if defined in the
118
- object.
119
- *
120
- * Example:
121
- * ```
122
- import ri from '@enact/ui/resolution';
123
-
124
- // Do calculations and get back the desired CSS unit.
125
- var frameWidth = 250,
126
- frameWithMarginInches = ri.unit( 10 + frameWidth + 10, 'in' ), // '2.8125in' == frameWithMarginInches
127
- frameWithMarginRems = ri.unit( 10 + frameWidth + 10, 'rem' ); // '22.5rem' == frameWithMarginRems
128
- ```
129
- */
130
- export function unit(pixels: string | number, toUnit: string): string | void;
131
- /**
132
- * Shorthand for when you know you need to scale some pixel value and have it converted to "rem" for
133
- proper scaling.
134
- *
135
- * This runs and together.
136
- */
137
- export function scaleToRem(pixels: number): string | void;
138
- /**
139
- * The default configurable options for . Additional resolutions
140
- may be added.
141
- */
142
- export interface selectSrcOptions {
143
- /**
144
- * HD / 720p Resolution image asset source URI/URL
145
- */
146
- hd?: string
147
- /**
148
- * FHD / 1080p Resolution image asset source URI/URL
149
- */;
150
- fhd?: string
151
- /**
152
- * UHD / 4K Resolution image asset source URI/URL
153
- */;
154
- uhd?: string;
155
- }
156
- /**
157
- * Selects the ideal image asset from a set of assets, based on various screen
158
- resolutions: HD (720p), FHD (1080p), UHD (4k).
159
- *
160
- * When a `src` argument is provided, `selectSrc()` will choose the best image with
161
- respect to the current screen resolution. `src` may be either the traditional
162
- string, which will pass straight through, or a hash/object of screen types and
163
- their asset sources (keys:screen and values:src). The image sources will be used
164
- when the screen resolution is less than or equal to the provided screen types.
165
- *
166
- * Example:
167
- * ```
168
- // Take advantage of the multi-res mode
169
- import {Image} from '@enact/ui/Image';
170
-
171
- const src = {
172
- 'hd': 'http://lorempixel.com/64/64/city/1/',
173
- 'fhd': 'http://lorempixel.com/128/128/city/1/',
174
- 'uhd': 'http://lorempixel.com/256/256/city/1/'
175
- };
176
- ...
177
- <Image src={src} ... />
178
- ...
179
- ```
180
- */
181
- export function selectSrc(
182
- src: string | ui_resolution_selectSrcSrcOptions
183
- ): string;
184
- /**
185
- * This will need to be re-run any time the screen size changes, so all the values can be re-cached.
186
- */
187
- export function init(args: object): void;
File without changes
File without changes