@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
@@ -18,15 +18,19 @@ 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); }; }
26
28
  function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
27
29
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
28
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
29
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
31
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /*
32
+ * Exports the {@link ui/ViewManager.TransitionGroup} component.
33
+ */ // Using string refs from the source code of ReactTransitionGroup
30
34
  /**
31
35
  * Returns the index of a child in an array found by `key` matching
32
36
  *
@@ -35,8 +39,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
35
39
  * @returns {Number} Index of child
36
40
  * @method
37
41
  * @private
38
- */
39
- // eslint-disable-next-line react-hooks/rules-of-hooks
42
+ */ // eslint-disable-next-line react-hooks/rules-of-hooks
40
43
  var indexOfChild = (0, _useWith["default"])(_findIndex["default"], [(0, _propEq["default"])('key'), _identity["default"]]);
41
44
 
42
45
  /**
@@ -403,7 +406,7 @@ TransitionGroup.propTypes = /** @lends ui/ViewManager.TransitionGroup.prototype
403
406
  */
404
407
  component: _propTypes["default"].renderable,
405
408
  /**
406
- * Called with a reference to {@link ui/ViewManager.TransitionGroup#component|component}
409
+ * Called with a reference to {@link ui/ViewManager.TransitionGroup.component|component}
407
410
  *
408
411
  * @type {Object|Function}
409
412
  * @private
@@ -13,18 +13,21 @@ 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); }; }
23
25
  function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
24
26
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
25
27
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
26
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
27
- // If the View was "appearing", then entering will always be false and this will not result in a
28
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /*
29
+ * Exports the {@link ui/ViewManager.View} component.
30
+ */ // If the View was "appearing", then entering will always be false and this will not result in a
28
31
  // re-render. If the view should enter, state.enter will be true and this will toggle it to false
29
32
  // causing a re-render.
30
33
  var clearEntering = function clearEntering(_ref) {
@@ -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;
@@ -31,17 +31,42 @@ var _View = require("./View");
31
31
  var _jsxRuntime = require("react/jsx-runtime");
32
32
  var _excluded = ["arranger", "childProps", "children", "duration", "index", "noAnimation", "enteringDelay", "enteringProp", "rtl"];
33
33
  var _class;
34
+ /**
35
+ * A component that manages the transitions of views.
36
+ *
37
+ * @module ui/ViewManager
38
+ * @exports shape
39
+ * @exports SlideArranger
40
+ * @exports SlideBottomArranger
41
+ * @exports SlideLeftArranger
42
+ * @exports SlideRightArranger
43
+ * @exports SlideTopArranger
44
+ * @exports ViewManager
45
+ * @exports ViewManagerBase
46
+ * @exports ViewManagerDecorator
47
+ */
48
+ /**
49
+ * The base `ViewManager` component, without
50
+ * {@link ui/ViewManager.ViewManagerDecorator|ViewManagerDecorator} applied.
51
+ *
52
+ * @class ViewManagerBase
53
+ * @memberof ui/ViewManager
54
+ * @ui
55
+ * @public
56
+ */
34
57
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
35
58
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
36
59
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
37
60
  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
61
  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; }
62
+ 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
63
  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
64
  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
65
  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); } }
66
+ 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
67
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
68
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
69
+ 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
70
  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
71
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
47
72
  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); }; }
@@ -49,15 +74,6 @@ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "
49
74
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
50
75
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
51
76
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
52
- /**
53
- * The base `ViewManager` component, without
54
- * {@link ui/ViewManager.ViewManagerDecorator|ViewManagerDecorator} applied.
55
- *
56
- * @class ViewManagerBase
57
- * @memberof ui/ViewManager
58
- * @ui
59
- * @public
60
- */
61
77
  var ViewManagerBase = (_class = /*#__PURE__*/function (_Component) {
62
78
  _inherits(ViewManagerBase, _Component);
63
79
  var _super = _createSuper(ViewManagerBase);
@@ -136,6 +152,8 @@ var ViewManagerBase = (_class = /*#__PURE__*/function (_Component) {
136
152
  value: function getDerivedStateFromProps(props, state) {
137
153
  if (props.reverseTransition != null) {
138
154
  return {
155
+ index: props.index,
156
+ prevIndex: state.index,
139
157
  reverseTransition: !!props.reverseTransition
140
158
  };
141
159
  } else if (props.index !== state.index) {
@@ -4,14 +4,17 @@ require("@testing-library/jest-dom");
4
4
  var _react = require("@testing-library/react");
5
5
  var _react2 = require("react");
6
6
  var _ = _interopRequireDefault(require("../"));
7
+ var _Arranger = require("../Arranger");
7
8
  var _testUtils = require("./test-utils");
8
9
  var _jsxRuntime = require("react/jsx-runtime");
9
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
11
  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
12
  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
13
  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); } }
14
+ 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
15
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
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); }
15
18
  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
19
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
17
20
  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); }; }
@@ -835,4 +838,47 @@ describe('ViewManager', function () {
835
838
  expect(actual).toMatchObject(expected);
836
839
  spy.mockRestore();
837
840
  });
841
+ test('should not remove view immediately after `index` change if an arranger is present even for multiple views', function () {
842
+ var _render19 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_["default"], {
843
+ arranger: _Arranger.SlideTopArranger,
844
+ "data-testid": "viewManager",
845
+ end: 2,
846
+ index: 0,
847
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
848
+ children: "View 1"
849
+ }, "view1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
850
+ children: "View 2"
851
+ }, "view2"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
852
+ children: "View 3"
853
+ }, "view3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
854
+ children: "View 4"
855
+ }, "view4"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
856
+ children: "View 5"
857
+ }, "view5")]
858
+ })),
859
+ rerender = _render19.rerender;
860
+ var actual = _react.screen.getByTestId('viewManager').children.length;
861
+ var expected = 3;
862
+ expect(actual).toBe(expected);
863
+ rerender( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_["default"], {
864
+ arranger: _Arranger.SlideTopArranger,
865
+ "data-testid": "viewManager",
866
+ end: 3,
867
+ index: 1,
868
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
869
+ children: "View 1"
870
+ }, "view1"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
871
+ children: "View 2"
872
+ }, "view2"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
873
+ children: "View 3"
874
+ }, "view3"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
875
+ children: "View 4"
876
+ }, "view4"), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
877
+ children: "View 5"
878
+ }, "view5")]
879
+ }));
880
+ actual = _react.screen.getByTestId('viewManager').children.length;
881
+ expected = 4;
882
+ expect(actual).toBe(expected);
883
+ });
838
884
  });
@@ -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); }; }
@@ -415,6 +417,8 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
415
417
  });
416
418
  }
417
419
  }
420
+
421
+ // For individually sized item
418
422
  }, {
419
423
  key: "getGridPosition",
420
424
  value: function getGridPosition(index) {
@@ -451,6 +455,8 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
451
455
  }
452
456
 
453
457
  // For individually sized item
458
+
459
+ // For individually sized item
454
460
  }, {
455
461
  key: "emitUpdateItems",
456
462
  value: function emitUpdateItems() {