@enact/limestone 1.3.0 → 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-branch.yml +21 -0
- package/.github/workflows/ci-pull-request.yml +16 -0
- package/.github/workflows/ci-reusable.yml +73 -0
- package/ActionGuide/ActionGuide.d.ts +5 -4
- package/ActionGuide/ActionGuide.module.css +1 -1
- package/Alert/Alert.d.ts +13 -2
- package/Alert/Alert.js +39 -5
- package/Alert/Alert.module.css +48 -1
- package/Alert/tests/Alert-specs.js +91 -0
- package/BodyText/BodyText.d.ts +5 -4
- package/BodyText/BodyText.module.css +7 -7
- package/Button/Button.d.ts +17 -12
- package/Button/Button.js +1 -1
- package/Button/Button.module.css +195 -268
- package/Button/tests/Button-specs.js +26 -0
- package/CHANGELOG.md +254 -0
- package/Card/Card.d.ts +40 -12
- package/Card/Card.js +164 -28
- package/Card/Card.module.css +277 -58
- package/Card/tests/Card-specs.js +67 -3
- package/Checkbox/Checkbox.d.ts +8 -7
- package/Checkbox/Checkbox.js +3 -1
- package/Checkbox/Checkbox.module.css +213 -120
- package/Checkbox/tests/Checkbox-specs.js +1 -1
- package/CheckboxItem/CheckboxItem.d.ts +22 -7
- package/CheckboxItem/CheckboxItem.js +71 -4
- package/Chips/Chip.js +72 -13
- package/Chips/Chip.module.css +3 -3
- package/Chips/Chips.js +37 -17
- package/Chips/Chips.module.css +1 -1
- package/Chips/tests/Chip-specs.js +43 -13
- package/Chips/tests/Chips-specs.js +31 -21
- package/ColorPicker/ColorPicker.js +27 -25
- package/ContextualMenuDecorator/ContextualMenuDecorator.d.ts +4 -5
- package/ContextualPopupDecorator/ContextualPopup.module.css +34 -34
- package/ContextualPopupDecorator/ContextualPopupDecorator.js +567 -549
- package/DatePicker/DatePicker.d.ts +4 -5
- package/DayPicker/DayPicker.d.ts +8 -7
- package/DayPicker/DaySelectorDecorator.js +12 -7
- package/Dropdown/Dropdown.d.ts +11 -13
- package/Dropdown/Dropdown.module.css +13 -9
- package/Dropdown/DropdownList.js +80 -54
- package/FixedPopupPanels/FixedPopupPanels.d.ts +4 -2
- package/FixedPopupPanels/FixedPopupPanels.module.css +18 -18
- package/FlexiblePopupPanels/FlexiblePopupPanels.module.css +23 -23
- package/FlexiblePopupPanels/useNavButtonFocus.js +7 -10
- package/FormCheckboxItem/FormCheckboxItem.d.ts +5 -4
- package/Heading/Heading.d.ts +9 -8
- package/Heading/Heading.js +2 -2
- package/Heading/Heading.module.css +5 -5
- package/Icon/Icon.d.ts +15 -4
- package/Icon/Icon.js +49 -2
- package/Icon/Icon.module.css +1 -1
- package/Icon/IconList.js +27 -1
- package/IconItem/IconItem.d.ts +13 -12
- package/IconItem/IconItem.js +15 -0
- package/IconItem/IconItem.module.css +107 -1
- package/IconItem/tests/IconItem-specs.js +30 -1
- package/Image/Image.d.ts +5 -4
- package/Image/Image.js +6 -4
- package/ImageItem/ImageItem.d.ts +11 -10
- package/ImageItem/ImageItem.js +37 -31
- package/ImageItem/ImageItem.module.css +30 -30
- package/ImageItem/tests/ImageItem-specs.js +3 -10
- package/Input/Input.js +21 -3
- package/Input/Input.module.css +37 -8
- package/Input/InputField.js +79 -24
- package/Input/InputField.module.css +273 -41
- package/Input/InputFieldDecoratorIcon.js +1 -0
- package/Input/InputFieldSpotlightDecorator.js +257 -228
- package/Input/index.d.ts +120 -111
- package/Input/tests/Input-specs.js +26 -0
- package/Input/tests/InputField-specs.js +170 -3
- package/Input/tests/InputPopup-specs.js +1 -1
- package/Item/Item.d.ts +16 -9
- package/Item/Item.js +20 -2
- package/Item/Item.module.css +1 -1
- package/KeyGuide/KeyGuide.d.ts +8 -7
- package/KeyGuide/KeyGuide.js +29 -27
- package/KeyGuide/KeyGuide.module.css +25 -1
- package/Marquee/Marquee.d.ts +2 -4
- package/MediaOverlay/MediaOverlay.d.ts +12 -11
- package/MediaOverlay/MediaOverlay.js +43 -21
- package/MediaOverlay/MediaOverlay.module.css +114 -15
- package/MediaOverlay/tests/MediaOverlay-specs.js +29 -0
- package/MediaPlayer/MediaControls.js +195 -13
- package/MediaPlayer/MediaControls.module.css +3 -2
- package/MediaPlayer/MediaSlider.module.css +7 -20
- package/MediaPlayer/index.d.ts +59 -7
- package/MediaPlayer/tests/util-specs.js +4 -1
- package/PageViews/PageViews.js +232 -82
- package/PageViews/PageViews.module.css +3 -0
- package/PageViews/PageViewsRouter.js +100 -42
- package/PageViews/tests/PageViews-specs.js +171 -0
- package/Panels/Header.js +54 -34
- package/Panels/Header.module.css +83 -31
- package/Panels/Panel.module.css +1 -1
- package/Panels/index.d.ts +7 -8
- package/Picker/Picker.d.ts +4 -5
- package/Picker/Picker.module.css +2 -2
- package/Popup/Popup.js +245 -242
- package/Popup/Popup.module.css +24 -24
- package/PopupTabLayout/PopupTabLayout.d.ts +5 -7
- package/PopupTabLayout/PopupTabLayout.js +26 -18
- package/PopupTabLayout/PopupTabLayout.module.css +53 -16
- package/PopupTabLayout/PopupTabLayoutStateContext.js +8 -0
- package/ProgressBar/ProgressBar.d.ts +5 -4
- package/ProgressBar/ProgressBarTooltip.module.css +12 -12
- package/ProgressButton/ProgressButton.d.ts +4 -5
- package/QuickGuidePanels/QuickGuidePanels.module.css +2 -2
- package/RadioItem/RadioItem.d.ts +18 -5
- package/RadioItem/RadioItem.js +69 -2
- package/RadioItem/RadioItem.module.css +36 -36
- package/RangePicker/RangePicker.module.css +2 -2
- package/Scroller/EditableWrapper.js +28 -18
- package/Scroller/Scroller.d.ts +20 -16
- package/Scroller/Scroller.js +20 -13
- package/Scroller/Scroller.module.css +4 -4
- package/Scroller/useThemeScroller.js +3 -3
- package/Slider/Slider.d.ts +20 -14
- package/Slider/Slider.js +71 -14
- package/Slider/Slider.module.css +464 -91
- package/Slider/SliderBehaviorDecorator.js +16 -14
- package/Slider/tests/Slider-specs.js +53 -1
- package/Slider/utils.js +23 -7
- package/Spinner/Spinner.d.ts +5 -4
- package/Spinner/Spinner.js +10 -8
- package/Spinner/Spinner.module.css +9 -9
- package/Steps/Steps.d.ts +5 -4
- package/Steps/Steps.js +9 -5
- package/Switch/Switch.d.ts +8 -7
- package/Switch/Switch.module.css +100 -13
- package/SwitchItem/SwitchItem.d.ts +9 -6
- package/TabLayout/RefocusDecorator.js +26 -18
- package/TabLayout/TabGroup.js +3 -2
- package/TabLayout/TabGroup.module.css +2 -2
- package/TabLayout/TabLayout.d.ts +6 -0
- package/TabLayout/TabLayout.js +11 -1
- package/TabLayout/TabLayout.module.css +18 -0
- package/TabLayout/tests/TabGroup-specs.js +1 -1
- package/TabLayout/tests/TabLayout-specs.js +52 -0
- package/ThemeDecorator/AccessibilityDecorator.js +12 -11
- package/ThemeDecorator/I18nFontDecorator.js +6 -4
- package/ThemeDecorator/ThemeDecorator.d.ts +16 -10
- package/ThemeDecorator/ThemeDecorator.js +24 -9
- package/ThemeDecorator/fontGenerator.js +1 -1
- package/ThemeDecorator/screenTypes.json +1 -0
- package/TimePicker/TimePicker.module.css +1 -1
- package/TimePicker/TimePickerBase.js +5 -3
- package/TooltipDecorator/Tooltip.module.css +1 -2
- package/TooltipDecorator/TooltipDecorator.js +12 -7
- package/TooltipDecorator/tests/useTooltip-specs.js +5 -2
- package/TooltipDecorator/tests/util-specs.js +12 -0
- package/TooltipDecorator/useTooltip.js +1 -1
- package/TooltipDecorator/util.js +18 -11
- package/VideoPlayer/Feedback.js +3 -0
- package/VideoPlayer/Feedback.module.css +5 -9
- package/VideoPlayer/FeedbackIcons.js +1 -1
- package/VideoPlayer/FeedbackTooltip.module.css +55 -11
- package/VideoPlayer/VideoPlayer.d.ts +44 -18
- package/VideoPlayer/VideoPlayer.js +153 -47
- package/VideoPlayer/VideoPlayer.module.css +28 -11
- package/VirtualList/VirtualList.d.ts +9 -2
- package/VirtualList/VirtualList.js +51 -24
- package/VirtualList/tests/VirtualGridList-translate-specs.js +3 -0
- package/VirtualList/tests/VirtualList-specs.js +28 -1
- package/VirtualList/tests/VirtualList-translate-specs.js +4 -1
- package/VirtualList/useSpotlight.js +1 -1
- package/WizardPanels/WizardPanels.module.css +2 -2
- package/WizardPanels/index.d.ts +4 -2
- package/fonts/Limestone_Icons.ttf +0 -0
- package/internal/$L/$L.js +3 -3
- package/internal/AsyncRenderChildren/AsyncRenderChildren.js +9 -5
- package/internal/AsyncRenderChildren/tests/AsyncRenderChildren-specs.js +4 -1
- package/internal/DateComponentPicker/DateComponentPicker.module.css +2 -2
- package/internal/DateTime/DateTime.module.css +1 -0
- package/internal/DateTime/DateTimeDecorator.js +5 -4
- package/internal/Panels/PanelsRouter.js +48 -31
- package/internal/Panels/useAutoFocus.js +10 -6
- package/internal/Panels/useFocusOnTransition.js +4 -3
- package/internal/Picker/Picker.js +7 -5
- package/internal/Picker/Picker.module.css +2 -2
- package/internal/Picker/SpottablePicker.js +15 -13
- package/internal/SharedStateDecorator/SharedStateDecorator.js +78 -99
- package/internal/validators/validators.js +21 -2
- package/package.json +18 -15
- package/styles/colors-highcontrast.less +9 -1
- package/styles/colors.less +12 -7
- package/styles/motion-mixins.less +66 -0
- package/styles/motions.less +78 -0
- package/styles/variables.less +176 -150
- package/useScroll/HoverToScroll.js +23 -17
- package/useScroll/Scrollbar.js +14 -10
- package/useScroll/ScrollbarPlaceholder.js +3 -5
- package/useScroll/ScrollbarTrack.js +7 -5
- package/useScroll/ScrollbarTrack.module.css +8 -8
- package/useScroll/useEvent.js +14 -3
- package/useScroll/useScroll.js +12 -2
- package/useScroll/useScroll.module.css +6 -6
- package/.travis.yml +0 -40
package/PageViews/PageViews.js
CHANGED
|
@@ -6,10 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = exports.PageViews = void 0;
|
|
7
7
|
var _handle = _interopRequireWildcard(require("@enact/core/handle"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("@enact/core/internal/prop-types"));
|
|
9
|
+
var _keymap = require("@enact/core/keymap");
|
|
9
10
|
var _kind = _interopRequireDefault(require("@enact/core/kind"));
|
|
10
11
|
var _util = require("@enact/core/util");
|
|
11
12
|
var _I18nDecorator = require("@enact/i18n/I18nDecorator");
|
|
13
|
+
var _spotlight = _interopRequireDefault(require("@enact/spotlight"));
|
|
12
14
|
var _SpotlightContainerDecorator = _interopRequireWildcard(require("@enact/spotlight/SpotlightContainerDecorator"));
|
|
15
|
+
var _Spottable = _interopRequireDefault(require("@enact/spotlight/Spottable"));
|
|
13
16
|
var _Changeable = _interopRequireDefault(require("@enact/ui/Changeable"));
|
|
14
17
|
var _Layout = require("@enact/ui/Layout");
|
|
15
18
|
var _ViewManager = _interopRequireWildcard(require("@enact/ui/ViewManager"));
|
|
@@ -25,16 +28,37 @@ var _Steps = _interopRequireDefault(require("../Steps"));
|
|
|
25
28
|
var _PageViewsRouter = require("./PageViewsRouter");
|
|
26
29
|
var _PageViewsModule = _interopRequireDefault(require("./PageViews.module.css"));
|
|
27
30
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
28
|
-
var _excluded = ["css", "componentRef", "fullContents", "index", "pageIndicatorPosition", "pageIndicatorType", "renderNextButton", "renderPrevButton", "renderViewManager", "stepHintAriaLabel", "steps"];
|
|
31
|
+
var _excluded = ["css", "componentRef", "fullContents", "index", "pageIndicatorPosition", "pageIndicatorType", "renderFooterButtons", "renderNextButton", "renderPrevButton", "renderViewManager", "stepHintAriaLabel", "steps", "uniqueId"];
|
|
29
32
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
30
33
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
31
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
32
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
33
34
|
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; }
|
|
34
35
|
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; }
|
|
36
|
+
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; }
|
|
37
|
+
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; }
|
|
35
38
|
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; }
|
|
36
39
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
37
|
-
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); }
|
|
40
|
+
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); }
|
|
41
|
+
var isLeft = (0, _keymap.is)('left');
|
|
42
|
+
var isRight = (0, _keymap.is)('right');
|
|
43
|
+
var handlePageChange = function handlePageChange(index, onChange, totalIndex) {
|
|
44
|
+
if (onChange && index !== totalIndex && totalIndex) {
|
|
45
|
+
var nextIndex = index < totalIndex - 1 ? index + 1 : index;
|
|
46
|
+
onChange({
|
|
47
|
+
type: 'onChange',
|
|
48
|
+
index: nextIndex
|
|
49
|
+
});
|
|
50
|
+
} else if (onChange && index !== 0) {
|
|
51
|
+
var prevIndex = index > 0 ? index - 1 : index;
|
|
52
|
+
onChange({
|
|
53
|
+
type: 'onChange',
|
|
54
|
+
index: prevIndex
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var SpottableCell = (0, _Spottable["default"])(_Layout.Cell);
|
|
59
|
+
var SpottableColumn = (0, _SpotlightContainerDecorator["default"])(_Layout.Column);
|
|
60
|
+
|
|
61
|
+
/**
|
|
38
62
|
* A PageViews that has page indicator with corresponding pages.
|
|
39
63
|
*
|
|
40
64
|
* @example
|
|
@@ -62,6 +86,14 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
62
86
|
* @private
|
|
63
87
|
*/
|
|
64
88
|
arranger: _ViewManager.shape,
|
|
89
|
+
/**
|
|
90
|
+
* When `true`, disables Spotlight outside the container and enables 5-way navigation between panels.
|
|
91
|
+
* Footer buttons are hidden when bannerMode is true.
|
|
92
|
+
*
|
|
93
|
+
* @type {Boolean}
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
bannerMode: _propTypes2["default"].bool,
|
|
65
97
|
/**
|
|
66
98
|
* {@link limestone/PageViews.Page|Page} to be rendered.
|
|
67
99
|
*
|
|
@@ -84,6 +116,7 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
84
116
|
*
|
|
85
117
|
* * `pageViews` - The root component class
|
|
86
118
|
* * `contentsArea` - The contentsArea component class
|
|
119
|
+
* * `footerButtons` - The footerButtons component class
|
|
87
120
|
* * `navButton` - The navButton component class
|
|
88
121
|
* * `navButtonContainer` - Applied to the container containing navButtons in fullContents mode
|
|
89
122
|
* * `stepsRow` - The step component class
|
|
@@ -92,6 +125,14 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
92
125
|
* @public
|
|
93
126
|
*/
|
|
94
127
|
css: _propTypes2["default"].object,
|
|
128
|
+
/**
|
|
129
|
+
* The label of the footer Close button.
|
|
130
|
+
*
|
|
131
|
+
* @type {String}
|
|
132
|
+
* @default 'Close'
|
|
133
|
+
* @public
|
|
134
|
+
*/
|
|
135
|
+
footerCloseLabel: _propTypes2["default"].string,
|
|
95
136
|
/**
|
|
96
137
|
* When `true`, maximize its contents area.
|
|
97
138
|
*
|
|
@@ -115,6 +156,13 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
115
156
|
* @public
|
|
116
157
|
*/
|
|
117
158
|
noAnimation: _propTypes2["default"].bool,
|
|
159
|
+
/**
|
|
160
|
+
* Called when the footer Close button is clicked.
|
|
161
|
+
*
|
|
162
|
+
* @type {Function}
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
onFooterCloseClick: _propTypes2["default"].func,
|
|
118
166
|
/**
|
|
119
167
|
* Called when a transition completes.
|
|
120
168
|
*
|
|
@@ -157,18 +205,35 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
157
205
|
* @private
|
|
158
206
|
*/
|
|
159
207
|
reverseTransition: _propTypes2["default"].bool,
|
|
208
|
+
/**
|
|
209
|
+
* When `true`, renders footer Close and Next buttons below the page content.
|
|
210
|
+
* Footer buttons are hidden when `bannerMode` is true.
|
|
211
|
+
*
|
|
212
|
+
* @type {Boolean}
|
|
213
|
+
* @default false
|
|
214
|
+
* @public
|
|
215
|
+
*/
|
|
216
|
+
showFooterButtons: _propTypes2["default"].bool,
|
|
160
217
|
/**
|
|
161
218
|
* The total number of pages.
|
|
162
219
|
*
|
|
163
220
|
* @type {Number}
|
|
164
221
|
* @private
|
|
165
222
|
*/
|
|
166
|
-
totalIndex: _propTypes2["default"].number
|
|
223
|
+
totalIndex: _propTypes2["default"].number,
|
|
224
|
+
/**
|
|
225
|
+
* A unique identifier for each PageViews component.
|
|
226
|
+
*
|
|
227
|
+
* @type {String}
|
|
228
|
+
* @private
|
|
229
|
+
*/
|
|
230
|
+
uniqueId: _propTypes2["default"].string
|
|
167
231
|
},
|
|
168
232
|
defaultProps: {
|
|
169
233
|
arranger: _Panels.BasicArranger,
|
|
170
234
|
pageIndicatorPosition: 'bottom',
|
|
171
|
-
pageIndicatorType: 'dot'
|
|
235
|
+
pageIndicatorType: 'dot',
|
|
236
|
+
showFooterButtons: false
|
|
172
237
|
},
|
|
173
238
|
styles: {
|
|
174
239
|
css: _PageViewsModule["default"],
|
|
@@ -176,32 +241,68 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
176
241
|
publicClassNames: true
|
|
177
242
|
},
|
|
178
243
|
handlers: {
|
|
179
|
-
|
|
244
|
+
onKeyDown: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), function (ev, _ref) {
|
|
180
245
|
var index = _ref.index,
|
|
181
246
|
onChange = _ref.onChange,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
247
|
+
rtl = _ref.rtl,
|
|
248
|
+
totalIndex = _ref.totalIndex,
|
|
249
|
+
uniqueId = _ref.uniqueId;
|
|
250
|
+
_spotlight["default"].set('banner-container' + uniqueId, {
|
|
251
|
+
navigableFilter: function navigableFilter(node) {
|
|
252
|
+
return node.classList.contains(_PageViewsModule["default"].viewManager);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
if (!rtl && isRight(ev.keyCode) || rtl && isLeft(ev.keyCode)) {
|
|
256
|
+
handlePageChange(index, onChange, totalIndex);
|
|
257
|
+
} else if (!rtl && isLeft(ev.keyCode) || rtl && isRight(ev.keyCode)) {
|
|
258
|
+
handlePageChange(index, onChange);
|
|
189
259
|
}
|
|
190
260
|
}),
|
|
191
|
-
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
onChange({
|
|
197
|
-
type: 'onChange',
|
|
198
|
-
index: prevIndex
|
|
199
|
-
});
|
|
200
|
-
}
|
|
261
|
+
onMouseOver: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), function (ev, _ref2) {
|
|
262
|
+
var uniqueId = _ref2.uniqueId;
|
|
263
|
+
return _spotlight["default"].set('banner-container' + uniqueId, {
|
|
264
|
+
navigableFilter: null
|
|
265
|
+
});
|
|
201
266
|
}),
|
|
202
|
-
|
|
267
|
+
onFooterNextClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onFooterNextClick'), function (ev, _ref3) {
|
|
203
268
|
var index = _ref3.index,
|
|
204
|
-
|
|
269
|
+
onChange = _ref3.onChange,
|
|
270
|
+
totalIndex = _ref3.totalIndex;
|
|
271
|
+
handlePageChange(index, onChange, totalIndex);
|
|
272
|
+
}),
|
|
273
|
+
onNextClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onNextClick'), function (ev, _ref4) {
|
|
274
|
+
var index = _ref4.index,
|
|
275
|
+
onChange = _ref4.onChange,
|
|
276
|
+
totalIndex = _ref4.totalIndex;
|
|
277
|
+
handlePageChange(index, onChange, totalIndex);
|
|
278
|
+
}),
|
|
279
|
+
onPrevClick: (0, _handle["default"])((0, _handle.forwardCustomWithPrevent)('onPrevClick'), function (ev, _ref5) {
|
|
280
|
+
var index = _ref5.index,
|
|
281
|
+
onChange = _ref5.onChange;
|
|
282
|
+
handlePageChange(index, onChange);
|
|
283
|
+
}),
|
|
284
|
+
onPointerOver: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), function (ev, _ref6) {
|
|
285
|
+
var uniqueId = _ref6.uniqueId;
|
|
286
|
+
return _spotlight["default"].set('banner-container' + uniqueId, {
|
|
287
|
+
navigableFilter: null
|
|
288
|
+
});
|
|
289
|
+
}),
|
|
290
|
+
onStepsClick: (0, _handle["default"])((0, _handle.forProp)('bannerMode', true), (0, _handle.forwardCustomWithPrevent)('onStepsClick'), function (ev, _ref7) {
|
|
291
|
+
var onChange = _ref7.onChange;
|
|
292
|
+
var node = ev.target;
|
|
293
|
+
var index = parseInt(node.getAttribute('data-index'));
|
|
294
|
+
if (node.children.length) return;
|
|
295
|
+
onChange({
|
|
296
|
+
type: 'onChange',
|
|
297
|
+
index: index
|
|
298
|
+
});
|
|
299
|
+
}),
|
|
300
|
+
onTransition: function onTransition(ev, _ref8) {
|
|
301
|
+
var index = _ref8.index,
|
|
302
|
+
_onTransition = _ref8.onTransition,
|
|
303
|
+
uniqueId = _ref8.uniqueId;
|
|
304
|
+
_spotlight["default"].focus('banner-view-manager' + uniqueId);
|
|
305
|
+
_spotlight["default"].resume();
|
|
205
306
|
if (_onTransition) {
|
|
206
307
|
_onTransition({
|
|
207
308
|
type: 'onTransition',
|
|
@@ -209,9 +310,10 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
209
310
|
});
|
|
210
311
|
}
|
|
211
312
|
},
|
|
212
|
-
onWillTransition: function onWillTransition(ev,
|
|
213
|
-
var index =
|
|
214
|
-
_onWillTransition =
|
|
313
|
+
onWillTransition: function onWillTransition(ev, _ref9) {
|
|
314
|
+
var index = _ref9.index,
|
|
315
|
+
_onWillTransition = _ref9.onWillTransition;
|
|
316
|
+
_spotlight["default"].pause();
|
|
215
317
|
if (_onWillTransition) {
|
|
216
318
|
_onWillTransition({
|
|
217
319
|
type: 'onWillTransition',
|
|
@@ -221,20 +323,47 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
221
323
|
}
|
|
222
324
|
},
|
|
223
325
|
computed: {
|
|
224
|
-
className: function className(
|
|
225
|
-
var fullContents =
|
|
226
|
-
pageIndicatorPosition =
|
|
227
|
-
pageIndicatorType =
|
|
228
|
-
styler =
|
|
326
|
+
className: function className(_ref0) {
|
|
327
|
+
var fullContents = _ref0.fullContents,
|
|
328
|
+
pageIndicatorPosition = _ref0.pageIndicatorPosition,
|
|
329
|
+
pageIndicatorType = _ref0.pageIndicatorType,
|
|
330
|
+
styler = _ref0.styler;
|
|
229
331
|
return styler.append({
|
|
230
332
|
fullContents: fullContents
|
|
231
333
|
}, "indicator".concat((0, _util.cap)(pageIndicatorPosition)), pageIndicatorType);
|
|
232
334
|
},
|
|
233
|
-
|
|
234
|
-
var
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
335
|
+
renderFooterButtons: function renderFooterButtons(_ref1) {
|
|
336
|
+
var bannerMode = _ref1.bannerMode,
|
|
337
|
+
css = _ref1.css,
|
|
338
|
+
footerCloseLabel = _ref1.footerCloseLabel,
|
|
339
|
+
index = _ref1.index,
|
|
340
|
+
onFooterCloseClick = _ref1.onFooterCloseClick,
|
|
341
|
+
onFooterNextClick = _ref1.onFooterNextClick,
|
|
342
|
+
showFooterButtons = _ref1.showFooterButtons,
|
|
343
|
+
totalIndex = _ref1.totalIndex,
|
|
344
|
+
uniqueId = _ref1.uniqueId;
|
|
345
|
+
if (!showFooterButtons || bannerMode) return null;
|
|
346
|
+
var isLastPage = index >= totalIndex - 1;
|
|
347
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Row, {
|
|
348
|
+
className: css.footerButtons,
|
|
349
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
|
|
350
|
+
className: isLastPage ? _SpotlightContainerDecorator.spotlightDefaultClass : null,
|
|
351
|
+
spotlightId: "PageViews-footer-close" + uniqueId,
|
|
352
|
+
onClick: onFooterCloseClick,
|
|
353
|
+
children: footerCloseLabel || (0, _$L["default"])('Close')
|
|
354
|
+
}), !isLastPage ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
|
|
355
|
+
className: _SpotlightContainerDecorator.spotlightDefaultClass,
|
|
356
|
+
spotlightId: "PageViews-footer-next" + uniqueId,
|
|
357
|
+
onClick: onFooterNextClick,
|
|
358
|
+
children: (0, _$L["default"])('Next')
|
|
359
|
+
}) : null]
|
|
360
|
+
});
|
|
361
|
+
},
|
|
362
|
+
renderNextButton: function renderNextButton(_ref10) {
|
|
363
|
+
var css = _ref10.css,
|
|
364
|
+
onNextClick = _ref10.onNextClick,
|
|
365
|
+
index = _ref10.index,
|
|
366
|
+
totalIndex = _ref10.totalIndex;
|
|
238
367
|
var isNextButtonVisible = index < totalIndex - 1;
|
|
239
368
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
240
369
|
className: css.navButtonCell,
|
|
@@ -249,10 +378,10 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
249
378
|
}) : null
|
|
250
379
|
});
|
|
251
380
|
},
|
|
252
|
-
renderPrevButton: function renderPrevButton(
|
|
253
|
-
var css =
|
|
254
|
-
index =
|
|
255
|
-
onPrevClick =
|
|
381
|
+
renderPrevButton: function renderPrevButton(_ref11) {
|
|
382
|
+
var css = _ref11.css,
|
|
383
|
+
index = _ref11.index,
|
|
384
|
+
onPrevClick = _ref11.onPrevClick;
|
|
256
385
|
var isPrevButtonVisible = index !== 0;
|
|
257
386
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
258
387
|
className: css.navButtonCell,
|
|
@@ -267,16 +396,21 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
267
396
|
}) : null
|
|
268
397
|
});
|
|
269
398
|
},
|
|
270
|
-
renderViewManager: function renderViewManager(
|
|
271
|
-
var arranger =
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
399
|
+
renderViewManager: function renderViewManager(_ref12) {
|
|
400
|
+
var arranger = _ref12.arranger,
|
|
401
|
+
bannerMode = _ref12.bannerMode,
|
|
402
|
+
css = _ref12.css,
|
|
403
|
+
index = _ref12.index,
|
|
404
|
+
noAnimation = _ref12.noAnimation,
|
|
405
|
+
onTransition = _ref12.onTransition,
|
|
406
|
+
onWillTransition = _ref12.onWillTransition,
|
|
407
|
+
reverseTransition = _ref12.reverseTransition,
|
|
408
|
+
uniqueId = _ref12.uniqueId,
|
|
409
|
+
children = _ref12.children;
|
|
410
|
+
var CellComponent = bannerMode ? SpottableCell : _Layout.Cell;
|
|
411
|
+
var props = {};
|
|
412
|
+
if (bannerMode) props.spotlightId = "banner-view-manager" + uniqueId;
|
|
413
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CellComponent, _objectSpread(_objectSpread({
|
|
280
414
|
arranger: arranger,
|
|
281
415
|
className: css.viewManager,
|
|
282
416
|
component: _ViewManager["default"],
|
|
@@ -285,28 +419,31 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
285
419
|
noAnimation: typeof ENACT_PACK_NO_ANIMATION !== 'undefined' && ENACT_PACK_NO_ANIMATION || noAnimation,
|
|
286
420
|
onTransition: onTransition,
|
|
287
421
|
onWillTransition: onWillTransition,
|
|
288
|
-
reverseTransition: reverseTransition
|
|
422
|
+
reverseTransition: reverseTransition
|
|
423
|
+
}, props), {}, {
|
|
289
424
|
children: children
|
|
290
|
-
});
|
|
425
|
+
}));
|
|
291
426
|
},
|
|
292
|
-
stepHintAriaLabel: function stepHintAriaLabel(
|
|
427
|
+
stepHintAriaLabel: function stepHintAriaLabel(_ref13) {
|
|
293
428
|
var _children$index;
|
|
294
|
-
var children =
|
|
295
|
-
index =
|
|
296
|
-
totalIndex =
|
|
429
|
+
var children = _ref13.children,
|
|
430
|
+
index = _ref13.index,
|
|
431
|
+
totalIndex = _ref13.totalIndex;
|
|
297
432
|
var pageHint = new _IString["default"]((0, _$L["default"])('Page {current} out of {total}')).format({
|
|
298
433
|
current: index + 1,
|
|
299
434
|
total: totalIndex
|
|
300
435
|
});
|
|
301
436
|
return "".concat(pageHint, " ").concat((children === null || children === void 0 || (_children$index = children[index]) === null || _children$index === void 0 ? void 0 : _children$index.props['aria-label']) || '');
|
|
302
437
|
},
|
|
303
|
-
steps: function steps(
|
|
304
|
-
var
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
438
|
+
steps: function steps(_ref14) {
|
|
439
|
+
var bannerMode = _ref14.bannerMode,
|
|
440
|
+
css = _ref14.css,
|
|
441
|
+
index = _ref14.index,
|
|
442
|
+
onNextClick = _ref14.onNextClick,
|
|
443
|
+
onPrevClick = _ref14.onPrevClick,
|
|
444
|
+
onStepsClick = _ref14.onStepsClick,
|
|
445
|
+
pageIndicatorType = _ref14.pageIndicatorType,
|
|
446
|
+
totalIndex = _ref14.totalIndex;
|
|
310
447
|
var isPrevButtonVisible = index !== 0;
|
|
311
448
|
var isNextButtonVisible = index < totalIndex - 1;
|
|
312
449
|
var isStepVisible = totalIndex !== 1;
|
|
@@ -317,6 +454,7 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
317
454
|
css: css,
|
|
318
455
|
current: index + 1,
|
|
319
456
|
highlightCurrentOnly: true,
|
|
457
|
+
onClick: onStepsClick,
|
|
320
458
|
total: totalIndex
|
|
321
459
|
})
|
|
322
460
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Layout.Row, {
|
|
@@ -325,6 +463,7 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
325
463
|
className: css.navButtonCell,
|
|
326
464
|
shrink: true,
|
|
327
465
|
children: isPrevButtonVisible ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
|
|
466
|
+
spotlightDisabled: bannerMode,
|
|
328
467
|
"aria-label": (0, _$L["default"])('Previous'),
|
|
329
468
|
className: css.navButton,
|
|
330
469
|
icon: "arrowlargeleft",
|
|
@@ -344,6 +483,7 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
344
483
|
className: css.navButtonCell,
|
|
345
484
|
shrink: true,
|
|
346
485
|
children: isNextButtonVisible ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], {
|
|
486
|
+
spotlightDisabled: bannerMode,
|
|
347
487
|
"aria-label": (0, _$L["default"])('Next'),
|
|
348
488
|
className: css.navButton,
|
|
349
489
|
icon: "arrowlargeright",
|
|
@@ -356,37 +496,47 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
356
496
|
});
|
|
357
497
|
}
|
|
358
498
|
},
|
|
359
|
-
render: function render(
|
|
360
|
-
var css =
|
|
361
|
-
componentRef =
|
|
362
|
-
fullContents =
|
|
363
|
-
index =
|
|
364
|
-
pageIndicatorPosition =
|
|
365
|
-
pageIndicatorType =
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
499
|
+
render: function render(_ref15) {
|
|
500
|
+
var css = _ref15.css,
|
|
501
|
+
componentRef = _ref15.componentRef,
|
|
502
|
+
fullContents = _ref15.fullContents,
|
|
503
|
+
index = _ref15.index,
|
|
504
|
+
pageIndicatorPosition = _ref15.pageIndicatorPosition,
|
|
505
|
+
pageIndicatorType = _ref15.pageIndicatorType,
|
|
506
|
+
renderFooterButtons = _ref15.renderFooterButtons,
|
|
507
|
+
renderNextButton = _ref15.renderNextButton,
|
|
508
|
+
renderPrevButton = _ref15.renderPrevButton,
|
|
509
|
+
renderViewManager = _ref15.renderViewManager,
|
|
510
|
+
stepHintAriaLabel = _ref15.stepHintAriaLabel,
|
|
511
|
+
steps = _ref15.steps,
|
|
512
|
+
uniqueId = _ref15.uniqueId,
|
|
513
|
+
rest = _objectWithoutProperties(_ref15, _excluded);
|
|
372
514
|
delete rest.arranger;
|
|
515
|
+
delete rest.bannerMode;
|
|
373
516
|
delete rest.children;
|
|
517
|
+
delete rest.footerCloseLabel;
|
|
374
518
|
delete rest.noAnimation;
|
|
375
|
-
delete rest.
|
|
519
|
+
delete rest.onFooterCloseClick;
|
|
520
|
+
delete rest.onFooterNextClick;
|
|
376
521
|
delete rest.onNextClick;
|
|
522
|
+
delete rest.onStepsClick;
|
|
377
523
|
delete rest.onPrevClick;
|
|
524
|
+
delete rest.onTransition;
|
|
378
525
|
delete rest.onWillTransition;
|
|
379
526
|
delete rest.reverseTransition;
|
|
527
|
+
delete rest.rtl;
|
|
528
|
+
delete rest.showFooterButtons;
|
|
380
529
|
delete rest.totalIndex;
|
|
381
530
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({
|
|
382
531
|
role: "region",
|
|
383
532
|
"aria-labelledby": "pageViews_index_".concat(index),
|
|
384
533
|
ref: componentRef
|
|
385
534
|
}, rest), {}, {
|
|
386
|
-
children: [!fullContents && pageIndicatorPosition === 'top' ? steps : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
535
|
+
children: [!fullContents && pageIndicatorPosition === 'top' ? steps : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(SpottableColumn, {
|
|
387
536
|
"aria-label": stepHintAriaLabel,
|
|
388
537
|
className: css.contentsArea,
|
|
389
538
|
id: "pageViews_index_".concat(index),
|
|
539
|
+
spotlightId: "banner-container" + uniqueId,
|
|
390
540
|
children: fullContents ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
391
541
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Row, {
|
|
392
542
|
className: css.horizontalLayout,
|
|
@@ -399,7 +549,7 @@ var PageViewsBase = (0, _kind["default"])({
|
|
|
399
549
|
className: css.horizontalLayout,
|
|
400
550
|
children: [pageIndicatorType === 'dot' ? renderPrevButton : null, renderViewManager, pageIndicatorType === 'dot' ? renderNextButton : null]
|
|
401
551
|
})
|
|
402
|
-
}), !fullContents && pageIndicatorPosition === 'bottom' ? steps : null]
|
|
552
|
+
}), !fullContents && pageIndicatorPosition === 'bottom' ? steps : null, renderFooterButtons]
|
|
403
553
|
}));
|
|
404
554
|
}
|
|
405
555
|
});
|
|
@@ -100,6 +100,9 @@
|
|
|
100
100
|
.pageViews .horizontalLayout {
|
|
101
101
|
height: 100%;
|
|
102
102
|
}
|
|
103
|
+
.pageViews .footerButtons {
|
|
104
|
+
justify-content: center;
|
|
105
|
+
}
|
|
103
106
|
.pageViews:global(.neutral) .viewManager {
|
|
104
107
|
background-color: color(from var(--semantic-color-surface-default-group) srgb r g b / 0.1);
|
|
105
108
|
}
|