@enact/ui 4.6.1 → 4.7.0

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 (168) hide show
  1. package/AnnounceDecorator/Announce.js +27 -15
  2. package/AnnounceDecorator/AnnounceDecorator.d.ts +64 -0
  3. package/AnnounceDecorator/AnnounceDecorator.js +15 -6
  4. package/AnnounceDecorator/useAnnounce.js +1 -2
  5. package/BodyText/BodyText.d.ts +66 -0
  6. package/BodyText/BodyText.js +14 -6
  7. package/Button/Button.d.ts +125 -0
  8. package/Button/Button.js +18 -10
  9. package/CHANGELOG.md +14 -0
  10. package/Cancelable/Cancelable.d.ts +64 -0
  11. package/Cancelable/Cancelable.js +17 -9
  12. package/Cancelable/tests/Cancelable-specs.js +3 -1
  13. package/Changeable/Changeable.d.ts +54 -0
  14. package/Changeable/Changeable.js +15 -9
  15. package/ComponentOverride/ComponentOverride.d.ts +52 -0
  16. package/ComponentOverride/ComponentOverride.js +18 -5
  17. package/FloatingLayer/FloatingLayer.js +14 -13
  18. package/FloatingLayer/FloatingLayerContainer.js +3 -1
  19. package/FloatingLayer/FloatingLayerDecorator.js +11 -6
  20. package/FloatingLayer/Scrim.js +4 -2
  21. package/FloatingLayer/index.d.ts +100 -0
  22. package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +3 -1
  23. package/FloatingLayer/useFloatingLayer.js +2 -2
  24. package/ForwardRef/ForwardRef.d.ts +22 -0
  25. package/ForwardRef/ForwardRef.js +13 -7
  26. package/GridListImageItem/GridListImageItem.d.ts +85 -0
  27. package/GridListImageItem/GridListImageItem.js +16 -7
  28. package/Group/Group.d.ts +107 -0
  29. package/Group/Group.js +17 -6
  30. package/Group/GroupItem.js +16 -10
  31. package/Heading/Heading.d.ts +89 -0
  32. package/Heading/Heading.js +22 -9
  33. package/Icon/Icon.d.ts +88 -0
  34. package/Icon/Icon.js +15 -6
  35. package/IconButton/IconButton.d.ts +115 -0
  36. package/IconButton/IconButton.js +26 -11
  37. package/Image/Image.d.ts +113 -0
  38. package/Image/Image.js +16 -6
  39. package/ImageItem/ImageItem.d.ts +83 -0
  40. package/ImageItem/ImageItem.js +12 -2
  41. package/ImageItem/tests/ImageItem-specs.js +3 -1
  42. package/Item/Item.d.ts +64 -0
  43. package/Item/Item.js +17 -7
  44. package/LabeledIcon/LabeledIcon.d.ts +130 -0
  45. package/LabeledIcon/LabeledIcon.js +16 -6
  46. package/Layout/Cell.js +30 -5
  47. package/Layout/Layout.d.ts +284 -0
  48. package/Layout/Layout.js +181 -36
  49. package/Layout/Layout.module.css +8 -0
  50. package/Layout/tests/Layout-specs.js +44 -3
  51. package/Marquee/MarqueeBase.js +3 -1
  52. package/Marquee/MarqueeController.js +54 -2
  53. package/Marquee/MarqueeDecorator.js +44 -4
  54. package/Marquee/index.d.ts +258 -0
  55. package/Marquee/tests/Marquee-specs.js +3 -1
  56. package/Measurable/Measurable.d.ts +26 -0
  57. package/Measurable/Measurable.js +16 -10
  58. package/Measurable/tests/Measurable-specs.js +8 -6
  59. package/Media/Media.d.ts +99 -0
  60. package/Media/Media.js +36 -27
  61. package/Placeholder/PlaceholderControllerDecorator.js +13 -10
  62. package/Placeholder/PlaceholderDecorator.js +11 -10
  63. package/Placeholder/index.d.ts +53 -0
  64. package/ProgressBar/ProgressBar.d.ts +92 -0
  65. package/ProgressBar/ProgressBar.js +14 -1
  66. package/README.md +1 -1
  67. package/RadioDecorator/RadioControllerDecorator.js +4 -2
  68. package/RadioDecorator/RadioDecorator.d.ts +35 -0
  69. package/RadioDecorator/RadioDecorator.js +17 -9
  70. package/Repeater/Repeater.d.ts +82 -0
  71. package/Repeater/Repeater.js +16 -10
  72. package/Repeater/tests/Repeater-specs.js +3 -1
  73. package/Resizable/Resizable.d.ts +31 -0
  74. package/Resizable/Resizable.js +16 -10
  75. package/Routable/Link.js +12 -10
  76. package/Routable/Routable.d.ts +148 -0
  77. package/Routable/Routable.js +17 -8
  78. package/Routable/Router.js +14 -12
  79. package/Routable/tests/Routable-specs.js +5 -3
  80. package/Scrollable/ScrollAnimator.js +3 -1
  81. package/Scrollable/ScrollThumb.js +10 -9
  82. package/Scrollable/Scrollable.d.ts +0 -0
  83. package/Scrollable/Scrollable.js +27 -3
  84. package/Scrollable/ScrollableNative.js +16 -2
  85. package/Scrollable/Scrollbar.js +4 -2
  86. package/Scroller/Scroller.d.ts +276 -0
  87. package/Scroller/Scroller.js +10 -1
  88. package/Scroller/ScrollerBasic.js +12 -11
  89. package/Scroller/UiScrollerBase.js +15 -14
  90. package/Skinnable/Skinnable.d.ts +94 -0
  91. package/Skinnable/Skinnable.js +20 -6
  92. package/Skinnable/tests/Skinnable-specs.js +3 -1
  93. package/Skinnable/tests/useSkins-specs.js +3 -1
  94. package/Skinnable/useSkins.js +1 -2
  95. package/Slider/Knob.js +8 -6
  96. package/Slider/PositionDecorator.js +4 -2
  97. package/Slider/Slider.d.ts +202 -0
  98. package/Slider/Slider.js +18 -9
  99. package/SlotItem/SlotItem.d.ts +118 -0
  100. package/SlotItem/SlotItem.js +20 -6
  101. package/Slottable/Slottable.d.ts +22 -0
  102. package/Slottable/Slottable.js +16 -8
  103. package/Slottable/useSlots.js +3 -1
  104. package/Spinner/Spinner.d.ts +95 -0
  105. package/Spinner/Spinner.js +24 -7
  106. package/ToggleIcon/ToggleIcon.d.ts +90 -0
  107. package/ToggleIcon/ToggleIcon.js +21 -7
  108. package/ToggleItem/ToggleItem.d.ts +132 -0
  109. package/ToggleItem/ToggleItem.js +17 -2
  110. package/ToggleItem/tests/ToggleItem-specs.js +3 -1
  111. package/Toggleable/Toggle.js +4 -2
  112. package/Toggleable/Toggleable.d.ts +103 -0
  113. package/Toggleable/Toggleable.js +13 -7
  114. package/Toggleable/useToggle.js +1 -2
  115. package/Touchable/ClickAllow.js +3 -1
  116. package/Touchable/Drag.js +6 -3
  117. package/Touchable/Flick.js +6 -2
  118. package/Touchable/Hold.js +6 -2
  119. package/Touchable/Pinch.js +6 -3
  120. package/Touchable/Touch.js +6 -4
  121. package/Touchable/Touchable.d.ts +217 -0
  122. package/Touchable/Touchable.js +10 -1
  123. package/Touchable/config.js +3 -1
  124. package/Touchable/tests/useTouch-specs.js +3 -1
  125. package/Touchable/useTouch.js +5 -4
  126. package/Transition/Transition.d.ts +194 -0
  127. package/Transition/Transition.js +22 -4
  128. package/Transition/tests/Transition-specs.js +5 -3
  129. package/ViewManager/Arranger.js +6 -1
  130. package/ViewManager/TransitionGroup.js +8 -5
  131. package/ViewManager/View.js +7 -4
  132. package/ViewManager/ViewManager.d.ts +191 -0
  133. package/ViewManager/ViewManager.js +29 -11
  134. package/ViewManager/tests/ViewManager-specs.js +47 -1
  135. package/VirtualList/UiVirtualListBase.js +9 -3
  136. package/VirtualList/VirtualList.d.ts +528 -0
  137. package/VirtualList/VirtualList.js +13 -1
  138. package/VirtualList/VirtualListBasic.js +9 -3
  139. package/VirtualList/tests/VirtualGridList-native-specs.js +3 -1
  140. package/VirtualList/tests/VirtualGridList-specs.js +3 -1
  141. package/VirtualList/tests/VirtualList-native-specs.js +3 -1
  142. package/VirtualList/tests/VirtualList-specs.js +3 -1
  143. package/index.d.ts +0 -0
  144. package/internal/IdProvider/IdProvider.d.ts +0 -0
  145. package/internal/IdProvider/IdProvider.js +8 -7
  146. package/internal/IdProvider/Provider.js +3 -1
  147. package/internal/IdProvider/tests/IdProvider-specs.js +3 -1
  148. package/internal/IdProvider/tests/useId-specs.js +4 -3
  149. package/internal/IdProvider/useId.js +0 -1
  150. package/internal/Pure/Pure.d.ts +0 -0
  151. package/internal/Pure/Pure.js +15 -9
  152. package/internal/Pure/tests/Pure-specs.js +4 -2
  153. package/internal/localized-fonts/localized-fonts.d.ts +53 -0
  154. package/internal/localized-fonts/localized-fonts.js +2 -2
  155. package/internal/selection/selection.d.ts +0 -0
  156. package/internal/validators/validators.d.ts +0 -0
  157. package/package.json +2 -2
  158. package/resolution/ResolutionDecorator.js +40 -9
  159. package/resolution/index.d.ts +187 -0
  160. package/resolution/resolution.js +23 -7
  161. package/useControlledState/tests/useControlledState-specs.js +2 -2
  162. package/useControlledState/useControlledState.d.ts +0 -0
  163. package/useControlledState/useControlledState.js +2 -2
  164. package/useScroll/ScrollAnimator.js +3 -1
  165. package/useScroll/Scrollbar.js +6 -4
  166. package/useScroll/ScrollbarTrack.js +8 -6
  167. package/useScroll/useScroll.d.ts +0 -0
  168. package/useScroll/useScroll.js +80 -52
@@ -17,8 +17,10 @@ var _Hold = require("./Hold");
17
17
  var _Pinch = require("./Pinch");
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
19
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
- 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, descriptor.key, descriptor); } }
20
+ 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); } }
21
21
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
22
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
23
+ 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); }
22
24
  var getEventCoordinates = function getEventCoordinates(ev) {
23
25
  var x = ev.clientX,
24
26
  y = ev.clientY,
@@ -69,8 +71,8 @@ var makeTouchableEvent = function makeTouchableEvent(type) {
69
71
  };
70
72
  };
71
73
  var isEnabled = (0, _handle.forProp)('disabled', false);
72
- var handleDown = (0, _handle.handle)(isEnabled, (0, _handle.adaptEvent)(makeTouchableEvent('onDown'), (0, _handle.forwardWithPrevent)('onDown')), (0, _handle.call)('activate'), (0, _handle.call)('startGesture')).named('handleDown');
73
- var handleUp = (0, _handle.handle)(isEnabled, (0, _handle.call)('endGesture'), (0, _handle.call)('isTracking'), (0, _handle.adaptEvent)(makeTouchableEvent('onUp'), (0, _handle.forwardWithPrevent)('onUp')), (0, _handle.adaptEvent)(makeTouchableEvent('onTap'), (0, _handle.forward)('onTap')))["finally"]((0, _handle.call)('deactivate')).named('handleUp');
74
+ var handleDown = (0, _handle.handle)(isEnabled, (0, _handle.forwardCustomWithPrevent)('onDown', makeTouchableEvent('onDown')), (0, _handle.call)('activate'), (0, _handle.call)('startGesture')).named('handleDown');
75
+ var handleUp = (0, _handle.handle)(isEnabled, (0, _handle.call)('endGesture'), (0, _handle.call)('isTracking'), (0, _handle.forwardCustomWithPrevent)('onUp', makeTouchableEvent('onUp')), (0, _handle.forwardCustom)('onTap', makeTouchableEvent('onTap')))["finally"]((0, _handle.call)('deactivate')).named('handleUp');
74
76
  var handleEnter = (0, _handle.handle)(isEnabled, (0, _handle.forProp)('noResume', false), (0, _handle.call)('enterGesture'), (0, _handle.call)('isPaused'), (0, _handle.call)('activate')).named('handleEnter');
75
77
  var handleLeave = (0, _handle.handle)(isEnabled, (0, _handle.call)('leaveGesture'), (0, _handle.oneOf)([(0, _handle.forProp)('noResume', false), (0, _handle.call)('pause')], [_handle.returnsTrue, (0, _handle.call)('deactivate')])).named('handleLeave');
76
78
 
@@ -94,7 +96,7 @@ var handleTouchMove = (0, _handle.handle)((0, _handle.forward)('onTouchMove'), (
94
96
  // detecting when the touch leaves the boundary. oneOf returns the value of whichever
95
97
  // branch it follows so we append moveHold to either to handle moves that aren't
96
98
  // entering or leaving
97
- (0, _handle.adaptEvent)(makeTouchableEvent('onMove'), (0, _handle.forward)('onMove')), (0, _handle.oneOf)([(0, _handle.call)('hasTouchLeftTarget'), handleLeave], [_handle.returnsTrue, handleEnter])["finally"]((0, _handle.call)('moveGesture')));
99
+ (0, _handle.forwardCustom)('onMove', makeTouchableEvent('onMove')), (0, _handle.oneOf)([(0, _handle.call)('hasTouchLeftTarget'), handleLeave], [_handle.returnsTrue, handleEnter])["finally"]((0, _handle.call)('moveGesture')));
98
100
  var handleTouchEnd = (0, _handle.handle)((0, _handle.forward)('onTouchEnd'),
99
101
  // block the next mousedown to prevent duplicate touchable events
100
102
  (0, _handle.returnsTrue)((0, _handle.call)('setLastTouchEnd')), (0, _handle.call)('isTracking'), (0, _complement["default"])((0, _handle.call)('hasTouchLeftTarget')), (0, _handle.returnsTrue)((0, _handle.call)('endTouch')), handleUp);
@@ -0,0 +1,217 @@
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 a pinch gesture.
105
+ *
106
+ * Event payload includes:
107
+ * * `type` - Type of event, `'onPinch'`
108
+ * * `scale` - The scale factor, calculated from the distance while pinching.
109
+ The default value is 1.0. The value would be a number between
110
+ pinchConfig.minScale and pinchConfig.maxScale.
111
+ * * `coords` - The coordinates array of the touch point, relative to the viewport
112
+ */
113
+ onPinch?: Function;
114
+ /**
115
+ * Event handler for the end of a pinch gesture.
116
+ *
117
+ * Event payload includes:
118
+ * * `type` - Type of event, `'onPinchEnd'`
119
+ */
120
+ onPinchEnd?: Function;
121
+ /**
122
+ * Event handler for the start of a pinch gesture.
123
+ *
124
+ * Event payload includes:
125
+ * * `type` - Type of event, `'onPinchStart'`
126
+ * * `coords` - The coordinates array of the touch point, relative to the viewport
127
+ */
128
+ onPinchStart?: Function;
129
+ /**
130
+ * Event handler for 'tap' pointer events.
131
+ */
132
+ onTap?: Function;
133
+ /**
134
+ * Event handler for 'up' pointer events.
135
+ */
136
+ onUp?: Function;
137
+ /**
138
+ * Instance-specific overrides of the pinch configuration.
139
+ */
140
+ pinchConfig?: object;
141
+ }
142
+ export function Touchable<P>(
143
+ config: TouchableConfig,
144
+ Component: React.ComponentType<P> | string
145
+ ): React.ComponentType<P & TouchableProps>;
146
+
147
+ export function Touchable<P>(
148
+ Component: React.ComponentType<P> | string
149
+ ): React.ComponentType<P & TouchableProps>;
150
+
151
+ /**
152
+ * Configures the global gesture configuration for the application.
153
+ *
154
+ * Example:
155
+ * ```
156
+ // Updates the `maxMoves`, `moveTolerance`, and `frequency` configurations while retaining the
157
+ // current value of all other configurations
158
+ configure({
159
+ flick: {
160
+ maxMoves: 10
161
+ },
162
+ hold: {
163
+ moveTolerance: 32,
164
+ frequency: 400
165
+ }
166
+ });
167
+ ```
168
+
169
+ * Each type of gesture has its own set of configuration properties grouped within a separate object
170
+ keyed by the name of the gesture. Partial configurations may be passed and will be merged with
171
+ the current configuration.
172
+ *
173
+ * `drag`
174
+ * * `boxSizing` - The part of the component's box model is used as the bounds of the constraint.
175
+ Only applies when `global` is `false` .
176
+ * * `'border-box'` - the default, includes the padding and border but excludes the margin.
177
+ * * `'content-box'` - excludes the padding, border, and margin.
178
+ * * `global` - When `true` , drag gestures will continue when leaving the bounds of the component
179
+ or blurring the component.
180
+ * * `moveTolerance` - The number of pixels from the start position of the drag that the pointer
181
+ may move before cancelling the drag. Defaults to `16` .
182
+ *
183
+ * `flick`
184
+ * * `maxDuration` - The amount of time, in milliseconds, to complete a flick gesture before it
185
+ is cancelled. Defaults to 250.
186
+ * * `maxMoves` - The number of moves tracked to determine if a flick occurred. Defaults to `5` .
187
+ * * `minVelocity` - The minimum threshold, measured as the change in pixels over the change in
188
+ time per move, that must be exceeded to generate a `onFlick` event.
189
+ *
190
+ * `hold`
191
+ * * `cancelOnMove` - When `true` , the hold is cancelled when moving beyond the `moveTolerance` .
192
+ Defaults to `false`
193
+ * * `global` - When `true` , hold gestures will continue when leaving the bounds of the component
194
+ or blurring the component.
195
+ * * `moveTolerance` - The number of pixels from the start position of the hold that the pointer
196
+ may move before cancelling the hold. Ignored when `cancelOnMove` is `false` . Defaults to
197
+ `16` .
198
+ * * `frequency` - The time, in milliseconds, to poll for hold events. Defaults to `200` .
199
+ * * `events` - An array of `onHoldStart` events which each contain a `name` and `time` . The `time`
200
+ controls the amount of time that must pass before this `onHoldStart` event is fired and should
201
+ be a multiple of `frequency` .
202
+ *
203
+ * `pinch`
204
+ * * `boxSizing` - The part of the component's box model is used as the bounds of the constraint.
205
+ Only applies when `global` is `false` .
206
+ * * `'border-box'` - the default, includes the padding and border but excludes the margin.
207
+ * * `'content-box'` - excludes the padding, border, and margin.
208
+ * * `global` - When `true` , pinch gestures will continue when leaving the bounds of the component
209
+ or blurring the component.
210
+ * * `maxScale` - The maximum scale value. Defaults to `4` .
211
+ * * `minScale` - The minimum scale value. Defaults to `0.5` .
212
+ * * `moveTolerance` - The distance difference from the previous distance that the pointer may move
213
+ before cancelling the scaling. Defaults to `16` .
214
+ */
215
+ export function configure(cfg: object): void;
216
+
217
+ export default Touchable;
@@ -28,10 +28,19 @@ var _Pinch = require("./Pinch");
28
28
  var _useTouch = _interopRequireDefault(require("./useTouch"));
29
29
  var _jsxRuntime = require("react/jsx-runtime");
30
30
  var _excluded = ["dragConfig", "flickConfig", "holdConfig", "pinchConfig", "disabled", "noResume", "onBlur", "onClick", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDown", "onDrag", "onDragEnd", "onDragStart", "onFlick", "onHold", "onHoldEnd", "onHoldStart", "onMove", "onPinch", "onPinchEnd", "onPinchStart", "onTap", "onUp"];
31
+ /**
32
+ * Application support for gestures.
33
+ *
34
+ * @module ui/Touchable
35
+ * @exports Touchable
36
+ * @exports configure
37
+ */
31
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
32
39
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
33
40
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
34
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
41
+ 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; }
42
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
43
+ 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); }
35
44
  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; }
36
45
  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; }
37
46
  var selectProps = function selectProps(props) {
@@ -10,7 +10,9 @@ var _Hold = require("./Hold.js");
10
10
  var _Pinch = require("./Pinch");
11
11
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
12
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ 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; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15
+ 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); }
14
16
  var allowedDragKeys = Object.keys(_Drag.defaultDragConfig);
15
17
  var allowedFlickKeys = Object.keys(_Flick.defaultFlickConfig);
16
18
  var allowedHoldKeys = Object.keys(_Hold.defaultHoldConfig);
@@ -8,7 +8,9 @@ var _excluded = ["activeProp", "id"];
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
9
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
10
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ 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; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
13
+ 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); }
12
14
  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; }
13
15
  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; }
14
16
  describe('useTouch', function () {
@@ -12,12 +12,14 @@ var _Touch = _interopRequireDefault(require("./Touch"));
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
14
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
+ 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; }
16
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
17
+ 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); }
16
18
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
19
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
20
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
20
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
21
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
22
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
21
23
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
24
  /**
23
25
  * Configuration for `useTouch`
@@ -68,7 +70,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
68
70
  * @property {Object} handlers Event handlers that need to be passed to DOM node
69
71
  * @private
70
72
  */
71
-
72
73
  /**
73
74
  * Provides a consistent set of pointer events -- `onDown`, `onUp`, and `onTap` --
74
75
  * across mouse and touch interfaces along with support for common gestures including
@@ -0,0 +1,194 @@
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
+ `ease-out-quart` , and `linear` .
81
+ */
82
+ timingFunction?: string;
83
+ /**
84
+ * The type of transition to affect the content.
85
+ * * Supported types are: `'slide'` , `'clip'` , and `'fade'` .
86
+ *
87
+ * Details on types:
88
+ * * `'slide'` - Typically used for bringing something which is off the edge of the screen,
89
+ and not visible, onto the screen. Think of a popup, toast, notification, dialog, or
90
+ an overlaying menu. This requires no re-rendering or repainting of the screen during
91
+ the transition, making it very performant. However, this does not affect layout at
92
+ all, which makes it less useful for transitioning from a place already on the
93
+ screen.
94
+ * * `'clip'` - This is useful for showing a component that transitions-in from a location
95
+ that is already on the screen. Examples would be an expanding header or an
96
+ accordion. This type does affects layout, its current size will push other sibling
97
+ elements to make room for itself. Because of this, repainting the layout does happen
98
+ during transition.
99
+ * * `'fade'` - Fade the components onto the screen, from 0 opacity (completely invisible)
100
+ to 1 (full visibility). Pretty basic, but useful for fading on/off a tooltip, a
101
+ menu, a panel, or even view contents. This does not affect layout at all.
102
+ */
103
+ type?: string;
104
+ /**
105
+ * Sets the visibility of the component, which determines whether it's on screen or off.
106
+ */
107
+ visible?: boolean;
108
+ }
109
+ /**
110
+ * The stateless structure of the component.
111
+ *
112
+ * In case you want to provide all of the state yourself.
113
+ In general, you'll probably want to use the `Transition` instead of `TransitionBase` .
114
+ */
115
+
116
+ export class TransitionBase extends React.Component<
117
+ Merge<React.HTMLProps<HTMLElement>, TransitionBaseProps>
118
+ > {}
119
+
120
+ export interface TransitionProps {
121
+ /**
122
+ * The node to be transitioned.
123
+ */
124
+ children?: React.ReactNode;
125
+ /**
126
+ * The direction of transition (i.e. where the component will move _to_ ; the destination).
127
+ * * Supported directions are: `'up'` , `'right'` , `'down'` , `'left'` .
128
+ */
129
+ direction?: string;
130
+ /**
131
+ * Controls how long the transition should take.
132
+ * * Supported preset durations are: `'short'` (250ms), `'medium'` (500ms), and `'long'` (1s).
133
+ `'medium'` (500ms) is default when no others are specified.
134
+ *
135
+ * Any valid CSS duration value is also accepted, e.g. "200ms" or "3s". Pure numeric values
136
+ are also supported and treated as miliseconds.
137
+ */
138
+ duration?: string | number;
139
+ /**
140
+ * Disables transition animation.
141
+ *
142
+ * When `false` , visibility changes animate.
143
+ */
144
+ noAnimation?: boolean;
145
+ /**
146
+ * Called after transition for hiding is finished.
147
+ */
148
+ onHide?: Function;
149
+ /**
150
+ * Called after transition for showing is finished.
151
+ */
152
+ onShow?: Function;
153
+ /**
154
+ * The transition timing function.
155
+ Supported function names are: `ease` , `ease-in` , `ease-out` , `ease-in-out` , `ease-in-quart` ,
156
+ `ease-out-quart` , and `linear` .
157
+ */
158
+ timingFunction?: string;
159
+ /**
160
+ * The type of transition to affect the content.
161
+ * * Supported types are: `'slide'` , `'clip'` , and `'fade'` .
162
+ *
163
+ * Details on types:
164
+ * * `'slide'` - Typically used for bringing something which is off the edge of the screen,
165
+ and not visible, onto the screen. Think of a popup, toast, notification, dialog, or
166
+ an overlaying menu. This requires no re-rendering or repainting of the screen during
167
+ the transition, making it very performant. However, this does not affect layout at
168
+ all, which makes it less useful for transitioning from a place already on the
169
+ screen.
170
+ * * `'clip'` - This is useful for showing a component that transitions-in from a location
171
+ that is already on the screen. Examples would be an expanding header or an
172
+ accordion. This type does affects layout, its current size will push other sibling
173
+ elements to make room for itself. Because of this, repainting the layout does happen
174
+ during transition.
175
+ * * `'fade'` - Fade the components onto the screen, from 0 opacity (completely invisible)
176
+ to 1 (full visibility). Pretty basic, but useful for fading on/off a tooltip, a
177
+ menu, a panel, or even view contents. This does not affect layout at all.
178
+ */
179
+ type?: string;
180
+ /**
181
+ * The visibility of the component, which determines whether it's on the screen or off.
182
+ */
183
+ visible?: boolean;
184
+ }
185
+ /**
186
+ * A stateful component that allows for applying transitions to its child items via configurable
187
+ properties and events.
188
+ */
189
+
190
+ export class Transition extends React.Component<
191
+ Merge<React.HTMLProps<HTMLElement>, TransitionProps>
192
+ > {}
193
+
194
+ export default Transition;
@@ -17,7 +17,7 @@ var _excluded = ["css", "childRef", "children", "innerStyle"],
17
17
  _excluded2 = ["visible"];
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
19
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20
- 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, descriptor.key, descriptor); } }
20
+ 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); } }
21
21
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
22
22
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
23
23
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
@@ -30,7 +30,25 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
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
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
32
32
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
33
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
+ 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; }
34
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
35
+ 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); } /**
36
+ * A component that can transition its children components onto the screen.
37
+ *
38
+ * Transitions whether that's from off the edge of the screen or hidden inside or behind an
39
+ * already-on-screen component. You can switch types of transitions using the `type` property,
40
+ * change the direction they come in from using the `direction` property, or even adjust the
41
+ * transition timing function using `timingFunction`.
42
+ *
43
+ * @example
44
+ * <Transition visible={true} type="slide">
45
+ * <div>Set `visible` above to `false` to hide this element.</div>
46
+ * </Transition>
47
+ *
48
+ * @module ui/Transition
49
+ * @exports Transition
50
+ * @exports TransitionBase
51
+ */
34
52
  var formatter = function formatter(duration) {
35
53
  return typeof duration === 'number' ? duration + 'ms' : duration;
36
54
  };
@@ -397,9 +415,9 @@ var Transition = /*#__PURE__*/function (_Component) {
397
415
  }
398
416
  if (noAnimation) {
399
417
  if (!prevProps.visible && visible) {
400
- (0, _handle.forwardCustom)('onShow')({}, this.props);
418
+ (0, _handle.forwardCustom)('onShow')(null, this.props);
401
419
  } else if (prevProps.visible && !visible) {
402
- (0, _handle.forwardCustom)('onHide')({}, this.props);
420
+ (0, _handle.forwardCustom)('onHide')(null, this.props);
403
421
  }
404
422
  }
405
423
  }
@@ -9,12 +9,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
9
9
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
10
10
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
11
11
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
13
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
12
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
13
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
14
14
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
15
15
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
16
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
17
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
+ 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; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
19
+ 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); }
18
20
  describe('Transition Specs', function () {
19
21
  // NOTE: Feature not yet implemented
20
22
  test.skip('should apply author classes', function () {
@@ -8,7 +8,12 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
9
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
10
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ 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; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
13
+ 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); } /*
14
+ * Exports a number of pre-defined arrangers for use with {@link ui/ViewManager}.
15
+ * note: not jsdoc on purpose
16
+ */
12
17
  var slideInOut = function slideInOut(direction, total, orientation) {
13
18
  var p = direction === 'out' ? total : -total;
14
19
  return orientation === 'top' && 'translateY(' + -p + '%)' || orientation === 'bottom' && 'translateY(' + p + '%)' || orientation === 'left' && 'translateX(' + -p + '%)' || orientation === 'right' && 'translateX(' + p + '%)';