@enact/ui 4.6.1 → 4.6.2

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 (163) hide show
  1. package/AnnounceDecorator/Announce.js +4 -2
  2. package/AnnounceDecorator/AnnounceDecorator.d.ts +64 -0
  3. package/AnnounceDecorator/AnnounceDecorator.js +3 -1
  4. package/BodyText/BodyText.d.ts +66 -0
  5. package/BodyText/BodyText.js +3 -1
  6. package/Button/Button.d.ts +125 -0
  7. package/Button/Button.js +3 -1
  8. package/CHANGELOG.md +4 -0
  9. package/Cancelable/Cancelable.d.ts +64 -0
  10. package/Cancelable/Cancelable.js +4 -2
  11. package/Cancelable/tests/Cancelable-specs.js +3 -1
  12. package/Changeable/Changeable.d.ts +54 -0
  13. package/Changeable/Changeable.js +4 -2
  14. package/ComponentOverride/ComponentOverride.d.ts +52 -0
  15. package/ComponentOverride/ComponentOverride.js +3 -1
  16. package/FloatingLayer/FloatingLayer.js +4 -2
  17. package/FloatingLayer/FloatingLayerContainer.js +3 -1
  18. package/FloatingLayer/FloatingLayerDecorator.js +3 -1
  19. package/FloatingLayer/Scrim.js +4 -2
  20. package/FloatingLayer/index.d.ts +100 -0
  21. package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +3 -1
  22. package/FloatingLayer/useFloatingLayer.js +2 -2
  23. package/ForwardRef/ForwardRef.d.ts +22 -0
  24. package/ForwardRef/ForwardRef.js +3 -1
  25. package/GridListImageItem/GridListImageItem.d.ts +85 -0
  26. package/GridListImageItem/GridListImageItem.js +3 -1
  27. package/Group/Group.d.ts +107 -0
  28. package/Group/Group.js +3 -1
  29. package/Group/GroupItem.js +3 -1
  30. package/Heading/Heading.d.ts +89 -0
  31. package/Heading/Heading.js +3 -1
  32. package/Icon/Icon.d.ts +88 -0
  33. package/Icon/Icon.js +3 -1
  34. package/IconButton/IconButton.d.ts +115 -0
  35. package/IconButton/IconButton.js +4 -2
  36. package/Image/Image.d.ts +113 -0
  37. package/Image/Image.js +3 -1
  38. package/ImageItem/ImageItem.d.ts +83 -0
  39. package/ImageItem/ImageItem.js +3 -1
  40. package/ImageItem/tests/ImageItem-specs.js +3 -1
  41. package/Item/Item.d.ts +64 -0
  42. package/Item/Item.js +3 -1
  43. package/LabeledIcon/LabeledIcon.d.ts +130 -0
  44. package/LabeledIcon/LabeledIcon.js +3 -1
  45. package/Layout/Cell.js +3 -1
  46. package/Layout/Layout.d.ts +267 -0
  47. package/Layout/Layout.js +28 -5
  48. package/Layout/tests/Layout-specs.js +5 -3
  49. package/Marquee/MarqueeBase.js +3 -1
  50. package/Marquee/MarqueeController.js +4 -2
  51. package/Marquee/MarqueeDecorator.js +4 -2
  52. package/Marquee/index.d.ts +258 -0
  53. package/Marquee/tests/Marquee-specs.js +3 -1
  54. package/Measurable/Measurable.d.ts +26 -0
  55. package/Measurable/Measurable.js +5 -3
  56. package/Measurable/tests/Measurable-specs.js +8 -6
  57. package/Media/Media.d.ts +99 -0
  58. package/Media/Media.js +6 -4
  59. package/Placeholder/PlaceholderControllerDecorator.js +4 -2
  60. package/Placeholder/PlaceholderDecorator.js +4 -2
  61. package/Placeholder/index.d.ts +53 -0
  62. package/ProgressBar/ProgressBar.d.ts +92 -0
  63. package/ProgressBar/ProgressBar.js +3 -1
  64. package/README.md +1 -1
  65. package/RadioDecorator/RadioControllerDecorator.js +4 -2
  66. package/RadioDecorator/RadioDecorator.d.ts +35 -0
  67. package/RadioDecorator/RadioDecorator.js +4 -2
  68. package/Repeater/Repeater.d.ts +82 -0
  69. package/Repeater/Repeater.js +3 -1
  70. package/Repeater/tests/Repeater-specs.js +3 -1
  71. package/Resizable/Resizable.d.ts +31 -0
  72. package/Resizable/Resizable.js +4 -2
  73. package/Routable/Link.js +4 -2
  74. package/Routable/Routable.d.ts +148 -0
  75. package/Routable/Routable.js +3 -1
  76. package/Routable/Router.js +4 -2
  77. package/Routable/tests/Routable-specs.js +5 -3
  78. package/Scrollable/ScrollAnimator.js +3 -1
  79. package/Scrollable/ScrollThumb.js +3 -1
  80. package/Scrollable/Scrollable.d.ts +0 -0
  81. package/Scrollable/Scrollable.js +4 -2
  82. package/Scrollable/ScrollableNative.js +4 -2
  83. package/Scrollable/Scrollbar.js +4 -2
  84. package/Scroller/Scroller.d.ts +276 -0
  85. package/Scroller/Scroller.js +3 -1
  86. package/Scroller/ScrollerBasic.js +4 -2
  87. package/Scroller/UiScrollerBase.js +4 -2
  88. package/Skinnable/Skinnable.d.ts +94 -0
  89. package/Skinnable/Skinnable.js +3 -1
  90. package/Skinnable/tests/Skinnable-specs.js +3 -1
  91. package/Skinnable/tests/useSkins-specs.js +3 -1
  92. package/Slider/Knob.js +3 -1
  93. package/Slider/PositionDecorator.js +4 -2
  94. package/Slider/Slider.d.ts +202 -0
  95. package/Slider/Slider.js +3 -1
  96. package/SlotItem/SlotItem.d.ts +118 -0
  97. package/SlotItem/SlotItem.js +3 -1
  98. package/Slottable/Slottable.d.ts +22 -0
  99. package/Slottable/Slottable.js +3 -1
  100. package/Slottable/useSlots.js +3 -1
  101. package/Spinner/Spinner.d.ts +95 -0
  102. package/Spinner/Spinner.js +3 -1
  103. package/ToggleIcon/ToggleIcon.d.ts +90 -0
  104. package/ToggleIcon/ToggleIcon.js +3 -1
  105. package/ToggleItem/ToggleItem.d.ts +132 -0
  106. package/ToggleItem/ToggleItem.js +3 -1
  107. package/ToggleItem/tests/ToggleItem-specs.js +3 -1
  108. package/Toggleable/Toggle.js +4 -2
  109. package/Toggleable/Toggleable.d.ts +103 -0
  110. package/Toggleable/Toggleable.js +3 -1
  111. package/Toggleable/useToggle.js +1 -1
  112. package/Touchable/ClickAllow.js +3 -1
  113. package/Touchable/Drag.js +4 -2
  114. package/Touchable/Flick.js +4 -2
  115. package/Touchable/Hold.js +4 -2
  116. package/Touchable/Pinch.js +4 -2
  117. package/Touchable/Touch.js +3 -1
  118. package/Touchable/Touchable.d.ts +217 -0
  119. package/Touchable/Touchable.js +3 -1
  120. package/Touchable/config.js +3 -1
  121. package/Touchable/tests/useTouch-specs.js +3 -1
  122. package/Touchable/useTouch.js +5 -3
  123. package/Transition/Transition.d.ts +194 -0
  124. package/Transition/Transition.js +4 -2
  125. package/Transition/tests/Transition-specs.js +5 -3
  126. package/ViewManager/Arranger.js +3 -1
  127. package/ViewManager/TransitionGroup.js +3 -1
  128. package/ViewManager/View.js +4 -2
  129. package/ViewManager/ViewManager.d.ts +191 -0
  130. package/ViewManager/ViewManager.js +4 -2
  131. package/ViewManager/tests/ViewManager-specs.js +3 -1
  132. package/VirtualList/UiVirtualListBase.js +5 -3
  133. package/VirtualList/VirtualList.d.ts +528 -0
  134. package/VirtualList/VirtualList.js +3 -1
  135. package/VirtualList/VirtualListBasic.js +5 -3
  136. package/VirtualList/tests/VirtualGridList-native-specs.js +3 -1
  137. package/VirtualList/tests/VirtualGridList-specs.js +3 -1
  138. package/VirtualList/tests/VirtualList-native-specs.js +3 -1
  139. package/VirtualList/tests/VirtualList-specs.js +3 -1
  140. package/index.d.ts +0 -0
  141. package/internal/IdProvider/IdProvider.d.ts +0 -0
  142. package/internal/IdProvider/IdProvider.js +3 -1
  143. package/internal/IdProvider/Provider.js +3 -1
  144. package/internal/IdProvider/tests/IdProvider-specs.js +3 -1
  145. package/internal/IdProvider/tests/useId-specs.js +4 -3
  146. package/internal/Pure/Pure.d.ts +0 -0
  147. package/internal/Pure/Pure.js +4 -2
  148. package/internal/Pure/tests/Pure-specs.js +4 -2
  149. package/internal/localized-fonts/localized-fonts.d.ts +53 -0
  150. package/internal/localized-fonts/localized-fonts.js +2 -2
  151. package/internal/selection/selection.d.ts +0 -0
  152. package/internal/validators/validators.d.ts +0 -0
  153. package/package.json +2 -2
  154. package/resolution/ResolutionDecorator.js +4 -2
  155. package/resolution/index.d.ts +187 -0
  156. package/useControlledState/tests/useControlledState-specs.js +2 -2
  157. package/useControlledState/useControlledState.d.ts +0 -0
  158. package/useControlledState/useControlledState.js +2 -2
  159. package/useScroll/ScrollAnimator.js +3 -1
  160. package/useScroll/Scrollbar.js +6 -4
  161. package/useScroll/ScrollbarTrack.js +3 -1
  162. package/useScroll/useScroll.d.ts +0 -0
  163. package/useScroll/useScroll.js +64 -52
@@ -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`
@@ -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,9 @@ 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); }
34
36
  var formatter = function formatter(duration) {
35
37
  return typeof duration === 'number' ? duration + 'ms' : duration;
36
38
  };
@@ -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,9 @@ 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); }
12
14
  var slideInOut = function slideInOut(direction, total, orientation) {
13
15
  var p = direction === 'out' ? total : -total;
14
16
  return orientation === 'top' && 'translateY(' + -p + '%)' || orientation === 'bottom' && 'translateY(' + p + '%)' || orientation === 'left' && 'translateX(' + -p + '%)' || orientation === 'right' && 'translateX(' + p + '%)';
@@ -18,8 +18,10 @@ var _useWith = _interopRequireDefault(require("ramda/src/useWith"));
18
18
  var _react = require("react");
19
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
20
20
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
- 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); } }
21
+ 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); } }
22
22
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
23
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
24
+ 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); }
23
25
  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); }
24
26
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
27
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -13,10 +13,12 @@ var _jsxRuntime = require("react/jsx-runtime");
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
14
  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; }
15
15
  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; }
16
- 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; }
16
+ 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; }
17
17
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18
- 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); } }
18
+ 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); } }
19
19
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
20
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
21
+ 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); }
20
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); }
21
23
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
22
24
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -0,0 +1,191 @@
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;
@@ -36,12 +36,14 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
36
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
37
37
  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; }
38
38
  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; }
39
- 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; }
39
+ 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; }
40
40
  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; }
41
41
  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; }
42
42
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
43
- 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); } }
43
+ 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); } }
44
44
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
45
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
46
+ 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); }
45
47
  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); }
46
48
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
47
49
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -10,8 +10,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
10
10
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
11
11
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
12
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
13
- 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); } }
13
+ 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); } }
14
14
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
15
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
16
+ 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); }
15
17
  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); }
16
18
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
17
19
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
@@ -22,13 +22,15 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
22
22
  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); }
23
23
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
24
24
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
25
- 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; }
25
+ 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; }
26
26
  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; }
27
27
  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; }
28
- 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; }
28
+ 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; }
29
29
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30
- 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); } }
30
+ 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); } }
31
31
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
32
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
33
+ 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); }
32
34
  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); }
33
35
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
34
36
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }