@enact/ui 3.2.3 → 3.2.7
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/A11yDecorator/A11yDecorator.js +1 -1
- package/A11yDecorator/tests/A11yDecorator-specs.js +9 -9
- package/AnnounceDecorator/Announce.js +10 -8
- package/AnnounceDecorator/AnnounceDecorator.d.ts +1 -1
- package/AnnounceDecorator/AnnounceDecorator.js +10 -8
- package/AnnounceDecorator/tests/Announce-specs.js +3 -3
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +4 -4
- package/BodyText/BodyText.d.ts +3 -3
- package/BodyText/BodyText.js +1 -1
- package/BodyText/tests/BodyText-specs.js +11 -7
- package/Button/Button.d.ts +8 -8
- package/Button/Button.js +5 -5
- package/CHANGELOG.md +24 -0
- package/Cancelable/Cancelable.js +15 -11
- package/Cancelable/tests/Cancelable-specs.js +20 -20
- package/Changeable/Changeable.js +12 -8
- package/Changeable/tests/Changeable-specs.js +24 -22
- package/ComponentOverride/ComponentOverride.d.ts +1 -1
- package/ComponentOverride/ComponentOverride.js +1 -1
- package/FloatingLayer/FloatingLayer.js +12 -8
- package/FloatingLayer/FloatingLayerDecorator.js +15 -11
- package/FloatingLayer/Scrim.js +12 -8
- package/FloatingLayer/tests/FloatingLayer-specs.js +3 -3
- package/FloatingLayer/tests/Scrim-specs.js +2 -2
- package/ForwardRef/ForwardRef.js +4 -2
- package/GridListImageItem/GridListImageItem.d.ts +2 -2
- package/GridListImageItem/GridListImageItem.js +7 -7
- package/Group/Group.d.ts +4 -4
- package/Group/Group.js +1 -1
- package/Group/GroupItem.js +1 -1
- package/Group/tests/Group-specs.js +9 -9
- package/Heading/Heading.d.ts +3 -2
- package/Heading/Heading.js +1 -1
- package/Heading/tests/Heading-specs.js +4 -4
- package/Icon/Icon.d.ts +5 -5
- package/Icon/Icon.js +2 -2
- package/Icon/tests/Icon-specs.js +8 -8
- package/IconButton/IconButton.d.ts +6 -6
- package/IconButton/IconButton.js +12 -6
- package/Image/Image.d.ts +1 -1
- package/Image/Image.js +5 -3
- package/Image/tests/Image-specs.js +4 -4
- package/Item/Item.d.ts +2 -2
- package/Item/Item.js +1 -1
- package/Item/tests/Item-specs.js +4 -4
- package/LabeledIcon/LabeledIcon.d.ts +6 -6
- package/LabeledIcon/LabeledIcon.js +4 -2
- package/LabeledIcon/tests/LabeledIcon-specs.js +6 -6
- package/Layout/Cell.js +4 -2
- package/Layout/Layout.d.ts +22 -22
- package/Layout/Layout.js +4 -2
- package/Layout/tests/Layout-specs.js +19 -11
- package/Marquee/MarqueeBase.js +71 -39
- package/Marquee/MarqueeController.js +14 -8
- package/Marquee/MarqueeDecorator.js +15 -11
- package/Marquee/index.d.ts +85 -81
- package/Marquee/tests/Marquee-specs.js +61 -22
- package/Measurable/Measurable.js +20 -20
- package/Media/Media.d.ts +1 -1
- package/Media/Media.js +10 -6
- package/Placeholder/PlaceholderControllerDecorator.js +13 -11
- package/Placeholder/PlaceholderDecorator.js +11 -7
- package/ProgressBar/ProgressBar.d.ts +1 -1
- package/ProgressBar/ProgressBar.js +8 -6
- package/ProgressBar/tests/ProgressBar-specs.js +4 -4
- package/RadioDecorator/RadioControllerDecorator.js +13 -9
- package/RadioDecorator/RadioDecorator.js +10 -8
- package/RadioDecorator/tests/RadioDecorator-specs.js +23 -19
- package/Repeater/Repeater.d.ts +4 -3
- package/Repeater/Repeater.js +7 -5
- package/Repeater/tests/Repeater-specs.js +15 -15
- package/Resizable/Resizable.js +12 -10
- package/Routable/Link.js +4 -4
- package/Routable/Routable.d.ts +2 -2
- package/Routable/Routable.js +5 -3
- package/Routable/Router.js +13 -7
- package/Routable/tests/Router-specs.js +30 -30
- package/Scrollable/ScrollAnimator.js +1 -3
- package/Scrollable/ScrollThumb.js +1 -1
- package/Scrollable/Scrollable.js +30 -24
- package/Scrollable/ScrollableNative.js +30 -24
- package/Scrollable/Scrollbar.js +21 -17
- package/Scroller/Scroller.d.ts +3 -3
- package/Scroller/Scroller.js +21 -11
- package/Skinnable/Skinnable.js +3 -3
- package/Skinnable/tests/Skinnable-specs.js +34 -34
- package/Skinnable/util.js +1 -1
- package/Slider/Knob.js +1 -1
- package/Slider/PositionDecorator.js +12 -8
- package/Slider/Slider.d.ts +6 -6
- package/Slider/Slider.js +6 -4
- package/SlotItem/SlotItem.d.ts +4 -4
- package/SlotItem/SlotItem.js +3 -3
- package/Slottable/Slottable.js +4 -2
- package/Slottable/tests/Slottable-specs.js +25 -25
- package/Spinner/Spinner.d.ts +3 -3
- package/Spinner/Spinner.js +6 -6
- package/Spinner/tests/Spinner-specs.js +5 -5
- package/ToggleIcon/ToggleIcon.d.ts +3 -3
- package/ToggleIcon/ToggleIcon.js +1 -1
- package/ToggleIcon/tests/ToggleIcon-specs.js +4 -4
- package/ToggleItem/ToggleItem.d.ts +15 -13
- package/ToggleItem/ToggleItem.js +8 -4
- package/ToggleItem/tests/ToggleItem-specs.js +12 -8
- package/Toggleable/Toggleable.js +15 -9
- package/Toggleable/tests/Toggleable-specs.js +33 -31
- package/Touchable/ClickAllow.js +1 -3
- package/Touchable/Drag.js +3 -1
- package/Touchable/Flick.js +1 -3
- package/Touchable/Hold.js +5 -5
- package/Touchable/Touchable.d.ts +3 -3
- package/Touchable/Touchable.js +15 -9
- package/Touchable/config.js +4 -2
- package/Touchable/tests/Touchable-specs.js +18 -18
- package/Transition/Transition.d.ts +31 -29
- package/Transition/Transition.js +15 -9
- package/Transition/tests/Transition-specs.js +23 -15
- package/ViewManager/Arranger.js +3 -1
- package/ViewManager/TransitionGroup.js +11 -7
- package/ViewManager/View.js +12 -8
- package/ViewManager/ViewManager.d.ts +10 -10
- package/ViewManager/ViewManager.js +10 -6
- package/ViewManager/tests/View-specs.js +24 -24
- package/ViewManager/tests/ViewManager-specs.js +93 -89
- package/VirtualList/VirtualList.d.ts +9 -8
- package/VirtualList/VirtualList.js +4 -4
- package/VirtualList/VirtualListBase.js +40 -24
- package/VirtualList/tests/VirtualList-specs.js +13 -13
- package/internal/IdProvider/IdProvider.js +10 -6
- package/internal/Pure/Pure.js +10 -6
- package/internal/localized-fonts/localized-fonts.js +7 -3
- package/package.json +2 -2
- package/resolution/ResolutionDecorator.js +10 -6
- package/resolution/index.js +5 -1
- package/resolution/resolution.js +1 -1
- package/resolution/tests/ResolutionDecorator-specs.js +2 -2
|
@@ -84,7 +84,7 @@ var VirtualList = (0, _kind["default"])({
|
|
|
84
84
|
itemSize: _propTypes["default"].number.isRequired
|
|
85
85
|
},
|
|
86
86
|
render: function render(props) {
|
|
87
|
-
return _react["default"].createElement(_VirtualListBase.ScrollableVirtualList, props);
|
|
87
|
+
return /*#__PURE__*/_react["default"].createElement(_VirtualListBase.ScrollableVirtualList, props);
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
/**
|
|
@@ -125,7 +125,7 @@ var VirtualGridList = (0, _kind["default"])({
|
|
|
125
125
|
itemSize: _VirtualListBase.gridListItemSizeShape.isRequired
|
|
126
126
|
},
|
|
127
127
|
render: function render(props) {
|
|
128
|
-
return _react["default"].createElement(_VirtualListBase.ScrollableVirtualList, props);
|
|
128
|
+
return /*#__PURE__*/_react["default"].createElement(_VirtualListBase.ScrollableVirtualList, props);
|
|
129
129
|
}
|
|
130
130
|
});
|
|
131
131
|
/**
|
|
@@ -166,7 +166,7 @@ var VirtualListNative = (0, _kind["default"])({
|
|
|
166
166
|
itemSize: _propTypes["default"].number.isRequired
|
|
167
167
|
},
|
|
168
168
|
render: function render(props) {
|
|
169
|
-
return _react["default"].createElement(_VirtualListBase.ScrollableVirtualListNative, props);
|
|
169
|
+
return /*#__PURE__*/_react["default"].createElement(_VirtualListBase.ScrollableVirtualListNative, props);
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
172
|
/**
|
|
@@ -211,7 +211,7 @@ var VirtualGridListNative = (0, _kind["default"])({
|
|
|
211
211
|
itemSize: _VirtualListBase.gridListItemSizeShape.isRequired
|
|
212
212
|
},
|
|
213
213
|
render: function render(props) {
|
|
214
|
-
return _react["default"].createElement(_VirtualListBase.ScrollableVirtualListNative, props);
|
|
214
|
+
return /*#__PURE__*/_react["default"].createElement(_VirtualListBase.ScrollableVirtualListNative, props);
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
217
|
exports.VirtualGridListNative = VirtualGridListNative;
|
|
@@ -23,25 +23,33 @@ var _ScrollableNative = _interopRequireDefault(require("../Scrollable/Scrollable
|
|
|
23
23
|
|
|
24
24
|
var _VirtualListModule = _interopRequireDefault(require("./VirtualList.module.css"));
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
27
|
+
|
|
28
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
29
|
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
31
|
|
|
30
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
32
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
31
33
|
|
|
32
34
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
33
35
|
|
|
34
36
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
35
37
|
|
|
36
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
38
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
39
|
+
|
|
40
|
+
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."); }
|
|
41
|
+
|
|
42
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
37
43
|
|
|
38
|
-
function
|
|
44
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
39
45
|
|
|
40
|
-
function
|
|
46
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
41
47
|
|
|
42
|
-
function
|
|
48
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
43
49
|
|
|
44
|
-
function
|
|
50
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
51
|
+
|
|
52
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
45
53
|
|
|
46
54
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
47
55
|
|
|
@@ -51,12 +59,16 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
51
59
|
|
|
52
60
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
53
61
|
|
|
54
|
-
function
|
|
62
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
55
63
|
|
|
56
|
-
function
|
|
64
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
57
65
|
|
|
58
66
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
59
67
|
|
|
68
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
69
|
+
|
|
70
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
71
|
+
|
|
60
72
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
61
73
|
|
|
62
74
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
@@ -113,11 +125,11 @@ exports.itemSizesShape = itemSizesShape;
|
|
|
113
125
|
var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
114
126
|
var _class, _temp;
|
|
115
127
|
|
|
116
|
-
return _temp = _class =
|
|
117
|
-
/*#__PURE__*/
|
|
118
|
-
function (_Component) {
|
|
128
|
+
return _temp = _class = /*#__PURE__*/function (_Component) {
|
|
119
129
|
_inherits(VirtualListCore, _Component);
|
|
120
130
|
|
|
131
|
+
var _super = _createSuper(VirtualListCore);
|
|
132
|
+
|
|
121
133
|
/* No displayName here. We set displayName to returned components of this factory function. */
|
|
122
134
|
function VirtualListCore(_props) {
|
|
123
135
|
var _this;
|
|
@@ -125,7 +137,7 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
|
125
137
|
_classCallCheck(this, VirtualListCore);
|
|
126
138
|
|
|
127
139
|
var nextState = null;
|
|
128
|
-
_this =
|
|
140
|
+
_this = _super.call(this, _props);
|
|
129
141
|
_this.scrollBounds = {
|
|
130
142
|
clientWidth: 0,
|
|
131
143
|
clientHeight: 0,
|
|
@@ -288,7 +300,7 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
|
288
300
|
}
|
|
289
301
|
|
|
290
302
|
return {
|
|
291
|
-
firstIndex: newFirstIndex,
|
|
303
|
+
firstIndex: Math.min(newFirstIndex, _this.maxFirstIndex),
|
|
292
304
|
numOfItems: numOfItems
|
|
293
305
|
};
|
|
294
306
|
};
|
|
@@ -324,13 +336,13 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
|
324
336
|
|
|
325
337
|
_this.cc[key] = _react["default"].cloneElement(itemElement, _objectSpread({}, componentProps, {
|
|
326
338
|
className: (0, _classnames["default"])(_VirtualListModule["default"].listItem, itemElement.props.className),
|
|
327
|
-
style: _objectSpread({}, itemElement.props.style, (_this2 = _this).composeStyle.apply(_this2, rest))
|
|
339
|
+
style: _objectSpread({}, itemElement.props.style, {}, (_this2 = _this).composeStyle.apply(_this2, rest))
|
|
328
340
|
}));
|
|
329
341
|
};
|
|
330
342
|
|
|
331
343
|
_this.applyStyleToHideNode = function (index) {
|
|
332
344
|
var key = index % _this.state.numOfItems;
|
|
333
|
-
_this.cc[key] = _react["default"].createElement("div", {
|
|
345
|
+
_this.cc[key] = /*#__PURE__*/_react["default"].createElement("div", {
|
|
334
346
|
key: key,
|
|
335
347
|
style: {
|
|
336
348
|
display: 'none'
|
|
@@ -1168,13 +1180,13 @@ var VirtualListBaseFactory = function VirtualListBaseFactory(type) {
|
|
|
1168
1180
|
this.positionItems();
|
|
1169
1181
|
}
|
|
1170
1182
|
|
|
1171
|
-
return _react["default"].createElement("div", {
|
|
1183
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
1172
1184
|
className: containerClasses,
|
|
1173
1185
|
"data-webos-voice-focused": voiceFocused,
|
|
1174
1186
|
"data-webos-voice-group-label": voiceGroupLabel,
|
|
1175
1187
|
ref: this.containerRef,
|
|
1176
1188
|
style: style
|
|
1177
|
-
}, _react["default"].createElement("div", Object.assign({}, rest, {
|
|
1189
|
+
}, /*#__PURE__*/_react["default"].createElement("div", Object.assign({}, rest, {
|
|
1178
1190
|
className: contentClasses,
|
|
1179
1191
|
ref: this.contentRef
|
|
1180
1192
|
}), itemsRenderer({
|
|
@@ -1584,18 +1596,20 @@ var ScrollableVirtualList = function ScrollableVirtualList(_ref6) {
|
|
|
1584
1596
|
var role = _ref6.role,
|
|
1585
1597
|
rest = _objectWithoutProperties(_ref6, ["role"]);
|
|
1586
1598
|
|
|
1587
|
-
return _react["default"].createElement(_Scrollable["default"], Object.assign({}, rest, {
|
|
1599
|
+
return /*#__PURE__*/_react["default"].createElement(_Scrollable["default"], Object.assign({}, rest, {
|
|
1588
1600
|
childRenderer: function childRenderer(_ref7) {
|
|
1589
1601
|
var initChildRef = _ref7.initChildRef,
|
|
1590
1602
|
childRest = _objectWithoutProperties(_ref7, ["initChildRef"]);
|
|
1591
1603
|
|
|
1592
|
-
return (
|
|
1604
|
+
return (
|
|
1605
|
+
/*#__PURE__*/
|
|
1606
|
+
// eslint-disable-line react/jsx-no-bind
|
|
1593
1607
|
_react["default"].createElement(VirtualListBase, Object.assign({}, childRest, {
|
|
1594
1608
|
itemsRenderer: function itemsRenderer(_ref8) {
|
|
1595
1609
|
var cc = _ref8.cc,
|
|
1596
1610
|
itemContainerRef = _ref8.itemContainerRef;
|
|
1597
1611
|
return (// eslint-disable-line react/jsx-no-bind
|
|
1598
|
-
cc.length ? _react["default"].createElement("div", {
|
|
1612
|
+
cc.length ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
1599
1613
|
ref: itemContainerRef,
|
|
1600
1614
|
role: role
|
|
1601
1615
|
}, cc) : null
|
|
@@ -1622,18 +1636,20 @@ var ScrollableVirtualListNative = function ScrollableVirtualListNative(_ref9) {
|
|
|
1622
1636
|
var role = _ref9.role,
|
|
1623
1637
|
rest = _objectWithoutProperties(_ref9, ["role"]);
|
|
1624
1638
|
|
|
1625
|
-
return _react["default"].createElement(_ScrollableNative["default"], Object.assign({}, rest, {
|
|
1639
|
+
return /*#__PURE__*/_react["default"].createElement(_ScrollableNative["default"], Object.assign({}, rest, {
|
|
1626
1640
|
childRenderer: function childRenderer(_ref10) {
|
|
1627
1641
|
var initChildRef = _ref10.initChildRef,
|
|
1628
1642
|
childRest = _objectWithoutProperties(_ref10, ["initChildRef"]);
|
|
1629
1643
|
|
|
1630
|
-
return (
|
|
1644
|
+
return (
|
|
1645
|
+
/*#__PURE__*/
|
|
1646
|
+
// eslint-disable-line react/jsx-no-bind
|
|
1631
1647
|
_react["default"].createElement(VirtualListBaseNative, Object.assign({}, childRest, {
|
|
1632
1648
|
itemsRenderer: function itemsRenderer(_ref11) {
|
|
1633
1649
|
var cc = _ref11.cc,
|
|
1634
1650
|
itemContainerRef = _ref11.itemContainerRef;
|
|
1635
1651
|
return (// eslint-disable-line react/jsx-no-bind
|
|
1636
|
-
cc.length ? _react["default"].createElement("div", {
|
|
1652
|
+
cc.length ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
1637
1653
|
ref: itemContainerRef,
|
|
1638
1654
|
role: role
|
|
1639
1655
|
}, cc) : null
|
|
@@ -54,7 +54,7 @@ describe('VirtualList', function () {
|
|
|
54
54
|
rest = _objectWithoutProperties(_ref, ["index"]);
|
|
55
55
|
|
|
56
56
|
// eslint-disable-line enact/display-name, enact/prop-types
|
|
57
|
-
return _react["default"].createElement("div", Object.assign({}, rest, {
|
|
57
|
+
return /*#__PURE__*/_react["default"].createElement("div", Object.assign({}, rest, {
|
|
58
58
|
id: 'item' + index
|
|
59
59
|
}), items[index].name);
|
|
60
60
|
};
|
|
@@ -81,7 +81,7 @@ describe('VirtualList', function () {
|
|
|
81
81
|
resultScrollTop = null;
|
|
82
82
|
});
|
|
83
83
|
test('should render a list of \'items\'', function () {
|
|
84
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
84
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
85
85
|
clientSize: clientSize,
|
|
86
86
|
dataSize: dataSize,
|
|
87
87
|
itemRenderer: renderItem,
|
|
@@ -92,7 +92,7 @@ describe('VirtualList', function () {
|
|
|
92
92
|
expect(actual).toBe(expected);
|
|
93
93
|
});
|
|
94
94
|
test('should render (clientHeight / itemHeight + overhang) items', function () {
|
|
95
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
95
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
96
96
|
clientSize: clientSize,
|
|
97
97
|
dataSize: dataSize,
|
|
98
98
|
itemRenderer: renderItem,
|
|
@@ -110,7 +110,7 @@ describe('VirtualList', function () {
|
|
|
110
110
|
var actual = resultScrollTop;
|
|
111
111
|
expect(actual).toBe(expected);
|
|
112
112
|
});
|
|
113
|
-
(0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
113
|
+
(0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
114
114
|
cbScrollTo: getScrollTo,
|
|
115
115
|
clientSize: clientSize,
|
|
116
116
|
dataSize: dataSize,
|
|
@@ -129,7 +129,7 @@ describe('VirtualList', function () {
|
|
|
129
129
|
var actual = onScrollStopCount;
|
|
130
130
|
expect(actual).toBe(expected);
|
|
131
131
|
});
|
|
132
|
-
(0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
132
|
+
(0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
133
133
|
cbScrollTo: getScrollTo,
|
|
134
134
|
clientSize: clientSize,
|
|
135
135
|
dataSize: dataSize,
|
|
@@ -151,7 +151,7 @@ describe('VirtualList', function () {
|
|
|
151
151
|
var actual = resultScrollTop;
|
|
152
152
|
expect(actual).toBe(expected);
|
|
153
153
|
});
|
|
154
|
-
(0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
154
|
+
(0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
155
155
|
cbScrollTo: getScrollTo,
|
|
156
156
|
clientSize: clientSize,
|
|
157
157
|
dataSize: dataSize,
|
|
@@ -168,7 +168,7 @@ describe('VirtualList', function () {
|
|
|
168
168
|
});
|
|
169
169
|
describe('scroll events', function () {
|
|
170
170
|
test('should call onScrollStart once', function () {
|
|
171
|
-
(0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
171
|
+
(0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
172
172
|
cbScrollTo: getScrollTo,
|
|
173
173
|
clientSize: clientSize,
|
|
174
174
|
dataSize: dataSize,
|
|
@@ -187,7 +187,7 @@ describe('VirtualList', function () {
|
|
|
187
187
|
expect(actual).toBe(expected);
|
|
188
188
|
});
|
|
189
189
|
test('should call onScroll once', function () {
|
|
190
|
-
(0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
190
|
+
(0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
191
191
|
cbScrollTo: getScrollTo,
|
|
192
192
|
clientSize: clientSize,
|
|
193
193
|
dataSize: dataSize,
|
|
@@ -211,7 +211,7 @@ describe('VirtualList', function () {
|
|
|
211
211
|
var actual = onScrollStopCount;
|
|
212
212
|
expect(actual).toBe(expected);
|
|
213
213
|
});
|
|
214
|
-
(0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
214
|
+
(0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
215
215
|
cbScrollTo: getScrollTo,
|
|
216
216
|
clientSize: clientSize,
|
|
217
217
|
dataSize: dataSize,
|
|
@@ -243,12 +243,12 @@ describe('VirtualList', function () {
|
|
|
243
243
|
rest = _objectWithoutProperties(_ref2, ["index"]);
|
|
244
244
|
|
|
245
245
|
// eslint-disable-line enact/display-name, enact/prop-types
|
|
246
|
-
return _react["default"].createElement("div", Object.assign({}, rest, {
|
|
246
|
+
return /*#__PURE__*/_react["default"].createElement("div", Object.assign({}, rest, {
|
|
247
247
|
id: 'item' + index
|
|
248
248
|
}), itemArray[index].name);
|
|
249
249
|
};
|
|
250
250
|
|
|
251
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
251
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
252
252
|
clientSize: clientSize,
|
|
253
253
|
dataSize: itemArray.length,
|
|
254
254
|
itemRenderer: renderItemArray // eslint-disable-line react/jsx-no-bind
|
|
@@ -271,7 +271,7 @@ describe('VirtualList', function () {
|
|
|
271
271
|
});
|
|
272
272
|
describe('Voice Control', function () {
|
|
273
273
|
test('should render "data-webos-voice-focused" to outermost node of VirtualList', function () {
|
|
274
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
274
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
275
275
|
cbScrollTo: getScrollTo,
|
|
276
276
|
clientSize: clientSize,
|
|
277
277
|
dataSize: dataSize,
|
|
@@ -285,7 +285,7 @@ describe('VirtualList', function () {
|
|
|
285
285
|
});
|
|
286
286
|
test('should render "data-webos-voice-group-label" to outermost node of VirtualList', function () {
|
|
287
287
|
var label = 'group label';
|
|
288
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(_VirtualList["default"], {
|
|
288
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(_VirtualList["default"], {
|
|
289
289
|
cbScrollTo: getScrollTo,
|
|
290
290
|
clientSize: clientSize,
|
|
291
291
|
dataSize: dataSize,
|
|
@@ -11,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
|
|
14
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
14
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
15
15
|
|
|
16
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
17
|
|
|
@@ -19,10 +19,14 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
19
19
|
|
|
20
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21
21
|
|
|
22
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
23
|
+
|
|
22
24
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
23
25
|
|
|
24
26
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
25
27
|
|
|
28
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
|
+
|
|
26
30
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
31
|
|
|
28
32
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
@@ -81,17 +85,17 @@ var IdProvider = (0, _hoc["default"])(defaultConfig, function (config, Wrapped)
|
|
|
81
85
|
var generateProp = config.generateProp,
|
|
82
86
|
idProp = config.idProp,
|
|
83
87
|
prefix = config.prefix;
|
|
84
|
-
return _temp = _class =
|
|
85
|
-
/*#__PURE__*/
|
|
86
|
-
function (_React$Component) {
|
|
88
|
+
return _temp = _class = /*#__PURE__*/function (_React$Component) {
|
|
87
89
|
_inherits(_class, _React$Component);
|
|
88
90
|
|
|
91
|
+
var _super = _createSuper(_class);
|
|
92
|
+
|
|
89
93
|
function _class() {
|
|
90
94
|
var _this;
|
|
91
95
|
|
|
92
96
|
_classCallCheck(this, _class);
|
|
93
97
|
|
|
94
|
-
_this =
|
|
98
|
+
_this = _super.call(this);
|
|
95
99
|
|
|
96
100
|
_this.generateId = function (key) {
|
|
97
101
|
var idPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : prefix;
|
|
@@ -142,7 +146,7 @@ var IdProvider = (0, _hoc["default"])(defaultConfig, function (config, Wrapped)
|
|
|
142
146
|
props[idProp] = this.generateId(ID_KEY);
|
|
143
147
|
}
|
|
144
148
|
|
|
145
|
-
return _react["default"].createElement(Wrapped, props);
|
|
149
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, props);
|
|
146
150
|
}
|
|
147
151
|
}]);
|
|
148
152
|
|
package/internal/Pure/Pure.js
CHANGED
|
@@ -11,7 +11,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
|
|
14
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
14
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
15
15
|
|
|
16
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
17
|
|
|
@@ -19,10 +19,14 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
19
19
|
|
|
20
20
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21
21
|
|
|
22
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
23
|
+
|
|
22
24
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
23
25
|
|
|
24
26
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
25
27
|
|
|
28
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
|
+
|
|
26
30
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
31
|
|
|
28
32
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
@@ -77,15 +81,15 @@ var Pure = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
|
77
81
|
var _class, _temp;
|
|
78
82
|
|
|
79
83
|
var propComparators = config.propComparators;
|
|
80
|
-
return _temp = _class =
|
|
81
|
-
/*#__PURE__*/
|
|
82
|
-
function (_React$Component) {
|
|
84
|
+
return _temp = _class = /*#__PURE__*/function (_React$Component) {
|
|
83
85
|
_inherits(_class, _React$Component);
|
|
84
86
|
|
|
87
|
+
var _super = _createSuper(_class);
|
|
88
|
+
|
|
85
89
|
function _class() {
|
|
86
90
|
_classCallCheck(this, _class);
|
|
87
91
|
|
|
88
|
-
return
|
|
92
|
+
return _super.apply(this, arguments);
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
_createClass(_class, [{
|
|
@@ -119,7 +123,7 @@ var Pure = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
|
119
123
|
}, {
|
|
120
124
|
key: "render",
|
|
121
125
|
value: function render() {
|
|
122
|
-
return _react["default"].createElement(Wrapped, this.props);
|
|
126
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, this.props);
|
|
123
127
|
}
|
|
124
128
|
}]);
|
|
125
129
|
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
|
|
5
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
+
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
8
12
|
|
|
9
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.7",
|
|
4
4
|
"description": "A collection of simplified unstyled cross-platform UI components for Enact",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"extends": "enact/strict"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@enact/core": "^3.2.
|
|
31
|
+
"@enact/core": "^3.2.7",
|
|
32
32
|
"classnames": "^2.2.5",
|
|
33
33
|
"direction": "^1.0.1",
|
|
34
34
|
"invariant": "^2.2.2",
|
|
@@ -17,7 +17,7 @@ var _resolution = require("./resolution");
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
19
|
|
|
20
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
20
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
21
21
|
|
|
22
22
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
23
|
|
|
@@ -25,10 +25,14 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
25
25
|
|
|
26
26
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
27
27
|
|
|
28
|
+
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
|
+
|
|
28
30
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
29
31
|
|
|
30
32
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
31
33
|
|
|
34
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
35
|
+
|
|
32
36
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
37
|
|
|
34
38
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
@@ -93,17 +97,17 @@ var ResolutionDecorator = (0, _hoc["default"])(defaultConfig, function (config,
|
|
|
93
97
|
(0, _resolution.defineScreenTypes)(config.screenTypes);
|
|
94
98
|
}
|
|
95
99
|
|
|
96
|
-
return _temp = _class =
|
|
97
|
-
/*#__PURE__*/
|
|
98
|
-
function (_React$Component) {
|
|
100
|
+
return _temp = _class = /*#__PURE__*/function (_React$Component) {
|
|
99
101
|
_inherits(_class, _React$Component);
|
|
100
102
|
|
|
103
|
+
var _super = _createSuper(_class);
|
|
104
|
+
|
|
101
105
|
function _class(props) {
|
|
102
106
|
var _this;
|
|
103
107
|
|
|
104
108
|
_classCallCheck(this, _class);
|
|
105
109
|
|
|
106
|
-
_this =
|
|
110
|
+
_this = _super.call(this, props);
|
|
107
111
|
|
|
108
112
|
_this.handleResize = function () {
|
|
109
113
|
var classNames = _this.didClassesChange();
|
|
@@ -163,7 +167,7 @@ var ResolutionDecorator = (0, _hoc["default"])(defaultConfig, function (config,
|
|
|
163
167
|
// Check if the classes are different from our previous classes
|
|
164
168
|
var classes = (0, _resolution.getResolutionClasses)();
|
|
165
169
|
if (this.props.className) classes += (classes ? ' ' : '') + this.props.className;
|
|
166
|
-
return _react["default"].createElement(Wrapped, Object.assign({}, this.props, {
|
|
170
|
+
return /*#__PURE__*/_react["default"].createElement(Wrapped, Object.assign({}, this.props, {
|
|
167
171
|
className: classes
|
|
168
172
|
}));
|
|
169
173
|
}
|
package/resolution/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -31,7 +33,9 @@ var _ResolutionDecorator = _interopRequireDefault(require("./ResolutionDecorator
|
|
|
31
33
|
|
|
32
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
35
|
|
|
34
|
-
function
|
|
36
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
37
|
+
|
|
38
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
41
|
* Exports a number of useful methods for resolution independence.
|
package/resolution/resolution.js
CHANGED
|
@@ -16,7 +16,7 @@ exports.selectSrc = selectSrc;
|
|
|
16
16
|
exports.unit = unit;
|
|
17
17
|
exports.unitToPixelFactors = exports.scaleToRem = exports.config = void 0;
|
|
18
18
|
|
|
19
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
19
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
20
20
|
|
|
21
21
|
var baseScreen,
|
|
22
22
|
orientation,
|
|
@@ -11,7 +11,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
11
11
|
describe('ResolutionDecorator Specs', function () {
|
|
12
12
|
test('should apply resolution classes to the wrapped component', function () {
|
|
13
13
|
var Component = (0, _ResolutionDecorator["default"])('div');
|
|
14
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
14
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
15
15
|
var div = subject.find('div');
|
|
16
16
|
var expected = true;
|
|
17
17
|
var actual = div.hasClass('enact-res-standard') && (div.hasClass('enact-orientation-landscape') || div.hasClass('enact-orientation-portrait'));
|
|
@@ -30,7 +30,7 @@ describe('ResolutionDecorator Specs', function () {
|
|
|
30
30
|
var Component = (0, _ResolutionDecorator["default"])({
|
|
31
31
|
screenTypes: screens
|
|
32
32
|
}, 'div');
|
|
33
|
-
var subject = (0, _enzyme.mount)(_react["default"].createElement(Component, null));
|
|
33
|
+
var subject = (0, _enzyme.mount)( /*#__PURE__*/_react["default"].createElement(Component, null));
|
|
34
34
|
var expected = true;
|
|
35
35
|
var actual = subject.find('div').hasClass('enact-res-mhd');
|
|
36
36
|
expect(actual).toBe(expected);
|