@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.
- package/CHANGELOG.md +15 -0
- package/FloatingLayer/package.json +3 -0
- package/IconButton/IconButton.js +7 -2
- package/RadioDecorator/RadioControllerDecorator.js +6 -0
- package/RadioDecorator/RadioDecorator.js +5 -0
- package/Scroller/UiScrollerBase.js +6 -0
- package/SlotItem/SlotItem.js +6 -2
- package/ToggleItem/ToggleItem.js +6 -2
- package/Touchable/Pinch.js +185 -0
- package/Touchable/Touch.js +34 -11
- package/Touchable/Touchable.js +63 -4
- package/Touchable/config.js +19 -2
- package/Touchable/tests/Touchable-specs.js +96 -6
- package/Touchable/useTouch.js +41 -32
- package/VirtualList/UiVirtualListBase.js +6 -0
- package/package.json +2 -2
- package/AnnounceDecorator/AnnounceDecorator.d.ts +0 -64
- package/BodyText/BodyText.d.ts +0 -66
- package/Button/Button.d.ts +0 -125
- package/Cancelable/Cancelable.d.ts +0 -64
- package/Changeable/Changeable.d.ts +0 -54
- package/ComponentOverride/ComponentOverride.d.ts +0 -52
- package/ForwardRef/ForwardRef.d.ts +0 -22
- package/GridListImageItem/GridListImageItem.d.ts +0 -85
- package/Group/Group.d.ts +0 -107
- package/Heading/Heading.d.ts +0 -90
- package/Icon/Icon.d.ts +0 -88
- package/IconButton/IconButton.d.ts +0 -115
- package/Image/Image.d.ts +0 -113
- package/ImageItem/ImageItem.d.ts +0 -83
- package/Item/Item.d.ts +0 -64
- package/LabeledIcon/LabeledIcon.d.ts +0 -130
- package/Layout/Layout.d.ts +0 -247
- package/Marquee/index.d.ts +0 -258
- package/Measurable/Measurable.d.ts +0 -26
- package/Media/Media.d.ts +0 -99
- package/Placeholder/index.d.ts +0 -53
- package/ProgressBar/ProgressBar.d.ts +0 -92
- package/RadioDecorator/RadioDecorator.d.ts +0 -35
- package/Repeater/Repeater.d.ts +0 -83
- package/Resizable/Resizable.d.ts +0 -31
- package/Routable/Routable.d.ts +0 -148
- package/Scrollable/Scrollable.d.ts +0 -0
- package/Scroller/Scroller.d.ts +0 -276
- package/Skinnable/Skinnable.d.ts +0 -94
- package/Slider/Slider.d.ts +0 -202
- package/SlotItem/SlotItem.d.ts +0 -118
- package/Slottable/Slottable.d.ts +0 -22
- package/Spinner/Spinner.d.ts +0 -95
- package/ToggleIcon/ToggleIcon.d.ts +0 -90
- package/ToggleItem/ToggleItem.d.ts +0 -134
- package/Toggleable/Toggleable.d.ts +0 -103
- package/Touchable/Touchable.d.ts +0 -175
- package/Transition/Transition.d.ts +0 -196
- package/ViewManager/ViewManager.d.ts +0 -191
- package/VirtualList/VirtualList.d.ts +0 -530
- package/index.d.ts +0 -0
- package/internal/IdProvider/IdProvider.d.ts +0 -0
- package/internal/Pure/Pure.d.ts +0 -0
- package/internal/localized-fonts/localized-fonts.d.ts +0 -53
- package/internal/selection/selection.d.ts +0 -0
- package/internal/validators/validators.d.ts +0 -0
- package/resolution/index.d.ts +0 -187
- package/useControlledState/useControlledState.d.ts +0 -0
- package/useScroll/useScroll.d.ts +0 -0
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// Type definitions for ui/Toggleable
|
|
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 ToggleableConfig extends Object {
|
|
7
|
-
/**
|
|
8
|
-
* Configures the event name that activates the component.
|
|
9
|
-
*
|
|
10
|
-
* Note : When using `activate` / `deactivate` , the event payload will only forward the original
|
|
11
|
-
event and not include toggled `prop` value. Use `toggle` to receive toggled value from the
|
|
12
|
-
event payload.
|
|
13
|
-
*
|
|
14
|
-
* Example:
|
|
15
|
-
* ```
|
|
16
|
-
const ToggleItem = Toggleable({activate: 'onFocus', deactivate: 'onBlur'}, Item);
|
|
17
|
-
|
|
18
|
-
handleEvent = (ev) => {
|
|
19
|
-
// do something with `ev.selected` here
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
<ToggleItem onToggle={handleEvent}>This is a toggle item</Item>
|
|
23
|
-
```
|
|
24
|
-
*/
|
|
25
|
-
activate?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Configures the event name that deactivates the component.
|
|
28
|
-
*
|
|
29
|
-
* Note : When using `activate` / `deactivate` , the event payload will only forward the original
|
|
30
|
-
event and not include toggled `prop` value. Use `toggle` to receive toggled value from the
|
|
31
|
-
event payload.
|
|
32
|
-
*
|
|
33
|
-
* Example:
|
|
34
|
-
* ```
|
|
35
|
-
const ToggleItem = Toggleable({activate: 'onFocus', deactivate: 'onBlur'}, Item);
|
|
36
|
-
|
|
37
|
-
handleEvent = (ev) => {
|
|
38
|
-
// do something with `ev.selected` here
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
<ToggleItem onToggle={handleEvent}>This is a toggle item</Item>
|
|
42
|
-
```
|
|
43
|
-
*/
|
|
44
|
-
deactivate?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Configures additional props to attach to the event that is sent when toggled.
|
|
47
|
-
*/
|
|
48
|
-
eventProps?: string[];
|
|
49
|
-
/**
|
|
50
|
-
* Configures the property that is passed to the wrapped component when toggled.
|
|
51
|
-
*/
|
|
52
|
-
prop?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Configures the event name that toggles the component.
|
|
55
|
-
*
|
|
56
|
-
* The payload includes a toggled Boolean value of `prop` .
|
|
57
|
-
*
|
|
58
|
-
* Note : The payload will override the original event. If a native event is set, then the native
|
|
59
|
-
event payload will be lost.
|
|
60
|
-
*/
|
|
61
|
-
toggle?: string;
|
|
62
|
-
/**
|
|
63
|
-
* Allows you to remap the incoming `toggle` callback to an event name of your choosing.
|
|
64
|
-
*
|
|
65
|
-
* For example, run `onToggle` when the wrapped component has an `onClick` property and you've specified
|
|
66
|
-
`onClick` here.
|
|
67
|
-
*/
|
|
68
|
-
toggleProp?: string;
|
|
69
|
-
}
|
|
70
|
-
export interface ToggleableProps {
|
|
71
|
-
/**
|
|
72
|
-
* Default toggled state applied at construction when the toggled prop is `undefined` or
|
|
73
|
-
`null` .
|
|
74
|
-
*/
|
|
75
|
-
defaultSelected?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Whether or not the component is in a disabled state.
|
|
78
|
-
*/
|
|
79
|
-
disabled?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* Current toggled state.
|
|
82
|
-
*
|
|
83
|
-
* When set at construction, the component is considered 'controlled' and will only
|
|
84
|
-
update its internal value when updated by new props. If undefined, the component
|
|
85
|
-
is 'uncontrolled' and `Toggleable` will manage the toggled state using callbacks
|
|
86
|
-
defined by its configuration.
|
|
87
|
-
*/
|
|
88
|
-
selected?: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Event callback to notify that state should be toggled.
|
|
91
|
-
*/
|
|
92
|
-
onToggle?: Function;
|
|
93
|
-
}
|
|
94
|
-
export function Toggleable<P>(
|
|
95
|
-
config: ToggleableConfig,
|
|
96
|
-
Component: React.ComponentType<P> | string
|
|
97
|
-
): React.ComponentType<P & ToggleableProps>;
|
|
98
|
-
|
|
99
|
-
export function Toggleable<P>(
|
|
100
|
-
Component: React.ComponentType<P> | string
|
|
101
|
-
): React.ComponentType<P & ToggleableProps>;
|
|
102
|
-
|
|
103
|
-
export default Toggleable;
|
package/Touchable/Touchable.d.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
// Type definitions for ui/Touchable
|
|
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 TouchableConfig extends Object {
|
|
7
|
-
/**
|
|
8
|
-
* Configures the prop name to pass the active state to the wrapped component
|
|
9
|
-
*/
|
|
10
|
-
activeProp?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface TouchableProps {
|
|
13
|
-
/**
|
|
14
|
-
* Disables the component.
|
|
15
|
-
*/
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Instance-specific overrides of the drag configuration.
|
|
19
|
-
*/
|
|
20
|
-
dragConfig?: object;
|
|
21
|
-
/**
|
|
22
|
-
* Instance-specific overrides of the flick configuration.
|
|
23
|
-
*/
|
|
24
|
-
flickConfig?: object;
|
|
25
|
-
/**
|
|
26
|
-
* Instance-specific overrides of the hold configuration.
|
|
27
|
-
*/
|
|
28
|
-
holdConfig?: object;
|
|
29
|
-
/**
|
|
30
|
-
* Prevents resuming the touch events and gestures when re-entering the component.
|
|
31
|
-
*/
|
|
32
|
-
noResume?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Event handler for 'down' pointer events.
|
|
35
|
-
*/
|
|
36
|
-
onDown?: Function;
|
|
37
|
-
/**
|
|
38
|
-
* Event handler for a drag gesture.
|
|
39
|
-
*
|
|
40
|
-
* Event payload includes:
|
|
41
|
-
* * `type` - Type of event, `'onDrag'`
|
|
42
|
-
* * `x` - Horizontal position of the drag, relative to the viewport
|
|
43
|
-
* * `y` - Vertical position of the drag, relative to the viewport
|
|
44
|
-
*/
|
|
45
|
-
onDrag?: Function;
|
|
46
|
-
/**
|
|
47
|
-
* Event handler for the end of a drag gesture.
|
|
48
|
-
*
|
|
49
|
-
* Event payload includes:
|
|
50
|
-
* * `type` - Type of event, `'onDragEnd'`
|
|
51
|
-
*/
|
|
52
|
-
onDragEnd?: Function;
|
|
53
|
-
/**
|
|
54
|
-
* Event handler for the start of a drag gesture.
|
|
55
|
-
*
|
|
56
|
-
* Event payload includes:
|
|
57
|
-
* * `type` - Type of event, `'onDragStart'`
|
|
58
|
-
* * `x` - Horizontal position of the drag, relative to the viewport
|
|
59
|
-
* * `y` - Vertical position of the drag, relative to the viewport
|
|
60
|
-
*/
|
|
61
|
-
onDragStart?: Function;
|
|
62
|
-
/**
|
|
63
|
-
* Event handler for a flick gesture.
|
|
64
|
-
*
|
|
65
|
-
* Event payload includes:
|
|
66
|
-
* * `type` - Type of event, `'onFlick'`
|
|
67
|
-
* * `direction` - Primary direction of the flick, either `'horizontal'` or `'vertical'`
|
|
68
|
-
* * `velocity` - Velocity of flick
|
|
69
|
-
* * `velocityX` - Velocity of flick along te horizontal axis
|
|
70
|
-
* * `velocityY` - Velocity of flick along te vertical axis
|
|
71
|
-
*/
|
|
72
|
-
onFlick?: Function;
|
|
73
|
-
/**
|
|
74
|
-
* Event handler for hold pulse events.
|
|
75
|
-
*
|
|
76
|
-
* Event payload includes:
|
|
77
|
-
* * `type` - Type of event, `'onHold'`
|
|
78
|
-
* * `time` - Time, in milliseconds, since the hold began
|
|
79
|
-
*/
|
|
80
|
-
onHold?: Function;
|
|
81
|
-
/**
|
|
82
|
-
* Event handler for the end of hold events.
|
|
83
|
-
*
|
|
84
|
-
* Event payload includes:
|
|
85
|
-
* * `type` - Type of event, `'onHoldEnd'`
|
|
86
|
-
* * `time` - Time, in milliseconds, since the hold began
|
|
87
|
-
*/
|
|
88
|
-
onHoldEnd?: Function;
|
|
89
|
-
/**
|
|
90
|
-
* Event handler for hold events.
|
|
91
|
-
*
|
|
92
|
-
* Event payload includes:
|
|
93
|
-
* * `type` - Type of event, `'onHoldStart'`
|
|
94
|
-
* * `name` - The name of the hold as configured in the events list
|
|
95
|
-
* * `time` - Time, in milliseconds, configured for this hold which may vary slightly
|
|
96
|
-
from time since the hold began
|
|
97
|
-
*/
|
|
98
|
-
onHoldStart?: Function;
|
|
99
|
-
/**
|
|
100
|
-
* Event handler for 'move' pointer events.
|
|
101
|
-
*/
|
|
102
|
-
onMove?: Function;
|
|
103
|
-
/**
|
|
104
|
-
* Event handler for 'tap' pointer events.
|
|
105
|
-
*/
|
|
106
|
-
onTap?: Function;
|
|
107
|
-
/**
|
|
108
|
-
* Event handler for 'up' pointer events.
|
|
109
|
-
*/
|
|
110
|
-
onUp?: Function;
|
|
111
|
-
}
|
|
112
|
-
export function Touchable<P>(
|
|
113
|
-
config: TouchableConfig,
|
|
114
|
-
Component: React.ComponentType<P> | string
|
|
115
|
-
): React.ComponentType<P & TouchableProps>;
|
|
116
|
-
|
|
117
|
-
export function Touchable<P>(
|
|
118
|
-
Component: React.ComponentType<P> | string
|
|
119
|
-
): React.ComponentType<P & TouchableProps>;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Configures the global gesture configuration for the application.
|
|
123
|
-
*
|
|
124
|
-
* Example:
|
|
125
|
-
* ```
|
|
126
|
-
// Updates the `maxMoves`, `moveTolerance`, and `frequency` configurations while retaining the
|
|
127
|
-
// current value of all other configurations
|
|
128
|
-
configure({
|
|
129
|
-
flick: {
|
|
130
|
-
maxMoves: 10
|
|
131
|
-
},
|
|
132
|
-
hold: {
|
|
133
|
-
moveTolerance: 32,
|
|
134
|
-
frequency: 400
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
* Each type of gesture has its own set of configuration properties grouped within a separate object
|
|
140
|
-
keyed by the name of the gesture. Partial configurations may be passed and will be merged with
|
|
141
|
-
the current configuration.
|
|
142
|
-
*
|
|
143
|
-
* `drag`
|
|
144
|
-
* * `boxSizing` - The part of the component's box model is used as the bounds of the constraint.
|
|
145
|
-
Only applies when `global` is `false` .
|
|
146
|
-
* * `'border-box'` - the default, includes the padding and border but excludes the margin.
|
|
147
|
-
* * `'content-box'` - excludes the padding, border, and margin.
|
|
148
|
-
* * `global` - When `true` , drag gestures will continue when leaving the bounds of the component
|
|
149
|
-
or blurring the component.
|
|
150
|
-
* * `moveTolerance` - The number of pixels from the start position of the drag that the pointer
|
|
151
|
-
may move before cancelling the drag. Defaults to `16` .
|
|
152
|
-
*
|
|
153
|
-
* `flick`
|
|
154
|
-
* * `maxDuration` - The amount of time, in milliseconds, to complete a flick gesture before it
|
|
155
|
-
is cancelled. Defaults to 250.
|
|
156
|
-
* * `maxMoves` - The number of moves tracked to determine if a flick occurred. Defaults to `5` .
|
|
157
|
-
* * `minVelocity` - The minimum threshold, measured as the change in pixels over the change in
|
|
158
|
-
time per move, that must be exceeded to generate a `onFlick` event.
|
|
159
|
-
*
|
|
160
|
-
* `hold`
|
|
161
|
-
* * `cancelOnMove` - When `true` , the hold is cancelled when moving beyond the `moveTolerance` .
|
|
162
|
-
Defaults to `false`
|
|
163
|
-
* * `global` - When `true` , hold gestures will continue when leaving the bounds of the component
|
|
164
|
-
or blurring the component.
|
|
165
|
-
* * `moveTolerance` - The number of pixels from the start position of the hold that the pointer
|
|
166
|
-
may move before cancelling the hold. Ignored when `cancelOnMove` is `false` . Defaults to
|
|
167
|
-
`16` .
|
|
168
|
-
* * `frequency` - The time, in milliseconds, to poll for hold events. Defaults to `200` .
|
|
169
|
-
* * `events` - An array of `onHoldStart` events which each contain a `name` and `time` . The `time`
|
|
170
|
-
controls the amount of time that must pass before this `onHoldStart` event is fired and should
|
|
171
|
-
be a multiple of `frequency` .
|
|
172
|
-
*/
|
|
173
|
-
export function configure(cfg: object): void;
|
|
174
|
-
|
|
175
|
-
export default Touchable;
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
// Type definitions for ui/Transition
|
|
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 TransitionBaseProps {
|
|
9
|
-
/**
|
|
10
|
-
* Provide a function to get the reference to the child node (the one with the content) at
|
|
11
|
-
render time.
|
|
12
|
-
*
|
|
13
|
-
* Useful if you need to measure or interact with the node directly.
|
|
14
|
-
*/
|
|
15
|
-
childRef?: object | Function;
|
|
16
|
-
/**
|
|
17
|
-
* The node to be transitioned.
|
|
18
|
-
*/
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* The height of the transition when `type` is set to `'clip'` , used when direction is
|
|
22
|
-
'left' or 'right'.
|
|
23
|
-
*/
|
|
24
|
-
clipHeight?: number;
|
|
25
|
-
/**
|
|
26
|
-
* The width of the transition when `type` is set to `'clip'` , used when direction is 'left'
|
|
27
|
-
or 'right'.
|
|
28
|
-
*/
|
|
29
|
-
clipWidth?: number;
|
|
30
|
-
/**
|
|
31
|
-
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
32
|
-
corresponding internal elements and states of this component.
|
|
33
|
-
*
|
|
34
|
-
* The following classes are supported:
|
|
35
|
-
* * `transition` - The root component class
|
|
36
|
-
* * `inner` - The element inside the transition. This is the container for the transitioning content.
|
|
37
|
-
* * `shown` - Applied when content is present (visible), related to the `visible` prop/state
|
|
38
|
-
* * `hidden` - Applied when content is not present (hiding), related to the `visible` prop/state
|
|
39
|
-
* * `slide` - Applied when the `slide` `type` is set
|
|
40
|
-
* * `fade` - Applied when the `fade` `type` is set
|
|
41
|
-
* * `clip` - Applied when the `clip` `type` is set
|
|
42
|
-
* * `up` - Applied when the `direction` `up` is set
|
|
43
|
-
* * `right` - Applied when the `direction` `right` is set
|
|
44
|
-
* * `down` - Applied when the `direction` `down` is set
|
|
45
|
-
* * `left` - Applied when the `direction` `left` is set
|
|
46
|
-
* * `short` - Applied when the `duration` `short` is set
|
|
47
|
-
* * `medium` - Applied when the `duration` `medium` is set
|
|
48
|
-
* * `long` - Applied when the `duration` `long` is set
|
|
49
|
-
* * `ease` - Applied when the `timingFunction` `ease` is set
|
|
50
|
-
* * `ease-in` - Applied when the `timingFunction` `ease-in` is set
|
|
51
|
-
* * `ease-out` - Applied when the `timingFunction` `ease-out` is set
|
|
52
|
-
* * `ease-in-out` - Applied when the `timingFunction` `ease-in-out` is set
|
|
53
|
-
* * `ease-in-quart` - Applied when the `timingFunction` `ease-in-quart` is set
|
|
54
|
-
* * `ease-out-quart` - Applied when the `timingFunction` `ease-out-quart` is set
|
|
55
|
-
* * `linear` - Applied when the `timingFunction` `linear` is set
|
|
56
|
-
*/
|
|
57
|
-
css?: object;
|
|
58
|
-
/**
|
|
59
|
-
* Sets the direction of transition. Where the component will move _to_ ; the destination.
|
|
60
|
-
Supported directions are: `'up'` , `'right'` , `'down'` , `'left'` .
|
|
61
|
-
*/
|
|
62
|
-
direction?: string;
|
|
63
|
-
/**
|
|
64
|
-
* Controls how long the transition should take.
|
|
65
|
-
Supported preset durations are: `'short'` (250ms), `'medium'` (500ms), and `'long'` (1s).
|
|
66
|
-
`'medium'` (500ms) is default when no others are specified.
|
|
67
|
-
Any valid CSS duration value is also accepted, e.g. "200ms" or "3s". Pure numeric values
|
|
68
|
-
are also supported and treated as milliseconds.
|
|
69
|
-
*/
|
|
70
|
-
duration?: string | number;
|
|
71
|
-
/**
|
|
72
|
-
* Disables transition animation.
|
|
73
|
-
*
|
|
74
|
-
* When `false` , visibility changes animate.
|
|
75
|
-
*/
|
|
76
|
-
noAnimation?: boolean;
|
|
77
|
-
/**
|
|
78
|
-
* The transition timing function.
|
|
79
|
-
* * Supported function names are: `ease` , `ease-in` , `ease-out` , `ease-in-out` , `ease-in-quart` ,
|
|
80
|
-
*
|
|
81
|
-
* `ease-out-quart` , and `linear` .
|
|
82
|
-
*/
|
|
83
|
-
timingFunction?: string;
|
|
84
|
-
/**
|
|
85
|
-
* The type of transition to affect the content.
|
|
86
|
-
* * Supported types are: `'slide'` , `'clip'` , and `'fade'` .
|
|
87
|
-
*
|
|
88
|
-
* Details on types:
|
|
89
|
-
* * `'slide'` - Typically used for bringing something which is off the edge of the screen,
|
|
90
|
-
and not visible, onto the screen. Think of a popup, toast, notification, dialog, or
|
|
91
|
-
an overlaying menu. This requires no re-rendering or repainting of the screen during
|
|
92
|
-
the transition, making it very performant. However, this does not affect layout at
|
|
93
|
-
all, which makes it less useful for transitioning from a place already on the
|
|
94
|
-
screen.
|
|
95
|
-
* * `'clip'` - This is useful for showing a component that transitions-in from a location
|
|
96
|
-
that is already on the screen. Examples would be an expanding header or an
|
|
97
|
-
accordion. This type does affects layout, its current size will push other sibling
|
|
98
|
-
elements to make room for itself. Because of this, repainting the layout does happen
|
|
99
|
-
during transition.
|
|
100
|
-
* * `'fade'` - Fade the components onto the screen, from 0 opacity (completely invisible)
|
|
101
|
-
to 1 (full visibility). Pretty basic, but useful for fading on/off a tooltip, a
|
|
102
|
-
menu, a panel, or even view contents. This does not affect layout at all.
|
|
103
|
-
*/
|
|
104
|
-
type?: string;
|
|
105
|
-
/**
|
|
106
|
-
* Sets the visibility of the component, which determines whether it's on screen or off.
|
|
107
|
-
*/
|
|
108
|
-
visible?: boolean;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* The stateless structure of the component.
|
|
112
|
-
*
|
|
113
|
-
* In case you want to provide all of the state yourself.
|
|
114
|
-
In general, you'll probably want to use the `Transition` instead of `TransitionBase` .
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
export class TransitionBase extends React.Component<
|
|
118
|
-
Merge<React.HTMLProps<HTMLElement>, TransitionBaseProps>
|
|
119
|
-
> {}
|
|
120
|
-
|
|
121
|
-
export interface TransitionProps {
|
|
122
|
-
/**
|
|
123
|
-
* The node to be transitioned.
|
|
124
|
-
*/
|
|
125
|
-
children?: React.ReactNode;
|
|
126
|
-
/**
|
|
127
|
-
* The direction of transition (i.e. where the component will move _to_ ; the destination).
|
|
128
|
-
* * Supported directions are: `'up'` , `'right'` , `'down'` , `'left'` .
|
|
129
|
-
*/
|
|
130
|
-
direction?: string;
|
|
131
|
-
/**
|
|
132
|
-
* Controls how long the transition should take.
|
|
133
|
-
* * Supported preset durations are: `'short'` (250ms), `'medium'` (500ms), and `'long'` (1s).
|
|
134
|
-
*
|
|
135
|
-
* `'medium'` (500ms) is default when no others are specified.
|
|
136
|
-
*
|
|
137
|
-
* Any valid CSS duration value is also accepted, e.g. "200ms" or "3s". Pure numeric values
|
|
138
|
-
are also supported and treated as miliseconds.
|
|
139
|
-
*/
|
|
140
|
-
duration?: string | number;
|
|
141
|
-
/**
|
|
142
|
-
* Disables transition animation.
|
|
143
|
-
*
|
|
144
|
-
* When `false` , visibility changes animate.
|
|
145
|
-
*/
|
|
146
|
-
noAnimation?: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Called after transition for hiding is finished.
|
|
149
|
-
*/
|
|
150
|
-
onHide?: Function;
|
|
151
|
-
/**
|
|
152
|
-
* Called after transition for showing is finished.
|
|
153
|
-
*/
|
|
154
|
-
onShow?: Function;
|
|
155
|
-
/**
|
|
156
|
-
* The transition timing function.
|
|
157
|
-
Supported function names are: `ease` , `ease-in` , `ease-out` , `ease-in-out` , `ease-in-quart` ,
|
|
158
|
-
`ease-out-quart` , and `linear` .
|
|
159
|
-
*/
|
|
160
|
-
timingFunction?: string;
|
|
161
|
-
/**
|
|
162
|
-
* The type of transition to affect the content.
|
|
163
|
-
* * Supported types are: `'slide'` , `'clip'` , and `'fade'` .
|
|
164
|
-
*
|
|
165
|
-
* Details on types:
|
|
166
|
-
* * `'slide'` - Typically used for bringing something which is off the edge of the screen,
|
|
167
|
-
and not visible, onto the screen. Think of a popup, toast, notification, dialog, or
|
|
168
|
-
an overlaying menu. This requires no re-rendering or repainting of the screen during
|
|
169
|
-
the transition, making it very performant. However, this does not affect layout at
|
|
170
|
-
all, which makes it less useful for transitioning from a place already on the
|
|
171
|
-
screen.
|
|
172
|
-
* * `'clip'` - This is useful for showing a component that transitions-in from a location
|
|
173
|
-
that is already on the screen. Examples would be an expanding header or an
|
|
174
|
-
accordion. This type does affects layout, its current size will push other sibling
|
|
175
|
-
elements to make room for itself. Because of this, repainting the layout does happen
|
|
176
|
-
during transition.
|
|
177
|
-
* * `'fade'` - Fade the components onto the screen, from 0 opacity (completely invisible)
|
|
178
|
-
to 1 (full visibility). Pretty basic, but useful for fading on/off a tooltip, a
|
|
179
|
-
menu, a panel, or even view contents. This does not affect layout at all.
|
|
180
|
-
*/
|
|
181
|
-
type?: string;
|
|
182
|
-
/**
|
|
183
|
-
* The visibility of the component, which determines whether it's on the screen or off.
|
|
184
|
-
*/
|
|
185
|
-
visible?: boolean;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* A stateful component that allows for applying transitions to its child items via configurable
|
|
189
|
-
properties and events.
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
export class Transition extends React.Component<
|
|
193
|
-
Merge<React.HTMLProps<HTMLElement>, TransitionProps>
|
|
194
|
-
> {}
|
|
195
|
-
|
|
196
|
-
export default Transition;
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
// Type definitions for ui/ViewManager
|
|
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 ViewManagerBaseProps {
|
|
10
|
-
/**
|
|
11
|
-
* Arranger to control the animation
|
|
12
|
-
*/
|
|
13
|
-
arranger?: Arranger;
|
|
14
|
-
/**
|
|
15
|
-
* An object containing properties to be passed to each child.
|
|
16
|
-
*/
|
|
17
|
-
childProps?: object;
|
|
18
|
-
/**
|
|
19
|
-
* Views to be managed.
|
|
20
|
-
*
|
|
21
|
-
* May be any renderable component including custom React components or primitive DOM nodes.
|
|
22
|
-
*/
|
|
23
|
-
children?: React.ReactNode;
|
|
24
|
-
/**
|
|
25
|
-
* Type of component wrapping the children. May be a DOM node or a custom React component.
|
|
26
|
-
*/
|
|
27
|
-
component?: string | React.ComponentType;
|
|
28
|
-
/**
|
|
29
|
-
* Called with a reference to the root component.
|
|
30
|
-
*
|
|
31
|
-
* When using , the `ref` prop is forwarded to this
|
|
32
|
-
component as `componentRef` .
|
|
33
|
-
*/
|
|
34
|
-
componentRef?: object | Function;
|
|
35
|
-
/**
|
|
36
|
-
* Time in milliseconds to complete a transition
|
|
37
|
-
*/
|
|
38
|
-
duration?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Index of last visible view.
|
|
41
|
-
*
|
|
42
|
-
* Defaults to the current value of `index` .
|
|
43
|
-
*/
|
|
44
|
-
end?: number;
|
|
45
|
-
/**
|
|
46
|
-
* Time, in milliseconds, to wait after a view has entered to inform it by pass the
|
|
47
|
-
`enteringProp` as false.
|
|
48
|
-
*/
|
|
49
|
-
enteringDelay?: number;
|
|
50
|
-
/**
|
|
51
|
-
* Name of the property to pass to the wrapped view to indicate when it is entering the
|
|
52
|
-
viewport.
|
|
53
|
-
*
|
|
54
|
-
* When `true` , the view has been created but has not transitioned into place.
|
|
55
|
-
When `false` , the view has finished its transition.
|
|
56
|
-
*
|
|
57
|
-
* The notification can be delayed by setting `enteringDelay` . If not set, the view will not
|
|
58
|
-
be notified of the change in transition.
|
|
59
|
-
*/
|
|
60
|
-
enteringProp?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Index of active view
|
|
63
|
-
*/
|
|
64
|
-
index?: number;
|
|
65
|
-
/**
|
|
66
|
-
* Indicates if the transition should be animated
|
|
67
|
-
*/
|
|
68
|
-
noAnimation?: boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Called when each view is rendered during initial construction.
|
|
71
|
-
*/
|
|
72
|
-
onAppear?: Function;
|
|
73
|
-
/**
|
|
74
|
-
* Called when each view completes its transition into the viewport.
|
|
75
|
-
*/
|
|
76
|
-
onEnter?: Function;
|
|
77
|
-
/**
|
|
78
|
-
* Called when each view completes its transition out of the viewport.
|
|
79
|
-
*/
|
|
80
|
-
onLeave?: Function;
|
|
81
|
-
/**
|
|
82
|
-
* Called when each view completes its transition within the viewport.
|
|
83
|
-
*/
|
|
84
|
-
onStay?: Function;
|
|
85
|
-
/**
|
|
86
|
-
* Called once when all views have completed their transition.
|
|
87
|
-
*/
|
|
88
|
-
onTransition?: Function;
|
|
89
|
-
/**
|
|
90
|
-
* Called once before views begin their transition.
|
|
91
|
-
*/
|
|
92
|
-
onWillTransition?: Function;
|
|
93
|
-
/**
|
|
94
|
-
* Explicitly sets the transition direction.
|
|
95
|
-
*
|
|
96
|
-
* If omitted, the direction is determined automatically based on the change of index or a
|
|
97
|
-
string comparison of the first child's key.
|
|
98
|
-
*/
|
|
99
|
-
reverseTransition?: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Indicates the current locale uses right-to-left reading order.
|
|
102
|
-
*
|
|
103
|
-
* `rtl` is passed to the `arranger` in order to alter the animation (e.g. reversing the
|
|
104
|
-
horizontal direction).
|
|
105
|
-
*/
|
|
106
|
-
rtl?: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Index of first visible view. Defaults to the current value of `index` .
|
|
109
|
-
*/
|
|
110
|
-
start?: number;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* The base `ViewManager` component, without
|
|
114
|
-
applied.
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
|
-
export class ViewManagerBase extends React.Component<
|
|
118
|
-
Merge<React.HTMLProps<HTMLElement>, ViewManagerBaseProps>
|
|
119
|
-
> {}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* A function that generates an animation for a given transition configuration
|
|
123
|
-
*/
|
|
124
|
-
export interface ArrangerCallback {
|
|
125
|
-
(
|
|
126
|
-
/**
|
|
127
|
-
* Animation configuration object.
|
|
128
|
-
*/
|
|
129
|
-
config: object
|
|
130
|
-
): any;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* An object with callback functions to arrange views within .
|
|
134
|
-
*/
|
|
135
|
-
export interface Arranger {
|
|
136
|
-
/**
|
|
137
|
-
* Returns an array of keyframes describing the animation when
|
|
138
|
-
a view is entering the viewport.
|
|
139
|
-
*/
|
|
140
|
-
enter: ArrangerCallback /**
|
|
141
|
-
* Returns an array of keyframes describing the animation when
|
|
142
|
-
a view is leaving the viewport.
|
|
143
|
-
*/;
|
|
144
|
-
leave: ArrangerCallback /**
|
|
145
|
-
* Returns an array of keyframes describing the animation when
|
|
146
|
-
a view is remaining in the viewport.
|
|
147
|
-
*/;
|
|
148
|
-
stay?: ArrangerCallback;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* A basic arranger factory that must be configured with `direction` and optionally an `amount` .
|
|
152
|
-
*/
|
|
153
|
-
export function SlideArranger(config: object): Arranger;
|
|
154
|
-
/**
|
|
155
|
-
* An arranger that enters from the left and leaves to the right.
|
|
156
|
-
*/
|
|
157
|
-
export declare const SlideRightArranger: Arranger;
|
|
158
|
-
/**
|
|
159
|
-
* An arranger that enters from the right and leaves to the left..
|
|
160
|
-
*/
|
|
161
|
-
export declare const SlideLeftArranger: Arranger;
|
|
162
|
-
/**
|
|
163
|
-
* An arranger that enters from the bottom and leaves to the top..
|
|
164
|
-
*/
|
|
165
|
-
export declare const SlideTopArranger: Arranger;
|
|
166
|
-
/**
|
|
167
|
-
* An arranger that enters from the top and leaves to the bottom..
|
|
168
|
-
*/
|
|
169
|
-
export declare const SlideBottomArranger: Arranger;
|
|
170
|
-
|
|
171
|
-
export interface ViewManagerDecoratorProps
|
|
172
|
-
extends ui_ForwardRef_ForwardRefProps {}
|
|
173
|
-
export function ViewManagerDecorator<P>(
|
|
174
|
-
Component: React.ComponentType<P> | string
|
|
175
|
-
): React.ComponentType<P & ViewManagerDecoratorProps>;
|
|
176
|
-
|
|
177
|
-
export interface ViewManagerProps
|
|
178
|
-
extends Omit<
|
|
179
|
-
Merge<ViewManagerBaseProps, ViewManagerDecoratorProps>,
|
|
180
|
-
"componentRef"
|
|
181
|
-
> {}
|
|
182
|
-
/**
|
|
183
|
-
* A `ViewManager` controls the visibility of a configurable number of views, allowing for them to be
|
|
184
|
-
transitioned on and off the viewport.
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
export class ViewManager extends React.Component<
|
|
188
|
-
Merge<React.HTMLProps<HTMLElement>, ViewManagerProps>
|
|
189
|
-
> {}
|
|
190
|
-
|
|
191
|
-
export default ViewManager;
|