@enact/ui 4.1.4 → 4.5.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AnnounceDecorator/Announce.js +9 -9
- package/AnnounceDecorator/AnnounceDecorator.js +6 -4
- package/AnnounceDecorator/useAnnounce.js +1 -1
- package/BodyText/BodyText.js +6 -4
- package/BodyText/tests/BodyText-specs.js +2 -2
- package/Button/Button.js +6 -4
- package/CHANGELOG.md +6 -0
- package/Cancelable/Cancelable.js +11 -10
- package/Cancelable/tests/Cancelable-specs.js +5 -3
- package/Changeable/Changeable.js +9 -9
- package/Changeable/tests/Changeable-specs.js +19 -9
- package/ComponentOverride/ComponentOverride.js +6 -4
- package/FloatingLayer/FloatingLayer.js +35 -32
- package/FloatingLayer/FloatingLayer.module.css +3 -0
- package/FloatingLayer/FloatingLayerContainer.js +2 -2
- package/FloatingLayer/FloatingLayerDecorator.js +6 -4
- package/FloatingLayer/Scrim.js +9 -7
- package/FloatingLayer/index.js +1 -1
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +2 -2
- package/FloatingLayer/useFloatingLayer.js +2 -2
- package/FloatingLayer/useFloatingLayerDecorator.js +1 -1
- package/ForwardRef/ForwardRef.js +3 -3
- package/GridListImageItem/GridListImageItem.js +6 -4
- package/Group/Group.js +7 -4
- package/Group/GroupItem.js +6 -4
- package/Group/tests/Group-specs.js +2 -2
- package/Heading/Heading.js +6 -4
- package/Icon/Icon.js +6 -4
- package/Icon/tests/Icon-specs.js +2 -2
- package/IconButton/IconButton.js +6 -4
- package/Image/Image.js +6 -4
- package/Image/tests/Image-specs.js +2 -2
- package/ImageItem/ImageItem.js +8 -5
- package/ImageItem/tests/ImageItem-specs.js +4 -4
- package/Item/Item.js +6 -4
- package/LabeledIcon/LabeledIcon.js +6 -4
- package/Layout/Cell.js +6 -4
- package/Layout/Layout.js +6 -4
- package/Layout/tests/Layout-specs.js +5 -5
- package/Marquee/MarqueeBase.js +6 -4
- package/Marquee/MarqueeController.js +9 -9
- package/Marquee/MarqueeDecorator.js +12 -10
- package/Marquee/index.js +2 -1
- package/Marquee/tests/Marquee-specs.js +22 -16
- package/Measurable/Measurable.js +4 -4
- package/Media/Media.js +9 -7
- package/Placeholder/PlaceholderControllerDecorator.js +9 -9
- package/Placeholder/PlaceholderDecorator.js +9 -9
- package/ProgressBar/ProgressBar.js +6 -4
- package/RadioDecorator/RadioControllerDecorator.js +9 -9
- package/RadioDecorator/RadioDecorator.js +9 -9
- package/Repeater/Repeater.js +6 -4
- package/Repeater/tests/Repeater-specs.js +4 -4
- package/Resizable/Resizable.js +10 -10
- package/Routable/Link.js +9 -7
- package/Routable/Routable.js +10 -6
- package/Routable/Route.js +1 -1
- package/Routable/Router.js +14 -11
- package/Routable/tests/Routable-specs.js +3 -3
- package/Routable/useLink.js +1 -1
- package/Routable/util.js +1 -1
- package/Scrollable/ScrollAnimator.js +2 -2
- package/Scrollable/ScrollThumb.js +3 -3
- package/Scrollable/Scrollable.js +13 -10
- package/Scrollable/ScrollableNative.js +13 -10
- package/Scrollable/Scrollbar.js +14 -8
- package/Scroller/Scroller.js +8 -7
- package/Scroller/ScrollerBasic.js +9 -7
- package/Scroller/UiScrollerBase.js +9 -7
- package/Skinnable/Skinnable.js +6 -4
- package/Skinnable/tests/Skinnable-specs.js +2 -2
- package/Skinnable/tests/useSkins-specs.js +2 -2
- package/Skinnable/useSkins.js +1 -1
- package/Slider/Knob.js +6 -4
- package/Slider/PositionDecorator.js +9 -9
- package/Slider/Slider.js +6 -4
- package/SlotItem/SlotItem.js +6 -4
- package/Slottable/Slottable.js +3 -3
- package/Slottable/useSlots.js +6 -4
- package/Spinner/Spinner.js +6 -4
- package/Spinner/tests/Spinner-specs.js +1 -1
- package/ToggleIcon/ToggleIcon.js +6 -4
- package/ToggleItem/ToggleItem.js +6 -4
- package/ToggleItem/tests/ToggleItem-specs.js +4 -4
- package/Toggleable/Toggle.js +4 -4
- package/Toggleable/Toggleable.js +5 -5
- package/Toggleable/tests/Toggleable-specs.js +54 -18
- package/Toggleable/useToggle.js +4 -2
- package/Touchable/ClickAllow.js +2 -2
- package/Touchable/Drag.js +9 -5
- package/Touchable/Flick.js +4 -4
- package/Touchable/Hold.js +4 -4
- package/Touchable/Touch.js +2 -2
- package/Touchable/Touchable.js +7 -4
- package/Touchable/config.js +3 -3
- package/Touchable/tests/Touchable-specs.js +3 -1
- package/Touchable/tests/useTouch-specs.js +5 -3
- package/Touchable/useTouch.js +4 -4
- package/Transition/Transition.js +11 -8
- package/Transition/tests/Transition-specs.js +5 -5
- package/ViewManager/Arranger.js +3 -3
- package/ViewManager/TransitionGroup.js +4 -4
- package/ViewManager/View.js +6 -6
- package/ViewManager/ViewManager.js +14 -12
- package/ViewManager/tests/View-specs.js +43 -11
- package/ViewManager/tests/ViewManager-specs.js +17 -10
- package/VirtualList/UiVirtualListBase.js +17 -16
- package/VirtualList/VirtualList.js +10 -9
- package/VirtualList/VirtualListBase.js +1 -1
- package/VirtualList/VirtualListBasic.js +12 -13
- package/VirtualList/tests/VirtualList-specs.js +56 -38
- package/internal/IdProvider/IdProvider.js +3 -3
- package/internal/IdProvider/Provider.js +2 -2
- package/internal/IdProvider/tests/useId-specs.js +2 -2
- package/internal/Pure/Pure.js +9 -9
- package/internal/localized-fonts/localized-fonts.js +1 -1
- package/internal/validators/validators.js +1 -1
- package/package.json +7 -7
- package/resolution/ResolutionDecorator.js +9 -9
- package/resolution/index.js +2 -2
- package/resolution/resolution.js +4 -2
- package/useControlledState/tests/useControlledState-specs.js +1 -1
- package/useControlledState/useControlledState.js +2 -2
- package/useScroll/ScrollAnimator.js +2 -2
- package/useScroll/Scrollbar.js +7 -4
- package/useScroll/ScrollbarTrack.js +6 -4
- package/useScroll/useScroll.js +9 -6
package/Transition/Transition.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = exports.TransitionBase = exports.Transition = void 0;
|
|
7
7
|
|
|
8
8
|
var _handle = require("@enact/core/handle");
|
|
9
9
|
|
|
@@ -23,21 +23,24 @@ var _TransitionModule = _interopRequireDefault(require("./Transition.module.css"
|
|
|
23
23
|
|
|
24
24
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
25
|
|
|
26
|
+
var _excluded = ["css", "childRef", "children", "innerStyle"],
|
|
27
|
+
_excluded2 = ["visible"];
|
|
28
|
+
|
|
26
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
30
|
|
|
28
31
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
32
|
|
|
30
33
|
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); } }
|
|
31
34
|
|
|
32
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
35
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
36
|
|
|
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
37
|
+
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); }
|
|
35
38
|
|
|
36
39
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
40
|
|
|
38
41
|
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); }; }
|
|
39
42
|
|
|
40
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
43
|
+
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); }
|
|
41
44
|
|
|
42
45
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
46
|
|
|
@@ -49,9 +52,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
49
52
|
|
|
50
53
|
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; }
|
|
51
54
|
|
|
52
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
55
|
+
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; }
|
|
53
56
|
|
|
54
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
57
|
+
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; }
|
|
55
58
|
|
|
56
59
|
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; }
|
|
57
60
|
|
|
@@ -306,7 +309,7 @@ var TransitionBase = (0, _kind["default"])({
|
|
|
306
309
|
childRef = _ref4.childRef,
|
|
307
310
|
children = _ref4.children,
|
|
308
311
|
innerStyle = _ref4.innerStyle,
|
|
309
|
-
rest = _objectWithoutProperties(_ref4,
|
|
312
|
+
rest = _objectWithoutProperties(_ref4, _excluded);
|
|
310
313
|
|
|
311
314
|
delete rest.clipHeight;
|
|
312
315
|
delete rest.clipWidth;
|
|
@@ -478,7 +481,7 @@ var Transition = /*#__PURE__*/function (_Component) {
|
|
|
478
481
|
value: function render() {
|
|
479
482
|
var _this$props2 = this.props,
|
|
480
483
|
visible = _this$props2.visible,
|
|
481
|
-
props = _objectWithoutProperties(_this$props2,
|
|
484
|
+
props = _objectWithoutProperties(_this$props2, _excluded2);
|
|
482
485
|
|
|
483
486
|
delete props.onHide;
|
|
484
487
|
delete props.onShow;
|
|
@@ -8,9 +8,9 @@ var _Transition = _interopRequireWildcard(require("../Transition"));
|
|
|
8
8
|
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
|
|
11
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
11
|
+
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); }
|
|
12
12
|
|
|
13
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
|
13
|
+
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; }
|
|
14
14
|
|
|
15
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
16
|
|
|
@@ -20,13 +20,13 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
20
20
|
|
|
21
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
22
|
|
|
23
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr
|
|
23
|
+
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; }
|
|
24
24
|
|
|
25
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
26
|
|
|
27
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
27
|
+
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; }
|
|
28
28
|
|
|
29
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
29
|
+
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; }
|
|
30
30
|
|
|
31
31
|
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; }
|
|
32
32
|
|
package/ViewManager/Arranger.js
CHANGED
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.shape = exports.
|
|
6
|
+
exports.shape = exports.arrange = exports.SlideTopArranger = exports.SlideRightArranger = exports.SlideLeftArranger = exports.SlideBottomArranger = exports.SlideArranger = void 0;
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
|
|
12
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
12
|
+
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; }
|
|
13
13
|
|
|
14
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
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
15
|
|
|
16
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; }
|
|
17
17
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = exports.TransitionGroup = void 0;
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
|
|
9
9
|
|
|
@@ -35,15 +35,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
35
35
|
|
|
36
36
|
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); } }
|
|
37
37
|
|
|
38
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
38
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
39
39
|
|
|
40
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
40
|
+
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); }
|
|
41
41
|
|
|
42
42
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
43
43
|
|
|
44
44
|
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); }; }
|
|
45
45
|
|
|
46
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
46
|
+
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); }
|
|
47
47
|
|
|
48
48
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
49
49
|
|
package/ViewManager/View.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.wrapWithView = exports
|
|
6
|
+
exports.wrapWithView = exports["default"] = exports.View = void 0;
|
|
7
7
|
|
|
8
8
|
var _util = require("@enact/core/util");
|
|
9
9
|
|
|
@@ -19,9 +19,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
21
|
|
|
22
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
22
|
+
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; }
|
|
23
23
|
|
|
24
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
24
|
+
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; }
|
|
25
25
|
|
|
26
26
|
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; }
|
|
27
27
|
|
|
@@ -29,15 +29,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
29
29
|
|
|
30
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); } }
|
|
31
31
|
|
|
32
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
33
|
|
|
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
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); }
|
|
35
35
|
|
|
36
36
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
37
|
|
|
38
38
|
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); }; }
|
|
39
39
|
|
|
40
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
40
|
+
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); }
|
|
41
41
|
|
|
42
42
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
43
|
|
|
@@ -8,7 +8,7 @@ var _exportNames = {
|
|
|
8
8
|
ViewManagerBase: true,
|
|
9
9
|
ViewManagerDecorator: true
|
|
10
10
|
};
|
|
11
|
-
exports.ViewManagerDecorator = exports.ViewManagerBase = exports.ViewManager =
|
|
11
|
+
exports["default"] = exports.ViewManagerDecorator = exports.ViewManagerBase = exports.ViewManager = void 0;
|
|
12
12
|
|
|
13
13
|
var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
|
|
14
14
|
|
|
@@ -40,17 +40,19 @@ var _View = require("./View");
|
|
|
40
40
|
|
|
41
41
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _excluded = ["arranger", "childProps", "children", "duration", "index", "noAnimation", "enteringDelay", "enteringProp", "rtl"];
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
var _class;
|
|
46
46
|
|
|
47
|
-
function
|
|
47
|
+
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); }
|
|
48
|
+
|
|
49
|
+
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; }
|
|
48
50
|
|
|
49
51
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
50
52
|
|
|
51
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
53
|
+
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; }
|
|
52
54
|
|
|
53
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
55
|
+
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; }
|
|
54
56
|
|
|
55
57
|
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; }
|
|
56
58
|
|
|
@@ -62,15 +64,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
62
64
|
|
|
63
65
|
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); } }
|
|
64
66
|
|
|
65
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
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; }
|
|
66
68
|
|
|
67
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
69
|
+
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); }
|
|
68
70
|
|
|
69
71
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
70
72
|
|
|
71
73
|
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); }; }
|
|
72
74
|
|
|
73
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
75
|
+
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); }
|
|
74
76
|
|
|
75
77
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
76
78
|
|
|
@@ -87,7 +89,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
87
89
|
* @ui
|
|
88
90
|
* @public
|
|
89
91
|
*/
|
|
90
|
-
var ViewManagerBase = (
|
|
92
|
+
var ViewManagerBase = (_class = /*#__PURE__*/function (_Component) {
|
|
91
93
|
_inherits(ViewManagerBase, _Component);
|
|
92
94
|
|
|
93
95
|
var _super = _createSuper(ViewManagerBase);
|
|
@@ -128,7 +130,7 @@ var ViewManagerBase = (_temp = _class = /*#__PURE__*/function (_Component) {
|
|
|
128
130
|
enteringDelay = _this$props.enteringDelay,
|
|
129
131
|
enteringProp = _this$props.enteringProp,
|
|
130
132
|
rtl = _this$props.rtl,
|
|
131
|
-
rest = _objectWithoutProperties(_this$props,
|
|
133
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
132
134
|
|
|
133
135
|
var _this$props2 = this.props,
|
|
134
136
|
_this$props2$end = _this$props2.end,
|
|
@@ -366,7 +368,7 @@ var ViewManagerBase = (_temp = _class = /*#__PURE__*/function (_Component) {
|
|
|
366
368
|
component: 'div',
|
|
367
369
|
duration: 300,
|
|
368
370
|
index: 0
|
|
369
|
-
},
|
|
371
|
+
}, _class);
|
|
370
372
|
/**
|
|
371
373
|
* Applies ViewManager behaviors.
|
|
372
374
|
*
|
|
@@ -66,7 +66,9 @@ describe('View', function () {
|
|
|
66
66
|
ref: ref,
|
|
67
67
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {})
|
|
68
68
|
}));
|
|
69
|
-
|
|
69
|
+
(0, _react.act)(function () {
|
|
70
|
+
return ref.current.componentWillStay(spy);
|
|
71
|
+
});
|
|
70
72
|
var expected = 1;
|
|
71
73
|
expect(spy).toHaveBeenCalledTimes(expected);
|
|
72
74
|
});
|
|
@@ -78,7 +80,9 @@ describe('View', function () {
|
|
|
78
80
|
ref: ref,
|
|
79
81
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {})
|
|
80
82
|
}));
|
|
81
|
-
|
|
83
|
+
(0, _react.act)(function () {
|
|
84
|
+
return ref.current.componentWillEnter(spy);
|
|
85
|
+
});
|
|
82
86
|
var expected = 1;
|
|
83
87
|
expect(spy).toHaveBeenCalledTimes(expected);
|
|
84
88
|
});
|
|
@@ -90,11 +94,14 @@ describe('View', function () {
|
|
|
90
94
|
ref: ref,
|
|
91
95
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {})
|
|
92
96
|
}));
|
|
93
|
-
|
|
97
|
+
(0, _react.act)(function () {
|
|
98
|
+
return ref.current.componentWillLeave(spy);
|
|
99
|
+
});
|
|
94
100
|
var expected = 1;
|
|
95
101
|
expect(spy).toHaveBeenCalledTimes(expected);
|
|
96
102
|
});
|
|
97
103
|
test('should reset entering if a rendered panel re-enters', function () {
|
|
104
|
+
jest.useFakeTimers();
|
|
98
105
|
var spy = jest.fn();
|
|
99
106
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
100
107
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_View["default"], {
|
|
@@ -105,13 +112,17 @@ describe('View', function () {
|
|
|
105
112
|
"data-testid": "span"
|
|
106
113
|
})
|
|
107
114
|
}));
|
|
108
|
-
|
|
115
|
+
(0, _react.act)(function () {
|
|
116
|
+
return ref.current.componentDidAppear(spy);
|
|
117
|
+
});
|
|
109
118
|
var firstExpected = 'false';
|
|
110
119
|
|
|
111
120
|
var firstSpan = _react.screen.getByTestId('span');
|
|
112
121
|
|
|
113
122
|
expect(firstSpan).toHaveAttribute('data-entering', firstExpected);
|
|
114
|
-
|
|
123
|
+
(0, _react.act)(function () {
|
|
124
|
+
return ref.current.componentWillEnter(spy);
|
|
125
|
+
});
|
|
115
126
|
var secondExpected = 'true';
|
|
116
127
|
|
|
117
128
|
var secondSpan = _react.screen.getByTestId('span');
|
|
@@ -120,6 +131,12 @@ describe('View', function () {
|
|
|
120
131
|
});
|
|
121
132
|
});
|
|
122
133
|
describe('imperative API with arranger', function () {
|
|
134
|
+
beforeEach(function () {
|
|
135
|
+
jest.useFakeTimers();
|
|
136
|
+
});
|
|
137
|
+
afterEach(function () {
|
|
138
|
+
jest.useRealTimers();
|
|
139
|
+
});
|
|
123
140
|
test('should call callback for "stay"', function (done) {
|
|
124
141
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
125
142
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_View["default"], {
|
|
@@ -133,7 +150,10 @@ describe('View', function () {
|
|
|
133
150
|
expect(spy).toHaveBeenCalledTimes(expected);
|
|
134
151
|
done();
|
|
135
152
|
});
|
|
136
|
-
|
|
153
|
+
(0, _react.act)(function () {
|
|
154
|
+
return ref.current.componentWillStay(spy);
|
|
155
|
+
});
|
|
156
|
+
jest.runAllTimers();
|
|
137
157
|
});
|
|
138
158
|
test('should call callback for "enter"', function (done) {
|
|
139
159
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
@@ -148,7 +168,10 @@ describe('View', function () {
|
|
|
148
168
|
expect(spy).toHaveBeenCalledTimes(expected);
|
|
149
169
|
done();
|
|
150
170
|
});
|
|
151
|
-
|
|
171
|
+
(0, _react.act)(function () {
|
|
172
|
+
return ref.current.componentWillEnter(spy);
|
|
173
|
+
});
|
|
174
|
+
jest.runAllTimers();
|
|
152
175
|
});
|
|
153
176
|
test('should call callback for "leave"', function (done) {
|
|
154
177
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
@@ -163,7 +186,10 @@ describe('View', function () {
|
|
|
163
186
|
expect(spy).toHaveBeenCalledTimes(expected);
|
|
164
187
|
done();
|
|
165
188
|
});
|
|
166
|
-
|
|
189
|
+
(0, _react.act)(function () {
|
|
190
|
+
return ref.current.componentWillLeave(spy);
|
|
191
|
+
});
|
|
192
|
+
jest.runAllTimers();
|
|
167
193
|
});
|
|
168
194
|
test('should call callback immediately when {noAnimation}', function () {
|
|
169
195
|
var spy = jest.fn();
|
|
@@ -175,7 +201,9 @@ describe('View', function () {
|
|
|
175
201
|
ref: ref,
|
|
176
202
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {})
|
|
177
203
|
}));
|
|
178
|
-
|
|
204
|
+
(0, _react.act)(function () {
|
|
205
|
+
return ref.current.componentWillEnter(spy);
|
|
206
|
+
});
|
|
179
207
|
var expected = 1;
|
|
180
208
|
expect(spy).toHaveBeenCalledTimes(expected);
|
|
181
209
|
});
|
|
@@ -188,7 +216,9 @@ describe('View', function () {
|
|
|
188
216
|
ref: ref,
|
|
189
217
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {})
|
|
190
218
|
}));
|
|
191
|
-
|
|
219
|
+
(0, _react.act)(function () {
|
|
220
|
+
return ref.current.componentWillAppear(spy);
|
|
221
|
+
});
|
|
192
222
|
var expected = 1;
|
|
193
223
|
expect(spy).toHaveBeenCalledTimes(expected);
|
|
194
224
|
});
|
|
@@ -215,7 +245,9 @@ describe('View', function () {
|
|
|
215
245
|
ref: ref,
|
|
216
246
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {})
|
|
217
247
|
}));
|
|
218
|
-
|
|
248
|
+
(0, _react.act)(function () {
|
|
249
|
+
return ref.current.componentWillEnter();
|
|
250
|
+
});
|
|
219
251
|
expect(arranger.enter).toBeCalledWith(arrangerStruct);
|
|
220
252
|
});
|
|
221
253
|
});
|
|
@@ -22,15 +22,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
22
22
|
|
|
23
23
|
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); } }
|
|
24
24
|
|
|
25
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
25
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
26
26
|
|
|
27
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
+
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); }
|
|
28
28
|
|
|
29
29
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
30
30
|
|
|
31
31
|
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); }; }
|
|
32
32
|
|
|
33
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
33
|
+
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); }
|
|
34
34
|
|
|
35
35
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
36
36
|
|
|
@@ -40,6 +40,12 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
40
40
|
|
|
41
41
|
describe('ViewManager', function () {
|
|
42
42
|
// Suite-wide setup
|
|
43
|
+
beforeEach(function () {
|
|
44
|
+
jest.useFakeTimers();
|
|
45
|
+
});
|
|
46
|
+
afterEach(function () {
|
|
47
|
+
jest.useRealTimers();
|
|
48
|
+
});
|
|
43
49
|
test('should render {component} as its child - <div/> by default', function () {
|
|
44
50
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_["default"], {
|
|
45
51
|
"data-testid": "component",
|
|
@@ -142,7 +148,7 @@ describe('ViewManager', function () {
|
|
|
142
148
|
|
|
143
149
|
expect(actual).toBe(expected);
|
|
144
150
|
});
|
|
145
|
-
test('should have 1 child immediately after setting new {index} with an {arranger} and {noAnimation} is
|
|
151
|
+
test('should have 1 child immediately after setting new {index} with an {arranger} and {noAnimation} is true', function () {
|
|
146
152
|
var _render2 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_["default"], {
|
|
147
153
|
arranger: _testUtils.MockArranger,
|
|
148
154
|
"data-testid": "viewManager",
|
|
@@ -306,14 +312,15 @@ describe('ViewManager', function () {
|
|
|
306
312
|
children: "View 5"
|
|
307
313
|
})]
|
|
308
314
|
}));
|
|
309
|
-
|
|
310
|
-
|
|
315
|
+
(0, _react.act)(function () {
|
|
316
|
+
return jest.advanceTimersByTime(duration + 10);
|
|
317
|
+
});
|
|
318
|
+
var expected = 1;
|
|
311
319
|
|
|
312
|
-
|
|
320
|
+
var actual = _react.screen.getByTestId('viewManager').children.length;
|
|
313
321
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}, duration + 10);
|
|
322
|
+
expect(actual).toBe(expected);
|
|
323
|
+
done();
|
|
317
324
|
});
|
|
318
325
|
test('should have 1 child when noAnimation is true', function () {
|
|
319
326
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_["default"], {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = exports.UiVirtualListBaseNative = exports.UiVirtualListBase = void 0;
|
|
7
7
|
|
|
8
8
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
|
|
@@ -21,6 +21,8 @@ var _UiVirtualListModule = _interopRequireDefault(require("./UiVirtualList.modul
|
|
|
21
21
|
|
|
22
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
23
|
|
|
24
|
+
var _excluded = ["className", "containerProps", "itemsRenderer", "style"];
|
|
25
|
+
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
27
|
|
|
26
28
|
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; }
|
|
@@ -39,9 +41,9 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
39
41
|
|
|
40
42
|
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; }
|
|
41
43
|
|
|
42
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
44
|
+
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; }
|
|
43
45
|
|
|
44
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
46
|
+
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; }
|
|
45
47
|
|
|
46
48
|
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; }
|
|
47
49
|
|
|
@@ -49,15 +51,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
49
51
|
|
|
50
52
|
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); } }
|
|
51
53
|
|
|
52
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
54
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
53
55
|
|
|
54
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
56
|
+
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); }
|
|
55
57
|
|
|
56
58
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
57
59
|
|
|
58
60
|
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); }; }
|
|
59
61
|
|
|
60
|
-
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
62
|
+
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); }
|
|
61
63
|
|
|
62
64
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
63
65
|
|
|
@@ -84,9 +86,9 @@ var gridListItemSizeShape = _propTypes["default"].shape({
|
|
|
84
86
|
|
|
85
87
|
|
|
86
88
|
var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
87
|
-
var _class
|
|
89
|
+
var _class;
|
|
88
90
|
|
|
89
|
-
return
|
|
91
|
+
return _class = /*#__PURE__*/function (_Component) {
|
|
90
92
|
_inherits(VirtualListCore, _Component);
|
|
91
93
|
|
|
92
94
|
var _super = _createSuper(VirtualListCore);
|
|
@@ -388,8 +390,7 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
|
388
390
|
value: // Calculate metrics for VirtualList after the 1st render to know client W/H.
|
|
389
391
|
function componentDidMount() {
|
|
390
392
|
if (!this.props.clientSize) {
|
|
391
|
-
this.calculateMetrics(this.props);
|
|
392
|
-
|
|
393
|
+
this.calculateMetrics(this.props);
|
|
393
394
|
this.setState(this.getStatesAndUpdateBounds(this.props));
|
|
394
395
|
} else {
|
|
395
396
|
this.emitUpdateItems();
|
|
@@ -467,8 +468,7 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
|
467
468
|
x = _this$getXY.x,
|
|
468
469
|
y = _this$getXY.y;
|
|
469
470
|
|
|
470
|
-
this.calculateMetrics(this.props);
|
|
471
|
-
|
|
471
|
+
this.calculateMetrics(this.props);
|
|
472
472
|
this.setState(this.getStatesAndUpdateBounds(this.props));
|
|
473
473
|
this.setContainerSize();
|
|
474
474
|
var _this$scrollBounds = this.scrollBounds,
|
|
@@ -484,8 +484,7 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
|
484
484
|
});
|
|
485
485
|
deferScrollTo = true;
|
|
486
486
|
} else if (this.hasDataSizeChanged) {
|
|
487
|
-
var newState = this.getStatesAndUpdateBounds(this.props, this.state.firstIndex);
|
|
488
|
-
|
|
487
|
+
var newState = this.getStatesAndUpdateBounds(this.props, this.state.firstIndex);
|
|
489
488
|
this.setState(newState);
|
|
490
489
|
this.setContainerSize();
|
|
491
490
|
deferScrollTo = true;
|
|
@@ -1116,7 +1115,7 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
|
1116
1115
|
containerProps = _this$props7.containerProps,
|
|
1117
1116
|
itemsRenderer = _this$props7.itemsRenderer,
|
|
1118
1117
|
style = _this$props7.style,
|
|
1119
|
-
rest = _objectWithoutProperties(_this$props7,
|
|
1118
|
+
rest = _objectWithoutProperties(_this$props7, _excluded),
|
|
1120
1119
|
cc = this.cc,
|
|
1121
1120
|
itemContainerRef = this.itemContainerRef,
|
|
1122
1121
|
primary = this.primary,
|
|
@@ -1365,10 +1364,12 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
|
1365
1364
|
cbScrollTo: nop,
|
|
1366
1365
|
dataSize: 0,
|
|
1367
1366
|
direction: 'vertical',
|
|
1367
|
+
itemsRenderer: nop,
|
|
1368
|
+
// eslint-disable-line react/default-props-match-prop-types
|
|
1368
1369
|
overhang: 3,
|
|
1369
1370
|
pageScroll: false,
|
|
1370
1371
|
spacing: 0
|
|
1371
|
-
},
|
|
1372
|
+
}, _class;
|
|
1372
1373
|
};
|
|
1373
1374
|
/**
|
|
1374
1375
|
* A basic base component for
|