@enact/ui 5.0.0-alpha.5 → 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/Button/Button.js +0 -2
- package/CHANGELOG.md +12 -0
- package/FloatingLayer/useFloatingLayer.js +1 -1
- package/FloatingLayer/useFloatingLayerDecorator.js +1 -1
- package/ForwardRef/ForwardRef.js +34 -11
- package/Group/GroupItem.js +0 -3
- package/Marquee/useMarqueeController.js +1 -1
- package/Placeholder/PlaceholderControllerDecorator.js +1 -1
- package/Placeholder/tests/PlaceholderDecorator-specs.js +1 -1
- package/Resizable/tests/Resizable-specs.js +1 -1
- package/Resizable/tests/useResize-specs.js +1 -1
- package/Resizable/useResize.js +1 -1
- package/Routable/Routable.js +1 -1
- package/Routable/useLink.js +1 -1
- package/Scroller/Scroller.js +1 -1
- package/Skinnable/useSkins.js +2 -2
- package/Touchable/Touchable.js +15 -5
- package/VirtualList/VirtualList.js +2 -2
- package/package.json +3 -3
- package/useScroll/ScrollbarTrack.js +15 -4
- package/useScroll/useScroll.js +6 -9
package/Button/Button.js
CHANGED
|
@@ -219,8 +219,6 @@ var ButtonBase = exports.ButtonBase = (0, _kind["default"])({
|
|
|
219
219
|
// configured to handle.
|
|
220
220
|
if (typeof iconComponent !== 'string') {
|
|
221
221
|
props.size = size;
|
|
222
|
-
// the following inadvertently triggers a linting rule
|
|
223
|
-
// eslint-disable-next-line enact/prop-types
|
|
224
222
|
props.flip = iconFlip;
|
|
225
223
|
}
|
|
226
224
|
if (_icon !== true) {
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
The following is a curated list of changes in the Enact ui module, newest changes on the top.
|
|
4
4
|
|
|
5
|
+
## [5.0.0-beta.1] - 2025-04-29
|
|
6
|
+
|
|
7
|
+
No significant changes.
|
|
8
|
+
|
|
9
|
+
## [4.9.8] - 2025-04-24
|
|
10
|
+
|
|
11
|
+
No significant changes.
|
|
12
|
+
|
|
13
|
+
## [4.9.7] - 2025-04-16
|
|
14
|
+
|
|
15
|
+
No significant changes.
|
|
16
|
+
|
|
5
17
|
## [5.0.0-alpha.5] - 2025-04-04
|
|
6
18
|
|
|
7
19
|
### Added
|
|
@@ -23,7 +23,7 @@ function useFloatingLayer() {
|
|
|
23
23
|
setId(ev.floatingLayer.id);
|
|
24
24
|
}
|
|
25
25
|
}, [setId]);
|
|
26
|
-
var registerFloatingLayer = (0, _react.
|
|
26
|
+
var registerFloatingLayer = (0, _react.use)(_FloatingLayerDecorator.FloatingLayerContext);
|
|
27
27
|
(0, _react.useEffect)(function () {
|
|
28
28
|
if (registerFloatingLayer) {
|
|
29
29
|
registerFloatingLayer(handler);
|
|
@@ -50,7 +50,7 @@ function useFloatingLayerDecorator() {
|
|
|
50
50
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
51
51
|
|
|
52
52
|
var provideFloatingLayer = (0, _react.useCallback)(function (children) {
|
|
53
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FloatingLayerContext
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(FloatingLayerContext, {
|
|
54
54
|
value: floating.registry.register,
|
|
55
55
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
56
56
|
className: className,
|
package/ForwardRef/ForwardRef.js
CHANGED
|
@@ -5,24 +5,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.ForwardRef = void 0;
|
|
7
7
|
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
8
|
-
var
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
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; }
|
|
13
|
-
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; }
|
|
14
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
15
|
-
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); } /**
|
|
10
|
+
var _excluded = ["ref"];
|
|
11
|
+
/**
|
|
16
12
|
* A higher-order component interface for `ref` forwarding.
|
|
17
13
|
*
|
|
18
14
|
* @module ui/ForwardRef
|
|
19
15
|
* @exports ForwardRef
|
|
20
|
-
*/
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
21
18
|
* Default config for {@link ui/ForwardRef.ForwardRef}.
|
|
22
19
|
*
|
|
23
20
|
* @memberof ui/ForwardRef.ForwardRef
|
|
24
21
|
* @hocconfig
|
|
25
22
|
*/
|
|
23
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
28
|
+
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); }
|
|
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; }
|
|
26
31
|
var defaultConfig = {
|
|
27
32
|
/**
|
|
28
33
|
* The prop name to pass the ref callback
|
|
@@ -57,9 +62,27 @@ var defaultConfig = {
|
|
|
57
62
|
*/
|
|
58
63
|
var ForwardRef = exports.ForwardRef = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
59
64
|
var prop = config.prop;
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
|
|
66
|
+
// eslint-disable-next-line no-shadow
|
|
67
|
+
var ForwardRef = function ForwardRef(props) {
|
|
68
|
+
var _props$ref = props.ref,
|
|
69
|
+
ref = _props$ref === void 0 ? null : _props$ref,
|
|
70
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
71
|
+
var withRef = _objectSpread(_objectSpread({}, rest), {}, _defineProperty({}, prop, ref));
|
|
62
72
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, withRef));
|
|
63
|
-
}
|
|
73
|
+
};
|
|
74
|
+
ForwardRef.propTypes = {
|
|
75
|
+
/**
|
|
76
|
+
* Forwards a reference to the DOM element.
|
|
77
|
+
*
|
|
78
|
+
* @type {Object}
|
|
79
|
+
* @private
|
|
80
|
+
*/
|
|
81
|
+
ref: _propTypes["default"].shape({
|
|
82
|
+
current: _propTypes["default"].any
|
|
83
|
+
})
|
|
84
|
+
};
|
|
85
|
+
ForwardRef.displayName = 'ForwardRef';
|
|
86
|
+
return ForwardRef;
|
|
64
87
|
});
|
|
65
88
|
var _default = exports["default"] = ForwardRef;
|
package/Group/GroupItem.js
CHANGED
|
@@ -60,9 +60,6 @@ var pickGroupItemProps = exports.pickGroupItemProps = function pickGroupItemProp
|
|
|
60
60
|
*/
|
|
61
61
|
var GroupItemBase = exports.GroupItemBase = exports.GroupItem = (0, _kind["default"])({
|
|
62
62
|
name: 'GroupItem',
|
|
63
|
-
// TODO: Add propTypes
|
|
64
|
-
/* eslint-disable enact/prop-types */
|
|
65
|
-
|
|
66
63
|
handlers: {
|
|
67
64
|
handleSelect: function handleSelect(ev, props) {
|
|
68
65
|
var _props$$$GroupItem = props.$$GroupItem,
|
|
@@ -263,7 +263,7 @@ var useMarqueeController = exports.useMarqueeController = function useMarqueeCon
|
|
|
263
263
|
};
|
|
264
264
|
}, [handleCancel, handleComplete, handleEnter, handleLeave, handleRegister, handleStart, handleUnregister]);
|
|
265
265
|
var provideMarqueeControllerContext = (0, _react.useCallback)(function (children) {
|
|
266
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MarqueeControllerContext
|
|
266
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MarqueeControllerContext, {
|
|
267
267
|
value: value,
|
|
268
268
|
children: children
|
|
269
269
|
});
|
|
@@ -164,7 +164,7 @@ var PlaceholderControllerDecorator = exports.PlaceholderControllerDecorator = (0
|
|
|
164
164
|
value: function render() {
|
|
165
165
|
var props = Object.assign({}, this.props);
|
|
166
166
|
if (notify) props[notify] = this.handleNotify;
|
|
167
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PlaceholderContext
|
|
167
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(PlaceholderContext, {
|
|
168
168
|
value: this.registry.register,
|
|
169
169
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(WrappedWithRef, _objectSpread(_objectSpread({}, props), {}, {
|
|
170
170
|
outermostRef: this.nodeRef,
|
|
@@ -12,7 +12,7 @@ describe('PlaceholderDecorator', function () {
|
|
|
12
12
|
describe('config', function () {
|
|
13
13
|
test('should configure the default style of the placeholder element', function () {
|
|
14
14
|
var controllerRegistry = _Registry["default"].create();
|
|
15
|
-
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_PlaceholderControllerDecorator.PlaceholderContext
|
|
15
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_PlaceholderControllerDecorator.PlaceholderContext, {
|
|
16
16
|
value: controllerRegistry.register,
|
|
17
17
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
18
18
|
"data-testid": "wrapper",
|
|
@@ -21,7 +21,7 @@ describe('Resizable', function () {
|
|
|
21
21
|
describe('config', function () {
|
|
22
22
|
test('should pass \'onClick\' handler to the wrapped component', function () {
|
|
23
23
|
var resizeRegistry = _Registry["default"].create();
|
|
24
|
-
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext
|
|
24
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext, {
|
|
25
25
|
value: resizeRegistry.register,
|
|
26
26
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ResizableComponent, {})
|
|
27
27
|
}));
|
|
@@ -30,7 +30,7 @@ describe('useResize', function () {
|
|
|
30
30
|
describe('config', function () {
|
|
31
31
|
test('should pass \'onClick\' handler to the wrapped component', function () {
|
|
32
32
|
var resizeRegistry = _Registry["default"].create();
|
|
33
|
-
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext
|
|
33
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext, {
|
|
34
34
|
value: resizeRegistry.register,
|
|
35
35
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ResizeButtonWithHook, {})
|
|
36
36
|
}));
|
package/Resizable/useResize.js
CHANGED
|
@@ -36,7 +36,7 @@ var useResize = function useResize(props, config) {
|
|
|
36
36
|
filter = _config$filter === void 0 ? null : _config$filter,
|
|
37
37
|
_config$resize = config.resize,
|
|
38
38
|
resize = _config$resize === void 0 ? null : _config$resize;
|
|
39
|
-
var resizeContextValue = (0, _react.
|
|
39
|
+
var resizeContextValue = (0, _react.use)(_ResizeContext["default"]);
|
|
40
40
|
var mutableRef = (0, _react.useRef)({
|
|
41
41
|
resizeRegistry: null
|
|
42
42
|
});
|
package/Routable/Routable.js
CHANGED
|
@@ -142,7 +142,7 @@ var Routable = exports.Routable = (0, _hoc["default"])(defaultConfig, function (
|
|
|
142
142
|
index = _ref6.index,
|
|
143
143
|
path = _ref6.path,
|
|
144
144
|
rest = _objectWithoutProperties(_ref6, _excluded2);
|
|
145
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_util.RouteContext
|
|
145
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_util.RouteContext, {
|
|
146
146
|
value: {
|
|
147
147
|
navigate: handleNavigate,
|
|
148
148
|
path: path
|
package/Routable/useLink.js
CHANGED
|
@@ -8,7 +8,7 @@ exports.useLink = useLink;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _util = require("./util");
|
|
10
10
|
function useLink() {
|
|
11
|
-
var _ref = (0, _react.
|
|
11
|
+
var _ref = (0, _react.use)(_util.RouteContext) || {},
|
|
12
12
|
currentPath = _ref.path,
|
|
13
13
|
navigate = _ref.navigate;
|
|
14
14
|
var handleNavigate = (0, _react.useCallback)(function (_ref2) {
|
package/Scroller/Scroller.js
CHANGED
|
@@ -82,7 +82,7 @@ var Scroller = exports.Scroller = function Scroller(props) {
|
|
|
82
82
|
|
|
83
83
|
// Return
|
|
84
84
|
|
|
85
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext
|
|
85
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext, _objectSpread(_objectSpread({}, resizeContextProps), {}, {
|
|
86
86
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, scrollContainerProps), {}, {
|
|
87
87
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, scrollInnerContainerProps), {}, {
|
|
88
88
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollContentWrapper, _objectSpread(_objectSpread({}, scrollContentWrapperProps), {}, {
|
package/Skinnable/useSkins.js
CHANGED
|
@@ -91,7 +91,7 @@ function useSkins(config) {
|
|
|
91
91
|
skins = config.skins,
|
|
92
92
|
skinVariants = config.skinVariants,
|
|
93
93
|
variants = config.variants;
|
|
94
|
-
var _ref = (0, _react.
|
|
94
|
+
var _ref = (0, _react.use)(SkinContext) || {},
|
|
95
95
|
parentSkin = _ref.parentSkin,
|
|
96
96
|
parentVariants = _ref.parentVariants;
|
|
97
97
|
var effectiveSkin = (0, _util.determineSkin)(defaultSkin, skin, parentSkin);
|
|
@@ -106,7 +106,7 @@ function useSkins(config) {
|
|
|
106
106
|
};
|
|
107
107
|
}, [effectiveSkin, effectiveVariants]);
|
|
108
108
|
var provideSkins = (0, _react.useCallback)(function (children) {
|
|
109
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinContext
|
|
109
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(SkinContext, {
|
|
110
110
|
value: value,
|
|
111
111
|
children: children
|
|
112
112
|
});
|
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
|
*
|
|
@@ -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;
|
|
@@ -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), {}, {
|
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,8 +32,8 @@
|
|
|
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
38
|
"ilib": "^14.21.0",
|
|
39
39
|
"invariant": "^2.2.4",
|
|
@@ -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
|
*
|
|
@@ -26,8 +26,10 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
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
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
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 =
|
|
30
|
-
var _props$
|
|
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
|
/**
|
|
@@ -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],
|