@enact/limestone 1.9.3 → 1.10.0
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/.github/workflows/ci-reusable.yml +2 -2
- package/Alert/Alert.d.ts +9 -0
- package/Alert/Alert.js +35 -4
- package/Alert/Alert.module.css +12 -1
- package/Alert/tests/Alert-specs.js +91 -0
- package/Button/tests/Button-specs.js +26 -0
- package/CHANGELOG.md +34 -0
- package/Card/Card.d.ts +4 -4
- package/Card/Card.js +7 -8
- package/Card/tests/Card-specs.js +39 -5
- package/CheckboxItem/CheckboxItem.js +6 -4
- package/Chips/Chip.js +12 -6
- package/Chips/Chips.js +12 -6
- package/Chips/tests/Chip-specs.js +25 -5
- package/Chips/tests/Chips-specs.js +12 -2
- package/ColorPicker/ColorPicker.js +27 -25
- package/ContextualPopupDecorator/ContextualPopupDecorator.js +32 -22
- package/DayPicker/DaySelectorDecorator.js +12 -7
- package/Dropdown/Dropdown.module.css +4 -0
- package/Dropdown/DropdownList.js +74 -53
- package/FlexiblePopupPanels/useNavButtonFocus.js +7 -10
- package/Heading/Heading.d.ts +1 -1
- package/Heading/Heading.js +2 -2
- package/Icon/Icon.d.ts +1 -0
- package/Icon/Icon.js +1 -0
- package/Icon/IconList.js +2 -0
- package/IconItem/IconItem.module.css +3 -3
- package/IconItem/tests/IconItem-specs.js +30 -1
- package/Image/Image.js +6 -4
- package/Input/Input.js +12 -1
- package/Input/InputField.js +75 -24
- package/Input/InputField.module.css +262 -45
- package/Input/InputFieldDecoratorIcon.js +1 -0
- package/Input/InputFieldSpotlightDecorator.js +53 -8
- package/Input/index.d.ts +105 -93
- package/Input/tests/Input-specs.js +26 -0
- package/Input/tests/InputField-specs.js +149 -3
- package/Input/tests/InputPopup-specs.js +1 -1
- package/KeyGuide/KeyGuide.js +29 -27
- package/MediaOverlay/tests/MediaOverlay-specs.js +29 -0
- package/MediaPlayer/tests/util-specs.js +4 -1
- package/PageViews/PageViews.js +134 -69
- package/PageViews/PageViews.module.css +3 -0
- package/PageViews/PageViewsRouter.js +91 -42
- package/PageViews/tests/PageViews-specs.js +87 -0
- package/Panels/Header.js +6 -4
- package/Popup/Popup.js +5 -4
- package/PopupTabLayout/PopupTabLayout.js +11 -9
- package/RadioItem/RadioItem.js +7 -5
- package/Scroller/EditableWrapper.js +17 -14
- package/Scroller/Scroller.js +11 -10
- package/Scroller/useThemeScroller.js +3 -3
- package/Slider/Slider.d.ts +4 -0
- package/Slider/Slider.js +40 -16
- package/Slider/Slider.module.css +150 -0
- package/Slider/SliderBehaviorDecorator.js +16 -14
- package/Slider/tests/Slider-specs.js +51 -0
- package/Slider/utils.js +23 -7
- package/Spinner/Spinner.js +10 -8
- package/TabLayout/RefocusDecorator.js +14 -12
- package/TabLayout/tests/TabGroup-specs.js +1 -1
- package/ThemeDecorator/AccessibilityDecorator.js +12 -11
- package/ThemeDecorator/I18nFontDecorator.js +6 -4
- package/ThemeDecorator/ThemeDecorator.d.ts +7 -0
- package/ThemeDecorator/ThemeDecorator.js +24 -9
- package/TimePicker/TimePickerBase.js +5 -3
- package/TooltipDecorator/TooltipDecorator.js +12 -7
- package/TooltipDecorator/tests/useTooltip-specs.js +5 -2
- package/VideoPlayer/VideoPlayer.js +25 -24
- package/VirtualList/VirtualList.js +20 -18
- package/VirtualList/useSpotlight.js +1 -1
- package/fonts/Limestone_Icons.ttf +0 -0
- package/internal/AsyncRenderChildren/AsyncRenderChildren.js +9 -5
- package/internal/AsyncRenderChildren/tests/AsyncRenderChildren-specs.js +4 -1
- package/internal/DateTime/DateTimeDecorator.js +5 -4
- package/internal/Panels/PanelsRouter.js +35 -29
- package/internal/Panels/useAutoFocus.js +10 -6
- package/internal/Panels/useFocusOnTransition.js +4 -3
- package/internal/Picker/Picker.js +7 -5
- package/internal/Picker/SpottablePicker.js +15 -13
- package/internal/SharedStateDecorator/SharedStateDecorator.js +6 -4
- package/package.json +14 -11
- package/styles/colors.less +1 -0
- package/styles/variables.less +1 -1
- package/useScroll/HoverToScroll.js +15 -12
- package/useScroll/Scrollbar.js +14 -10
- package/useScroll/ScrollbarPlaceholder.js +3 -5
- package/useScroll/ScrollbarTrack.js +7 -5
- package/useScroll/useEvent.js +7 -2
- package/useScroll/useScroll.js +10 -2
|
@@ -7,12 +7,13 @@ exports.PageViewsRouter = PageViewsRouter;
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
|
|
9
9
|
var _useChainRefs = _interopRequireDefault(require("@enact/core/useChainRefs"));
|
|
10
|
+
var _util = require("@enact/core/util");
|
|
10
11
|
var _spotlight = _interopRequireDefault(require("@enact/spotlight"));
|
|
11
12
|
var _propTypes2 = _interopRequireDefault(require("prop-types"));
|
|
12
13
|
var _react = require("react");
|
|
13
14
|
var _Panels = require("../internal/Panels");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["autoFocus", "children", "componentRef", "data-spotlight-id", "index", "onTransition", "onWillTransition", "rtl"],
|
|
16
|
+
var _excluded = ["autoFocus", "bannerMode", "children", "componentRef", "data-spotlight-id", "index", "onFooterCloseClick", "onFooterNextClick", "onNextClick", "onPrevClick", "onTransition", "onWillTransition", "rtl", "showFooterButtons"],
|
|
16
17
|
_excluded2 = ["onWillTransition"]; // single-index ViewManagers need some help knowing when the transition direction needs to change
|
|
17
18
|
// because the index is always 0 from its perspective.
|
|
18
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -24,36 +25,44 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
24
25
|
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; }
|
|
25
26
|
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
27
|
function useReverseTransition(index, rtl) {
|
|
27
|
-
var prevIndex = (0,
|
|
28
|
+
var prevIndex = (0, _util.usePrevious)(index);
|
|
28
29
|
var reverse = false;
|
|
29
|
-
if (prevIndex
|
|
30
|
-
reverse = rtl ? index > prevIndex
|
|
30
|
+
if (prevIndex !== index) {
|
|
31
|
+
reverse = rtl ? index > prevIndex : index < prevIndex;
|
|
31
32
|
}
|
|
32
|
-
prevIndex.current = index;
|
|
33
33
|
return {
|
|
34
34
|
reverseTransition: reverse
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* PageViewsRouter passes children, index and transition handlers
|
|
39
|
+
* PageViewsRouter passes children, index and transition handlers.
|
|
40
40
|
*
|
|
41
41
|
* @class PageViewsRouter
|
|
42
42
|
* @memberof limestone/PageViews
|
|
43
43
|
* @private
|
|
44
44
|
*/
|
|
45
45
|
function PageViewsRouter(Wrapped) {
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
var _PageViewsProvider = function PageViewsProvider(props) {
|
|
47
|
+
var pageViewsProviderProps = (0, _util.setDefaultProps)(props, {
|
|
48
|
+
index: 0
|
|
49
|
+
});
|
|
50
|
+
(0, _util.checkPropTypes)(_PageViewsProvider, pageViewsProviderProps);
|
|
51
|
+
var autoFocus = pageViewsProviderProps.autoFocus,
|
|
52
|
+
bannerMode = pageViewsProviderProps.bannerMode,
|
|
53
|
+
children = pageViewsProviderProps.children,
|
|
54
|
+
componentRef = pageViewsProviderProps.componentRef,
|
|
55
|
+
spotlightId = pageViewsProviderProps['data-spotlight-id'],
|
|
56
|
+
index = pageViewsProviderProps.index,
|
|
57
|
+
onFooterCloseClick = pageViewsProviderProps.onFooterCloseClick,
|
|
58
|
+
onFooterNextClick = pageViewsProviderProps.onFooterNextClick,
|
|
59
|
+
onNextClick = pageViewsProviderProps.onNextClick,
|
|
60
|
+
onPrevClick = pageViewsProviderProps.onPrevClick,
|
|
61
|
+
onTransition = pageViewsProviderProps.onTransition,
|
|
62
|
+
onWillTransition = pageViewsProviderProps.onWillTransition,
|
|
63
|
+
rtl = pageViewsProviderProps.rtl,
|
|
64
|
+
showFooterButtons = pageViewsProviderProps.showFooterButtons,
|
|
65
|
+
rest = _objectWithoutProperties(pageViewsProviderProps, _excluded);
|
|
57
66
|
var uniqueId = (0, _react.useId)();
|
|
58
67
|
var totalIndex = _react.Children.count(children);
|
|
59
68
|
var _useToggleRole = (0, _Panels.useToggleRole)(),
|
|
@@ -65,8 +74,42 @@ function PageViewsRouter(Wrapped) {
|
|
|
65
74
|
var ref = (0, _useChainRefs["default"])(autoFocusRef, a11yRef, componentRef);
|
|
66
75
|
var _useReverseTransition = useReverseTransition(index, rtl),
|
|
67
76
|
reverseTransition = _useReverseTransition.reverseTransition;
|
|
77
|
+
var navigationSource = (0, _react.useRef)(null); // 'internal-next' | 'internal-prev' | 'footer' | null
|
|
78
|
+
|
|
79
|
+
(0, _react.useEffect)(function () {
|
|
80
|
+
if (showFooterButtons && !bannerMode) {
|
|
81
|
+
_spotlight["default"].focus(spotlightId, {
|
|
82
|
+
enterTo: 'default-element'
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}, [bannerMode, showFooterButtons, spotlightId]);
|
|
86
|
+
var handleNextClick = (0, _react.useCallback)(function (ev) {
|
|
87
|
+
navigationSource.current = 'internal-next';
|
|
88
|
+
onNextClick === null || onNextClick === void 0 || onNextClick(ev);
|
|
89
|
+
}, [onNextClick]);
|
|
90
|
+
var handlePrevClick = (0, _react.useCallback)(function (ev) {
|
|
91
|
+
navigationSource.current = 'internal-prev';
|
|
92
|
+
onPrevClick === null || onPrevClick === void 0 || onPrevClick(ev);
|
|
93
|
+
}, [onPrevClick]);
|
|
94
|
+
var handleFooterNextClick = (0, _react.useCallback)(function (ev) {
|
|
95
|
+
navigationSource.current = 'footer';
|
|
96
|
+
onFooterNextClick === null || onFooterNextClick === void 0 || onFooterNextClick(ev);
|
|
97
|
+
}, [onFooterNextClick]);
|
|
98
|
+
var handleTransition = (0, _react.useCallback)(function (ev) {
|
|
99
|
+
if (showFooterButtons && !bannerMode) {
|
|
100
|
+
var source = navigationSource.current;
|
|
101
|
+
var newIndex = ev.index;
|
|
102
|
+
if (source === 'footer' || source === 'internal-next' && newIndex === totalIndex - 1 || source === 'internal-prev' && newIndex === 0) {
|
|
103
|
+
_spotlight["default"].focus(spotlightId, {
|
|
104
|
+
enterTo: 'default-element'
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
navigationSource.current = null;
|
|
109
|
+
onTransition === null || onTransition === void 0 || onTransition(ev);
|
|
110
|
+
}, [bannerMode, onTransition, showFooterButtons, spotlightId, totalIndex]);
|
|
68
111
|
var _useFocusOnTransition = (0, _Panels.useFocusOnTransition)({
|
|
69
|
-
onTransition:
|
|
112
|
+
onTransition: handleTransition,
|
|
70
113
|
onWillTransition: onWillTransition,
|
|
71
114
|
spotlightId: spotlightId
|
|
72
115
|
}),
|
|
@@ -82,18 +125,24 @@ function PageViewsRouter(Wrapped) {
|
|
|
82
125
|
};
|
|
83
126
|
}, []);
|
|
84
127
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread(_objectSpread(_objectSpread({}, rest), transition), {}, {
|
|
128
|
+
bannerMode: bannerMode,
|
|
85
129
|
componentRef: ref,
|
|
86
130
|
"data-spotlight-id": spotlightId,
|
|
87
131
|
index: index,
|
|
88
|
-
|
|
132
|
+
onFooterCloseClick: onFooterCloseClick,
|
|
133
|
+
onFooterNextClick: handleFooterNextClick,
|
|
134
|
+
onNextClick: handleNextClick,
|
|
135
|
+
onPrevClick: handlePrevClick,
|
|
89
136
|
onWillTransition: handleWillTransition,
|
|
90
137
|
reverseTransition: reverseTransition,
|
|
91
138
|
rtl: rtl,
|
|
139
|
+
showFooterButtons: showFooterButtons,
|
|
140
|
+
totalIndex: totalIndex,
|
|
92
141
|
uniqueId: uniqueId,
|
|
93
142
|
children: children
|
|
94
143
|
}));
|
|
95
144
|
};
|
|
96
|
-
|
|
145
|
+
_PageViewsProvider.propTypes = /** @lends limestone/PageViews.PageViewsRouter.prototype */{
|
|
97
146
|
/**
|
|
98
147
|
* Sets the strategy used to automatically focus an element within the PageViews upon render.
|
|
99
148
|
* When set to 'none', focus is not set only on the first render.
|
|
@@ -111,19 +160,19 @@ function PageViewsRouter(Wrapped) {
|
|
|
111
160
|
*/
|
|
112
161
|
componentRef: _propTypes["default"].ref,
|
|
113
162
|
/**
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
163
|
+
* The spotlight id for the panel.
|
|
164
|
+
*
|
|
165
|
+
* @type {String}
|
|
166
|
+
* @private
|
|
167
|
+
*/
|
|
119
168
|
'data-spotlight-id': _propTypes2["default"].string,
|
|
120
169
|
/**
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
170
|
+
* The currently selected step.
|
|
171
|
+
*
|
|
172
|
+
* @type {Number}
|
|
173
|
+
* @default 0
|
|
174
|
+
* @private
|
|
175
|
+
*/
|
|
127
176
|
index: _propTypes2["default"].number,
|
|
128
177
|
/**
|
|
129
178
|
* Disables panel transitions.
|
|
@@ -133,18 +182,18 @@ function PageViewsRouter(Wrapped) {
|
|
|
133
182
|
*/
|
|
134
183
|
noAnimation: _propTypes2["default"].bool,
|
|
135
184
|
/**
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
185
|
+
* Called when a transition completes.
|
|
186
|
+
*
|
|
187
|
+
* @type {Function}
|
|
188
|
+
* @private
|
|
189
|
+
*/
|
|
141
190
|
onTransition: _propTypes2["default"].func,
|
|
142
191
|
/**
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
192
|
+
* Called when a transition begins.
|
|
193
|
+
*
|
|
194
|
+
* @type {Function}
|
|
195
|
+
* @private
|
|
196
|
+
*/
|
|
148
197
|
onWillTransition: _propTypes2["default"].func,
|
|
149
198
|
/**
|
|
150
199
|
* Used to determine the transition direction.
|
|
@@ -154,6 +203,6 @@ function PageViewsRouter(Wrapped) {
|
|
|
154
203
|
*/
|
|
155
204
|
rtl: _propTypes2["default"].bool
|
|
156
205
|
};
|
|
157
|
-
return
|
|
206
|
+
return _PageViewsProvider;
|
|
158
207
|
}
|
|
159
208
|
var _default = exports["default"] = PageViewsRouter;
|
|
@@ -273,4 +273,91 @@ describe('PageViews Specs', function () {
|
|
|
273
273
|
});
|
|
274
274
|
});
|
|
275
275
|
}));
|
|
276
|
+
test('should render footer Close and Next buttons when `showFooterButtons` is true', function () {
|
|
277
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
|
|
278
|
+
showFooterButtons: true,
|
|
279
|
+
index: 0,
|
|
280
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {})]
|
|
281
|
+
}));
|
|
282
|
+
expect(_react.screen.getByText('Close')).toBeInTheDocument();
|
|
283
|
+
expect(_react.screen.getByText('Next')).toBeInTheDocument();
|
|
284
|
+
});
|
|
285
|
+
test('should not render footer Next button on the last page', function () {
|
|
286
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
|
|
287
|
+
showFooterButtons: true,
|
|
288
|
+
index: 1,
|
|
289
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {})]
|
|
290
|
+
}));
|
|
291
|
+
expect(_react.screen.getByText('Close')).toBeInTheDocument();
|
|
292
|
+
expect(_react.screen.queryByText('Next')).toBeNull();
|
|
293
|
+
});
|
|
294
|
+
test('should not render footer buttons when `bannerMode` is true', function () {
|
|
295
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
|
|
296
|
+
showFooterButtons: true,
|
|
297
|
+
bannerMode: true,
|
|
298
|
+
index: 0,
|
|
299
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {})]
|
|
300
|
+
}));
|
|
301
|
+
expect(_react.screen.queryByText('Close')).toBeNull();
|
|
302
|
+
});
|
|
303
|
+
test('should fire `onFooterNextClick`, `onChange`, and `onTransition` when footer Next button is clicked', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
304
|
+
var handleChange = jest.fn();
|
|
305
|
+
var handleFooterNextClick = jest.fn();
|
|
306
|
+
var spy = jest.fn();
|
|
307
|
+
var user = _userEvent["default"].setup();
|
|
308
|
+
var index = 0;
|
|
309
|
+
var _render3 = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
|
|
310
|
+
showFooterButtons: true,
|
|
311
|
+
index: index,
|
|
312
|
+
onChange: handleChange,
|
|
313
|
+
onFooterNextClick: handleFooterNextClick,
|
|
314
|
+
onTransition: spy,
|
|
315
|
+
noAnimation: true,
|
|
316
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {})]
|
|
317
|
+
})),
|
|
318
|
+
rerender = _render3.rerender;
|
|
319
|
+
yield user.click(_react.screen.getByText('Next'));
|
|
320
|
+
yield (0, _react.waitFor)(function () {
|
|
321
|
+
expect(handleChange).toHaveBeenCalledWith({
|
|
322
|
+
index: 1,
|
|
323
|
+
type: 'onChange'
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
yield (0, _react.waitFor)(function () {
|
|
327
|
+
expect(handleFooterNextClick).toHaveBeenCalled();
|
|
328
|
+
});
|
|
329
|
+
spy.mockClear();
|
|
330
|
+
index++;
|
|
331
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
|
|
332
|
+
showFooterButtons: true,
|
|
333
|
+
index: index,
|
|
334
|
+
onChange: handleChange,
|
|
335
|
+
onFooterNextClick: handleFooterNextClick,
|
|
336
|
+
onTransition: spy,
|
|
337
|
+
noAnimation: true,
|
|
338
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {})]
|
|
339
|
+
}));
|
|
340
|
+
var expected = {
|
|
341
|
+
index: index,
|
|
342
|
+
type: 'onTransition'
|
|
343
|
+
};
|
|
344
|
+
var actual = spy.mock.calls.length && spy.mock.calls[0][0];
|
|
345
|
+
yield (0, _react.waitFor)(function () {
|
|
346
|
+
expect(actual).toMatchObject(expected);
|
|
347
|
+
});
|
|
348
|
+
}));
|
|
349
|
+
test('should fire `onFooterCloseClick` when footer Close button is clicked', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
350
|
+
var handleFooterCloseClick = jest.fn();
|
|
351
|
+
var user = _userEvent["default"].setup();
|
|
352
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_.PageViews, {
|
|
353
|
+
showFooterButtons: true,
|
|
354
|
+
index: 0,
|
|
355
|
+
onFooterCloseClick: handleFooterCloseClick,
|
|
356
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Page, {})]
|
|
357
|
+
}));
|
|
358
|
+
yield user.click(_react.screen.getByText('Close'));
|
|
359
|
+
yield (0, _react.waitFor)(function () {
|
|
360
|
+
expect(handleFooterCloseClick).toHaveBeenCalled();
|
|
361
|
+
});
|
|
362
|
+
}));
|
|
276
363
|
});
|
package/Panels/Header.js
CHANGED
|
@@ -7,7 +7,8 @@ exports["default"] = exports.HeaderBase = exports.Header = void 0;
|
|
|
7
7
|
var _handle = require("@enact/core/handle");
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
|
|
9
9
|
var _kind = _interopRequireDefault(require("@enact/core/kind"));
|
|
10
|
-
var _util = require("@enact/
|
|
10
|
+
var _util = require("@enact/core/util");
|
|
11
|
+
var _util2 = require("@enact/i18n/util");
|
|
11
12
|
var _SpotlightContainerDecorator = _interopRequireDefault(require("@enact/spotlight/SpotlightContainerDecorator"));
|
|
12
13
|
var _Layout = require("@enact/ui/Layout");
|
|
13
14
|
var _resolution = require("@enact/ui/resolution");
|
|
@@ -20,7 +21,7 @@ var _Button = _interopRequireDefault(require("../Button"));
|
|
|
20
21
|
var _Heading = _interopRequireDefault(require("../Heading"));
|
|
21
22
|
var _$L = _interopRequireDefault(require("../internal/$L"));
|
|
22
23
|
var _Panels = require("../internal/Panels");
|
|
23
|
-
var
|
|
24
|
+
var _util3 = require("../internal/Panels/util");
|
|
24
25
|
var _PopupTabLayoutStateContext = require("../PopupTabLayout/PopupTabLayoutStateContext");
|
|
25
26
|
var _Skinnable = _interopRequireDefault(require("../Skinnable"));
|
|
26
27
|
var _HeaderModule = _interopRequireDefault(require("./Header.module.css"));
|
|
@@ -375,7 +376,7 @@ var HeaderBase = exports.HeaderBase = (0, _kind["default"])({
|
|
|
375
376
|
title = _ref2.title,
|
|
376
377
|
titleId = _ref2.titleId,
|
|
377
378
|
type = _ref2.type;
|
|
378
|
-
var direction = (0,
|
|
379
|
+
var direction = (0, _util2.isRtlText)(title) || (0, _util2.isRtlText)(subtitle) ? 'rtl' : 'ltr';
|
|
379
380
|
var titleHeading = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Heading["default"], _objectSpread(_objectSpread({}, centered ? {
|
|
380
381
|
slotSize: slotSize
|
|
381
382
|
} : {}), {}, {
|
|
@@ -530,7 +531,8 @@ var ContextAsDefaultsHeader = function ContextAsDefaultsHeader(Wrapped) {
|
|
|
530
531
|
// eslint-disable-next-line no-shadow
|
|
531
532
|
function ContextAsDefaultsHeader(props) {
|
|
532
533
|
var _ref4;
|
|
533
|
-
|
|
534
|
+
(0, _util.checkPropTypes)(ContextAsDefaultsHeader, props);
|
|
535
|
+
var _useContextAsDefaults = (0, _util3.useContextAsDefaults)(props),
|
|
534
536
|
contextProps = _useContextAsDefaults.contextProps,
|
|
535
537
|
provideContextAsDefaults = _useContextAsDefaults.provideContextAsDefaults;
|
|
536
538
|
var _use = (0, _react.use)(_Panels.PanelsStateContext),
|
package/Popup/Popup.js
CHANGED
|
@@ -320,7 +320,8 @@ var popupDefaultProps = {
|
|
|
320
320
|
* @ui
|
|
321
321
|
* @public
|
|
322
322
|
*/
|
|
323
|
-
var
|
|
323
|
+
var _Popup = exports.Popup = function Popup(props) {
|
|
324
|
+
(0, _util.checkPropTypes)(_Popup, props);
|
|
324
325
|
var componentProps = (0, _util.setDefaultProps)(props, popupDefaultProps);
|
|
325
326
|
var noAnimation = componentProps.noAnimation,
|
|
326
327
|
noAutoDismiss = componentProps.noAutoDismiss,
|
|
@@ -564,8 +565,8 @@ var Popup = exports.Popup = function Popup(props) {
|
|
|
564
565
|
}))
|
|
565
566
|
});
|
|
566
567
|
};
|
|
567
|
-
|
|
568
|
-
|
|
568
|
+
_Popup.displayName = 'Popup';
|
|
569
|
+
_Popup.propTypes = /** @lends limestone/Popup.Popup.prototype */{
|
|
569
570
|
/**
|
|
570
571
|
* Prevents closing the popup via 5-way navigation out of the content.
|
|
571
572
|
*
|
|
@@ -689,4 +690,4 @@ Popup.propTypes = /** @lends limestone/Popup.Popup.prototype */{
|
|
|
689
690
|
*/
|
|
690
691
|
spotlightRestrict: _propTypes["default"].oneOf(['self-first', 'self-only'])
|
|
691
692
|
};
|
|
692
|
-
var _default = exports["default"] =
|
|
693
|
+
var _default = exports["default"] = _Popup;
|
|
@@ -527,9 +527,10 @@ var tabPanelsHandlers = {
|
|
|
527
527
|
* @ui
|
|
528
528
|
* @public
|
|
529
529
|
*/
|
|
530
|
-
var
|
|
531
|
-
|
|
532
|
-
|
|
530
|
+
var _TabPanelsBase = exports.TabPanelsBase = function TabPanelsBase(props) {
|
|
531
|
+
(0, _util.checkPropTypes)(_TabPanelsBase, props);
|
|
532
|
+
var rtl = props.rtl,
|
|
533
|
+
rest = _objectWithoutProperties(props, _excluded2);
|
|
533
534
|
var onTransition = (0, _react.use)(_TabLayout.TabLayoutContext);
|
|
534
535
|
var handlers = (0, _useHandlers["default"])(tabPanelsHandlers, _objectSpread({
|
|
535
536
|
rtl: rtl
|
|
@@ -542,7 +543,7 @@ var TabPanelsBase = exports.TabPanelsBase = function TabPanelsBase(_ref9) {
|
|
|
542
543
|
css: _PopupTabLayoutModule["default"]
|
|
543
544
|
}, handlers));
|
|
544
545
|
};
|
|
545
|
-
|
|
546
|
+
_TabPanelsBase.propTypes = {
|
|
546
547
|
rtl: _propTypes["default"].bool
|
|
547
548
|
};
|
|
548
549
|
|
|
@@ -557,7 +558,7 @@ TabPanelsBase.propTypes = {
|
|
|
557
558
|
*/
|
|
558
559
|
var TabPanels = exports.TabPanels = (0, _I18nDecorator.I18nContextDecorator)({
|
|
559
560
|
rtlProp: 'rtl'
|
|
560
|
-
},
|
|
561
|
+
}, _TabPanelsBase);
|
|
561
562
|
|
|
562
563
|
/**
|
|
563
564
|
* Omits the close button.
|
|
@@ -585,9 +586,10 @@ var TabPanels = exports.TabPanels = (0, _I18nDecorator.I18nContextDecorator)({
|
|
|
585
586
|
* @ui
|
|
586
587
|
* @public
|
|
587
588
|
*/
|
|
588
|
-
var
|
|
589
|
-
|
|
590
|
-
|
|
589
|
+
var _TabPanel = exports.TabPanel = function TabPanel(props) {
|
|
590
|
+
(0, _util.checkPropTypes)(_TabPanel, props);
|
|
591
|
+
var spotlightId = props.spotlightId,
|
|
592
|
+
rest = _objectWithoutProperties(props, _excluded3);
|
|
591
593
|
(0, _react.useEffect)(function () {
|
|
592
594
|
_spotlight["default"].set(spotlightId, {
|
|
593
595
|
partition: true
|
|
@@ -599,7 +601,7 @@ var TabPanel = exports.TabPanel = function TabPanel(_ref0) {
|
|
|
599
601
|
spotlightId: spotlightId
|
|
600
602
|
}));
|
|
601
603
|
};
|
|
602
|
-
|
|
604
|
+
_TabPanel.propTypes = {
|
|
603
605
|
/**
|
|
604
606
|
* The container id for {@link spotlight/SpotlightContainerDecorator/#SpotlightContainerDecorator.spotlightId|Spotlight container}.
|
|
605
607
|
*
|
package/RadioItem/RadioItem.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.RadioItemGroup = exports.RadioItemDecorator = exports.RadioItemBase = exports.RadioItem = void 0;
|
|
7
7
|
var _kind = _interopRequireDefault(require("@enact/core/kind"));
|
|
8
|
+
var _util = require("@enact/core/util");
|
|
8
9
|
var _Group = _interopRequireDefault(require("@enact/ui/Group"));
|
|
9
10
|
var _Pure = _interopRequireDefault(require("@enact/ui/internal/Pure"));
|
|
10
11
|
var _Slottable = _interopRequireDefault(require("@enact/ui/Slottable"));
|
|
@@ -161,16 +162,13 @@ var RadioItem = exports.RadioItem = (0, _Pure["default"])(RadioItemDecorator(Rad
|
|
|
161
162
|
* @public
|
|
162
163
|
*/
|
|
163
164
|
var _RadioItemGroup = exports.RadioItemGroup = function RadioItemGroup(props) {
|
|
165
|
+
(0, _util.checkPropTypes)(_RadioItemGroup, props);
|
|
164
166
|
var children = props.children,
|
|
165
167
|
groupId = props.groupId,
|
|
166
168
|
itemProps = props.itemProps,
|
|
167
169
|
rest = _objectWithoutProperties(props, _excluded2);
|
|
168
|
-
_RadioItemGroup.propTypes = {
|
|
169
|
-
groupId: _propTypes["default"].string,
|
|
170
|
-
itemProps: _propTypes["default"].object
|
|
171
|
-
};
|
|
172
170
|
if (typeof children[0] === 'string') {
|
|
173
|
-
// The case of multiple radio items are represented by string array instead of `RadioItem`
|
|
171
|
+
// The case of multiple radio items are represented by string array instead of `RadioItem` components using `ui/Group`
|
|
174
172
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
175
173
|
role: "region",
|
|
176
174
|
"aria-labelledby": groupId || "radioItemGroup",
|
|
@@ -208,4 +206,8 @@ var _RadioItemGroup = exports.RadioItemGroup = function RadioItemGroup(props) {
|
|
|
208
206
|
});
|
|
209
207
|
}
|
|
210
208
|
};
|
|
209
|
+
_RadioItemGroup.propTypes = {
|
|
210
|
+
groupId: _propTypes["default"].string,
|
|
211
|
+
itemProps: _propTypes["default"].object
|
|
212
|
+
};
|
|
211
213
|
var _default = exports["default"] = RadioItem;
|
|
@@ -8,6 +8,7 @@ var _handle = require("@enact/core/handle");
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
|
|
9
9
|
var _keymap = require("@enact/core/keymap");
|
|
10
10
|
var _usePublicClassNames = require("@enact/core/usePublicClassNames");
|
|
11
|
+
var _util = require("@enact/core/util");
|
|
11
12
|
var _spotlight = _interopRequireWildcard(require("@enact/spotlight"));
|
|
12
13
|
var _container = require("@enact/spotlight/src/container");
|
|
13
14
|
var _target = require("@enact/spotlight/src/target");
|
|
@@ -89,21 +90,22 @@ var holdConfig = {
|
|
|
89
90
|
* @ui
|
|
90
91
|
* @public
|
|
91
92
|
*/
|
|
92
|
-
var
|
|
93
|
+
var _EditableWrapper = exports.EditableWrapper = function EditableWrapper(props) {
|
|
93
94
|
var _editable$hideIndex;
|
|
95
|
+
(0, _util.checkPropTypes)(_EditableWrapper, props);
|
|
94
96
|
var children = props.children,
|
|
95
97
|
editable = props.editable,
|
|
96
98
|
scrollContainerHandle = props.scrollContainerHandle,
|
|
97
99
|
scrollContainerRef = props.scrollContainerRef,
|
|
98
100
|
scrollContentRef = props.scrollContentRef;
|
|
99
|
-
var centered = (editable === null || editable === void 0 ? void 0 : editable.centered) != null ? editable.centered : true;
|
|
100
|
-
var selectItemBy = (editable === null || editable === void 0 ? void 0 : editable.selectItemBy) || 'longPress';
|
|
101
|
-
var customCss = (editable === null || editable === void 0 ? void 0 : editable.css) || {};
|
|
102
101
|
var removeItemFuncRef = editable === null || editable === void 0 ? void 0 : editable.removeItemFuncRef;
|
|
103
102
|
var hideItemFuncRef = editable === null || editable === void 0 ? void 0 : editable.hideItemFuncRef;
|
|
104
103
|
var showItemFuncRef = editable === null || editable === void 0 ? void 0 : editable.showItemFuncRef;
|
|
105
104
|
var focusItemFuncRef = editable === null || editable === void 0 ? void 0 : editable.focusItemFuncRef;
|
|
106
105
|
var blurItemFuncRef = editable === null || editable === void 0 ? void 0 : editable.blurItemFuncRef;
|
|
106
|
+
var centered = (editable === null || editable === void 0 ? void 0 : editable.centered) != null ? editable.centered : true;
|
|
107
|
+
var selectItemBy = (editable === null || editable === void 0 ? void 0 : editable.selectItemBy) || 'longPress';
|
|
108
|
+
var customCss = (editable === null || editable === void 0 ? void 0 : editable.css) || {};
|
|
107
109
|
var mergedCss = (0, _usePublicClassNames.usePublicClassNames)({
|
|
108
110
|
componentCss: _EditableWrapperModule["default"],
|
|
109
111
|
customCss: customCss,
|
|
@@ -126,7 +128,7 @@ var EditableWrapper = exports.EditableWrapper = function EditableWrapper(props)
|
|
|
126
128
|
// Indices
|
|
127
129
|
fromIndex: null,
|
|
128
130
|
prevToIndex: null,
|
|
129
|
-
hideIndex: null,
|
|
131
|
+
hideIndex: (_editable$hideIndex = editable === null || editable === void 0 ? void 0 : editable.hideIndex) !== null && _editable$hideIndex !== void 0 ? _editable$hideIndex : dataSize,
|
|
130
132
|
// Position for restoring focus after removing item
|
|
131
133
|
nextSpotlightRect: null,
|
|
132
134
|
// Move direction from the starting position to the current position
|
|
@@ -146,7 +148,6 @@ var EditableWrapper = exports.EditableWrapper = function EditableWrapper(props)
|
|
|
146
148
|
initialSelected: editable === null || editable === void 0 ? void 0 : editable.initialSelected
|
|
147
149
|
});
|
|
148
150
|
var announceRef = (0, _react.useRef)({});
|
|
149
|
-
mutableRef.current.hideIndex = (_editable$hideIndex = editable === null || editable === void 0 ? void 0 : editable.hideIndex) !== null && _editable$hideIndex !== void 0 ? _editable$hideIndex : dataSize;
|
|
150
151
|
|
|
151
152
|
// Functions
|
|
152
153
|
|
|
@@ -886,27 +887,27 @@ var EditableWrapper = exports.EditableWrapper = function EditableWrapper(props)
|
|
|
886
887
|
}, [handleMouseLeave, handleTouchMove, scrollContainerRef]);
|
|
887
888
|
(0, _react.useLayoutEffect)(function () {
|
|
888
889
|
if (removeItemFuncRef) {
|
|
889
|
-
removeItemFuncRef.current = removeItem;
|
|
890
|
+
removeItemFuncRef.current = removeItem; // eslint-disable-line react-hooks/immutability
|
|
890
891
|
}
|
|
891
892
|
}, [removeItem, removeItemFuncRef]);
|
|
892
893
|
(0, _react.useLayoutEffect)(function () {
|
|
893
894
|
if (hideItemFuncRef) {
|
|
894
|
-
hideItemFuncRef.current = hideItem;
|
|
895
|
+
hideItemFuncRef.current = hideItem; // eslint-disable-line react-hooks/immutability
|
|
895
896
|
}
|
|
896
897
|
}, [hideItem, hideItemFuncRef]);
|
|
897
898
|
(0, _react.useLayoutEffect)(function () {
|
|
898
899
|
if (showItemFuncRef) {
|
|
899
|
-
showItemFuncRef.current = showItem;
|
|
900
|
+
showItemFuncRef.current = showItem; // eslint-disable-line react-hooks/immutability
|
|
900
901
|
}
|
|
901
902
|
}, [showItem, showItemFuncRef]);
|
|
902
903
|
(0, _react.useLayoutEffect)(function () {
|
|
903
904
|
if (focusItemFuncRef) {
|
|
904
|
-
focusItemFuncRef.current = focusItem;
|
|
905
|
+
focusItemFuncRef.current = focusItem; // eslint-disable-line react-hooks/immutability
|
|
905
906
|
}
|
|
906
907
|
}, [focusItem, focusItemFuncRef]);
|
|
907
908
|
(0, _react.useLayoutEffect)(function () {
|
|
908
909
|
if (blurItemFuncRef) {
|
|
909
|
-
blurItemFuncRef.current = blurItem;
|
|
910
|
+
blurItemFuncRef.current = blurItem; // eslint-disable-line react-hooks/immutability
|
|
910
911
|
}
|
|
911
912
|
}, [blurItem, blurItemFuncRef]);
|
|
912
913
|
(0, _react.useEffect)(function () {
|
|
@@ -981,6 +982,8 @@ var EditableWrapper = exports.EditableWrapper = function EditableWrapper(props)
|
|
|
981
982
|
|
|
982
983
|
// We set 'data-is-hiding' for all hidden items at component mount
|
|
983
984
|
(0, _react.useEffect)(function () {
|
|
985
|
+
var _editable$hideIndex2;
|
|
986
|
+
mutableRef.current.hideIndex = (_editable$hideIndex2 = editable === null || editable === void 0 ? void 0 : editable.hideIndex) !== null && _editable$hideIndex2 !== void 0 ? _editable$hideIndex2 : dataSize;
|
|
984
987
|
children.map(function (child, index) {
|
|
985
988
|
if (index >= mutableRef.current.hideIndex) {
|
|
986
989
|
var hiddenElement = document.querySelector('[aria-label="' + child.props['aria-label'] + '"]');
|
|
@@ -1007,8 +1010,8 @@ var EditableWrapper = exports.EditableWrapper = function EditableWrapper(props)
|
|
|
1007
1010
|
}, "editable-wrapper-announce")]
|
|
1008
1011
|
});
|
|
1009
1012
|
};
|
|
1010
|
-
|
|
1011
|
-
|
|
1013
|
+
_EditableWrapper.displayName = 'EditableWrapper';
|
|
1014
|
+
_EditableWrapper.propTypes = /** @lends limestone/Scroller.EditableWrapper.prototype */{
|
|
1012
1015
|
/**
|
|
1013
1016
|
* Enables editing items in the scroller.
|
|
1014
1017
|
* You can specify props for editable scroller as an object.
|
|
@@ -1040,4 +1043,4 @@ EditableWrapper.propTypes = /** @lends limestone/Scroller.EditableWrapper.protot
|
|
|
1040
1043
|
*/
|
|
1041
1044
|
scrollContentRef: _propTypes["default"].ref
|
|
1042
1045
|
};
|
|
1043
|
-
var _default = exports["default"] =
|
|
1046
|
+
var _default = exports["default"] = _EditableWrapper;
|
package/Scroller/Scroller.js
CHANGED
|
@@ -15,7 +15,7 @@ var _I18nDecorator = require("@enact/i18n/I18nDecorator");
|
|
|
15
15
|
var _SpotlightContainerDecorator = _interopRequireDefault(require("@enact/spotlight/SpotlightContainerDecorator"));
|
|
16
16
|
var _Spottable = _interopRequireDefault(require("@enact/spotlight/Spottable"));
|
|
17
17
|
var _Resizable = require("@enact/ui/Resizable");
|
|
18
|
-
var
|
|
18
|
+
var _Scroller2 = require("@enact/ui/Scroller");
|
|
19
19
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
20
20
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
21
21
|
var _react = require("react");
|
|
@@ -97,8 +97,9 @@ var scrollerDefaultProps = {
|
|
|
97
97
|
* @ui
|
|
98
98
|
* @public
|
|
99
99
|
*/
|
|
100
|
-
var
|
|
100
|
+
var _Scroller = exports.Scroller = function Scroller(props) {
|
|
101
101
|
var scrollerProps = (0, _util.setDefaultProps)(props, scrollerDefaultProps);
|
|
102
|
+
(0, _util.checkPropTypes)(_Scroller, scrollerProps);
|
|
102
103
|
if (typeof ENACT_PACK_NO_ANIMATION !== 'undefined' && ENACT_PACK_NO_ANIMATION) {
|
|
103
104
|
scrollerProps.overscrollEffectOn = {
|
|
104
105
|
arrowKey: false,
|
|
@@ -146,7 +147,7 @@ var Scroller = exports.Scroller = function Scroller(props) {
|
|
|
146
147
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext, _objectSpread(_objectSpread({}, resizeContextProps), {}, {
|
|
147
148
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ScrollContentWrapper, _objectSpread(_objectSpread(_objectSpread({}, scrollContainerProps), scrollContentWrapperRest), {}, {
|
|
148
149
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(ScrollBody, _objectSpread(_objectSpread({}, focusableBodyProps), {}, {
|
|
149
|
-
children: [rest.focusableScrollbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollbarPlaceholder["default"], {}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
150
|
+
children: [rest.focusableScrollbar ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollbarPlaceholder["default"], {}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Scroller2.ScrollerBasic, _objectSpread(_objectSpread({}, themeScrollContentProps), {}, {
|
|
150
151
|
"aria-label": ariaLabel,
|
|
151
152
|
id: id,
|
|
152
153
|
ref: scrollContentHandle,
|
|
@@ -156,8 +157,8 @@ var Scroller = exports.Scroller = function Scroller(props) {
|
|
|
156
157
|
}))
|
|
157
158
|
}));
|
|
158
159
|
};
|
|
159
|
-
|
|
160
|
-
|
|
160
|
+
_Scroller.displayName = 'Scroller';
|
|
161
|
+
_Scroller.propTypes = /** @lends limestone/Scroller.Scroller.prototype */{
|
|
161
162
|
/**
|
|
162
163
|
* The "aria-label" for the Scroller.
|
|
163
164
|
*
|
|
@@ -464,13 +465,13 @@ Scroller.propTypes = /** @lends limestone/Scroller.Scroller.prototype */{
|
|
|
464
465
|
*/
|
|
465
466
|
verticalScrollThumbAriaLabel: _propTypes["default"].string
|
|
466
467
|
};
|
|
467
|
-
var ScrollerBase = exports.ScrollerBase =
|
|
468
|
-
exports.Scroller =
|
|
468
|
+
var ScrollerBase = exports.ScrollerBase = _Scroller;
|
|
469
|
+
exports.Scroller = _Scroller = (0, _Skinnable["default"])((0, _SpotlightContainerDecorator["default"])({
|
|
469
470
|
overflow: true,
|
|
470
471
|
preserveId: true,
|
|
471
472
|
restrict: 'self-first'
|
|
472
473
|
}, (0, _I18nDecorator.I18nContextDecorator)({
|
|
473
474
|
rtlProp: 'rtl'
|
|
474
|
-
},
|
|
475
|
-
|
|
476
|
-
var _default = exports["default"] =
|
|
475
|
+
}, _Scroller)));
|
|
476
|
+
_Scroller.defaultPropValues = scrollerDefaultProps;
|
|
477
|
+
var _default = exports["default"] = _Scroller;
|
|
@@ -128,12 +128,12 @@ var useSpottable = function useSpottable(props, instances) {
|
|
|
128
128
|
var _useEventKey = (0, _useEvent.useEventKey)(),
|
|
129
129
|
addGlobalKeyDownEventListener = _useEventKey.addGlobalKeyDownEventListener,
|
|
130
130
|
removeGlobalKeyDownEventListener = _useEventKey.removeGlobalKeyDownEventListener;
|
|
131
|
-
var setContainerDisabled = (0, _react.useCallback)(function (bool) {
|
|
131
|
+
var setContainerDisabled = (0, _react.useCallback)(function self(bool) {
|
|
132
132
|
if (scrollContainerRef.current) {
|
|
133
133
|
scrollContainerRef.current.dataset.spotlightContainerDisabled = bool;
|
|
134
134
|
if (bool) {
|
|
135
135
|
addGlobalKeyDownEventListener(function () {
|
|
136
|
-
|
|
136
|
+
self(false);
|
|
137
137
|
});
|
|
138
138
|
} else {
|
|
139
139
|
removeGlobalKeyDownEventListener();
|
|
@@ -384,7 +384,7 @@ var useThemeScroller = exports.useThemeScroller = function useThemeScroller(prop
|
|
|
384
384
|
filterTarget: 'body'
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
|
-
}, [props.focusableScrollbar, scrollContainerRef
|
|
387
|
+
}, [props.focusableScrollbar, scrollContainerRef]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
388
388
|
|
|
389
389
|
scrollContentProps.setThemeScrollContentHandle({
|
|
390
390
|
calculatePositionOnFocus: calculatePositionOnFocus,
|