@enact/ui 5.4.1 → 5.4.3
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/BodyText/BodyText.d.ts +4 -5
- package/Button/Button.d.ts +4 -2
- package/CHANGELOG.md +20 -0
- package/Card/Card.d.ts +4 -2
- package/FloatingLayer/index.d.ts +4 -2
- package/Group/Group.d.ts +8 -4
- package/Heading/Heading.d.ts +4 -2
- package/Icon/Icon.d.ts +4 -2
- package/Image/Image.d.ts +4 -2
- package/ImageItem/ImageItem.d.ts +5 -7
- package/Item/Item.d.ts +8 -4
- package/LabeledIcon/LabeledIcon.d.ts +5 -7
- package/Layout/Layout.d.ts +16 -11
- package/Marquee/index.d.ts +4 -2
- package/ProgressBar/ProgressBar.d.ts +5 -7
- package/Repeater/Repeater.d.ts +4 -5
- package/Scroller/Scroller.d.ts +9 -1
- package/Scroller/ScrollerBasic.js +47 -6
- package/Scroller/tests/ScrollerBasic-specs.js +59 -0
- package/Slider/Slider.d.ts +8 -4
- package/Spinner/Spinner.d.ts +4 -5
- package/ToggleIcon/ToggleIcon.d.ts +8 -10
- package/ViewManager/ViewManager.d.ts +9 -11
- package/VirtualList/VirtualList.d.ts +4 -4
- package/package.json +6 -6
- package/resolution/index.d.ts +4 -4
- package/useScroll/useScroll.js +3 -1
package/BodyText/BodyText.d.ts
CHANGED
|
@@ -50,11 +50,10 @@ export function BodyTextDecorator<P>(
|
|
|
50
50
|
Component: React.ComponentType<P> | string,
|
|
51
51
|
): React.ComponentType<P & BodyTextDecoratorProps>;
|
|
52
52
|
|
|
53
|
-
export interface BodyTextProps
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
> {}
|
|
53
|
+
export interface BodyTextProps extends Omit<
|
|
54
|
+
Merge<BodyTextBaseProps, BodyTextDecoratorProps>,
|
|
55
|
+
"componentRef"
|
|
56
|
+
> {}
|
|
58
57
|
/**
|
|
59
58
|
* A simple, unstyled text block component.
|
|
60
59
|
*/
|
package/Button/Button.d.ts
CHANGED
|
@@ -112,8 +112,10 @@ export function ButtonDecorator<P>(
|
|
|
112
112
|
Component: React.ComponentType<P> | string,
|
|
113
113
|
): React.ComponentType<P & ButtonDecoratorProps>;
|
|
114
114
|
|
|
115
|
-
export interface ButtonProps
|
|
116
|
-
|
|
115
|
+
export interface ButtonProps extends Omit<
|
|
116
|
+
Merge<ButtonBaseProps, ButtonDecoratorProps>,
|
|
117
|
+
"componentRef"
|
|
118
|
+
> {}
|
|
117
119
|
/**
|
|
118
120
|
* A minimally-styled button component with touch support.
|
|
119
121
|
*/
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
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.4.3] - 2026-02-26
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `ui/VirtualList` to revert 5.4.2 cix that not to jump to the top when item size was changed
|
|
10
|
+
- `ui/VirtulList` to revert 5.4.2 fix that not to cut off focused item when scroll by pressing key
|
|
11
|
+
- `ui/VirtualList.VirtualGridList` to revert 5.4.2 fix to adjust itemSize properly when resizing window
|
|
12
|
+
|
|
13
|
+
## [5.4.2] - 2026-01-28
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- `ui/Scroller` scroll animation method for `scrollMode: native`
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- `ui/VirtulList` not to cut off focused item when scroll by pressing key
|
|
22
|
+
- `ui/VirtualList` not to jump to the top when item size was changed
|
|
23
|
+
- `ui/VirtualList.VirtualGridList` to adjust itemSize properly when resizing window
|
|
24
|
+
|
|
5
25
|
## [5.4.1] - 2025-12-30
|
|
6
26
|
|
|
7
27
|
No significant changes.
|
package/Card/Card.d.ts
CHANGED
|
@@ -73,8 +73,10 @@ export function CardDecorator<P>(
|
|
|
73
73
|
Component: React.ComponentType<P> | string,
|
|
74
74
|
): React.ComponentType<P & CardDecoratorProps>;
|
|
75
75
|
|
|
76
|
-
export interface CardProps
|
|
77
|
-
|
|
76
|
+
export interface CardProps extends Omit<
|
|
77
|
+
Merge<CardBaseProps, CardDecoratorProps>,
|
|
78
|
+
"componentRef"
|
|
79
|
+
> {}
|
|
78
80
|
/**
|
|
79
81
|
* A minimally styled Card ready for customization by a theme.
|
|
80
82
|
*/
|
package/FloatingLayer/index.d.ts
CHANGED
|
@@ -85,8 +85,10 @@ export class FloatingLayerBase extends React.Component<
|
|
|
85
85
|
Merge<React.HTMLProps<HTMLElement>, FloatingLayerBaseProps>
|
|
86
86
|
> {}
|
|
87
87
|
|
|
88
|
-
export interface FloatingLayerProps
|
|
89
|
-
|
|
88
|
+
export interface FloatingLayerProps extends Merge<
|
|
89
|
+
FloatingLayerBaseProps,
|
|
90
|
+
ui_Cancelable_CancelableProps
|
|
91
|
+
> {}
|
|
90
92
|
/**
|
|
91
93
|
* FloatingLayer that mixes to handle FloatingLayer dismissal.
|
|
92
94
|
*
|
package/Group/Group.d.ts
CHANGED
|
@@ -17,8 +17,10 @@ export class GroupBase extends React.Component<
|
|
|
17
17
|
Merge<React.HTMLProps<HTMLElement>, GroupBaseProps>
|
|
18
18
|
> {}
|
|
19
19
|
|
|
20
|
-
export interface GroupProps
|
|
21
|
-
|
|
20
|
+
export interface GroupProps extends Omit<
|
|
21
|
+
Merge<GroupBaseProps, GroupDecoratorProps>,
|
|
22
|
+
"componentRef"
|
|
23
|
+
> {
|
|
22
24
|
/**
|
|
23
25
|
* Component type to repeat. This can be a React component or a string describing a DOM
|
|
24
26
|
node (e.g. `'div'` )
|
|
@@ -98,8 +100,10 @@ export class Group extends React.Component<
|
|
|
98
100
|
Merge<React.HTMLProps<HTMLElement>, GroupProps>
|
|
99
101
|
> {}
|
|
100
102
|
|
|
101
|
-
export interface GroupDecoratorProps
|
|
102
|
-
|
|
103
|
+
export interface GroupDecoratorProps extends Merge<
|
|
104
|
+
ui_ForwardRef_ForwardRefProps,
|
|
105
|
+
ui_Changeable_ChangeableProps
|
|
106
|
+
> {}
|
|
103
107
|
export function GroupDecorator<P>(
|
|
104
108
|
Component: React.ComponentType<P> | string,
|
|
105
109
|
): React.ComponentType<P & GroupDecoratorProps>;
|
package/Heading/Heading.d.ts
CHANGED
|
@@ -15,8 +15,10 @@ export class HeadingBase extends React.Component<
|
|
|
15
15
|
Merge<React.HTMLProps<HTMLElement>, HeadingBaseProps>
|
|
16
16
|
> {}
|
|
17
17
|
|
|
18
|
-
export interface HeadingProps
|
|
19
|
-
|
|
18
|
+
export interface HeadingProps extends Omit<
|
|
19
|
+
Merge<HeadingBaseProps, HeadingDecoratorProps>,
|
|
20
|
+
"componentRef"
|
|
21
|
+
> {
|
|
20
22
|
/**
|
|
21
23
|
* The text for the label of the Heading.
|
|
22
24
|
*/
|
package/Icon/Icon.d.ts
CHANGED
|
@@ -75,8 +75,10 @@ export function IconDecorator<P>(
|
|
|
75
75
|
Component: React.ComponentType<P> | string,
|
|
76
76
|
): React.ComponentType<P & IconDecoratorProps>;
|
|
77
77
|
|
|
78
|
-
export interface IconProps
|
|
79
|
-
|
|
78
|
+
export interface IconProps extends Omit<
|
|
79
|
+
Merge<IconBaseProps, IconDecoratorProps>,
|
|
80
|
+
"componentRef"
|
|
81
|
+
> {}
|
|
80
82
|
/**
|
|
81
83
|
* An Icon component.
|
|
82
84
|
*/
|
package/Image/Image.d.ts
CHANGED
|
@@ -88,8 +88,10 @@ export class ImageBase extends React.Component<
|
|
|
88
88
|
Merge<React.HTMLProps<HTMLElement>, ImageBaseProps>
|
|
89
89
|
> {}
|
|
90
90
|
|
|
91
|
-
export interface ImageProps
|
|
92
|
-
|
|
91
|
+
export interface ImageProps extends Omit<
|
|
92
|
+
Merge<ImageBaseProps, ImageDecoratorProps>,
|
|
93
|
+
"componentRef"
|
|
94
|
+
> {
|
|
93
95
|
/**
|
|
94
96
|
* The aria-label for the image.
|
|
95
97
|
*
|
package/ImageItem/ImageItem.d.ts
CHANGED
|
@@ -69,17 +69,15 @@ export class ImageItemBase extends React.Component<
|
|
|
69
69
|
Merge<React.HTMLProps<HTMLElement>, ImageItemBaseProps>
|
|
70
70
|
> {}
|
|
71
71
|
|
|
72
|
-
export interface ImageItemDecoratorProps
|
|
73
|
-
extends ui_ForwardRef_ForwardRefProps {}
|
|
72
|
+
export interface ImageItemDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
74
73
|
export function ImageItemDecorator<P>(
|
|
75
74
|
Component: React.ComponentType<P> | string,
|
|
76
75
|
): React.ComponentType<P & ImageItemDecoratorProps>;
|
|
77
76
|
|
|
78
|
-
export interface ImageItemProps
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
> {}
|
|
77
|
+
export interface ImageItemProps extends Omit<
|
|
78
|
+
Merge<ImageItemBaseProps, ImageItemDecoratorProps>,
|
|
79
|
+
"componentRef"
|
|
80
|
+
> {}
|
|
83
81
|
/**
|
|
84
82
|
* A minimally styled ImageItem ready for customization by a theme.
|
|
85
83
|
*/
|
package/Item/Item.d.ts
CHANGED
|
@@ -45,14 +45,18 @@ export class ItemBase extends React.Component<
|
|
|
45
45
|
Merge<React.HTMLProps<HTMLElement>, ItemBaseProps>
|
|
46
46
|
> {}
|
|
47
47
|
|
|
48
|
-
export interface ItemDecoratorProps
|
|
49
|
-
|
|
48
|
+
export interface ItemDecoratorProps extends Merge<
|
|
49
|
+
ui_ForwardRef_ForwardRefProps,
|
|
50
|
+
ui_Touchable_TouchableProps
|
|
51
|
+
> {}
|
|
50
52
|
export function ItemDecorator<P>(
|
|
51
53
|
Component: React.ComponentType<P> | string,
|
|
52
54
|
): React.ComponentType<P & ItemDecoratorProps>;
|
|
53
55
|
|
|
54
|
-
export interface ItemProps
|
|
55
|
-
|
|
56
|
+
export interface ItemProps extends Omit<
|
|
57
|
+
Merge<ItemBaseProps, ItemDecoratorProps>,
|
|
58
|
+
"componentRef"
|
|
59
|
+
> {}
|
|
56
60
|
/**
|
|
57
61
|
* A minimally-styled ready-to-use list item component with touch support.
|
|
58
62
|
*/
|
|
@@ -101,17 +101,15 @@ export class LabeledIconBase extends React.Component<
|
|
|
101
101
|
Merge<React.HTMLProps<HTMLElement>, LabeledIconBaseProps>
|
|
102
102
|
> {}
|
|
103
103
|
|
|
104
|
-
export interface LabeledIconDecoratorProps
|
|
105
|
-
extends ui_Slottable_SlottableProps {}
|
|
104
|
+
export interface LabeledIconDecoratorProps extends ui_Slottable_SlottableProps {}
|
|
106
105
|
export function LabeledIconDecorator<P>(
|
|
107
106
|
Component: React.ComponentType<P> | string,
|
|
108
107
|
): React.ComponentType<P & LabeledIconDecoratorProps>;
|
|
109
108
|
|
|
110
|
-
export interface LabeledIconProps
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
> {}
|
|
109
|
+
export interface LabeledIconProps extends Omit<
|
|
110
|
+
Merge<LabeledIconBaseProps, LabeledIconDecoratorProps>,
|
|
111
|
+
"componentRef"
|
|
112
|
+
> {}
|
|
115
113
|
/**
|
|
116
114
|
* An icon component with a label without any behaviors applied to it.
|
|
117
115
|
*
|
package/Layout/Layout.d.ts
CHANGED
|
@@ -203,8 +203,10 @@ export function CellDecorator<P>(
|
|
|
203
203
|
Component: React.ComponentType<P> | string,
|
|
204
204
|
): React.ComponentType<P & CellDecoratorProps>;
|
|
205
205
|
|
|
206
|
-
export interface CellProps
|
|
207
|
-
|
|
206
|
+
export interface CellProps extends Omit<
|
|
207
|
+
Merge<CellBaseProps, CellDecoratorProps>,
|
|
208
|
+
"componentRef"
|
|
209
|
+
> {}
|
|
208
210
|
/**
|
|
209
211
|
* A stateless component that provides a space for your content in a
|
|
210
212
|
.
|
|
@@ -219,11 +221,10 @@ export function LayoutDecorator<P>(
|
|
|
219
221
|
Component: React.ComponentType<P> | string,
|
|
220
222
|
): React.ComponentType<P & LayoutDecoratorProps>;
|
|
221
223
|
|
|
222
|
-
export interface LayoutProps
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
> {}
|
|
224
|
+
export interface LayoutProps extends Omit<
|
|
225
|
+
Merge<LayoutBaseProps, ui_ForwardRef_ForwardRefProps>,
|
|
226
|
+
"componentRef"
|
|
227
|
+
> {}
|
|
227
228
|
/**
|
|
228
229
|
* A container for `Cell` s.
|
|
229
230
|
*
|
|
@@ -254,8 +255,10 @@ export class Layout extends React.Component<
|
|
|
254
255
|
Merge<React.HTMLProps<HTMLElement>, LayoutProps>
|
|
255
256
|
> {}
|
|
256
257
|
|
|
257
|
-
export interface ColumnProps
|
|
258
|
-
|
|
258
|
+
export interface ColumnProps extends Merge<
|
|
259
|
+
LayoutProps,
|
|
260
|
+
ui_ForwardRef_ForwardRefProps
|
|
261
|
+
> {}
|
|
259
262
|
/**
|
|
260
263
|
* Shorthand for `<Layout orientation="vertical">` , which positions its
|
|
261
264
|
vertically.
|
|
@@ -272,8 +275,10 @@ export class Column extends React.Component<
|
|
|
272
275
|
Merge<React.HTMLProps<HTMLElement>, ColumnProps>
|
|
273
276
|
> {}
|
|
274
277
|
|
|
275
|
-
export interface RowProps
|
|
276
|
-
|
|
278
|
+
export interface RowProps extends Merge<
|
|
279
|
+
LayoutProps,
|
|
280
|
+
ui_ForwardRef_ForwardRefProps
|
|
281
|
+
> {}
|
|
277
282
|
/**
|
|
278
283
|
* Shorthand for `<Layout orientation="horizontal">` , which positions its
|
|
279
284
|
horizontally.
|
package/Marquee/index.d.ts
CHANGED
|
@@ -241,8 +241,10 @@ export function MarqueeDecorator<P>(
|
|
|
241
241
|
Component: React.ComponentType<P> | string,
|
|
242
242
|
): React.ComponentType<P & MarqueeDecoratorProps>;
|
|
243
243
|
|
|
244
|
-
export interface MarqueeProps
|
|
245
|
-
|
|
244
|
+
export interface MarqueeProps extends Merge<
|
|
245
|
+
MarqueeBaseProps,
|
|
246
|
+
MarqueeDecoratorProps
|
|
247
|
+
> {}
|
|
246
248
|
/**
|
|
247
249
|
* A minimally-styled marquee component.
|
|
248
250
|
*/
|
|
@@ -70,17 +70,15 @@ export class ProgressBarBase extends React.Component<
|
|
|
70
70
|
Merge<React.HTMLProps<HTMLElement>, ProgressBarBaseProps>
|
|
71
71
|
> {}
|
|
72
72
|
|
|
73
|
-
export interface ProgressBarDecoratorProps
|
|
74
|
-
extends ui_ForwardRef_ForwardRefProps {}
|
|
73
|
+
export interface ProgressBarDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
75
74
|
export function ProgressBarDecorator<P>(
|
|
76
75
|
Component: React.ComponentType<P> | string,
|
|
77
76
|
): React.ComponentType<P & ProgressBarDecoratorProps>;
|
|
78
77
|
|
|
79
|
-
export interface ProgressBarProps
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
> {}
|
|
78
|
+
export interface ProgressBarProps extends Omit<
|
|
79
|
+
Merge<ProgressBarBaseProps, ProgressBarDecoratorProps>,
|
|
80
|
+
"componentRef"
|
|
81
|
+
> {}
|
|
84
82
|
/**
|
|
85
83
|
* An unstyled progress bar component that can be customized by a theme or application.
|
|
86
84
|
*/
|
package/Repeater/Repeater.d.ts
CHANGED
|
@@ -66,11 +66,10 @@ export function RepeaterDecorator<P>(
|
|
|
66
66
|
Component: React.ComponentType<P> | string,
|
|
67
67
|
): React.ComponentType<P & RepeaterDecoratorProps>;
|
|
68
68
|
|
|
69
|
-
export interface RepeaterProps
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
> {}
|
|
69
|
+
export interface RepeaterProps extends Omit<
|
|
70
|
+
Merge<RepeaterBaseProps, RepeaterDecoratorProps>,
|
|
71
|
+
"componentRef"
|
|
72
|
+
> {}
|
|
74
73
|
/**
|
|
75
74
|
* A stateless component that stamps out copies of `childComponent` .
|
|
76
75
|
*/
|
package/Scroller/Scroller.d.ts
CHANGED
|
@@ -22,7 +22,15 @@ export interface ScrollerBasicProps {
|
|
|
22
22
|
|
|
23
23
|
export class ScrollerBasic extends React.Component<
|
|
24
24
|
Merge<React.HTMLProps<HTMLElement>, ScrollerBasicProps>
|
|
25
|
-
> {
|
|
25
|
+
> {
|
|
26
|
+
/**
|
|
27
|
+
* Programmatically animates the native scroll position of `node` toward the target `left` / `top`
|
|
28
|
+
offsets using `requestAnimationFrame` . It computes the scroll direction on each axis, then repeatedly
|
|
29
|
+
calls `scrollBy` in small 18px steps (instant behavior) until the target is reached or a scroll bound
|
|
30
|
+
is hit. Used as a Chrome fallback when repeating a smooth scroll.
|
|
31
|
+
*/
|
|
32
|
+
animateScroll(any, any, any): void;
|
|
33
|
+
}
|
|
26
34
|
|
|
27
35
|
export interface ScrollerProps extends ScrollerBasicProps {
|
|
28
36
|
/**
|
|
@@ -18,6 +18,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
18
18
|
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; }
|
|
19
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
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
|
+
function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); }
|
|
21
22
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
22
23
|
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); } }
|
|
23
24
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
@@ -45,6 +46,7 @@ var ScrollerBasic = exports.ScrollerBasic = /*#__PURE__*/function (_Component) {
|
|
|
45
46
|
args[_key] = arguments[_key];
|
|
46
47
|
}
|
|
47
48
|
_this = _callSuper(this, ScrollerBasic, [].concat(args));
|
|
49
|
+
_this.scrollAnimationId = null;
|
|
48
50
|
_this.scrollBounds = {
|
|
49
51
|
clientWidth: 0,
|
|
50
52
|
clientHeight: 0,
|
|
@@ -143,12 +145,51 @@ var ScrollerBasic = exports.ScrollerBasic = /*#__PURE__*/function (_Component) {
|
|
|
143
145
|
// scrollMode 'native'
|
|
144
146
|
}, {
|
|
145
147
|
key: "scrollToPosition",
|
|
146
|
-
value: function scrollToPosition(left, top, behavior) {
|
|
147
|
-
this.props.scrollContentRef.current
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}
|
|
148
|
+
value: function scrollToPosition(left, top, behavior, repeat) {
|
|
149
|
+
var node = this.props.scrollContentRef.current;
|
|
150
|
+
var smoothBehavior = behavior === 'smooth';
|
|
151
|
+
if (_platform.platform.chrome && smoothBehavior && repeat) {
|
|
152
|
+
this.animateScroll(this.getRtlPositionX(left), top, node);
|
|
153
|
+
} else {
|
|
154
|
+
node.scrollTo({
|
|
155
|
+
left: this.getRtlPositionX(left),
|
|
156
|
+
top: top,
|
|
157
|
+
behavior: behavior
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Programmatically animates the native scroll position of `node` toward the target `left`/`top`
|
|
164
|
+
* offsets using `requestAnimationFrame`. It computes the scroll direction on each axis, then repeatedly
|
|
165
|
+
* calls `scrollBy` in small 18px steps (instant behavior) until the target is reached or a scroll bound
|
|
166
|
+
* is hit. Used as a Chrome fallback when repeating a smooth scroll.
|
|
167
|
+
*/
|
|
168
|
+
}, {
|
|
169
|
+
key: "animateScroll",
|
|
170
|
+
value: function _animateScroll(left, top, node) {
|
|
171
|
+
var _this3 = this;
|
|
172
|
+
var directionX = Math.sign(left - node.scrollLeft);
|
|
173
|
+
var directionY = Math.sign(top - node.scrollTop);
|
|
174
|
+
var _animateScroll = function animateScroll() {
|
|
175
|
+
var scrollLeft = directionX > 0 ? node.scrollLeft < left : node.scrollLeft > left;
|
|
176
|
+
var scrollTop = directionY > 0 ? node.scrollTop < top : node.scrollTop > top;
|
|
177
|
+
|
|
178
|
+
// Check if we reached the scroll bounds and cancel the animation
|
|
179
|
+
if (top > _this3.scrollBounds.maxTop && node.scrollTop === _this3.scrollBounds.maxTop || left > _this3.scrollBounds.maxLeft && node.scrollLeft === _this3.scrollBounds.maxLeft || top < 0 && node.scrollTop === 0 || left < 0 && node.scrollLeft === 0) {
|
|
180
|
+
window.cancelAnimationFrame(_this3.scrollAnimationId);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (scrollTop || scrollLeft) {
|
|
184
|
+
node.scrollBy({
|
|
185
|
+
top: directionY * 8,
|
|
186
|
+
left: directionX * 8,
|
|
187
|
+
behavior: 'instant'
|
|
188
|
+
});
|
|
189
|
+
_this3.scrollAnimationId = window.requestAnimationFrame(_animateScroll);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
this.scrollAnimationId = window.requestAnimationFrame(_animateScroll);
|
|
152
193
|
}
|
|
153
194
|
|
|
154
195
|
// scrollMode 'native'
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("@testing-library/jest-dom");
|
|
4
|
+
var _Scroller = require("../Scroller");
|
|
5
|
+
describe('ScrollBasic', function () {
|
|
6
|
+
var scrollContentRef;
|
|
7
|
+
beforeEach(function () {
|
|
8
|
+
jest.createMockFromModule('@enact/core/platform');
|
|
9
|
+
scrollContentRef = {
|
|
10
|
+
current: {
|
|
11
|
+
scrollLeft: 0,
|
|
12
|
+
scrollTop: 0,
|
|
13
|
+
scrollBy: jest.fn(),
|
|
14
|
+
scrollTo: jest.fn()
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
afterEach(function () {
|
|
19
|
+
jest.clearAllMocks();
|
|
20
|
+
});
|
|
21
|
+
test('should call scrollBy on scrollToPosition', function () {
|
|
22
|
+
var instance = new _Scroller.ScrollerBasic({
|
|
23
|
+
scrollContentRef: scrollContentRef,
|
|
24
|
+
direction: 'both'
|
|
25
|
+
});
|
|
26
|
+
instance.scrollToPosition(100, 200, 'smooth');
|
|
27
|
+
expect(scrollContentRef.current.scrollTo).toHaveBeenCalledWith({
|
|
28
|
+
left: 100,
|
|
29
|
+
top: 200,
|
|
30
|
+
behavior: 'smooth'
|
|
31
|
+
});
|
|
32
|
+
instance.scrollToPosition(100, 200, 'instant');
|
|
33
|
+
expect(scrollContentRef.current.scrollTo).toHaveBeenCalledWith({
|
|
34
|
+
left: 100,
|
|
35
|
+
top: 200,
|
|
36
|
+
behavior: 'instant'
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
test('should call scrollBy with animated values during animateScroll', function () {
|
|
40
|
+
var rafCallback;
|
|
41
|
+
var instance = new _Scroller.ScrollerBasic({
|
|
42
|
+
scrollContentRef: scrollContentRef,
|
|
43
|
+
direction: 'both'
|
|
44
|
+
});
|
|
45
|
+
instance.scrollBounds.maxTop = 500;
|
|
46
|
+
instance.scrollBounds.maxLeft = 500;
|
|
47
|
+
window.requestAnimationFrame = jest.fn(function (cb) {
|
|
48
|
+
rafCallback = cb;
|
|
49
|
+
});
|
|
50
|
+
window.cancelAnimationFrame = jest.fn();
|
|
51
|
+
instance.animateScroll(100, 200, scrollContentRef.current);
|
|
52
|
+
rafCallback();
|
|
53
|
+
expect(scrollContentRef.current.scrollBy).toHaveBeenCalled();
|
|
54
|
+
scrollContentRef.current.scrollTop = 500;
|
|
55
|
+
instance.animateScroll(550, 550, scrollContentRef.current);
|
|
56
|
+
rafCallback();
|
|
57
|
+
expect(window.cancelAnimationFrame).toHaveBeenCalled();
|
|
58
|
+
});
|
|
59
|
+
});
|
package/Slider/Slider.d.ts
CHANGED
|
@@ -182,14 +182,18 @@ export class SliderBase extends React.Component<
|
|
|
182
182
|
Merge<React.HTMLProps<HTMLElement>, SliderBaseProps>
|
|
183
183
|
> {}
|
|
184
184
|
|
|
185
|
-
export interface SliderDecoratorProps
|
|
186
|
-
|
|
185
|
+
export interface SliderDecoratorProps extends Merge<
|
|
186
|
+
ui_Changeable_ChangeableProps,
|
|
187
|
+
ui_Touchable_TouchableProps
|
|
188
|
+
> {}
|
|
187
189
|
export function SliderDecorator<P>(
|
|
188
190
|
Component: React.ComponentType<P> | string,
|
|
189
191
|
): React.ComponentType<P & SliderDecoratorProps>;
|
|
190
192
|
|
|
191
|
-
export interface SliderProps
|
|
192
|
-
|
|
193
|
+
export interface SliderProps extends Omit<
|
|
194
|
+
Merge<SliderBaseProps, SliderDecoratorProps>,
|
|
195
|
+
"componentRef"
|
|
196
|
+
> {
|
|
193
197
|
/**
|
|
194
198
|
* Called when the value is changed.
|
|
195
199
|
*/
|
package/Spinner/Spinner.d.ts
CHANGED
|
@@ -79,11 +79,10 @@ export function SpinnerDecorator<P>(
|
|
|
79
79
|
Component: React.ComponentType<P> | string,
|
|
80
80
|
): React.ComponentType<P & SpinnerDecoratorProps>;
|
|
81
81
|
|
|
82
|
-
export interface SpinnerProps
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
> {}
|
|
82
|
+
export interface SpinnerProps extends Omit<
|
|
83
|
+
Merge<SpinnerBaseProps, SpinnerDecoratorProps>,
|
|
84
|
+
"componentRef"
|
|
85
|
+
> {}
|
|
87
86
|
/**
|
|
88
87
|
* A minimally styled component that controls `Spinner` positioning and interaction states.
|
|
89
88
|
*/
|
|
@@ -55,11 +55,10 @@ export class ToggleIconBase extends React.Component<
|
|
|
55
55
|
Merge<React.HTMLProps<HTMLElement>, ToggleIconBaseProps>
|
|
56
56
|
> {}
|
|
57
57
|
|
|
58
|
-
export interface ToggleIconDecoratorProps
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
> {}
|
|
58
|
+
export interface ToggleIconDecoratorProps extends Merge<
|
|
59
|
+
Merge<ui_ForwardRef_ForwardRefProps, ui_Toggleable_ToggleableProps>,
|
|
60
|
+
ui_Touchable_TouchableProps
|
|
61
|
+
> {}
|
|
63
62
|
/**
|
|
64
63
|
* Adds support for the `onToggle` prop callback to be fired when the `onTap` (touch-safe `onClick` )
|
|
65
64
|
event executes.
|
|
@@ -69,11 +68,10 @@ export class ToggleIconDecorator extends React.Component<
|
|
|
69
68
|
Merge<React.HTMLProps<HTMLElement>, ToggleIconDecoratorProps>
|
|
70
69
|
> {}
|
|
71
70
|
|
|
72
|
-
export interface ToggleIconProps
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
> {
|
|
71
|
+
export interface ToggleIconProps extends Omit<
|
|
72
|
+
Merge<ToggleIconBaseProps, ToggleIconDecoratorProps>,
|
|
73
|
+
"componentRef"
|
|
74
|
+
> {
|
|
77
75
|
/**
|
|
78
76
|
* The handler to run when the component is toggled.
|
|
79
77
|
*/
|
|
@@ -137,14 +137,14 @@ export interface Arranger {
|
|
|
137
137
|
* Returns an array of keyframes describing the animation when
|
|
138
138
|
a view is entering the viewport.
|
|
139
139
|
*/
|
|
140
|
-
enter: ArrangerCallback /**
|
|
140
|
+
enter: ArrangerCallback; /**
|
|
141
141
|
* Returns an array of keyframes describing the animation when
|
|
142
142
|
a view is leaving the viewport.
|
|
143
|
-
|
|
144
|
-
leave: ArrangerCallback /**
|
|
143
|
+
*/
|
|
144
|
+
leave: ArrangerCallback; /**
|
|
145
145
|
* Returns an array of keyframes describing the animation when
|
|
146
146
|
a view is remaining in the viewport.
|
|
147
|
-
|
|
147
|
+
*/
|
|
148
148
|
stay?: ArrangerCallback;
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
@@ -168,17 +168,15 @@ export declare const SlideTopArranger: Arranger;
|
|
|
168
168
|
*/
|
|
169
169
|
export declare const SlideBottomArranger: Arranger;
|
|
170
170
|
|
|
171
|
-
export interface ViewManagerDecoratorProps
|
|
172
|
-
extends ui_ForwardRef_ForwardRefProps {}
|
|
171
|
+
export interface ViewManagerDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
173
172
|
export function ViewManagerDecorator<P>(
|
|
174
173
|
Component: React.ComponentType<P> | string,
|
|
175
174
|
): React.ComponentType<P & ViewManagerDecoratorProps>;
|
|
176
175
|
|
|
177
|
-
export interface ViewManagerProps
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
> {}
|
|
176
|
+
export interface ViewManagerProps extends Omit<
|
|
177
|
+
Merge<ViewManagerBaseProps, ViewManagerDecoratorProps>,
|
|
178
|
+
"componentRef"
|
|
179
|
+
> {}
|
|
182
180
|
/**
|
|
183
181
|
* A `ViewManager` controls the visibility of a configurable number of views, allowing for them to be
|
|
184
182
|
transitioned on and off the viewport.
|
|
@@ -13,9 +13,9 @@ export interface gridListItemSizeShape {
|
|
|
13
13
|
/**
|
|
14
14
|
* The minimum width of the grid list item.
|
|
15
15
|
*/
|
|
16
|
-
minWidth: number /**
|
|
16
|
+
minWidth: number; /**
|
|
17
17
|
* The minimum height of the grid list item.
|
|
18
|
-
|
|
18
|
+
*/
|
|
19
19
|
minHeight: number;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -26,9 +26,9 @@ export interface itemSizesShape {
|
|
|
26
26
|
/**
|
|
27
27
|
* The minimum size of the list item.
|
|
28
28
|
*/
|
|
29
|
-
minSize: number /**
|
|
29
|
+
minSize: number; /**
|
|
30
30
|
* An array of the list item size. If it is not defined, the list items will render with the `minSize` size.
|
|
31
|
-
|
|
31
|
+
*/
|
|
32
32
|
size: number[];
|
|
33
33
|
}
|
|
34
34
|
export interface VirtualListProps extends VirtualListBasicProps {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enact/ui",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.3",
|
|
4
4
|
"description": "A collection of simplified unstyled cross-platform UI components for Enact",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@enact/core": "^5.4.
|
|
36
|
-
"@enact/i18n": "^5.4.
|
|
35
|
+
"@enact/core": "^5.4.3",
|
|
36
|
+
"@enact/i18n": "^5.4.3",
|
|
37
37
|
"classnames": "^2.5.1",
|
|
38
38
|
"ilib": "^14.21.2",
|
|
39
39
|
"invariant": "^2.2.4",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"ramda": "^0.32.0",
|
|
42
|
-
"react": "^19.2.
|
|
43
|
-
"react-dom": "^19.2.
|
|
44
|
-
"react-is": "^19.2.
|
|
42
|
+
"react": "^19.2.4",
|
|
43
|
+
"react-dom": "^19.2.4",
|
|
44
|
+
"react-is": "^19.2.4",
|
|
45
45
|
"warning": "^4.0.3"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/resolution/index.d.ts
CHANGED
|
@@ -147,12 +147,12 @@ export interface selectSrcOptions {
|
|
|
147
147
|
/**
|
|
148
148
|
* HD / 720p Resolution image asset source URI/URL
|
|
149
149
|
*/
|
|
150
|
-
hd?: string /**
|
|
150
|
+
hd?: string; /**
|
|
151
151
|
* FHD / 1080p Resolution image asset source URI/URL
|
|
152
|
-
|
|
153
|
-
fhd?: string /**
|
|
152
|
+
*/
|
|
153
|
+
fhd?: string; /**
|
|
154
154
|
* UHD / 4K Resolution image asset source URI/URL
|
|
155
|
-
|
|
155
|
+
*/
|
|
156
156
|
uhd?: string;
|
|
157
157
|
}
|
|
158
158
|
/**
|
package/useScroll/useScroll.js
CHANGED
|
@@ -849,6 +849,8 @@ var useScrollBase = exports.useScrollBase = function useScrollBase(props) {
|
|
|
849
849
|
} else {
|
|
850
850
|
var _props$preventScroll;
|
|
851
851
|
(_props$preventScroll = props.preventScroll) === null || _props$preventScroll === void 0 || _props$preventScroll.call(props, ev);
|
|
852
|
+
mutableRef.current.repeat = ev.repeat;
|
|
853
|
+
if (ev.repeat && mutableRef.current.lastInputType === 'arrowKey') return;
|
|
852
854
|
(0, _handle.forward)('onKeyDown', ev, props);
|
|
853
855
|
}
|
|
854
856
|
}
|
|
@@ -1168,7 +1170,7 @@ var useScrollBase = exports.useScrollBase = function useScrollBase(props) {
|
|
|
1168
1170
|
roundedTargetX = _roundTarget.roundedTargetX,
|
|
1169
1171
|
roundedTargetY = _roundTarget.roundedTargetY;
|
|
1170
1172
|
if (animate) {
|
|
1171
|
-
scrollContentHandle.current.scrollToPosition(roundedTargetX, roundedTargetY, 'smooth');
|
|
1173
|
+
scrollContentHandle.current.scrollToPosition(roundedTargetX, roundedTargetY, 'smooth', mutableRef.current.repeat);
|
|
1172
1174
|
} else {
|
|
1173
1175
|
scrollContentHandle.current.scrollToPosition(roundedTargetX, roundedTargetY, 'instant');
|
|
1174
1176
|
}
|