@enact/ui 5.0.0-alpha.4 → 5.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AnnounceDecorator/AnnounceDecorator.js +2 -2
- package/BodyText/BodyText.js +2 -2
- package/Button/Button.js +2 -4
- package/CHANGELOG.md +22 -0
- package/Cancelable/tests/Cancelable-specs.js +2 -2
- package/Card/Card.d.ts +77 -0
- package/Card/Card.js +215 -0
- package/Card/Card.module.css +31 -0
- package/Card/package.json +3 -0
- package/Card/tests/Card-specs.js +90 -0
- package/ComponentOverride/ComponentOverride.js +2 -2
- package/FloatingLayer/FloatingLayer.js +2 -2
- package/FloatingLayer/FloatingLayerDecorator.js +2 -2
- package/FloatingLayer/Scrim.js +2 -2
- package/FloatingLayer/useFloatingLayer.js +1 -1
- package/FloatingLayer/useFloatingLayerDecorator.js +1 -1
- package/ForwardRef/ForwardRef.js +34 -11
- package/Group/Group.js +2 -2
- package/Group/GroupItem.js +2 -5
- package/Heading/Heading.js +2 -2
- package/Icon/Icon.js +3 -2
- package/Image/Image.js +2 -2
- package/ImageItem/ImageItem.js +2 -2
- package/Item/Item.js +2 -2
- package/LabeledIcon/LabeledIcon.js +2 -2
- package/Layout/Cell.js +2 -2
- package/Layout/Layout.js +2 -2
- package/Marquee/MarqueeBase.js +2 -2
- package/Marquee/MarqueeDecorator.js +2 -2
- package/Marquee/useMarqueeController.js +1 -1
- package/Media/Media.js +2 -2
- package/Placeholder/PlaceholderControllerDecorator.js +1 -1
- package/Placeholder/tests/PlaceholderDecorator-specs.js +1 -1
- package/ProgressBar/ProgressBar.js +2 -2
- package/Repeater/Repeater.js +2 -2
- package/Resizable/tests/Resizable-specs.js +1 -1
- package/Resizable/tests/useResize-specs.js +1 -1
- package/Resizable/useResize.js +1 -1
- package/Routable/Link.js +2 -2
- package/Routable/Routable.js +3 -3
- package/Routable/Router.js +2 -2
- package/Routable/useLink.js +1 -1
- package/Scroller/Scroller.js +1 -1
- package/Scroller/ScrollerBasic.js +2 -2
- package/Skinnable/Skinnable.js +2 -2
- package/Skinnable/useSkins.js +2 -2
- package/Slider/Knob.js +2 -2
- package/Slider/Slider.js +2 -2
- package/Slottable/useSlots.js +2 -2
- package/Spinner/Spinner.js +2 -2
- package/ToggleIcon/ToggleIcon.js +2 -2
- package/Toggleable/Toggleable.js +2 -2
- package/Toggleable/useToggle.js +2 -2
- package/Touchable/Touchable.js +17 -7
- package/Touchable/tests/Touchable-specs.js +2 -2
- package/Touchable/tests/useTouch-specs.js +2 -2
- package/Transition/Transition.js +2 -2
- package/ViewManager/ViewManager.js +2 -2
- package/VirtualList/VirtualList.js +2 -2
- package/VirtualList/VirtualListBasic.js +2 -2
- package/VirtualList/tests/VirtualGridList-native-specs.js +2 -2
- package/VirtualList/tests/VirtualGridList-specs.js +2 -2
- package/VirtualList/tests/VirtualList-native-specs.js +2 -2
- package/VirtualList/tests/VirtualList-specs.js +2 -2
- package/package.json +4 -4
- package/resolution/index.d.ts +5 -1
- package/resolution/resolution.js +5 -1
- package/resolution/tests/resolution-specs.js +46 -19
- package/useScroll/Scrollbar.js +2 -2
- package/useScroll/ScrollbarTrack.js +17 -6
- package/useScroll/useScroll.js +8 -11
package/Toggleable/Toggleable.js
CHANGED
|
@@ -24,8 +24,8 @@ var _excluded = ["disabled"];
|
|
|
24
24
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
25
25
|
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); }
|
|
26
26
|
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; }
|
|
27
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
28
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
27
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
28
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
29
29
|
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; }
|
|
30
30
|
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; }
|
|
31
31
|
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; }
|
package/Toggleable/useToggle.js
CHANGED
|
@@ -16,8 +16,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
16
16
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
17
17
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
18
18
|
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; }
|
|
19
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
20
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
19
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(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 (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
21
21
|
/**
|
|
22
22
|
* Configuration for `useToggle`
|
|
23
23
|
*
|
package/Touchable/Touchable.js
CHANGED
|
@@ -19,7 +19,6 @@ Object.defineProperty(exports, "useTouch", {
|
|
|
19
19
|
});
|
|
20
20
|
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
21
21
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
22
|
-
var _react = require("react");
|
|
23
22
|
var _config = require("./config");
|
|
24
23
|
var _Drag = require("./Drag");
|
|
25
24
|
var _Flick = require("./Flick");
|
|
@@ -28,7 +27,7 @@ var _Pinch = require("./Pinch");
|
|
|
28
27
|
var _useTouch = _interopRequireDefault(require("./useTouch"));
|
|
29
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
30
29
|
var _excluded = ["dragConfig", "flickConfig", "holdConfig", "pinchConfig", "disabled", "noResume", "onBlur", "onClick", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDown", "onDrag", "onDragEnd", "onDragStart", "onFlick", "onHold", "onHoldEnd", "onHoldStart", "onMove", "onPinch", "onPinchEnd", "onPinchStart", "onTap", "onUp"],
|
|
31
|
-
_excluded2 = ["disabled", "noResume"];
|
|
30
|
+
_excluded2 = ["disabled", "noResume", "ref"];
|
|
32
31
|
/**
|
|
33
32
|
* Application support for gestures.
|
|
34
33
|
*
|
|
@@ -42,8 +41,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
42
41
|
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; }
|
|
43
42
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
44
43
|
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); }
|
|
45
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
46
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
44
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
45
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
47
46
|
var selectProps = function selectProps(props) {
|
|
48
47
|
var dragConfig = props.dragConfig,
|
|
49
48
|
flickConfig = props.flickConfig,
|
|
@@ -153,11 +152,13 @@ var Touchable = exports.Touchable = (0, _hoc["default"])(defaultConfig, function
|
|
|
153
152
|
var activeProp = config.activeProp;
|
|
154
153
|
|
|
155
154
|
// eslint-disable-next-line no-shadow
|
|
156
|
-
var Touchable =
|
|
155
|
+
var Touchable = function Touchable(props) {
|
|
157
156
|
var _props$disabled = props.disabled,
|
|
158
157
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
159
158
|
_props$noResume = props.noResume,
|
|
160
159
|
noResume = _props$noResume === void 0 ? false : _props$noResume,
|
|
160
|
+
_props$ref = props.ref,
|
|
161
|
+
ref = _props$ref === void 0 ? null : _props$ref,
|
|
161
162
|
rest = _objectWithoutProperties(props, _excluded2);
|
|
162
163
|
var _selectProps = selectProps(_objectSpread({
|
|
163
164
|
disabled: disabled,
|
|
@@ -175,7 +176,7 @@ var Touchable = exports.Touchable = (0, _hoc["default"])(defaultConfig, function
|
|
|
175
176
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread(_objectSpread({}, propsForWrapped), {}, {
|
|
176
177
|
ref: ref
|
|
177
178
|
}));
|
|
178
|
-
}
|
|
179
|
+
};
|
|
179
180
|
Touchable.propTypes = {
|
|
180
181
|
/**
|
|
181
182
|
* Disables the component.
|
|
@@ -400,7 +401,16 @@ var Touchable = exports.Touchable = (0, _hoc["default"])(defaultConfig, function
|
|
|
400
401
|
* @type {Object}
|
|
401
402
|
* @public
|
|
402
403
|
*/
|
|
403
|
-
pinchConfig: _Pinch.pinchConfigPropType
|
|
404
|
+
pinchConfig: _Pinch.pinchConfigPropType,
|
|
405
|
+
/**
|
|
406
|
+
* Forwards a reference to the DOM element.
|
|
407
|
+
*
|
|
408
|
+
* @type {Object}
|
|
409
|
+
* @private
|
|
410
|
+
*/
|
|
411
|
+
ref: _propTypes["default"].shape({
|
|
412
|
+
current: _propTypes["default"].any
|
|
413
|
+
})
|
|
404
414
|
};
|
|
405
415
|
Touchable.displayName = 'Touchable';
|
|
406
416
|
return Touchable;
|
|
@@ -6,8 +6,8 @@ var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
var _excluded = ["children", "id", "onClick", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseUp", "onTouchStart", "onTouchEnd"];
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
10
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
9
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
11
11
|
describe('Touchable', function () {
|
|
12
12
|
beforeEach(function () {
|
|
13
13
|
jest.useFakeTimers();
|
|
@@ -11,8 +11,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
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; }
|
|
12
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
13
13
|
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); }
|
|
14
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
15
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
14
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
15
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
16
16
|
describe('useTouch', function () {
|
|
17
17
|
var data;
|
|
18
18
|
var DivComponent = function DivComponent(props) {
|
package/Transition/Transition.js
CHANGED
|
@@ -26,8 +26,8 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
26
26
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
27
27
|
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); }
|
|
28
28
|
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
29
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
30
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
29
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
30
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
31
31
|
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; }
|
|
32
32
|
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; }
|
|
33
33
|
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; }
|
|
@@ -60,8 +60,8 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
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
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
|
|
64
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
63
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(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 (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
65
65
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
66
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
67
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -93,7 +93,7 @@ var VirtualList = exports.VirtualList = function VirtualList(props) {
|
|
|
93
93
|
|
|
94
94
|
// Render
|
|
95
95
|
|
|
96
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext, _objectSpread(_objectSpread({}, resizeContextProps), {}, {
|
|
97
97
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, scrollContainerProps), {}, {
|
|
98
98
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, scrollInnerContainerProps), {}, {
|
|
99
99
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollContentWrapper, _objectSpread(_objectSpread({}, scrollContentWrapperProps), {}, {
|
|
@@ -343,7 +343,7 @@ var VirtualGridList = exports.VirtualGridList = function VirtualGridList(props)
|
|
|
343
343
|
scrollContentProps = _useScroll2.scrollContentProps,
|
|
344
344
|
verticalScrollbarProps = _useScroll2.verticalScrollbarProps,
|
|
345
345
|
horizontalScrollbarProps = _useScroll2.horizontalScrollbarProps;
|
|
346
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext
|
|
346
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext, _objectSpread(_objectSpread({}, resizeContextProps), {}, {
|
|
347
347
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, scrollContainerProps), {}, {
|
|
348
348
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, scrollInnerContainerProps), {}, {
|
|
349
349
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollContentWrapper, _objectSpread(_objectSpread({}, scrollContentWrapperProps), {}, {
|
|
@@ -16,8 +16,8 @@ var _VirtualListModule = _interopRequireDefault(require("./VirtualList.module.cs
|
|
|
16
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
17
|
var _excluded = ["className", "containerProps", "placeholderRenderer", "role", "style", "scrollMode"];
|
|
18
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
20
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
19
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(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 (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
21
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
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; } }
|
|
@@ -12,8 +12,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
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
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(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
16
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(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 (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
17
|
describe('VirtualGridList with native scrollMode', function () {
|
|
18
18
|
var clientSize, dataSize, items, itemSize, renderItem, svgGenerator;
|
|
19
19
|
beforeEach(function () {
|
|
@@ -12,8 +12,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
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
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(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
16
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(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 (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
17
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
18
18
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
19
19
|
var activate = function activate(list) {
|
|
@@ -12,8 +12,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
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
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(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
16
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(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 (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
17
|
describe('VirtualList with native scrollMode', function () {
|
|
18
18
|
var clientSize, dataSize, items, itemSize, renderItem;
|
|
19
19
|
beforeEach(function () {
|
|
@@ -12,8 +12,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
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
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(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
16
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
15
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(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 (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
17
17
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
18
18
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
19
19
|
var activate = function activate(list) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/ui",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-beta.1",
|
|
4
4
|
"description": "A collection of simplified unstyled cross-platform UI components for Enact",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@enact/core": "^5.0.0-
|
|
36
|
-
"@enact/i18n": "^5.0.0-
|
|
35
|
+
"@enact/core": "^5.0.0-beta.1",
|
|
36
|
+
"@enact/i18n": "^5.0.0-beta.1",
|
|
37
37
|
"classnames": "^2.5.1",
|
|
38
|
-
"ilib": "^14.
|
|
38
|
+
"ilib": "^14.21.0",
|
|
39
39
|
"invariant": "^2.2.4",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"ramda": "^0.30.1",
|
package/resolution/index.d.ts
CHANGED
|
@@ -49,9 +49,13 @@ ri.defineScreenTypes([
|
|
|
49
49
|
{name: 'vga', pxPerRem: 8, width: 640, height: 480, aspectRatioName: 'standard'},
|
|
50
50
|
{name: 'xga', pxPerRem: 16, width: 1024, height: 768, aspectRatioName: 'standard'},
|
|
51
51
|
{name: 'hd', pxPerRem: 16, width: 1280, height: 720, aspectRatioName: 'hdtv'},
|
|
52
|
+
{name: 'uw-hd', pxPerRem: 16, width: 1920, height: 804, aspectRatioName: 'cinema'},
|
|
52
53
|
{name: 'fhd', pxPerRem: 24, width: 1920, height: 1080, aspectRatioName: 'hdtv', base: true},
|
|
53
54
|
{name: 'uw-uxga', pxPerRem: 24, width: 2560, height: 1080, aspectRatioName: 'cinema'},
|
|
54
|
-
{name: '
|
|
55
|
+
{name: 'qhd', pxPerRem: 32, width: 2560, height: 1440, aspectRatioName: 'hdtv'},
|
|
56
|
+
{name: 'wqhd', pxPerRem: 32, width: 3440, height: 1440, aspectRatioName: 'cinema'},
|
|
57
|
+
{name: 'uhd', pxPerRem: 48, width: 3840, height: 2160, aspectRatioName: 'hdtv'},
|
|
58
|
+
{name: 'uhd2', pxPerRem: 96, width: 7680, height: 4320, aspectRatioName: 'hdtv'}
|
|
55
59
|
]);
|
|
56
60
|
```
|
|
57
61
|
*/
|
package/resolution/resolution.js
CHANGED
|
@@ -126,9 +126,13 @@ function getScreenTypeObject(type) {
|
|
|
126
126
|
* {name: 'vga', pxPerRem: 8, width: 640, height: 480, aspectRatioName: 'standard'},
|
|
127
127
|
* {name: 'xga', pxPerRem: 16, width: 1024, height: 768, aspectRatioName: 'standard'},
|
|
128
128
|
* {name: 'hd', pxPerRem: 16, width: 1280, height: 720, aspectRatioName: 'hdtv'},
|
|
129
|
+
* {name: 'uw-hd', pxPerRem: 16, width: 1920, height: 804, aspectRatioName: 'cinema'},
|
|
129
130
|
* {name: 'fhd', pxPerRem: 24, width: 1920, height: 1080, aspectRatioName: 'hdtv', base: true},
|
|
130
131
|
* {name: 'uw-uxga', pxPerRem: 24, width: 2560, height: 1080, aspectRatioName: 'cinema'},
|
|
131
|
-
* {name: '
|
|
132
|
+
* {name: 'qhd', pxPerRem: 32, width: 2560, height: 1440, aspectRatioName: 'hdtv'},
|
|
133
|
+
* {name: 'wqhd', pxPerRem: 32, width: 3440, height: 1440, aspectRatioName: 'cinema'},
|
|
134
|
+
* {name: 'uhd', pxPerRem: 48, width: 3840, height: 2160, aspectRatioName: 'hdtv'},
|
|
135
|
+
* {name: 'uhd2', pxPerRem: 96, width: 7680, height: 4320, aspectRatioName: 'hdtv'}
|
|
132
136
|
* ]);
|
|
133
137
|
* ```
|
|
134
138
|
*
|
|
@@ -20,6 +20,12 @@ describe('Resolution Specs', function () {
|
|
|
20
20
|
width: 1280,
|
|
21
21
|
height: 720,
|
|
22
22
|
aspectRatioName: 'hdtv'
|
|
23
|
+
}, {
|
|
24
|
+
name: 'uw-hd',
|
|
25
|
+
pxPerRem: 16,
|
|
26
|
+
width: 1920,
|
|
27
|
+
height: 804,
|
|
28
|
+
aspectRatioName: 'cinema'
|
|
23
29
|
}, {
|
|
24
30
|
name: 'fhd',
|
|
25
31
|
pxPerRem: 24,
|
|
@@ -70,6 +76,10 @@ describe('Resolution Specs', function () {
|
|
|
70
76
|
width: 1280,
|
|
71
77
|
height: 720
|
|
72
78
|
};
|
|
79
|
+
var UWHD = {
|
|
80
|
+
width: 1920,
|
|
81
|
+
height: 804
|
|
82
|
+
};
|
|
73
83
|
var FHD = {
|
|
74
84
|
width: 1920,
|
|
75
85
|
height: 1080
|
|
@@ -100,6 +110,7 @@ describe('Resolution Specs', function () {
|
|
|
100
110
|
expect((0, _resolution.getScreenType)(VGA)).toBe('vga');
|
|
101
111
|
expect((0, _resolution.getScreenType)(XGA)).toBe('xga');
|
|
102
112
|
expect((0, _resolution.getScreenType)(HD)).toBe('hd');
|
|
113
|
+
expect((0, _resolution.getScreenType)(UWHD)).toBe('uw-hd');
|
|
103
114
|
expect((0, _resolution.getScreenType)(FHD)).toBe('fhd');
|
|
104
115
|
expect((0, _resolution.getScreenType)(UWUXGA)).toBe('uw-uxga');
|
|
105
116
|
expect((0, _resolution.getScreenType)(QHD)).toBe('qhd');
|
|
@@ -209,22 +220,28 @@ describe('Resolution Specs', function () {
|
|
|
209
220
|
width: FHD.width - 1,
|
|
210
221
|
height: FHD.height - 1
|
|
211
222
|
})).toBe('hd');
|
|
212
|
-
expect((0, _resolution.getScreenType)({
|
|
213
|
-
width: FHD.width + 1,
|
|
214
|
-
height: FHD.height - 1
|
|
215
|
-
})).toBe('hd');
|
|
216
223
|
expect((0, _resolution.getScreenType)({
|
|
217
224
|
width: FHD.width - 1,
|
|
218
225
|
height: FHD.height + 1
|
|
219
226
|
})).toBe('hd');
|
|
227
|
+
|
|
228
|
+
// UWHD
|
|
229
|
+
expect((0, _resolution.getScreenType)({
|
|
230
|
+
width: UWHD.width + 1,
|
|
231
|
+
height: UWHD.height + 1
|
|
232
|
+
})).toBe('uw-hd');
|
|
233
|
+
expect((0, _resolution.getScreenType)({
|
|
234
|
+
width: FHD.width + 1,
|
|
235
|
+
height: FHD.height - 1
|
|
236
|
+
})).toBe('uw-hd');
|
|
220
237
|
expect((0, _resolution.getScreenType)({
|
|
221
238
|
width: UWUXGA.width - 1,
|
|
222
239
|
height: UWUXGA.height - 1
|
|
223
|
-
})).toBe('hd');
|
|
240
|
+
})).toBe('uw-hd');
|
|
224
241
|
expect((0, _resolution.getScreenType)({
|
|
225
242
|
width: UWUXGA.width + 1,
|
|
226
243
|
height: UWUXGA.height - 1
|
|
227
|
-
})).toBe('hd');
|
|
244
|
+
})).toBe('uw-hd');
|
|
228
245
|
|
|
229
246
|
// FHD
|
|
230
247
|
expect((0, _resolution.getScreenType)({
|
|
@@ -368,55 +385,65 @@ describe('Resolution Specs', function () {
|
|
|
368
385
|
height: HD.height - 1
|
|
369
386
|
})).toBe('hd');
|
|
370
387
|
|
|
371
|
-
//
|
|
388
|
+
// UWHD
|
|
389
|
+
expect((0, _resolution.getScreenType)({
|
|
390
|
+
width: UWHD.width - 1,
|
|
391
|
+
height: UWHD.height - 1
|
|
392
|
+
})).toBe('uw-hd');
|
|
372
393
|
expect((0, _resolution.getScreenType)({
|
|
373
394
|
width: XGA.width + 1,
|
|
374
395
|
height: XGA.height - 1
|
|
375
|
-
})).toBe('
|
|
396
|
+
})).toBe('uw-hd');
|
|
376
397
|
expect((0, _resolution.getScreenType)({
|
|
377
398
|
width: XGA.width - 1,
|
|
378
399
|
height: XGA.height + 1
|
|
379
|
-
})).toBe('
|
|
400
|
+
})).toBe('uw-hd');
|
|
380
401
|
expect((0, _resolution.getScreenType)({
|
|
381
402
|
width: XGA.width + 1,
|
|
382
403
|
height: XGA.height + 1
|
|
383
|
-
})).toBe('
|
|
404
|
+
})).toBe('uw-hd');
|
|
384
405
|
expect((0, _resolution.getScreenType)({
|
|
385
406
|
width: HD.width,
|
|
386
407
|
height: XGA.height
|
|
387
|
-
})).toBe('
|
|
408
|
+
})).toBe('uw-hd');
|
|
388
409
|
expect((0, _resolution.getScreenType)({
|
|
389
410
|
width: HD.width - 1,
|
|
390
411
|
height: XGA.height - 1
|
|
391
|
-
})).toBe('
|
|
412
|
+
})).toBe('uw-hd');
|
|
392
413
|
expect((0, _resolution.getScreenType)({
|
|
393
414
|
width: HD.width + 1,
|
|
394
415
|
height: XGA.height - 1
|
|
395
|
-
})).toBe('
|
|
416
|
+
})).toBe('uw-hd');
|
|
396
417
|
expect((0, _resolution.getScreenType)({
|
|
397
418
|
width: HD.width - 1,
|
|
398
419
|
height: XGA.height + 1
|
|
399
|
-
})).toBe('
|
|
420
|
+
})).toBe('uw-hd');
|
|
400
421
|
expect((0, _resolution.getScreenType)({
|
|
401
422
|
width: HD.width + 1,
|
|
402
423
|
height: XGA.height + 1
|
|
403
|
-
})).toBe('
|
|
424
|
+
})).toBe('uw-hd');
|
|
404
425
|
expect((0, _resolution.getScreenType)({
|
|
405
426
|
width: XGA.width + 1,
|
|
406
427
|
height: HD.height + 1
|
|
407
|
-
})).toBe('
|
|
428
|
+
})).toBe('uw-hd');
|
|
408
429
|
expect((0, _resolution.getScreenType)({
|
|
409
430
|
width: HD.width + 1,
|
|
410
431
|
height: HD.height - 1
|
|
411
|
-
})).toBe('
|
|
432
|
+
})).toBe('uw-hd');
|
|
412
433
|
expect((0, _resolution.getScreenType)({
|
|
413
434
|
width: HD.width - 1,
|
|
414
435
|
height: HD.height + 1
|
|
415
|
-
})).toBe('
|
|
436
|
+
})).toBe('uw-hd');
|
|
416
437
|
expect((0, _resolution.getScreenType)({
|
|
417
438
|
width: HD.width + 1,
|
|
418
439
|
height: HD.height + 1
|
|
419
|
-
})).toBe('
|
|
440
|
+
})).toBe('uw-hd');
|
|
441
|
+
expect((0, _resolution.getScreenType)({
|
|
442
|
+
width: HD.width + 1,
|
|
443
|
+
height: UWHD.height - 1
|
|
444
|
+
})).toBe('uw-hd');
|
|
445
|
+
|
|
446
|
+
// FHD
|
|
420
447
|
expect((0, _resolution.getScreenType)({
|
|
421
448
|
width: FHD.width - 1,
|
|
422
449
|
height: FHD.height - 1
|
package/useScroll/Scrollbar.js
CHANGED
|
@@ -27,8 +27,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
27
27
|
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; }
|
|
28
28
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
29
29
|
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); }
|
|
30
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
31
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
30
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
31
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
32
32
|
var scrollbarTrackHidingDelay = 900; // 900ms + 100ms(fade out duration) = 1000ms.
|
|
33
33
|
|
|
34
34
|
var addClass = function addClass(element, className) {
|
|
@@ -9,7 +9,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _ScrollbarTrackModule = _interopRequireDefault(require("./ScrollbarTrack.module.css"));
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
var _excluded = ["vertical"];
|
|
12
|
+
var _excluded = ["ref", "vertical"];
|
|
13
13
|
/**
|
|
14
14
|
* An unstyled scroll track without any behavior.
|
|
15
15
|
*
|
|
@@ -24,10 +24,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
24
24
|
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; }
|
|
25
25
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
26
26
|
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); }
|
|
27
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
28
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
29
|
-
var ScrollbarTrack =
|
|
30
|
-
var _props$
|
|
27
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
28
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
29
|
+
var ScrollbarTrack = function ScrollbarTrack(props) {
|
|
30
|
+
var _props$ref = props.ref,
|
|
31
|
+
ref = _props$ref === void 0 ? null : _props$ref,
|
|
32
|
+
_props$vertical = props.vertical,
|
|
31
33
|
vertical = _props$vertical === void 0 ? true : _props$vertical,
|
|
32
34
|
rest = _objectWithoutProperties(props, _excluded),
|
|
33
35
|
className = (0, _classnames["default"])(_ScrollbarTrackModule["default"].scrollbarTrack, vertical ? _ScrollbarTrackModule["default"].vertical : null);
|
|
@@ -35,8 +37,17 @@ var ScrollbarTrack = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
35
37
|
className: className,
|
|
36
38
|
ref: ref
|
|
37
39
|
}));
|
|
38
|
-
}
|
|
40
|
+
};
|
|
39
41
|
ScrollbarTrack.propTypes = /** @lends ui/useScroll.ScrollbarTrack.prototype */{
|
|
42
|
+
/**
|
|
43
|
+
* Forwards a reference to the DOM element.
|
|
44
|
+
*
|
|
45
|
+
* @type {Object}
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
ref: _propTypes["default"].shape({
|
|
49
|
+
current: _propTypes["default"].any
|
|
50
|
+
}),
|
|
40
51
|
/**
|
|
41
52
|
* If `true`, the scrollbar will be oriented vertically.
|
|
42
53
|
*
|
package/useScroll/useScroll.js
CHANGED
|
@@ -13,7 +13,6 @@ var _util = require("@enact/core/util");
|
|
|
13
13
|
var _clamp = _interopRequireDefault(require("ramda/src/clamp"));
|
|
14
14
|
var _react = require("react");
|
|
15
15
|
var _warning = _interopRequireDefault(require("warning"));
|
|
16
|
-
var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
|
|
17
16
|
var _Resizable = require("../Resizable");
|
|
18
17
|
var _resolution = _interopRequireDefault(require("../resolution"));
|
|
19
18
|
var _Touchable = _interopRequireDefault(require("../Touchable"));
|
|
@@ -22,7 +21,7 @@ var _utilDOM = _interopRequireDefault(require("./utilDOM"));
|
|
|
22
21
|
var _utilEvent = _interopRequireDefault(require("./utilEvent"));
|
|
23
22
|
var _useScrollModule = _interopRequireDefault(require("./useScroll.module.css"));
|
|
24
23
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
-
var _excluded = ["
|
|
24
|
+
var _excluded = ["ref"],
|
|
26
25
|
_excluded2 = ["childProps", "children", "className", "clientSize", "assignProperties", "dataSize", "direction", "horizontalScrollbar", "horizontalScrollbarHandle", "itemRenderer", "itemSize", "itemSizes", "noScrollByDrag", "noScrollByWheel", "overhang", "overscrollEffectOn", "pageScroll", "role", "rtl", "scrollContainerRef", "scrollContentHandle", "scrollContentRef", "scrollMode", "setScrollContainerHandle", "snapToCenter", "spacing", "spotlightContainerDisabled", "verticalScrollbar", "verticalScrollbarHandle", "wrap"];
|
|
27
26
|
/* global ResizeObserver */
|
|
28
27
|
/**
|
|
@@ -48,8 +47,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
48
47
|
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; }
|
|
49
48
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
50
49
|
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); }
|
|
51
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
52
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
50
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
51
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
53
52
|
var constants = exports.constants = {
|
|
54
53
|
animationDuration: 1000,
|
|
55
54
|
epsilon: 1,
|
|
@@ -84,15 +83,13 @@ var constants = exports.constants = {
|
|
|
84
83
|
paginationPageMultiplier = constants.paginationPageMultiplier,
|
|
85
84
|
scrollStopWaiting = constants.scrollStopWaiting,
|
|
86
85
|
scrollWheelPageMultiplierForMaxPixel = constants.scrollWheelPageMultiplierForMaxPixel;
|
|
87
|
-
var TouchableDiv = (0,
|
|
88
|
-
|
|
89
|
-
}, (0, _Touchable["default"])(function (_ref) {
|
|
90
|
-
var componentRef = _ref.componentRef,
|
|
86
|
+
var TouchableDiv = (0, _Touchable["default"])(function (_ref) {
|
|
87
|
+
var ref = _ref.ref,
|
|
91
88
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
92
89
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, rest), {}, {
|
|
93
|
-
ref:
|
|
90
|
+
ref: ref
|
|
94
91
|
}));
|
|
95
|
-
})
|
|
92
|
+
});
|
|
96
93
|
var useForceUpdate = function useForceUpdate() {
|
|
97
94
|
return (0, _react.useReducer)(function (x) {
|
|
98
95
|
return x + 1;
|
|
@@ -168,7 +165,7 @@ var useScrollBase = exports.useScrollBase = function useScrollBase(props) {
|
|
|
168
165
|
var _useForceUpdate = useForceUpdate(),
|
|
169
166
|
_useForceUpdate2 = _slicedToArray(_useForceUpdate, 2),
|
|
170
167
|
forceUpdate = _useForceUpdate2[1];
|
|
171
|
-
var context = (0, _react.
|
|
168
|
+
var context = (0, _react.use)(_Resizable.ResizeContext);
|
|
172
169
|
var _useState = (0, _react.useState)(horizontalScrollbar === 'visible'),
|
|
173
170
|
_useState2 = _slicedToArray(_useState, 2),
|
|
174
171
|
isHorizontalScrollbarVisible = _useState2[0],
|