@enact/ui 4.9.2 → 5.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AnnounceDecorator/Announce.js +20 -22
- package/AnnounceDecorator/AnnounceDecorator.js +5 -5
- package/AnnounceDecorator/tests/Announce-specs.js +1 -1
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +1 -1
- package/AnnounceDecorator/tests/useAnnounce-specs.js +1 -1
- package/AnnounceDecorator/useAnnounce.js +1 -1
- package/BodyText/BodyText.js +5 -5
- package/BodyText/tests/BodyText-specs.js +1 -1
- package/Button/Button.js +5 -5
- package/Button/tests/Button-specs.js +3 -3
- package/CHANGELOG.md +33 -0
- package/Cancelable/Cancelable.js +22 -24
- package/Cancelable/tests/Cancelable-specs.js +4 -4
- package/Changeable/Changeable.js +22 -24
- package/Changeable/tests/Changeable-specs.js +1 -1
- package/ComponentOverride/ComponentOverride.js +4 -4
- package/FloatingLayer/FloatingLayer.js +20 -22
- package/FloatingLayer/FloatingLayerContainer.js +6 -7
- package/FloatingLayer/FloatingLayerDecorator.js +5 -5
- package/FloatingLayer/Scrim.js +18 -20
- package/FloatingLayer/tests/FloatingLayer-specs.js +1 -1
- package/FloatingLayer/tests/Scrim-specs.js +1 -1
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +2 -2
- package/FloatingLayer/useFloatingLayer.js +4 -4
- package/FloatingLayer/useFloatingLayerDecorator.js +1 -1
- package/ForwardRef/ForwardRef.js +3 -3
- package/Group/Group.js +5 -5
- package/Group/GroupItem.js +5 -5
- package/Group/tests/Group-specs.js +4 -4
- package/Heading/Heading.js +5 -5
- package/Heading/tests/Heading-specs.js +1 -1
- package/Icon/Icon.js +5 -5
- package/Icon/tests/Icon-specs.js +1 -1
- package/Image/Image.js +5 -5
- package/Image/tests/Image-specs.js +1 -1
- package/ImageItem/ImageItem.js +5 -5
- package/ImageItem/tests/ImageItem-specs.js +3 -3
- package/Item/Item.js +5 -5
- package/Item/tests/Item-specs.js +3 -3
- package/LabeledIcon/LabeledIcon.js +5 -5
- package/LabeledIcon/tests/LabeledIcon-specs.js +1 -1
- package/Layout/Cell.js +5 -5
- package/Layout/Layout.js +5 -5
- package/Layout/tests/Layout-specs.js +7 -7
- package/Marquee/MarqueeBase.js +5 -5
- package/Marquee/MarqueeController.js +3 -3
- package/Marquee/MarqueeDecorator.js +30 -51
- package/Marquee/index.d.ts +10 -14
- package/Marquee/index.js +1 -1
- package/Marquee/tests/Marquee-specs.js +5 -6
- package/Marquee/useMarqueeController.js +2 -2
- package/Measurable/Measurable.js +8 -8
- package/Measurable/tests/Measurable-specs.js +8 -10
- package/Media/Media.js +17 -19
- package/Placeholder/PlaceholderControllerDecorator.js +22 -24
- package/Placeholder/PlaceholderDecorator.js +20 -22
- package/Placeholder/index.js +1 -1
- package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +2 -2
- package/Placeholder/tests/PlaceholderDecorator-specs.js +1 -1
- package/ProgressBar/ProgressBar.js +5 -5
- package/ProgressBar/tests/ProgressBar-specs.js +1 -1
- package/Repeater/Repeater.js +5 -5
- package/Repeater/tests/Repeater-specs.js +3 -3
- package/Resizable/Resizable.js +3 -3
- package/Resizable/tests/Resizable-specs.js +2 -2
- package/Resizable/tests/useResize-specs.js +3 -3
- package/Resizable/useResize.js +3 -3
- package/Routable/Link.js +17 -19
- package/Routable/Routable.js +5 -5
- package/Routable/Route.js +1 -1
- package/Routable/Router.js +22 -24
- package/Routable/tests/Routable-specs.js +9 -9
- package/Routable/tests/Router-specs.js +1 -1
- package/Routable/util.js +1 -1
- package/Scroller/Scroller.d.ts +0 -120
- package/Scroller/Scroller.js +3 -11
- package/Scroller/ScrollerBasic.js +19 -21
- package/Scroller/tests/Scroller-specs.js +1 -1
- package/Skinnable/Skinnable.js +5 -5
- package/Skinnable/tests/Skinnable-specs.js +3 -3
- package/Skinnable/tests/useSkins-specs.js +3 -3
- package/Skinnable/util.js +1 -1
- package/Slider/Knob.js +5 -5
- package/Slider/PositionDecorator.js +25 -27
- package/Slider/Slider.js +5 -5
- package/Slider/tests/Slider-specs.js +1 -1
- package/Slottable/Slottable.js +3 -5
- package/Slottable/tests/Slottable-specs.js +1 -1
- package/Slottable/tests/useSlots-specs.js +1 -1
- package/Slottable/useSlots.js +5 -5
- package/Spinner/Spinner.js +5 -5
- package/ToggleIcon/ToggleIcon.js +5 -5
- package/ToggleIcon/tests/ToggleIcon-specs.js +3 -3
- package/Toggleable/Toggle.js +6 -7
- package/Toggleable/Toggleable.js +6 -6
- package/Toggleable/tests/Toggleable-specs.js +1 -1
- package/Toggleable/useToggle.js +8 -8
- package/Touchable/ClickAllow.js +5 -6
- package/Touchable/Drag.js +6 -6
- package/Touchable/Flick.js +7 -8
- package/Touchable/Hold.js +7 -8
- package/Touchable/Pinch.js +6 -6
- package/Touchable/Touch.js +6 -7
- package/Touchable/Touchable.js +5 -5
- package/Touchable/config.js +2 -2
- package/Touchable/tests/Touchable-specs.js +3 -3
- package/Touchable/tests/useTouch-specs.js +5 -5
- package/Touchable/useTouch.js +7 -7
- package/Transition/Transition.js +17 -19
- package/Transition/tests/Transition-specs.js +7 -7
- package/ViewManager/Arranger.js +3 -3
- package/ViewManager/TransitionGroup.js +18 -20
- package/ViewManager/View.js +15 -17
- package/ViewManager/ViewManager.js +25 -27
- package/ViewManager/tests/View-specs.js +1 -1
- package/ViewManager/tests/ViewManager-specs.js +16 -18
- package/VirtualList/VirtualList.d.ts +0 -158
- package/VirtualList/VirtualList.js +3 -17
- package/VirtualList/VirtualListBasic.js +42 -43
- package/VirtualList/tests/VirtualGridList-native-specs.js +4 -4
- package/VirtualList/tests/VirtualGridList-specs.js +6 -6
- package/VirtualList/tests/VirtualList-native-specs.js +5 -5
- package/VirtualList/tests/VirtualList-specs.js +7 -7
- package/internal/IdProvider/IdProvider.js +3 -3
- package/internal/IdProvider/Provider.js +5 -6
- package/internal/IdProvider/tests/IdProvider-specs.js +3 -3
- package/internal/IdProvider/tests/useId-specs.js +3 -3
- package/internal/IdProvider/useId.js +1 -1
- package/internal/Pure/Pure.js +20 -22
- package/internal/Pure/tests/Pure-specs.js +15 -17
- package/internal/localized-fonts/localized-fonts.js +4 -4
- package/internal/selection/selection.js +1 -1
- package/package.json +5 -4
- package/resolution/ResolutionDecorator.js +21 -23
- package/resolution/index.js +2 -2
- package/resolution/tests/ResolutionDecorator-specs.js +1 -1
- package/useControlledState/tests/useControlledState-specs.js +5 -5
- package/useControlledState/useControlledState.js +4 -4
- package/useScroll/ScrollAnimator.js +6 -7
- package/useScroll/Scrollbar.js +5 -5
- package/useScroll/ScrollbarTrack.js +5 -5
- package/useScroll/useScroll.js +9 -9
- package/useScroll/utilDOM.js +1 -1
- package/GridListImageItem/GridListImageItem.d.ts +0 -85
- package/GridListImageItem/GridListImageItem.js +0 -250
- package/GridListImageItem/GridListImageItem.module.css +0 -28
- package/GridListImageItem/package.json +0 -3
- package/IconButton/IconButton.d.ts +0 -115
- package/IconButton/IconButton.js +0 -253
- package/IconButton/IconButton.module.css +0 -11
- package/IconButton/package.json +0 -3
- package/IconButton/tests/IconButton-specs.js +0 -29
- package/RadioDecorator/RadioControllerDecorator.js +0 -101
- package/RadioDecorator/RadioDecorator.d.ts +0 -35
- package/RadioDecorator/RadioDecorator.js +0 -177
- package/RadioDecorator/package.json +0 -3
- package/RadioDecorator/tests/RadioDecorator-specs.js +0 -247
- package/Scrollable/ScrollAnimator.js +0 -130
- package/Scrollable/ScrollThumb.js +0 -57
- package/Scrollable/ScrollThumb.module.css +0 -34
- package/Scrollable/Scrollable.js +0 -1430
- package/Scrollable/Scrollable.module.css +0 -36
- package/Scrollable/ScrollableNative.js +0 -1429
- package/Scrollable/Scrollbar.js +0 -281
- package/Scrollable/Scrollbar.module.css +0 -24
- package/Scrollable/package.json +0 -3
- package/Scroller/UiScroller.module.css +0 -10
- package/Scroller/UiScrollerBase.js +0 -372
- package/SlotItem/SlotItem.d.ts +0 -118
- package/SlotItem/SlotItem.js +0 -248
- package/SlotItem/SlotItem.module.css +0 -12
- package/SlotItem/package.json +0 -3
- package/SlotItem/tests/SlotItem-specs.js +0 -24
- package/ToggleItem/ToggleItem.d.ts +0 -132
- package/ToggleItem/ToggleItem.js +0 -301
- package/ToggleItem/ToggleItem.module.css +0 -9
- package/ToggleItem/package.json +0 -3
- package/ToggleItem/tests/ToggleItem-specs.js +0 -120
- package/VirtualList/UiVirtualList.module.css +0 -26
- package/VirtualList/UiVirtualListBase.js +0 -1410
- package/VirtualList/VirtualListBase.js +0 -33
|
@@ -30,7 +30,7 @@ var _TransitionGroup = _interopRequireDefault(require("./TransitionGroup"));
|
|
|
30
30
|
var _View = require("./View");
|
|
31
31
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
32
32
|
var _excluded = ["arranger", "childProps", "children", "duration", "index", "noAnimation", "enteringDelay", "enteringProp", "rtl"];
|
|
33
|
-
var
|
|
33
|
+
var _Class;
|
|
34
34
|
/**
|
|
35
35
|
* A component that manages the transitions of views.
|
|
36
36
|
*
|
|
@@ -55,47 +55,46 @@ var _class;
|
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
57
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
58
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
59
|
-
function _interopRequireDefault(
|
|
58
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
59
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
60
60
|
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
61
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
62
|
-
function _defineProperty(
|
|
63
|
-
function _objectWithoutProperties(
|
|
64
|
-
function _objectWithoutPropertiesLoose(
|
|
65
|
-
function _classCallCheck(
|
|
66
|
-
function _defineProperties(
|
|
67
|
-
function _createClass(
|
|
68
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
62
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
63
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
64
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
65
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
66
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
67
|
+
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
69
69
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
70
|
-
function
|
|
71
|
-
function
|
|
72
|
-
function
|
|
73
|
-
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
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
70
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
71
|
+
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
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
75
73
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
76
|
-
function _getPrototypeOf(
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
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
|
+
var ViewManagerBase = exports.ViewManagerBase = (_Class = /*#__PURE__*/function (_Component) {
|
|
80
78
|
function ViewManagerBase(props) {
|
|
81
79
|
var _this;
|
|
82
80
|
_classCallCheck(this, ViewManagerBase);
|
|
83
|
-
_this =
|
|
81
|
+
_this = _callSuper(this, ViewManagerBase, [props]);
|
|
84
82
|
_this.makeTransitionEvent = function () {
|
|
85
83
|
return {
|
|
86
84
|
index: _this.props.index,
|
|
87
85
|
previousIndex: _this.state.prevIndex
|
|
88
86
|
};
|
|
89
87
|
};
|
|
90
|
-
_this.handleTransition = (0, _handle["default"])((0, _handle.forwardCustom)('onTransition', _this.makeTransitionEvent)).bindAs(
|
|
91
|
-
_this.handleWillTransition = (0, _handle["default"])((0, _handle.forwardCustom)('onWillTransition', _this.makeTransitionEvent)).bindAs(
|
|
88
|
+
_this.handleTransition = (0, _handle["default"])((0, _handle.forwardCustom)('onTransition', _this.makeTransitionEvent)).bindAs(_this, 'handleTransition');
|
|
89
|
+
_this.handleWillTransition = (0, _handle["default"])((0, _handle.forwardCustom)('onWillTransition', _this.makeTransitionEvent)).bindAs(_this, 'handleWillTransition');
|
|
92
90
|
_this.state = {
|
|
93
91
|
prevIndex: null,
|
|
94
92
|
reverseTransition: null
|
|
95
93
|
};
|
|
96
94
|
return _this;
|
|
97
95
|
}
|
|
98
|
-
|
|
96
|
+
_inherits(ViewManagerBase, _Component);
|
|
97
|
+
return _createClass(ViewManagerBase, [{
|
|
99
98
|
key: "render",
|
|
100
99
|
value: function render() {
|
|
101
100
|
var _this$props = this.props,
|
|
@@ -166,8 +165,7 @@ var ViewManagerBase = exports.ViewManagerBase = (_class = /*#__PURE__*/function
|
|
|
166
165
|
return null;
|
|
167
166
|
}
|
|
168
167
|
}]);
|
|
169
|
-
|
|
170
|
-
}(_react.Component), _class.displayName = 'ViewManager', _class.propTypes = /** @lends ui/ViewManager.ViewManagerBase.prototype */{
|
|
168
|
+
}(_react.Component), _Class.displayName = 'ViewManager', _Class.propTypes = /** @lends ui/ViewManager.ViewManagerBase.prototype */{
|
|
171
169
|
/**
|
|
172
170
|
* Arranger to control the animation
|
|
173
171
|
*
|
|
@@ -318,11 +316,11 @@ var ViewManagerBase = exports.ViewManagerBase = (_class = /*#__PURE__*/function
|
|
|
318
316
|
* @default value of index
|
|
319
317
|
*/
|
|
320
318
|
start: _propTypes2["default"].number
|
|
321
|
-
},
|
|
319
|
+
}, _Class.defaultProps = {
|
|
322
320
|
component: 'div',
|
|
323
321
|
duration: 300,
|
|
324
322
|
index: 0
|
|
325
|
-
},
|
|
323
|
+
}, _Class);
|
|
326
324
|
|
|
327
325
|
/**
|
|
328
326
|
* Applies ViewManager behaviors.
|
|
@@ -6,7 +6,7 @@ var _react2 = require("react");
|
|
|
6
6
|
var _testUtils = require("./test-utils");
|
|
7
7
|
var _View = _interopRequireDefault(require("../View"));
|
|
8
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
10
|
describe('View', function () {
|
|
11
11
|
test('should render its child when neither enteringProp or childProps is specified', function () {
|
|
12
12
|
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_View["default"], {
|
|
@@ -7,21 +7,21 @@ var _ = _interopRequireDefault(require("../"));
|
|
|
7
7
|
var _Arranger = require("../Arranger");
|
|
8
8
|
var _testUtils = require("./test-utils");
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function _interopRequireDefault(
|
|
11
|
-
function asyncGeneratorStep(
|
|
12
|
-
function _asyncToGenerator(
|
|
13
|
-
function _classCallCheck(
|
|
14
|
-
function _defineProperties(
|
|
15
|
-
function _createClass(
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
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
|
+
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
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
-
function
|
|
19
|
-
function
|
|
20
|
-
function
|
|
21
|
-
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); }
|
|
22
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
18
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
19
|
+
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
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
23
21
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
-
function _getPrototypeOf(
|
|
22
|
+
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 () {
|
|
@@ -202,13 +202,12 @@ describe('ViewManager', function () {
|
|
|
202
202
|
test('should allow child props to update', function () {
|
|
203
203
|
var content = 'updated';
|
|
204
204
|
var ViewManagerTest = /*#__PURE__*/function (_Component) {
|
|
205
|
-
_inherits(ViewManagerTest, _Component);
|
|
206
|
-
var _super = _createSuper(ViewManagerTest);
|
|
207
205
|
function ViewManagerTest() {
|
|
208
206
|
_classCallCheck(this, ViewManagerTest);
|
|
209
|
-
return
|
|
207
|
+
return _callSuper(this, ViewManagerTest, arguments);
|
|
210
208
|
}
|
|
211
|
-
|
|
209
|
+
_inherits(ViewManagerTest, _Component);
|
|
210
|
+
return _createClass(ViewManagerTest, [{
|
|
212
211
|
key: "render",
|
|
213
212
|
value: function render() {
|
|
214
213
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_["default"], {
|
|
@@ -219,7 +218,6 @@ describe('ViewManager', function () {
|
|
|
219
218
|
});
|
|
220
219
|
}
|
|
221
220
|
}]);
|
|
222
|
-
return ViewManagerTest;
|
|
223
221
|
}(_react2.Component);
|
|
224
222
|
var _render4 = (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(ViewManagerTest, {
|
|
225
223
|
content: "original"
|
|
@@ -230,164 +230,6 @@ export class VirtualListBasic extends React.Component<
|
|
|
230
230
|
Merge<React.HTMLProps<HTMLElement>, VirtualListBasicProps>
|
|
231
231
|
> {}
|
|
232
232
|
|
|
233
|
-
export interface VirtualListBaseProps {
|
|
234
|
-
/**
|
|
235
|
-
* The rendering function called for each item in the list.
|
|
236
|
-
*
|
|
237
|
-
* Note : The list does not always render a component whenever its render function is called
|
|
238
|
-
due to performance optimization.
|
|
239
|
-
*
|
|
240
|
-
* Example:
|
|
241
|
-
* ```
|
|
242
|
-
renderItem = ({index, ...rest}) => {
|
|
243
|
-
delete rest.data;
|
|
244
|
-
|
|
245
|
-
return (
|
|
246
|
-
<MyComponent index={index} {...rest} />
|
|
247
|
-
);
|
|
248
|
-
}
|
|
249
|
-
```
|
|
250
|
-
*/
|
|
251
|
-
itemRenderer: Function;
|
|
252
|
-
/**
|
|
253
|
-
* A callback function that receives a reference to the `scrollTo` feature.
|
|
254
|
-
*
|
|
255
|
-
* Once received, the `scrollTo` method can be called as an imperative interface.
|
|
256
|
-
*
|
|
257
|
-
* The `scrollTo` function accepts the following parameters:
|
|
258
|
-
* * {position: {x, y}} - Pixel value for x and/or y position
|
|
259
|
-
* * {align} - Where the scroll area should be aligned. Values are:
|
|
260
|
-
`'left'` , `'right'` , `'top'` , `'bottom'` ,
|
|
261
|
-
`'topleft'` , `'topright'` , `'bottomleft'` , and `'bottomright'` .
|
|
262
|
-
* * {index} - Index of specific item. ( `0` or positive integer)
|
|
263
|
-
This option is available for only `VirtualList` kind.
|
|
264
|
-
* * {node} - Node to scroll into view
|
|
265
|
-
* * {animate} - When `true` , scroll occurs with animation. When `false` , no
|
|
266
|
-
animation occurs.
|
|
267
|
-
* * {focus} - When `true` , attempts to focus item after scroll. Only valid when scrolling
|
|
268
|
-
by `index` or `node` .
|
|
269
|
-
*
|
|
270
|
-
* Note: Only specify one of: `position` , `align` , `index` or `node`
|
|
271
|
-
*
|
|
272
|
-
* Example:
|
|
273
|
-
* ```
|
|
274
|
-
// If you set cbScrollTo prop like below;
|
|
275
|
-
cbScrollTo: (fn) => {this.scrollTo = fn;}
|
|
276
|
-
// You can simply call like below;
|
|
277
|
-
this.scrollTo({align: 'top'}); // scroll to the top
|
|
278
|
-
```
|
|
279
|
-
*/
|
|
280
|
-
cbScrollTo?: Function;
|
|
281
|
-
/**
|
|
282
|
-
* Additional props included in the object passed to the `itemsRenderer` callback.
|
|
283
|
-
*/
|
|
284
|
-
childProps?: object;
|
|
285
|
-
/**
|
|
286
|
-
* Client size of the list; valid values are an object that has `clientWidth` and `clientHeight` .
|
|
287
|
-
*/
|
|
288
|
-
clientSize?: object;
|
|
289
|
-
/**
|
|
290
|
-
* The number of items of data the list contains.
|
|
291
|
-
*/
|
|
292
|
-
dataSize?: number;
|
|
293
|
-
/**
|
|
294
|
-
* The layout direction of the list.
|
|
295
|
-
*
|
|
296
|
-
* Valid values are:
|
|
297
|
-
* * `'horizontal'` , and
|
|
298
|
-
* * `'vertical'` .
|
|
299
|
-
*/
|
|
300
|
-
direction?: string;
|
|
301
|
-
/**
|
|
302
|
-
* The spacing between items.
|
|
303
|
-
*/
|
|
304
|
-
spacing?: number;
|
|
305
|
-
/**
|
|
306
|
-
* Specifies how to show horizontal scrollbar.
|
|
307
|
-
*
|
|
308
|
-
* Valid values are:
|
|
309
|
-
* * `'auto'` ,
|
|
310
|
-
* * `'visible'` , and
|
|
311
|
-
* * `'hidden'` .
|
|
312
|
-
*/
|
|
313
|
-
horizontalScrollbar?: string;
|
|
314
|
-
/**
|
|
315
|
-
* Prevents scroll by wheeling on the list.
|
|
316
|
-
*/
|
|
317
|
-
noScrollByWheel?: boolean;
|
|
318
|
-
/**
|
|
319
|
-
* Called when scrolling.
|
|
320
|
-
*
|
|
321
|
-
* Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
|
|
322
|
-
It is not recommended to set this prop since it can cause performance degradation.
|
|
323
|
-
Use `onScrollStart` or `onScrollStop` instead.
|
|
324
|
-
*/
|
|
325
|
-
onScroll?: Function;
|
|
326
|
-
/**
|
|
327
|
-
* Called when scroll starts.
|
|
328
|
-
*
|
|
329
|
-
* Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
|
|
330
|
-
You can get firstVisibleIndex and lastVisibleIndex from VirtualList with `moreInfo` .
|
|
331
|
-
*
|
|
332
|
-
* Example:
|
|
333
|
-
* ```
|
|
334
|
-
onScrollStart = ({scrollLeft, scrollTop, moreInfo}) => {
|
|
335
|
-
const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
|
|
336
|
-
// do something with firstVisibleIndex and lastVisibleIndex
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
render = () => (
|
|
340
|
-
<VirtualList
|
|
341
|
-
...
|
|
342
|
-
onScrollStart={this.onScrollStart}
|
|
343
|
-
...
|
|
344
|
-
/>
|
|
345
|
-
)
|
|
346
|
-
```
|
|
347
|
-
*/
|
|
348
|
-
onScrollStart?: Function;
|
|
349
|
-
/**
|
|
350
|
-
* Called when scroll stops.
|
|
351
|
-
*
|
|
352
|
-
* Passes `scrollLeft` , `scrollTop` , and `moreInfo` .
|
|
353
|
-
You can get firstVisibleIndex and lastVisibleIndex from VirtualList with `moreInfo` .
|
|
354
|
-
*
|
|
355
|
-
* Example:
|
|
356
|
-
* ```
|
|
357
|
-
onScrollStop = ({scrollLeft, scrollTop, moreInfo}) => {
|
|
358
|
-
const {firstVisibleIndex, lastVisibleIndex} = moreInfo;
|
|
359
|
-
// do something with firstVisibleIndex and lastVisibleIndex
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
render = () => (
|
|
363
|
-
<VirtualList
|
|
364
|
-
...
|
|
365
|
-
onScrollStop={this.onScrollStop}
|
|
366
|
-
...
|
|
367
|
-
/>
|
|
368
|
-
)
|
|
369
|
-
```
|
|
370
|
-
*/
|
|
371
|
-
onScrollStop?: Function;
|
|
372
|
-
/**
|
|
373
|
-
* Specifies how to show vertical scrollbar.
|
|
374
|
-
*
|
|
375
|
-
* Valid values are:
|
|
376
|
-
* * `'auto'` ,
|
|
377
|
-
* * `'visible'` , and
|
|
378
|
-
* * `'hidden'` .
|
|
379
|
-
*/
|
|
380
|
-
verticalScrollbar?: string;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* A basic base component for
|
|
384
|
-
and .
|
|
385
|
-
*/
|
|
386
|
-
|
|
387
|
-
export class VirtualListBase extends React.Component<
|
|
388
|
-
Merge<React.HTMLProps<HTMLElement>, VirtualListBaseProps>
|
|
389
|
-
> {}
|
|
390
|
-
|
|
391
233
|
export interface VirtualGridListProps extends VirtualListBasicProps {
|
|
392
234
|
/**
|
|
393
235
|
* A callback function that receives a reference to the `scrollTo` feature.
|
|
@@ -4,18 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.VirtualList = exports.VirtualGridList = void 0;
|
|
7
|
-
Object.defineProperty(exports, "VirtualListBase", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _UiVirtualListBase.UiVirtualListBase;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "VirtualListBaseNative", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function get() {
|
|
16
|
-
return _UiVirtualListBase.UiVirtualListBaseNative;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
7
|
Object.defineProperty(exports, "VirtualListBasic", {
|
|
20
8
|
enumerable: true,
|
|
21
9
|
get: function get() {
|
|
@@ -40,14 +28,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
40
28
|
var _Resizable = require("../Resizable");
|
|
41
29
|
var _useScroll3 = _interopRequireDefault(require("../useScroll"));
|
|
42
30
|
var _Scrollbar = _interopRequireDefault(require("../useScroll/Scrollbar"));
|
|
43
|
-
var _UiVirtualListBase = require("./UiVirtualListBase");
|
|
44
31
|
var _VirtualListBasic = require("./VirtualListBasic");
|
|
45
32
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
46
|
-
function _interopRequireDefault(
|
|
33
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
47
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; }
|
|
48
35
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
49
|
-
function _defineProperty(
|
|
50
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
36
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
37
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
51
38
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
|
|
52
39
|
* Unstyled virtual list components and behaviors to be customized by a theme or application.
|
|
53
40
|
*
|
|
@@ -56,7 +43,6 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
56
43
|
* @exports itemSizesShape
|
|
57
44
|
* @exports VirtualGridList
|
|
58
45
|
* @exports VirtualList
|
|
59
|
-
* @exports VirtualListBase
|
|
60
46
|
* @exports VirtualListBasic
|
|
61
47
|
*/
|
|
62
48
|
var nop = function nop() {};
|
|
@@ -15,30 +15,30 @@ var _react = require("react");
|
|
|
15
15
|
var _VirtualListModule = _interopRequireDefault(require("./VirtualList.module.css"));
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
var _excluded = ["className", "containerProps", "placeholderRenderer", "role", "style", "scrollMode"];
|
|
18
|
-
function _interopRequireDefault(
|
|
19
|
-
function _objectWithoutProperties(
|
|
20
|
-
function _objectWithoutPropertiesLoose(
|
|
21
|
-
function _toConsumableArray(
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
20
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
21
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
22
22
|
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."); }
|
|
23
|
-
function _unsupportedIterableToArray(
|
|
24
|
-
function _iterableToArray(
|
|
25
|
-
function _arrayWithoutHoles(
|
|
26
|
-
function _arrayLikeToArray(
|
|
23
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
24
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
25
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
26
|
+
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; }
|
|
27
27
|
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; }
|
|
28
28
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29
|
-
function _defineProperty(
|
|
30
|
-
function _classCallCheck(
|
|
31
|
-
function _defineProperties(
|
|
32
|
-
function _createClass(
|
|
33
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
29
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
30
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
31
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
32
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
33
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
34
34
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
35
|
-
function
|
|
36
|
-
function
|
|
37
|
-
function
|
|
38
|
-
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); }
|
|
39
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
36
|
+
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); }
|
|
37
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
40
38
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
41
|
-
function _getPrototypeOf(
|
|
39
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
40
|
+
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); }
|
|
41
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
42
42
|
var nop = function nop() {};
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -81,12 +81,10 @@ var itemSizesShape = exports.itemSizesShape = _propTypes2["default"].shape({
|
|
|
81
81
|
* @public
|
|
82
82
|
*/
|
|
83
83
|
var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Component) {
|
|
84
|
-
_inherits(VirtualListBasic, _Component);
|
|
85
|
-
var _super = _createSuper(VirtualListBasic);
|
|
86
84
|
function VirtualListBasic(_props) {
|
|
87
85
|
var _this;
|
|
88
86
|
_classCallCheck(this, VirtualListBasic);
|
|
89
|
-
_this =
|
|
87
|
+
_this = _callSuper(this, VirtualListBasic, [_props]);
|
|
90
88
|
_this.displayName = 'ui:VirtualListBasic';
|
|
91
89
|
_this.scrollBounds = {
|
|
92
90
|
clientWidth: 0,
|
|
@@ -160,10 +158,10 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
160
158
|
var stickTo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'start';
|
|
161
159
|
var optionalOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
162
160
|
var disallowNegativeOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
163
|
-
var
|
|
164
|
-
isPrimaryDirectionVertical =
|
|
165
|
-
primary =
|
|
166
|
-
scrollBounds =
|
|
161
|
+
var _this2 = _this,
|
|
162
|
+
isPrimaryDirectionVertical = _this2.isPrimaryDirectionVertical,
|
|
163
|
+
primary = _this2.primary,
|
|
164
|
+
scrollBounds = _this2.scrollBounds;
|
|
167
165
|
var maxPos = isPrimaryDirectionVertical ? scrollBounds.maxTop : scrollBounds.maxLeft;
|
|
168
166
|
var position = _this.getGridPosition(index);
|
|
169
167
|
var offset = 0;
|
|
@@ -219,11 +217,11 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
219
217
|
var dataSize = props.dataSize,
|
|
220
218
|
overhang = props.overhang,
|
|
221
219
|
updateStatesAndBounds = props.updateStatesAndBounds,
|
|
222
|
-
|
|
223
|
-
dimensionToExtent =
|
|
224
|
-
primary =
|
|
225
|
-
moreInfo =
|
|
226
|
-
scrollPosition =
|
|
220
|
+
_this3 = _this,
|
|
221
|
+
dimensionToExtent = _this3.dimensionToExtent,
|
|
222
|
+
primary = _this3.primary,
|
|
223
|
+
moreInfo = _this3.moreInfo,
|
|
224
|
+
scrollPosition = _this3.scrollPosition,
|
|
227
225
|
numOfItems = Math.min(dataSize, dimensionToExtent * (Math.ceil(primary.clientSize / primary.gridSize) + overhang)),
|
|
228
226
|
wasFirstIndexMax = _this.maxFirstIndex < moreInfo.firstVisibleIndex - dimensionToExtent && firstIndex === _this.maxFirstIndex,
|
|
229
227
|
dataSizeDiff = dataSize - _this.curDataSize;
|
|
@@ -269,7 +267,7 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
269
267
|
return x;
|
|
270
268
|
};
|
|
271
269
|
_this.applyStyleToNewNode = function (index) {
|
|
272
|
-
var
|
|
270
|
+
var _this4;
|
|
273
271
|
var _this$props = _this.props,
|
|
274
272
|
childProps = _this$props.childProps,
|
|
275
273
|
itemRefs = _this$props.itemRefs,
|
|
@@ -292,7 +290,8 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
292
290
|
_this.cc[key] = /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
293
291
|
className: _VirtualListModule["default"].listItem,
|
|
294
292
|
ref: itemContainerRef,
|
|
295
|
-
|
|
293
|
+
role: "presentation",
|
|
294
|
+
style: (_this4 = _this).composeStyle.apply(_this4, rest),
|
|
296
295
|
children: itemRenderer(_objectSpread(_objectSpread(_objectSpread({}, childProps), componentProps), {}, {
|
|
297
296
|
index: index
|
|
298
297
|
}))
|
|
@@ -323,17 +322,17 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
323
322
|
return total + size + (index > 0 ? _this.props.spacing : 0);
|
|
324
323
|
}, 0);
|
|
325
324
|
} else {
|
|
326
|
-
var
|
|
327
|
-
dimensionToExtent =
|
|
328
|
-
primary =
|
|
329
|
-
curDataSize =
|
|
325
|
+
var _this5 = _this,
|
|
326
|
+
dimensionToExtent = _this5.dimensionToExtent,
|
|
327
|
+
primary = _this5.primary,
|
|
328
|
+
curDataSize = _this5.curDataSize,
|
|
330
329
|
spacing = _this.props.spacing;
|
|
331
330
|
return Math.ceil(curDataSize / dimensionToExtent) * primary.gridSize - spacing;
|
|
332
331
|
}
|
|
333
332
|
};
|
|
334
333
|
_this.syncClientSize = function () {
|
|
335
|
-
var
|
|
336
|
-
props =
|
|
334
|
+
var _this6 = _this,
|
|
335
|
+
props = _this6.props,
|
|
337
336
|
node = _this.props.scrollContentRef.current;
|
|
338
337
|
if (!props.clientSize && !node) {
|
|
339
338
|
return false;
|
|
@@ -341,8 +340,8 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
341
340
|
var _ref3 = props.clientSize || _this.getClientSize(node),
|
|
342
341
|
clientWidth = _ref3.clientWidth,
|
|
343
342
|
clientHeight = _ref3.clientHeight,
|
|
344
|
-
|
|
345
|
-
scrollBounds =
|
|
343
|
+
_this7 = _this,
|
|
344
|
+
scrollBounds = _this7.scrollBounds;
|
|
346
345
|
if (clientWidth !== scrollBounds.clientWidth || clientHeight !== scrollBounds.clientHeight) {
|
|
347
346
|
_this.calculateMetrics(props);
|
|
348
347
|
_this.setState(_this.getStatesAndUpdateBounds(props));
|
|
@@ -367,7 +366,8 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
367
366
|
}
|
|
368
367
|
return _this;
|
|
369
368
|
}
|
|
370
|
-
|
|
369
|
+
_inherits(VirtualListBasic, _Component);
|
|
370
|
+
return _createClass(VirtualListBasic, [{
|
|
371
371
|
key: "componentDidMount",
|
|
372
372
|
value:
|
|
373
373
|
// Calculate metrics for VirtualList after the 1st render to know client W/H.
|
|
@@ -1126,7 +1126,6 @@ var VirtualListBasic = exports.VirtualListBasic = /*#__PURE__*/function (_Compon
|
|
|
1126
1126
|
});
|
|
1127
1127
|
}
|
|
1128
1128
|
}]);
|
|
1129
|
-
return VirtualListBasic;
|
|
1130
1129
|
}(_react.Component);
|
|
1131
1130
|
VirtualListBasic.propTypes = /** @lends ui/VirtualList.VirtualListBasic.prototype */{
|
|
1132
1131
|
/**
|
|
@@ -9,11 +9,11 @@ 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
11
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
function _defineProperty(
|
|
13
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
|
12
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
-
function _objectWithoutProperties(
|
|
16
|
-
function _objectWithoutPropertiesLoose(
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
16
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(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;
|
|
19
19
|
beforeEach(function () {
|