@enact/ui 5.6.0 → 5.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.
- package/AnnounceDecorator/Announce.js +8 -8
- package/AnnounceDecorator/AnnounceDecorator.js +5 -5
- package/BodyText/BodyText.js +5 -5
- package/BodyText/tests/BodyText-specs.js +2 -1
- package/Button/Button.js +5 -5
- package/CHANGELOG.md +18 -0
- package/Cancelable/Cancelable.js +9 -9
- package/Cancelable/tests/Cancelable-specs.js +5 -5
- package/Card/Card.js +5 -5
- package/Card/tests/Card-specs.js +2 -1
- package/Changeable/Changeable.js +9 -9
- package/ComponentOverride/ComponentOverride.js +15 -11
- package/FloatingLayer/FloatingLayer.js +10 -10
- package/FloatingLayer/FloatingLayerContainer.js +3 -3
- package/FloatingLayer/FloatingLayerDecorator.js +5 -5
- package/FloatingLayer/Scrim.js +9 -9
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +4 -4
- package/FloatingLayer/useFloatingLayer.js +3 -4
- package/ForwardRef/ForwardRef.js +5 -5
- package/Group/Group.js +5 -5
- package/Group/GroupItem.js +5 -5
- package/Group/tests/Group-specs.js +2 -1
- package/Heading/Heading.js +5 -5
- package/Icon/Icon.js +5 -5
- package/Icon/tests/Icon-specs.js +2 -1
- package/Image/Image.js +5 -5
- package/Image/tests/Image-specs.js +2 -1
- package/ImageItem/ImageItem.js +5 -5
- package/ImageItem/tests/ImageItem-specs.js +6 -5
- package/Item/Item.js +5 -5
- package/LabeledIcon/LabeledIcon.js +5 -5
- package/Layout/Cell.js +5 -5
- package/Layout/Layout.js +5 -5
- package/Layout/tests/Layout-specs.js +9 -9
- package/Marquee/Marquee.module.css +44 -0
- package/Marquee/MarqueeBase.js +134 -21
- package/Marquee/MarqueeController.js +4 -4
- package/Marquee/MarqueeDecorator.js +219 -27
- package/Marquee/index.d.ts +60 -12
- package/Marquee/tests/Marquee-specs.js +3 -3
- package/Marquee/tests/Marquee-vertical-specs.js +1358 -0
- package/Marquee/useMarqueeController.js +4 -4
- package/Marquee/utils.js +22 -0
- package/Marquee/verticalMeasure.js +118 -0
- package/Measurable/Measurable.js +8 -9
- package/Measurable/tests/Measurable-specs.js +7 -6
- package/Media/Media.js +10 -10
- package/Placeholder/PlaceholderControllerDecorator.js +9 -9
- package/Placeholder/PlaceholderDecorator.js +9 -9
- package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +4 -4
- package/ProgressBar/ProgressBar.js +5 -5
- package/Repeater/Repeater.js +5 -5
- package/Repeater/tests/Repeater-specs.js +6 -5
- package/Resizable/Resizable.js +4 -4
- package/Resizable/tests/Resizable-specs.js +2 -1
- package/Resizable/tests/useResize-specs.js +4 -4
- package/Resizable/useResize.js +3 -3
- package/Routable/Link.js +9 -9
- package/Routable/Routable.js +5 -5
- package/Routable/Router.js +9 -9
- package/Routable/tests/Routable-specs.js +7 -8
- package/Routable/tests/Router-specs.js +1 -1
- package/Scroller/Scroller.js +4 -4
- package/Scroller/ScrollerBasic.js +10 -10
- package/Skinnable/Skinnable.js +5 -5
- package/Skinnable/tests/Skinnable-specs.js +4 -4
- package/Skinnable/tests/useSkins-specs.js +4 -4
- package/Slider/Knob.js +5 -5
- package/Slider/PositionDecorator.js +8 -8
- package/Slider/Slider.js +5 -5
- package/Slottable/Slottable.js +4 -4
- package/Slottable/useSlots.js +5 -5
- package/Spinner/Spinner.js +5 -5
- package/ToggleIcon/ToggleIcon.js +5 -5
- package/Toggleable/Toggle.js +5 -5
- package/Toggleable/Toggleable.js +9 -9
- package/Toggleable/useToggle.js +5 -5
- package/Touchable/ClickAllow.js +3 -3
- package/Touchable/Drag.js +6 -6
- package/Touchable/Flick.js +5 -5
- package/Touchable/Hold.js +5 -5
- package/Touchable/Pinch.js +6 -6
- package/Touchable/Touch.js +3 -3
- package/Touchable/Touchable.js +5 -5
- package/Touchable/config.js +4 -4
- package/Touchable/tests/Touchable-specs.js +1 -1
- package/Touchable/tests/useTouch-specs.js +5 -5
- package/Touchable/useTouch.js +7 -8
- package/Transition/Transition.js +14 -13
- package/Transition/tests/Transition-specs.js +9 -9
- package/ViewManager/Arranger.js +4 -4
- package/ViewManager/TransitionGroup.js +7 -7
- package/ViewManager/View.js +9 -9
- package/ViewManager/ViewManager.js +11 -10
- package/ViewManager/tests/ViewManager-specs.js +6 -6
- package/VirtualList/VirtualList.js +4 -4
- package/VirtualList/VirtualListBasic.js +67 -47
- package/VirtualList/tests/VirtualGridList-native-specs.js +5 -5
- package/VirtualList/tests/VirtualGridList-specs.js +16 -15
- package/VirtualList/tests/VirtualList-native-specs.js +164 -16
- package/VirtualList/tests/VirtualList-specs.js +16 -15
- package/internal/IdProvider/IdProvider.js +4 -4
- package/internal/IdProvider/Provider.js +3 -3
- package/internal/IdProvider/tests/IdProvider-specs.js +4 -4
- package/internal/IdProvider/tests/useId-specs.js +16 -8
- package/internal/Pure/Pure.js +9 -9
- package/internal/Pure/tests/Pure-specs.js +8 -8
- package/internal/localized-fonts/localized-fonts.js +3 -4
- package/package.json +6 -6
- package/resolution/ResolutionDecorator.js +71 -87
- package/resolution/index.js +2 -1
- package/resolution/tests/resolution-specs.js +7 -8
- package/useControlledState/tests/useControlledState-specs.js +3 -4
- package/useControlledState/useControlledState.js +3 -4
- package/useScroll/ScrollAnimator.js +3 -3
- package/useScroll/Scrollbar.js +5 -5
- package/useScroll/ScrollbarTrack.js +5 -5
- package/useScroll/scrollMotion.js +126 -0
- package/useScroll/tests/scrollMotion-specs.js +215 -0
- package/useScroll/tests/useScroll-specs.js +430 -9
- package/useScroll/useScroll.js +156 -92
|
@@ -55,25 +55,26 @@ var _Class;
|
|
|
55
55
|
* @ui
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
var e;
|
|
59
|
+
function _interopRequireWildcard(t, r) { if (!r && t && t.__esModule) return t; var n, a, o = Object.defineProperty, f = { __proto__: null, "default": t }; if (Object(t) !== t) return f; if (e || "function" != typeof WeakMap || (e = new WeakMap()), e) { if (e.has(t)) return e.get(t); e.set(t, f); } for (a in t) "default" !== a && {}.hasOwnProperty.call(t, a) && ((n = o && Object.getOwnPropertyDescriptor(t, a)) && (n.get || n.set) ? o(f, a, n) : f[a] = t[a]); return f; }
|
|
59
60
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
60
61
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
61
|
-
function _objectSpread(
|
|
62
|
-
function _defineProperty(
|
|
63
|
-
function _objectWithoutProperties(
|
|
62
|
+
function _objectSpread(r) { for (var t = 1; t < arguments.length; t++) { var o = null != arguments[t] ? arguments[t] : {}; t % 2 ? ownKeys(Object(o), !0).forEach(function (t) { _defineProperty(r, t, o[t]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(o)) : ownKeys(Object(o)).forEach(function (e) { Object.defineProperty(r, e, Object.getOwnPropertyDescriptor(o, e)); }); } return r; }
|
|
63
|
+
function _defineProperty(r, t, o) { return (t = _toPropertyKey(t)) in r ? Object.defineProperty(r, t, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : r[t] = o, r; }
|
|
64
|
+
function _objectWithoutProperties(t, r) { if (null == t) return {}; var o, n, i = _objectWithoutPropertiesLoose(t, r); if (Object.getOwnPropertySymbols) { var l = Object.getOwnPropertySymbols(t); for (n = 0; n < l.length; n++) o = l[n], -1 === r.indexOf(o) && {}.propertyIsEnumerable.call(t, o) && (i[o] = t[o]); } return i; }
|
|
64
65
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
65
66
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
66
|
-
function _defineProperties(
|
|
67
|
+
function _defineProperties(r, t) { for (var o = 0; o < t.length; o++) { var i = t[o]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(r, _toPropertyKey(i.key), i); } }
|
|
67
68
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
68
|
-
function _toPropertyKey(
|
|
69
|
-
function _toPrimitive(t,
|
|
70
|
-
function
|
|
69
|
+
function _toPropertyKey(r) { var o = _toPrimitive(r, "string"); return "symbol" == typeof o ? o : o + ""; }
|
|
70
|
+
function _toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
|
|
71
|
+
function _inherits(t, r) { if ("function" != typeof r && null !== r) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), r && _setPrototypeOf(t, r); }
|
|
72
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
73
|
+
function _callSuper(e, c, p) { return c = _getPrototypeOf(c), _possibleConstructorReturn(e, _isNativeReflectConstruct() ? Reflect.construct(c, p || [], _getPrototypeOf(e).constructor) : c.apply(e, p)); }
|
|
71
74
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
72
75
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
73
76
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
74
77
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
75
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
76
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
77
78
|
var ViewManagerBase = exports.ViewManagerBase = (_Class = /*#__PURE__*/function (_Component) {
|
|
78
79
|
function ViewManagerBase(props) {
|
|
79
80
|
var _this;
|
|
@@ -11,17 +11,17 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
11
11
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
12
12
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
13
13
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
-
function _defineProperties(
|
|
14
|
+
function _defineProperties(r, t) { for (var o = 0; o < t.length; o++) { var i = t[o]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(r, _toPropertyKey(i.key), i); } }
|
|
15
15
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
-
function _toPropertyKey(
|
|
17
|
-
function _toPrimitive(t,
|
|
18
|
-
function
|
|
16
|
+
function _toPropertyKey(r) { var o = _toPrimitive(r, "string"); return "symbol" == typeof o ? o : o + ""; }
|
|
17
|
+
function _toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
|
|
18
|
+
function _inherits(t, r) { if ("function" != typeof r && null !== r) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), r && _setPrototypeOf(t, r); }
|
|
19
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
20
|
+
function _callSuper(e, c, p) { return c = _getPrototypeOf(c), _possibleConstructorReturn(e, _isNativeReflectConstruct() ? Reflect.construct(c, p || [], _getPrototypeOf(e).constructor) : c.apply(e, p)); }
|
|
19
21
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
20
22
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
21
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
24
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
23
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
24
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
25
25
|
describe('ViewManager', function () {
|
|
26
26
|
// Suite-wide setup
|
|
27
27
|
beforeEach(function () {
|
|
@@ -32,10 +32,10 @@ var _VirtualListBasic = require("./VirtualListBasic");
|
|
|
32
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
33
33
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
34
34
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
|
-
function _objectSpread(
|
|
36
|
-
function _defineProperty(
|
|
37
|
-
function _toPropertyKey(
|
|
38
|
-
function _toPrimitive(t,
|
|
35
|
+
function _objectSpread(r) { for (var t = 1; t < arguments.length; t++) { var o = null != arguments[t] ? arguments[t] : {}; t % 2 ? ownKeys(Object(o), !0).forEach(function (t) { _defineProperty(r, t, o[t]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(o)) : ownKeys(Object(o)).forEach(function (e) { Object.defineProperty(r, e, Object.getOwnPropertyDescriptor(o, e)); }); } return r; }
|
|
36
|
+
function _defineProperty(r, t, o) { return (t = _toPropertyKey(t)) in r ? Object.defineProperty(r, t, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : r[t] = o, r; }
|
|
37
|
+
function _toPropertyKey(r) { var o = _toPrimitive(r, "string"); return "symbol" == typeof o ? o : o + ""; }
|
|
38
|
+
function _toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); } /**
|
|
39
39
|
* Unstyled virtual list components and behaviors to be customized by a theme or application.
|
|
40
40
|
*
|
|
41
41
|
* @module ui/VirtualList
|
|
@@ -16,30 +16,30 @@ var _VirtualListModule = _interopRequireDefault(require("./VirtualList.module.cs
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
var _excluded = ["className", "containerProps", "placeholderRenderer", "role", "style", "scrollMode"];
|
|
18
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
-
function _objectWithoutProperties(
|
|
19
|
+
function _objectWithoutProperties(t, r) { if (null == t) return {}; var o, n, i = _objectWithoutPropertiesLoose(t, r); if (Object.getOwnPropertySymbols) { var l = Object.getOwnPropertySymbols(t); for (n = 0; n < l.length; n++) o = l[n], -1 === r.indexOf(o) && {}.propertyIsEnumerable.call(t, o) && (i[o] = t[o]); } return i; }
|
|
20
20
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
21
21
|
function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); }
|
|
22
|
-
function _toConsumableArray(
|
|
22
|
+
function _toConsumableArray(a) { return _arrayWithoutHoles(a) || _iterableToArray(a) || _unsupportedIterableToArray(a) || _nonIterableSpread(); }
|
|
23
23
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
-
function _unsupportedIterableToArray(
|
|
25
|
-
function _iterableToArray(r) {
|
|
26
|
-
function _arrayWithoutHoles(
|
|
24
|
+
function _unsupportedIterableToArray(t, e) { if (t) { if ("string" == typeof t) return _arrayLikeToArray(t, e); var o = {}.toString.call(t).slice(8, -1); return "Object" === o && t.constructor && (o = t.constructor.name), "Map" === o || "Set" === o ? Array.from(t) : "Arguments" === o || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o) ? _arrayLikeToArray(t, e) : void 0; } }
|
|
25
|
+
function _iterableToArray(r) { var e = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (Array.isArray(r) && (null == e || e === ("undefined" != typeof Symbol && [][Symbol.iterator]) || e === []["@@iterator"])) return r; if (null != e) { for (var t, o = [], a = e.call(r); !(t = a.next()).done;) o.push(t.value); return o; } }
|
|
26
|
+
function _arrayWithoutHoles(a) { if (Array.isArray(a)) return _arrayLikeToArray(a); }
|
|
27
27
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
28
28
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
-
function _objectSpread(
|
|
30
|
-
function _defineProperty(
|
|
29
|
+
function _objectSpread(r) { for (var t = 1; t < arguments.length; t++) { var o = null != arguments[t] ? arguments[t] : {}; t % 2 ? ownKeys(Object(o), !0).forEach(function (t) { _defineProperty(r, t, o[t]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(o)) : ownKeys(Object(o)).forEach(function (e) { Object.defineProperty(r, e, Object.getOwnPropertyDescriptor(o, e)); }); } return r; }
|
|
30
|
+
function _defineProperty(r, t, o) { return (t = _toPropertyKey(t)) in r ? Object.defineProperty(r, t, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : r[t] = o, r; }
|
|
31
31
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
32
|
-
function _defineProperties(
|
|
32
|
+
function _defineProperties(r, t) { for (var o = 0; o < t.length; o++) { var i = t[o]; i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(r, _toPropertyKey(i.key), i); } }
|
|
33
33
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
34
|
-
function _toPropertyKey(
|
|
35
|
-
function _toPrimitive(t,
|
|
36
|
-
function
|
|
34
|
+
function _toPropertyKey(r) { var o = _toPrimitive(r, "string"); return "symbol" == typeof o ? o : o + ""; }
|
|
35
|
+
function _toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
|
|
36
|
+
function _inherits(t, r) { if ("function" != typeof r && null !== r) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(r && r.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), r && _setPrototypeOf(t, r); }
|
|
37
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
38
|
+
function _callSuper(e, c, p) { return c = _getPrototypeOf(c), _possibleConstructorReturn(e, _isNativeReflectConstruct() ? Reflect.construct(c, p || [], _getPrototypeOf(e).constructor) : c.apply(e, p)); }
|
|
37
39
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
38
40
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
39
41
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
40
42
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
41
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
42
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
43
43
|
var nop = function nop() {};
|
|
44
44
|
|
|
45
45
|
/**
|
|
@@ -171,7 +171,7 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
171
171
|
scrollBounds = _this2.scrollBounds;
|
|
172
172
|
var maxPos = isPrimaryDirectionVertical ? scrollBounds.maxTop : scrollBounds.maxLeft;
|
|
173
173
|
var position = _this.getGridPosition(index);
|
|
174
|
-
var offset
|
|
174
|
+
var offset;
|
|
175
175
|
var marginOffset = isPrimaryDirectionVertical ? _this.itemMarginTop + _this.itemMarginBottom : _this.itemMarginLeft + _this.itemMarginRight;
|
|
176
176
|
if (stickTo === 'start') {
|
|
177
177
|
// 'start'
|
|
@@ -319,10 +319,10 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
319
319
|
}, key);
|
|
320
320
|
};
|
|
321
321
|
_this.getScrollHeight = function () {
|
|
322
|
-
return _this.isPrimaryDirectionVertical ? _this.getVirtualScrollDimension() + _this.props.getAffordance() : _this.scrollBounds.clientHeight;
|
|
322
|
+
return _this.isPrimaryDirectionVertical ? _this.getVirtualScrollDimension() + _this.props.getAffordance() + _this.itemMarginTop + _this.itemMarginBottom : _this.scrollBounds.clientHeight;
|
|
323
323
|
};
|
|
324
324
|
_this.getScrollWidth = function () {
|
|
325
|
-
return _this.isPrimaryDirectionVertical ? _this.scrollBounds.clientWidth : _this.getVirtualScrollDimension();
|
|
325
|
+
return _this.isPrimaryDirectionVertical ? _this.scrollBounds.clientWidth : _this.getVirtualScrollDimension() + _this.itemMarginLeft + _this.itemMarginRight;
|
|
326
326
|
};
|
|
327
327
|
_this.getVirtualScrollDimension = function () {
|
|
328
328
|
if (_this.props.itemSizes) {
|
|
@@ -383,6 +383,8 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
383
383
|
function componentDidMount() {
|
|
384
384
|
if (!this.props.clientSize) {
|
|
385
385
|
this.calculateMetrics(this.props);
|
|
386
|
+
// The metrics are measured from the rendered DOM, so they can only be stored after the first render
|
|
387
|
+
// eslint-disable-next-line @eslint-react/no-set-state-in-component-did-mount
|
|
386
388
|
this.setState(this.getStatesAndUpdateBounds(this.props));
|
|
387
389
|
} else {
|
|
388
390
|
this.emitUpdateItems();
|
|
@@ -404,15 +406,7 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
404
406
|
this.itemMarginBottom = Number(firstItemStyle.getPropertyValue('margin-bottom').slice(0, -2));
|
|
405
407
|
this.itemMarginLeft = Number(firstItemStyle.getPropertyValue('margin-left').slice(0, -2));
|
|
406
408
|
this.itemMarginRight = Number(firstItemStyle.getPropertyValue('margin-right').slice(0, -2));
|
|
407
|
-
|
|
408
|
-
var marginSum = this.itemMarginTop + this.itemMarginBottom;
|
|
409
|
-
this.scrollBounds.scrollHeight += marginSum;
|
|
410
|
-
this.scrollBounds.maxTop += marginSum;
|
|
411
|
-
} else {
|
|
412
|
-
var _marginSum = this.itemMarginLeft + this.itemMarginRight;
|
|
413
|
-
this.scrollBounds.scrollWidth += _marginSum;
|
|
414
|
-
this.scrollBounds.maxLeft += _marginSum;
|
|
415
|
-
}
|
|
409
|
+
this.calculateScrollBounds(this.props);
|
|
416
410
|
this.setContainerSize();
|
|
417
411
|
}
|
|
418
412
|
var deferScrollTo = false;
|
|
@@ -479,6 +473,8 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
479
473
|
/* istanbul ignore next */
|
|
480
474
|
if (this.scrollPosition === 0 && this.moreInfo.firstVisibleIndex !== 0) {
|
|
481
475
|
this.scrollPosition = this.prevScrollPosition;
|
|
476
|
+
// Restores the previous first index after the layout props changed (guarded, so it does not loop)
|
|
477
|
+
// eslint-disable-next-line @eslint-react/no-set-state-in-component-did-update
|
|
482
478
|
this.setState({
|
|
483
479
|
firstIndex: prevState.firstIndex
|
|
484
480
|
});
|
|
@@ -504,6 +500,8 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
504
500
|
x = _this$getXY.x,
|
|
505
501
|
y = _this$getXY.y;
|
|
506
502
|
this.calculateMetrics(this.props);
|
|
503
|
+
// Layout props changed: the metrics are re-measured from the DOM and stored (guarded, so it does not loop)
|
|
504
|
+
// eslint-disable-next-line @eslint-react/no-set-state-in-component-did-update
|
|
507
505
|
this.setState(this.getStatesAndUpdateBounds(this.props, prevState.firstIndex ? prevState.firstIndex : 0));
|
|
508
506
|
this.setContainerSize();
|
|
509
507
|
var xMax = scrollWidth - clientWidth;
|
|
@@ -515,6 +513,8 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
515
513
|
deferScrollTo = true;
|
|
516
514
|
} else if (this.hasDataSizeChanged) {
|
|
517
515
|
var newState = this.getStatesAndUpdateBounds(this.props, this.state.firstIndex);
|
|
516
|
+
// Data size changed: the bounds are recalculated for the new items (guarded, so it does not loop)
|
|
517
|
+
// eslint-disable-next-line @eslint-react/no-set-state-in-component-did-update
|
|
518
518
|
this.setState(newState);
|
|
519
519
|
this.setContainerSize();
|
|
520
520
|
deferScrollTo = true;
|
|
@@ -668,7 +668,7 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
668
668
|
scrollPosition = this.scrollPosition,
|
|
669
669
|
threshold = this.threshold,
|
|
670
670
|
gridSize = primary.gridSize;
|
|
671
|
-
var newFirstIndex
|
|
671
|
+
var newFirstIndex;
|
|
672
672
|
if (wasFirstIndexMax && dataSizeDiff > 0) {
|
|
673
673
|
// If dataSize increased from bottom, we need adjust firstIndex
|
|
674
674
|
// If this is a gridlist and dataSizeDiff is smaller than 1 line, we are adjusting firstIndex without threshold change.
|
|
@@ -825,27 +825,48 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
825
825
|
key: "animateScroll",
|
|
826
826
|
value: function _animateScroll(left, top, node) {
|
|
827
827
|
var _this8 = this;
|
|
828
|
-
//
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
828
|
+
// Retarget the ongoing animation instead of starting another loop so that only one loop drives the scroll.
|
|
829
|
+
// Concurrent loops keep scrolling toward their own old targets, and when frames are delayed
|
|
830
|
+
// (e.g. holding a 5-way key while the device is busy), their timeout fallbacks override the latest target.
|
|
831
|
+
// Keeping the loop alive also keeps `scrolling` true, so `onScrollStop` is not fired in the middle of a key repeat.
|
|
832
|
+
this.scrollAnimationTarget = {
|
|
833
|
+
left: left,
|
|
834
|
+
top: top
|
|
835
|
+
};
|
|
836
|
+
this.scrollAnimationStartTime = performance.now();
|
|
837
|
+
if (this.scrollAnimationId) {
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
836
840
|
|
|
837
|
-
// Progressively scrolls the node toward
|
|
841
|
+
// Progressively scrolls the node toward the latest target position using requestAnimationFrame.
|
|
838
842
|
// It applies an incremental scroll on each frame and cancels the animation once
|
|
839
|
-
// the target is reached or the duration (500ms) is exceeded, falling back to
|
|
843
|
+
// the target is reached or the duration (500ms since the latest request) is exceeded, falling back to
|
|
840
844
|
// a smooth scroll if the timeout occurs first.
|
|
841
845
|
var _animateScroll = function animateScroll(currentTime) {
|
|
842
|
-
var
|
|
846
|
+
var _this8$scrollAnimatio = _this8.scrollAnimationTarget,
|
|
847
|
+
targetLeft = _this8$scrollAnimatio.left,
|
|
848
|
+
targetTop = _this8$scrollAnimatio.top;
|
|
849
|
+
var elapsed = (currentTime - _this8.scrollAnimationStartTime) / 500;
|
|
850
|
+
var distanceX = targetLeft - node.scrollLeft;
|
|
851
|
+
var distanceY = targetTop - node.scrollTop;
|
|
852
|
+
|
|
853
|
+
// Determine the direction of scroll (1 for forward/down, -1 for backward/up, 0 for no movement)
|
|
854
|
+
var directionX = Math.sign(distanceX);
|
|
855
|
+
var directionY = Math.sign(distanceY);
|
|
856
|
+
|
|
857
|
+
// Calculate an adaptive scroll factor (pixels per frame) for each item left to scroll.
|
|
858
|
+
// It uses the average item size (gridSize) to ensure the speed feels consistent,
|
|
859
|
+
// and speeds up while the target is several items away (e.g. holding a 5-way key) to keep up with the focus.
|
|
860
|
+
var gridSize = Math.max(_this8.primary.gridSize, 1);
|
|
861
|
+
var scrollFactor = Math.max(gridSize / 12, 2);
|
|
862
|
+
var speedX = scrollFactor * Math.max(Math.ceil(Math.abs(distanceX) / gridSize), 1);
|
|
863
|
+
var speedY = scrollFactor * Math.max(Math.ceil(Math.abs(distanceY) / gridSize), 1);
|
|
843
864
|
|
|
844
865
|
// Clamp each step to the remaining distance so the final frame lands exactly on the target
|
|
845
866
|
// instead of overshooting by up to `scrollFactor`. Overshooting would push a focused item
|
|
846
867
|
// anchored to the start edge (e.g. `stickTo="start"`) past that edge and clip it.
|
|
847
|
-
var stepX = directionX
|
|
848
|
-
var stepY = directionY
|
|
868
|
+
var stepX = directionX * Math.min(speedX, Math.abs(distanceX));
|
|
869
|
+
var stepY = directionY * Math.min(speedY, Math.abs(distanceY));
|
|
849
870
|
node.scrollBy({
|
|
850
871
|
top: stepY,
|
|
851
872
|
left: stepX,
|
|
@@ -853,20 +874,20 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
853
874
|
});
|
|
854
875
|
_this8.scrollAnimationId = window.requestAnimationFrame(_animateScroll);
|
|
855
876
|
_this8.scrolling = true;
|
|
856
|
-
var scrollHorizontally = directionX > 0 ? node.scrollLeft <
|
|
857
|
-
var scrollVertically = directionY > 0 ? node.scrollTop <
|
|
858
|
-
var targetReached = node.scrollLeft ===
|
|
877
|
+
var scrollHorizontally = directionX > 0 ? node.scrollLeft < targetLeft : node.scrollLeft > targetLeft;
|
|
878
|
+
var scrollVertically = directionY > 0 ? node.scrollTop < targetTop : node.scrollTop > targetTop;
|
|
879
|
+
var targetReached = node.scrollLeft === targetLeft && node.scrollTop === targetTop;
|
|
859
880
|
|
|
860
881
|
// Check if we've reached the needed scroll position
|
|
861
|
-
// or the elapsed time since
|
|
882
|
+
// or the elapsed time since the latest request is longer than 0.5s and cancel the animation
|
|
862
883
|
if (!scrollHorizontally && !scrollVertically || elapsed > 1) {
|
|
863
884
|
_this8.cancelScrollAnimation();
|
|
864
885
|
|
|
865
886
|
// Fallback: if time is out before reaching the target, jump there with smooth scroll
|
|
866
887
|
if (elapsed > 1 && !targetReached) {
|
|
867
888
|
node.scrollTo({
|
|
868
|
-
top:
|
|
869
|
-
left:
|
|
889
|
+
top: targetTop,
|
|
890
|
+
left: targetLeft,
|
|
870
891
|
behavior: 'smooth'
|
|
871
892
|
});
|
|
872
893
|
}
|
|
@@ -948,8 +969,7 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
948
969
|
pos = x;
|
|
949
970
|
}
|
|
950
971
|
if (pos > threshold.max || pos < threshold.min) {
|
|
951
|
-
var newThresholdMin
|
|
952
|
-
newThresholdMax = Infinity;
|
|
972
|
+
var newThresholdMin, newThresholdMax;
|
|
953
973
|
if (this.props.itemSizes) {
|
|
954
974
|
var overhangBefore = Math.floor(this.props.overhang / 2);
|
|
955
975
|
var firstRenderedIndex = -1;
|
|
@@ -8,11 +8,11 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _excluded = ["index"],
|
|
9
9
|
_excluded2 = ["index"];
|
|
10
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
-
function _objectSpread(
|
|
12
|
-
function _defineProperty(
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(t,
|
|
15
|
-
function _objectWithoutProperties(
|
|
11
|
+
function _objectSpread(r) { for (var t = 1; t < arguments.length; t++) { var o = null != arguments[t] ? arguments[t] : {}; t % 2 ? ownKeys(Object(o), !0).forEach(function (t) { _defineProperty(r, t, o[t]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(o)) : ownKeys(Object(o)).forEach(function (e) { Object.defineProperty(r, e, Object.getOwnPropertyDescriptor(o, e)); }); } return r; }
|
|
12
|
+
function _defineProperty(r, t, o) { return (t = _toPropertyKey(t)) in r ? Object.defineProperty(r, t, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : r[t] = o, r; }
|
|
13
|
+
function _toPropertyKey(r) { var o = _toPrimitive(r, "string"); return "symbol" == typeof o ? o : o + ""; }
|
|
14
|
+
function _toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
|
|
15
|
+
function _objectWithoutProperties(t, r) { if (null == t) return {}; var o, n, i = _objectWithoutPropertiesLoose(t, r); if (Object.getOwnPropertySymbols) { var l = Object.getOwnPropertySymbols(t); for (n = 0; n < l.length; n++) o = l[n], -1 === r.indexOf(o) && {}.propertyIsEnumerable.call(t, o) && (i[o] = t[o]); } return i; }
|
|
16
16
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
17
|
describe('VirtualGridList with native scrollMode', function () {
|
|
18
18
|
var clientSize, dataSize, items, itemSize, renderItem, svgGenerator;
|
|
@@ -8,11 +8,11 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
8
8
|
var _excluded = ["index"],
|
|
9
9
|
_excluded2 = ["index"];
|
|
10
10
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
-
function _objectSpread(
|
|
12
|
-
function _defineProperty(
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(t,
|
|
15
|
-
function _objectWithoutProperties(
|
|
11
|
+
function _objectSpread(r) { for (var t = 1; t < arguments.length; t++) { var o = null != arguments[t] ? arguments[t] : {}; t % 2 ? ownKeys(Object(o), !0).forEach(function (t) { _defineProperty(r, t, o[t]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(o)) : ownKeys(Object(o)).forEach(function (e) { Object.defineProperty(r, e, Object.getOwnPropertyDescriptor(o, e)); }); } return r; }
|
|
12
|
+
function _defineProperty(r, t, o) { return (t = _toPropertyKey(t)) in r ? Object.defineProperty(r, t, { value: o, enumerable: !0, configurable: !0, writable: !0 }) : r[t] = o, r; }
|
|
13
|
+
function _toPropertyKey(r) { var o = _toPrimitive(r, "string"); return "symbol" == typeof o ? o : o + ""; }
|
|
14
|
+
function _toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
|
|
15
|
+
function _objectWithoutProperties(t, r) { if (null == t) return {}; var o, n, i = _objectWithoutPropertiesLoose(t, r); if (Object.getOwnPropertySymbols) { var l = Object.getOwnPropertySymbols(t); for (n = 0; n < l.length; n++) o = l[n], -1 === r.indexOf(o) && {}.propertyIsEnumerable.call(t, o) && (i[o] = t[o]); } return i; }
|
|
16
16
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
17
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
18
18
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
@@ -41,7 +41,7 @@ var getElementClientCenter = function getElementClientCenter(element) {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
var drag = /*#__PURE__*/function () {
|
|
44
|
-
var
|
|
44
|
+
var _drag = _asyncToGenerator(function* (element, _ref) {
|
|
45
45
|
var delta = _ref.delta,
|
|
46
46
|
_ref$steps = _ref.steps,
|
|
47
47
|
steps = _ref$steps === void 0 ? 1 : _ref$steps;
|
|
@@ -72,9 +72,10 @@ var drag = /*#__PURE__*/function () {
|
|
|
72
72
|
}
|
|
73
73
|
_react.fireEvent.mouseUp(element, current);
|
|
74
74
|
});
|
|
75
|
-
|
|
76
|
-
return
|
|
77
|
-
}
|
|
75
|
+
function drag(_x, _x2) {
|
|
76
|
+
return _drag.apply(this, arguments);
|
|
77
|
+
}
|
|
78
|
+
return drag;
|
|
78
79
|
}();
|
|
79
80
|
describe('VirtualGridList', function () {
|
|
80
81
|
var clientSize, dataSize, getScrollTo, handlerOnScroll, handlerOnScrollStart, handlerOnScrollStop, items, itemSize, myScrollTo, onScrollCount, onScrollStartCount, onScrollStopCount, renderItem, resultScrollTop, startScrollTop, svgGenerator;
|
|
@@ -112,9 +113,9 @@ describe('VirtualGridList', function () {
|
|
|
112
113
|
done();
|
|
113
114
|
};
|
|
114
115
|
};
|
|
115
|
-
renderItem = function renderItem(
|
|
116
|
-
var index =
|
|
117
|
-
rest = _objectWithoutProperties(
|
|
116
|
+
renderItem = function renderItem(_ref2) {
|
|
117
|
+
var index = _ref2.index,
|
|
118
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
118
119
|
// eslint-disable-line enact/display-name
|
|
119
120
|
var _items$index = items[index],
|
|
120
121
|
text = _items$index.text,
|
|
@@ -578,9 +579,9 @@ describe('VirtualGridList', function () {
|
|
|
578
579
|
}, {
|
|
579
580
|
name: 'C'
|
|
580
581
|
}];
|
|
581
|
-
var renderItemArray = function renderItemArray(
|
|
582
|
-
var index =
|
|
583
|
-
rest = _objectWithoutProperties(
|
|
582
|
+
var renderItemArray = function renderItemArray(_ref4) {
|
|
583
|
+
var index = _ref4.index,
|
|
584
|
+
rest = _objectWithoutProperties(_ref4, _excluded2);
|
|
584
585
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, rest), {}, {
|
|
585
586
|
id: 'item' + index,
|
|
586
587
|
children: itemArray[index].name
|