@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,258 +0,0 @@
1
- // Type definitions for ui/Marquee
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
- export interface MarqueeBaseProps {
9
- /**
10
- * Text alignment value of the marquee
11
- *
12
- * Valid values are:
13
- * * `'left'` ,
14
- * * `'right'` , and
15
- * * `'center'`
16
- */
17
- alignment?: string;
18
- /**
19
- * Applies animating styles such as removing the ellipsis.
20
- */
21
- animating?: boolean;
22
- /**
23
- * Sets the value of the `aria-label` attribute for the wrapped component.
24
- */
25
- "aria-label"?: string;
26
- /**
27
- * The text or a set of components that should be marqueed
28
- *
29
- * This prop may be empty in some cases, which is OK.
30
- */
31
- children?: React.ReactNode;
32
- /**
33
- * Called when mounting or unmounting with a reference to the client node
34
- */
35
- clientRef?: object | Function;
36
- /**
37
- * Customizes the component by mapping the supplied collection of CSS class names to the
38
- corresponding internal elements and states of this component.
39
- *
40
- * The following classes are supported:
41
- * * `marquee` - The root component class
42
- * * `animate` - Applied to the inner content node when the text is animating
43
- * * `spacing` - The spacing node used between the repeated content
44
- * * `text` - The inner content node
45
- * * `willAnimate` - Applied to the inner content node shortly before animation
46
- */
47
- css?: object;
48
- /**
49
- * Distance to animate the marquee
50
- *
51
- * Usually, the `distance` is the width of the text minus the width of the container
52
- */
53
- distance?: number;
54
- /**
55
- * Called when the marquee completes its animation
56
- */
57
- onMarqueeComplete?: Function;
58
- /**
59
- * Text overflow setting. Either `'clip'` or `'ellipsis'`
60
- */
61
- overflow?: "clip" | "ellipsis";
62
- /**
63
- * `true` if the directionality of the content is right-to-left
64
- */
65
- rtl?: boolean;
66
- /**
67
- * Amount of spacing, in pixels, between the instances of the content
68
- */
69
- spacing?: number;
70
- /**
71
- * Speed of marquee animation in pixels/second.
72
- */
73
- speed?: number;
74
- /**
75
- * Indicates the marquee will animate soon.
76
- *
77
- * Should be used by the component to prepare itself for animation such as promoting
78
- composite layers for improved performance.
79
- */
80
- willAnimate?: boolean;
81
- }
82
- /**
83
- * Marquees the children of the component.
84
- *
85
- * For automated marquee calculations use .
86
- */
87
-
88
- export class MarqueeBase extends React.Component<
89
- Merge<React.HTMLProps<HTMLElement>, MarqueeBaseProps>
90
- > {}
91
-
92
- export interface MarqueeControllerConfig extends Object {
93
- /**
94
- * When `true` , any `onFocus` events that bubble to the controller will start the contained
95
- `Marquee` instances. This is useful when a component contains `Marquee` instances that need to be
96
- started when sibling components are focused.
97
- */
98
- marqueeOnFocus?: boolean;
99
- }
100
- export interface MarqueeControllerProps {}
101
- export function MarqueeController<P>(
102
- config: MarqueeControllerConfig,
103
- Component: React.ComponentType<P> | string
104
- ): React.ComponentType<P & MarqueeControllerProps>;
105
-
106
- export function MarqueeController<P>(
107
- Component: React.ComponentType<P> | string
108
- ): React.ComponentType<P & MarqueeControllerProps>;
109
-
110
- export interface MarqueeDecoratorConfig extends Object {
111
- /**
112
- * Property containing the callback to stop the animation when `marqueeOn` is `'focus'`
113
- */
114
- blur?: string;
115
- /**
116
- * Optional CSS class name to customize the marquee `component`
117
- */
118
- className?: string;
119
- /**
120
- * The base marquee component wrapping the content.
121
- */
122
- component?: React.ComponentType;
123
- /**
124
- * Customizes the component by mapping the supplied collection of CSS class names to the
125
- corresponding internal elements and states of this component.
126
- *
127
- * The following classes are supported:
128
- * * `marquee` - The root component class
129
- * * `animate` - Applied to the inner content node when the text is animating
130
- * * `spacing` - The spacing node used between the repeated content
131
- * * `text` - The inner content node
132
- * * `willAnimate` - Applied to the inner content node shortly before animation
133
- */
134
- css?: object;
135
- /**
136
- * Property containing the callback to start the animation when `marqueeOn` is `'hover'`
137
- */
138
- enter?: string;
139
- /**
140
- * Property containing the callback to start the animation when `marqueeOn` is `'focus'`
141
- */
142
- focus?: string;
143
- /**
144
- * Invalidate the distance if any property (like 'inline') changes.
145
- Expects an array of props which on change trigger invalidateMetrics.
146
- */
147
- invalidateProps?: string[];
148
- /**
149
- * Property containing the callback to stop the animation when `marqueeOn` is `'hover'`
150
- */
151
- leave?: string;
152
- /**
153
- * A function that determines the text directionality of a string.
154
- *
155
- * Returns:
156
- * * `'rtl'` if the text should marquee to the right
157
- * * `'ltr'` if the text should marquee to the left
158
- */
159
- marqueeDirection?: Function;
160
- }
161
- export interface MarqueeDecoratorProps {
162
- /**
163
- * Text alignment value of the marquee. Valid values are `'left'` , `'right'` and `'center'` .
164
- */
165
- alignment?: string;
166
- /**
167
- * Children to be marqueed
168
- */
169
- children?: React.ReactNode;
170
- /**
171
- * Passed through to the wrapped component.
172
- *
173
- * Does not affect Marquee behavior except that components that are `marqueeOn="focus"`
174
- will be treated as if they were `marqueeOn="hover"` , to allow disabled (and thus,
175
- unfocusable) components to marquee.
176
- */
177
- disabled?: boolean;
178
- /**
179
- * Forces the `direction` of the marquee.
180
- *
181
- * Valid values are `'rtl'` , `'ltr'` , and `'locale'` . This includes non-text elements as well.
182
- The default behavior, if this prop is unset, is to evaluate the text content for
183
- directionality using .
184
- *
185
- * If `'locale'` , the `direction` is determined by the locale, same as .
186
- In other words, it will not consider the text content for determining the direction.
187
- */
188
- forceDirection?: string;
189
- /**
190
- * The current locale as a
191
- .
192
- */
193
- locale?: string;
194
- /**
195
- * Number of milliseconds to wait before starting marquee when `marqueeOn` is `'hover'` or
196
- `'focus'` or before restarting any marquee.
197
- */
198
- marqueeDelay?: number;
199
- /**
200
- * Disables all marquee behavior and removes supporting markup.
201
- */
202
- marqueeDisabled?: boolean;
203
- /**
204
- * Determines what triggers the marquee to start its animation.
205
- */
206
- marqueeOn?: "focus" | "hover" | "render";
207
- /**
208
- * Number of milliseconds to wait before starting marquee the first time.
209
- *
210
- * Has no effect if `marqueeOn` is not `'render'`
211
- */
212
- marqueeOnRenderDelay?: number;
213
- /**
214
- * Number of milliseconds to wait before resetting the marquee position after it
215
- finishes.
216
- *
217
- * A minimum of 40 milliseconds is enforced.
218
- */
219
- marqueeResetDelay?: number;
220
- /**
221
- * Amount of spacing between the instances of the content when animating.
222
- *
223
- * May either be a number indicating the number of pixels or a string indicating the
224
- percentage relative to the width of the component.
225
- *
226
- * _Note:_ When using a number, the value should be based on 1920x1080 display and
227
- will be scaled automatically for the current resolution using .
228
- */
229
- marqueeSpacing?: string | number;
230
- /**
231
- * Rate of marquee measured in pixels/second.
232
- */
233
- marqueeSpeed?: number;
234
- /**
235
- * Indicates the text directionality of the current locale is right-to-left
236
- */
237
- rtl?: string;
238
- }
239
- export function MarqueeDecorator<P>(
240
- config: MarqueeDecoratorConfig,
241
- Component: React.ComponentType<P> | string
242
- ): React.ComponentType<P & MarqueeDecoratorProps>;
243
-
244
- export function MarqueeDecorator<P>(
245
- Component: React.ComponentType<P> | string
246
- ): React.ComponentType<P & MarqueeDecoratorProps>;
247
-
248
- export interface MarqueeProps
249
- extends Merge<MarqueeBaseProps, MarqueeDecoratorProps> {}
250
- /**
251
- * A minimally-styled marquee component.
252
- */
253
-
254
- export class Marquee extends React.Component<
255
- Merge<React.HTMLProps<HTMLElement>, MarqueeProps>
256
- > {}
257
-
258
- export default Marquee;
@@ -1,26 +0,0 @@
1
- // Type definitions for ui/Measurable
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 MeasurableConfig extends Object {
7
- /**
8
- * Configures the prop name to pass the measurement object.
9
- */
10
- measurementProp?: string;
11
- /**
12
- * Configures the prop name to pass a function to capture a reference to the element to measure.
13
- */
14
- refProp?: string;
15
- }
16
- export interface MeasurableProps {}
17
- export function Measurable<P>(
18
- config: MeasurableConfig,
19
- Component: React.ComponentType<P> | string
20
- ): React.ComponentType<P & MeasurableProps>;
21
-
22
- export function Measurable<P>(
23
- Component: React.ComponentType<P> | string
24
- ): React.ComponentType<P & MeasurableProps>;
25
-
26
- export default Measurable;
package/Media/Media.d.ts DELETED
@@ -1,99 +0,0 @@
1
- // Type definitions for ui/Media
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
- * Generates a key representing the source node or nodes provided
10
- *
11
- * Example:
12
- * ```
13
- getKeyFromSource('path/file.mp4'); // 'path/file.mp4'
14
- getKeyFromSource(
15
- <source src="path/file.mp4" type="video/mp4" />
16
- ); // 'path/file.mp4'
17
- getKeyFromSource([
18
- <source src="path/file.mp4" type="video/mp4" />,
19
- <source src="path/file.ogg" type="video/ogg" />,
20
- ]); // 'path/file.mp4+path/file.ogg'
21
- ```
22
- */
23
- export function getKeyFromSource(
24
- source: string | JSX.Element | JSX.Element[]
25
- ): string;
26
- /**
27
- * Maps standard media event `type` values to React-style callback prop names
28
- *
29
- * See
30
- * ```
31
- {
32
- abort : 'onAbort',
33
- canplay : 'onCanPlay',
34
- canplaythrough : 'onCanPlayThrough',
35
- durationchange : 'onDurationChange',
36
- emptied : 'onEmptied',
37
- encrypted : 'onEncrypted',
38
- ended : 'onEnded',
39
- error : 'onError',
40
- loadeddata : 'onLoadedData',
41
- loadedmetadata : 'onLoadedMetadata',
42
- loadstart : 'onLoadStart',
43
- pause : 'onPause',
44
- play : 'onPlay',
45
- playing : 'onPlaying',
46
- progress : 'onProgress',
47
- ratechange : 'onRateChange',
48
- seeked : 'onSeeked',
49
- seeking : 'onSeeking',
50
- stalled : 'onStalled',
51
- suspend : 'onSuspend',
52
- timeupdate : 'onTimeUpdate',
53
- volumechange : 'onVolumeChange',
54
- waiting : 'onWaiting'
55
- }
56
- ```
57
- */
58
- export interface handledMediaEventsMap {}
59
- export interface MediaProps {
60
- /**
61
- * A type of media component.
62
- */
63
- mediaComponent: string | React.ComponentType;
64
- /**
65
- * An event map object for custom media events.
66
- *
67
- * List custom events that aren't standard to React. These will be directly added to the media
68
- element and props matching their name will be executed as callback functions when the event fires.
69
- *
70
- * Example:
71
- * ```
72
- {'umsmediainfo': 'onUMSMediaInfo'} // `onUMSMediaInfo` prop function will execute when the `umsmediainfo` event happens
73
- ```
74
- */
75
- customMediaEventsMap?: object;
76
- /**
77
- * A event map object for media events.
78
- */
79
- mediaEventsMap?: object;
80
- /**
81
- * A function to be run when media updates.
82
- */
83
- onUpdate?: Function;
84
- /**
85
- * Media sources passed as children to `mediaComponent`
86
- *
87
- * See:
88
- */
89
- source?: any;
90
- }
91
- /**
92
- * A component representation of HTMLMediaElement.
93
- */
94
-
95
- export class Media extends React.Component<
96
- Merge<React.HTMLProps<HTMLElement>, MediaProps>
97
- > {}
98
-
99
- export default Media;
@@ -1,53 +0,0 @@
1
- // Type definitions for ui/Placeholder
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 PlaceholderDecoratorConfig extends Object {
7
- /**
8
- * Configures the style of the placeholder element
9
- */
10
- style?: object;
11
- /**
12
- * The component to use as a placeholder.
13
- */
14
- placeholderComponent?: string;
15
- }
16
- export interface PlaceholderDecoratorProps {}
17
- export function PlaceholderDecorator<P>(
18
- config: PlaceholderDecoratorConfig,
19
- Component: React.ComponentType<P> | string
20
- ): React.ComponentType<P & PlaceholderDecoratorProps>;
21
-
22
- export function PlaceholderDecorator<P>(
23
- Component: React.ComponentType<P> | string
24
- ): React.ComponentType<P & PlaceholderDecoratorProps>;
25
-
26
- export interface PlaceholderControllerDecoratorConfig extends Object {
27
- /**
28
- * The bounds of the container represented by an object with `height` and `width` members.
29
- *
30
- * If the container is a static size, this can be specified at design-time to avoid calculating
31
- the bounds at run-time (the default behavior).
32
- */
33
- bounds?: object;
34
- /**
35
- * Event callback which indicates that the viewport has scrolled and placeholders should be
36
- notified.
37
- */
38
- notify?: string;
39
- /**
40
- * Multiplier used with the wrapped component's height and width to determine the threshold for
41
- replacing the placeholder component with the true component.
42
- */
43
- thresholdFactor?: number;
44
- }
45
- export interface PlaceholderControllerDecoratorProps {}
46
- export function PlaceholderControllerDecorator<P>(
47
- config: PlaceholderControllerDecoratorConfig,
48
- Component: React.ComponentType<P> | string
49
- ): React.ComponentType<P & PlaceholderControllerDecoratorProps>;
50
-
51
- export function PlaceholderControllerDecorator<P>(
52
- Component: React.ComponentType<P> | string
53
- ): React.ComponentType<P & PlaceholderControllerDecoratorProps>;
@@ -1,92 +0,0 @@
1
- // Type definitions for ui/ProgressBar
2
-
3
- import * as React from "react";
4
- import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef";
5
-
6
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
7
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
8
-
9
- export interface ProgressBarBaseProps {
10
- /**
11
- * The proportion of the loaded portion of the progress bar.
12
- * * Valid values are between `0` and `1` .
13
- */
14
- backgroundProgress?: number;
15
- /**
16
- * The contents to be displayed with progress bar.
17
- */
18
- children?: React.ReactNode;
19
- /**
20
- * Called with a reference to the root component.
21
- *
22
- * When using , the `ref` prop is forwarded to this
23
- component as `componentRef` .
24
- */
25
- componentRef?: object | Function;
26
- /**
27
- * Customizes the component by mapping the supplied collection of CSS class names to the
28
- corresponding internal elements and states of this component.
29
- *
30
- * The following classes are supported:
31
- * * `progressBar` - The root component class
32
- * * `bar` - The background node (the empty part of the progressBar)
33
- * * `fill` - The foreground of the progress bar ( `progress` )
34
- * * `load` - The `backgroundProgress` node
35
- * * `horizontal` - Applied when `orientation` is `'horizontal'`
36
- * * `vertical` - Applied when `orientation` is `'vertical'`
37
- * * `radial` - Applied when `orientation` is `'radial'`
38
- */
39
- css?: object;
40
- /**
41
- * Sets the orientation of the slider.
42
- *
43
- * Allowed values include:
44
- * * `'horizontal'` - A left and right orientation
45
- * * `'vertical'` - An up and down orientation
46
- * * `'radial'` - A circular orientation
47
- */
48
- orientation?: string;
49
- /**
50
- * The proportion of the filled portion of the progress bar.
51
- * * Valid values are between `0` and `1` .
52
- */
53
- progress?: number;
54
- /**
55
- * Sets the point, as a proportion between 0 and 1, from which the progress bar is filled.
56
- *
57
- * Applies to both the progress bar's `value` and `backgroundProgress` . In both cases,
58
- setting the value of `progressAnchor` will cause the progress bar to fill from that point
59
- down, when `value` or `backgroundProgress` is proportionally less than the anchor, or up,
60
- when `value` or `backgroundProgress` is proportionally greater than the anchor, rather
61
- than always from the start of the progress bar.
62
- */
63
- progressAnchor?: number;
64
- }
65
- /**
66
- * An unstyled progress bar component that can be customized by a theme or application.
67
- */
68
-
69
- export class ProgressBarBase extends React.Component<
70
- Merge<React.HTMLProps<HTMLElement>, ProgressBarBaseProps>
71
- > {}
72
-
73
- export interface ProgressBarDecoratorProps
74
- extends ui_ForwardRef_ForwardRefProps {}
75
- export function ProgressBarDecorator<P>(
76
- Component: React.ComponentType<P> | string
77
- ): React.ComponentType<P & ProgressBarDecoratorProps>;
78
-
79
- export interface ProgressBarProps
80
- extends Omit<
81
- Merge<ProgressBarBaseProps, ProgressBarDecoratorProps>,
82
- "componentRef"
83
- > {}
84
- /**
85
- * An unstyled progress bar component that can be customized by a theme or application.
86
- */
87
-
88
- export class ProgressBar extends React.Component<
89
- Merge<React.HTMLProps<HTMLElement>, ProgressBarProps>
90
- > {}
91
-
92
- export default ProgressBar;
@@ -1,35 +0,0 @@
1
- // Type definitions for ui/RadioDecorator
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 RadioControllerDecoratorProps {}
7
- export function RadioControllerDecorator<P>(
8
- Component: React.ComponentType<P> | string
9
- ): React.ComponentType<P & RadioControllerDecoratorProps>;
10
-
11
- export interface RadioDecoratorConfig extends Object {
12
- /**
13
- * The event indicating the wrapped component is activated
14
- */
15
- activate?: string;
16
- /**
17
- * The event indicating the wrapped component is deactivated
18
- */
19
- deactivate?: string;
20
- /**
21
- * The name of a boolean prop that activates the wrapped component when it is true.
22
- */
23
- prop?: string;
24
- }
25
- export interface RadioDecoratorProps {}
26
- export function RadioDecorator<P>(
27
- config: RadioDecoratorConfig,
28
- Component: React.ComponentType<P> | string
29
- ): React.ComponentType<P & RadioDecoratorProps>;
30
-
31
- export function RadioDecorator<P>(
32
- Component: React.ComponentType<P> | string
33
- ): React.ComponentType<P & RadioDecoratorProps>;
34
-
35
- export default RadioDecorator;
@@ -1,83 +0,0 @@
1
- // Type definitions for ui/Repeater
2
-
3
- import * as React from "react";
4
- import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef";
5
-
6
- type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
7
- type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
8
-
9
- export interface RepeaterBaseProps {
10
- /**
11
- * Component type to repeat.
12
- *
13
- * This can be a React component or a string describing a DOM node (e.g. `'div'` ).
14
- */
15
- childComponent: string | React.ComponentType;
16
- /**
17
- * An array of data to be mapped onto the `childComponent` .
18
- *
19
- * This supports two data types. If an array of strings is provided, the strings will be used
20
- in the generated `childComponent` as the readable text. If an array of objects is provided,
21
- each object will be spread onto the generated `childComponent` with no interpretation.
22
- You'll be responsible for setting properties like `disabled` , `className` , and setting the
23
- text content using the `children` key.
24
- *
25
- * NOTE : When an array of objects is provided, make sure a unique `key` is assigned to each
26
- *
27
- * data. See for more information.
28
- */
29
- children: string[] | { key: number | string; [propName: string]: any }[];
30
- /**
31
- * The property on each `childComponent` that receives the data in `children` .
32
- */
33
- childProp?: string;
34
- /**
35
- * Component type to wrap around all of the repeated elements.
36
- *
37
- * This can be a string describing a DOM node or React component (e.g. `'div'` or `Layout` ).
38
- */
39
- component?: string | React.ComponentType;
40
- /**
41
- * Called with a reference to the root component.
42
- *
43
- * When using , the `ref` prop is forwarded to this component
44
- as `componentRef` .
45
- */
46
- componentRef?: object | Function;
47
- /**
48
- * The property on each `childComponent` that receives the index of the item in the `Repeater` .
49
- */
50
- indexProp?: string;
51
- /**
52
- * An object containing properties to be passed to each child.
53
- */
54
- itemProps?: object;
55
- }
56
- /**
57
- * A stateless component that stamps out copies of `childComponent` , without
58
- applied.
59
- */
60
-
61
- export class RepeaterBase extends React.Component<
62
- Merge<React.HTMLProps<HTMLElement>, RepeaterBaseProps>
63
- > {}
64
-
65
- export interface RepeaterDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
66
- export function RepeaterDecorator<P>(
67
- Component: React.ComponentType<P> | string
68
- ): React.ComponentType<P & RepeaterDecoratorProps>;
69
-
70
- export interface RepeaterProps
71
- extends Omit<
72
- Merge<RepeaterBaseProps, RepeaterDecoratorProps>,
73
- "componentRef"
74
- > {}
75
- /**
76
- * A stateless component that stamps out copies of `childComponent` .
77
- */
78
-
79
- export class Repeater extends React.Component<
80
- Merge<React.HTMLProps<HTMLElement>, RepeaterProps>
81
- > {}
82
-
83
- export default Repeater;
@@ -1,31 +0,0 @@
1
- // Type definitions for ui/Resizable
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 ResizableConfig extends Object {
7
- /**
8
- * A handler to process the `resize` event.
9
- *
10
- * It should return a truthy value if the event should trigger a resize.
11
- */
12
- filter?: Function;
13
- /**
14
- * The name of the event on the wrapped component to listen to for size changes.
15
- *
16
- * This event name will be passed to the wrapped component and will also be forwarded (if
17
- needed) to the parent component.
18
- */
19
- resize: string;
20
- }
21
- export interface ResizableProps {}
22
- export function Resizable<P>(
23
- config: ResizableConfig,
24
- Component: React.ComponentType<P> | string
25
- ): React.ComponentType<P & ResizableProps>;
26
-
27
- export function Resizable<P>(
28
- Component: React.ComponentType<P> | string
29
- ): React.ComponentType<P & ResizableProps>;
30
-
31
- export default Resizable;