@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
|
@@ -5,13 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getNavigableFilter = exports["default"] = exports.RefocusDecorator = void 0;
|
|
7
7
|
exports.getTabsSpotlightId = getTabsSpotlightId;
|
|
8
|
+
var _util = require("@enact/core/util");
|
|
8
9
|
var _spotlight = _interopRequireDefault(require("@enact/spotlight"));
|
|
9
10
|
var _IdProvider = require("@enact/ui/internal/IdProvider");
|
|
10
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
12
|
var _react = require("react");
|
|
12
13
|
var _TabGroupModule = _interopRequireDefault(require("./TabGroup.module.css"));
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
var _excluded = ["blockCollapseOnPortrait", "collapsed", "index", "onCollapse", "
|
|
15
|
+
var _excluded = ["blockCollapseOnPortrait", "blockExpandOnLandscape", "collapsed", "index", "onCollapse", "onExpand", "onTabAnimationEnd", "orientation"];
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
17
|
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; }
|
|
17
18
|
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; }
|
|
@@ -60,21 +61,24 @@ function useScreenOrientation() {
|
|
|
60
61
|
}
|
|
61
62
|
var RefocusDecorator = exports.RefocusDecorator = function RefocusDecorator(Wrapped) {
|
|
62
63
|
// eslint-disable-next-line no-shadow
|
|
63
|
-
function RefocusDecorator(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
function RefocusDecorator(props) {
|
|
65
|
+
(0, _util.checkPropTypes)(RefocusDecorator, props);
|
|
66
|
+
var blockCollapseOnPortrait = props.blockCollapseOnPortrait,
|
|
67
|
+
blockExpandOnLandscape = props.blockExpandOnLandscape,
|
|
68
|
+
collapsed = props.collapsed,
|
|
69
|
+
index = props.index,
|
|
70
|
+
onCollapse = props.onCollapse,
|
|
71
|
+
onExpand = props.onExpand,
|
|
72
|
+
onTabAnimationEnd = props.onTabAnimationEnd,
|
|
73
|
+
orientation = props.orientation,
|
|
74
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
75
|
+
var spotlightId = props.spotlightId;
|
|
72
76
|
var _useId = (0, _IdProvider.useId)({
|
|
73
77
|
prefix: 'lime-tablayout-'
|
|
74
78
|
}),
|
|
75
79
|
generateId = _useId.generateId;
|
|
76
80
|
var screenOrientation = useScreenOrientation();
|
|
77
|
-
var screenOrientationRef = (0, _react.useRef)(
|
|
81
|
+
var screenOrientationRef = (0, _react.useRef)('landscape');
|
|
78
82
|
|
|
79
83
|
// generate an id for the component (and a derived id for the tabs) so we can refocus them
|
|
80
84
|
// generating a different ID by orientation so swapping orientations doesn't clear container
|
|
@@ -97,18 +101,21 @@ var RefocusDecorator = exports.RefocusDecorator = function RefocusDecorator(Wrap
|
|
|
97
101
|
});
|
|
98
102
|
}, [collapsed, orientation, spotlightId]);
|
|
99
103
|
(0, _react.useEffect)(function () {
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (
|
|
104
|
+
if (screenOrientationRef.current !== screenOrientation) {
|
|
105
|
+
var currentFocusedElement = document.querySelector(':focus'),
|
|
106
|
+
tabsSpotlightId = getTabsSpotlightId(spotlightId, false),
|
|
107
|
+
tabsContainer = getContainerNode(tabsSpotlightId);
|
|
108
|
+
if (tabsContainer && !tabsContainer.contains(currentFocusedElement)) {
|
|
109
|
+
if (!blockCollapseOnPortrait && screenOrientation === 'portrait') {
|
|
106
110
|
onCollapse();
|
|
107
111
|
}
|
|
112
|
+
if (!blockExpandOnLandscape && screenOrientation === 'landscape') {
|
|
113
|
+
onExpand();
|
|
114
|
+
}
|
|
108
115
|
}
|
|
109
116
|
screenOrientationRef.current = screenOrientation;
|
|
110
117
|
}
|
|
111
|
-
}, [blockCollapseOnPortrait, onCollapse, screenOrientation, spotlightId]);
|
|
118
|
+
}, [blockCollapseOnPortrait, blockExpandOnLandscape, onCollapse, onExpand, screenOrientation, spotlightId]);
|
|
112
119
|
var handleTabAnimationEnd = (0, _react.useCallback)(function (ev) {
|
|
113
120
|
if (onTabAnimationEnd) {
|
|
114
121
|
onTabAnimationEnd(ev);
|
|
@@ -125,6 +132,7 @@ var RefocusDecorator = exports.RefocusDecorator = function RefocusDecorator(Wrap
|
|
|
125
132
|
collapsed: collapsed,
|
|
126
133
|
index: index,
|
|
127
134
|
onCollapse: onCollapse,
|
|
135
|
+
onExpand: onExpand,
|
|
128
136
|
onTabAnimationEnd: handleTabAnimationEnd,
|
|
129
137
|
orientation: orientation,
|
|
130
138
|
spotlightId: spotlightId
|
package/TabLayout/TabGroup.js
CHANGED
|
@@ -59,7 +59,7 @@ var TabBase = (0, _kind["default"])({
|
|
|
59
59
|
styles: {
|
|
60
60
|
css: _TabGroupModule["default"],
|
|
61
61
|
className: 'tab',
|
|
62
|
-
publicClassNames: ['bg', 'button', 'client', 'selected', 'tab', 'vertical']
|
|
62
|
+
publicClassNames: ['bg', 'button', 'client', 'icon', 'selected', 'tab', 'vertical']
|
|
63
63
|
},
|
|
64
64
|
handlers: {
|
|
65
65
|
onClick: (0, _handle["default"])((0, _handle.forward)('onClick'), (0, _handle.not)((0, _handle.forProp)('disabled', true)), (0, _handle.forwardCustom)('onTabClick', function (ev, _ref) {
|
|
@@ -196,7 +196,7 @@ var TabGroupBase = (0, _kind["default"])({
|
|
|
196
196
|
styles: {
|
|
197
197
|
css: _TabGroupModule["default"],
|
|
198
198
|
className: 'tabGroup',
|
|
199
|
-
publicClassNames: ['bg', 'button', 'client', 'selected', 'tab', 'tabGroup', 'vertical']
|
|
199
|
+
publicClassNames: ['bg', 'button', 'client', 'icon', 'selected', 'tab', 'tabGroup', 'vertical']
|
|
200
200
|
},
|
|
201
201
|
computed: {
|
|
202
202
|
className: function className(_ref6) {
|
|
@@ -313,6 +313,7 @@ var TabGroupBase = (0, _kind["default"])({
|
|
|
313
313
|
noScrollByWheel: collapsed,
|
|
314
314
|
onScrollStop: onScrollStop,
|
|
315
315
|
scrollbarTrackCss: _TabGroupModule["default"],
|
|
316
|
+
scrollToContentContainerOnFocus: false,
|
|
316
317
|
spotlightDisabled: spotlightDisabled,
|
|
317
318
|
spotlightId: spotlightId,
|
|
318
319
|
verticalScrollbar: collapsed ? 'hidden' : 'auto'
|
|
@@ -132,8 +132,8 @@
|
|
|
132
132
|
gap: var(--primitive-spacing-36);
|
|
133
133
|
}
|
|
134
134
|
.tabGroup.vertical .scrollbarTrack {
|
|
135
|
-
margin-top:
|
|
136
|
-
margin-bottom:
|
|
135
|
+
margin-top: var(--primitive-spacing-36);
|
|
136
|
+
margin-bottom: var(--primitive-spacing-36);
|
|
137
137
|
height: calc(100% - 72px);
|
|
138
138
|
}
|
|
139
139
|
.tabGroup.vertical.collapsed:has(.noIcons) {
|
package/TabLayout/TabLayout.d.ts
CHANGED
|
@@ -56,6 +56,12 @@ export interface TabLayoutProps {
|
|
|
56
56
|
* Only applies to `orientation="vertical".
|
|
57
57
|
*/
|
|
58
58
|
blockCollapseOnPortrait?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Prevents the tab list from automatically expand when the screen orientation changes to landscape mode.
|
|
61
|
+
*
|
|
62
|
+
* Only applies to `orientation="vertical".
|
|
63
|
+
*/
|
|
64
|
+
blockExpandOnLandscape?: boolean;
|
|
59
65
|
/**
|
|
60
66
|
* Collection of to render.
|
|
61
67
|
*/
|
package/TabLayout/TabLayout.js
CHANGED
|
@@ -130,6 +130,15 @@ var TabLayoutBase = exports.TabLayoutBase = (0, _kind["default"])({
|
|
|
130
130
|
* @public
|
|
131
131
|
*/
|
|
132
132
|
blockCollapseOnPortrait: _propTypes["default"].bool,
|
|
133
|
+
/**
|
|
134
|
+
* Prevents the tab list from automatically expand when the screen orientation changes to landscape mode.
|
|
135
|
+
*
|
|
136
|
+
* Only applies to `orientation="vertical".
|
|
137
|
+
*
|
|
138
|
+
* @type {Boolean}
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
blockExpandOnLandscape: _propTypes["default"].bool,
|
|
133
142
|
/**
|
|
134
143
|
* Collection of {@link limestone/TabLayout.Tab|Tabs} to render.
|
|
135
144
|
*
|
|
@@ -331,7 +340,7 @@ var TabLayoutBase = exports.TabLayoutBase = (0, _kind["default"])({
|
|
|
331
340
|
styles: {
|
|
332
341
|
css: _TabLayoutModule["default"],
|
|
333
342
|
className: 'tabLayout',
|
|
334
|
-
publicClassNames: ['bg', 'button', 'client', 'collapsed', 'content', 'selected', 'tab', 'tabGroup', 'tabLayout', 'tabs', 'tabsExpanded', 'vertical']
|
|
343
|
+
publicClassNames: ['bg', 'button', 'client', 'collapsed', 'content', 'icon', 'selected', 'tab', 'tabGroup', 'tabLayout', 'tabs', 'tabsExpanded', 'vertical']
|
|
335
344
|
},
|
|
336
345
|
handlers: {
|
|
337
346
|
onKeyDown: function onKeyDown(ev, props) {
|
|
@@ -559,6 +568,7 @@ var TabLayoutBase = exports.TabLayoutBase = (0, _kind["default"])({
|
|
|
559
568
|
rest = _objectWithoutProperties(_ref12, _excluded);
|
|
560
569
|
delete rest.anchorTo;
|
|
561
570
|
delete rest.blockCollapseOnPortrait;
|
|
571
|
+
delete rest.blockExpandOnLandscape;
|
|
562
572
|
delete rest.onExpand;
|
|
563
573
|
delete rest.offset;
|
|
564
574
|
delete rest.onTabAnimationEnd;
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
.tabLayout.collapsed .tabGroup .tab.vertical.button.selected .bg {
|
|
13
13
|
/* Override TabLayout */
|
|
14
14
|
}
|
|
15
|
+
.tabLayout.collapsed .tabGroup .tab.vertical.button.selected .icon,
|
|
16
|
+
.tabLayout.collapsed .tabGroup .tab.vertical.button.selected .client {
|
|
17
|
+
/* Override TabLayout */
|
|
18
|
+
}
|
|
15
19
|
.tabLayout.anchorEnd,
|
|
16
20
|
.tabLayout.anchorRight {
|
|
17
21
|
flex-direction: row-reverse;
|
|
@@ -92,10 +96,24 @@
|
|
|
92
96
|
.tabLayout .tabGroup .tab.vertical.button.selected .bg {
|
|
93
97
|
/* Override TabLayout */
|
|
94
98
|
}
|
|
99
|
+
.tabLayout .tabGroup .tab.vertical.button.selected .icon,
|
|
100
|
+
.tabLayout .tabGroup .tab.vertical.button.selected .client {
|
|
101
|
+
/* Override TabLayout */
|
|
102
|
+
}
|
|
95
103
|
:global(.spotlight-input-key) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .bg,
|
|
96
104
|
:global(.spotlight-input-mouse) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .bg {
|
|
97
105
|
/* Override TabLayout */
|
|
98
106
|
}
|
|
107
|
+
:global(.spotlight-input-key) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .icon,
|
|
108
|
+
:global(.spotlight-input-mouse) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .icon,
|
|
109
|
+
:global(.spotlight-input-key) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .client,
|
|
110
|
+
:global(.spotlight-input-mouse) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):focus .client {
|
|
111
|
+
/* Override TabLayout */
|
|
112
|
+
}
|
|
99
113
|
:global(.spotlight-input-touch) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):active .bg {
|
|
100
114
|
/* Override TabLayout */
|
|
101
115
|
}
|
|
116
|
+
:global(.spotlight-input-touch) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):active .icon,
|
|
117
|
+
:global(.spotlight-input-touch) .tabLayout .tabGroup .tab.vertical.button:global(.spottable):active .client {
|
|
118
|
+
/* Override TabLayout */
|
|
119
|
+
}
|
|
@@ -181,7 +181,7 @@ describe('TabGroup specs', function () {
|
|
|
181
181
|
expect(handleFocusTab).toHaveBeenCalled();
|
|
182
182
|
});
|
|
183
183
|
test('should set the size for all tabs in horizontal orientation', function () {
|
|
184
|
-
var size =
|
|
184
|
+
var size = 'small';
|
|
185
185
|
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabGroup["default"], {
|
|
186
186
|
orientation: "horizontal",
|
|
187
187
|
size: size,
|
|
@@ -36,6 +36,16 @@ var setPortraitOrientation = function setPortraitOrientation() {
|
|
|
36
36
|
value: 1920
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
+
var setLandscapeOrientation = function setLandscapeOrientation() {
|
|
40
|
+
Object.defineProperty(window, 'innerWidth', {
|
|
41
|
+
configurable: true,
|
|
42
|
+
value: 1920
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(window, 'innerHeight', {
|
|
45
|
+
configurable: true,
|
|
46
|
+
value: 1080
|
|
47
|
+
});
|
|
48
|
+
};
|
|
39
49
|
var spySpotlight = function spySpotlight() {
|
|
40
50
|
jest.spyOn(_spotlight["default"], 'setPointerMode');
|
|
41
51
|
jest.spyOn(_spotlight["default"], 'move');
|
|
@@ -561,6 +571,27 @@ describe('TabLayout specs', function () {
|
|
|
561
571
|
var actual = _react.screen.getByTestId('tabLayout');
|
|
562
572
|
expect(actual).toHaveClass(expected);
|
|
563
573
|
});
|
|
574
|
+
test('should update orientation on window resize, collapse and expand tabs', function () {
|
|
575
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout["default"], {
|
|
576
|
+
"data-testid": "tabLayout",
|
|
577
|
+
orientation: "vertical",
|
|
578
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout.Tab, {
|
|
579
|
+
title: "Home",
|
|
580
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
581
|
+
children: "Home"
|
|
582
|
+
})
|
|
583
|
+
})
|
|
584
|
+
}));
|
|
585
|
+
var actual = _react.screen.getByTestId('tabLayout');
|
|
586
|
+
setPortraitOrientation();
|
|
587
|
+
(0, _react.fireEvent)(window, new Event('resize'));
|
|
588
|
+
var expectedCollapsed = 'collapsed';
|
|
589
|
+
expect(actual).toHaveClass(expectedCollapsed);
|
|
590
|
+
setLandscapeOrientation();
|
|
591
|
+
(0, _react.fireEvent)(window, new Event('resize'));
|
|
592
|
+
var expectedExpanded = 'expanded';
|
|
593
|
+
expect(actual).not.toHaveClass(expectedExpanded);
|
|
594
|
+
});
|
|
564
595
|
test('should update orientation on window resize and not collapse tabs when \'blockCollapseOnPortrait\' is set', function () {
|
|
565
596
|
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout["default"], {
|
|
566
597
|
blockCollapseOnPortrait: true,
|
|
@@ -579,6 +610,27 @@ describe('TabLayout specs', function () {
|
|
|
579
610
|
var actual = _react.screen.getByTestId('tabLayout');
|
|
580
611
|
expect(actual).not.toHaveClass(expected);
|
|
581
612
|
});
|
|
613
|
+
test('should update orientation on window resize and not expand tabs when \'blockExpandOnLandscape\' is set', function () {
|
|
614
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout["default"], {
|
|
615
|
+
blockExpandOnLandscape: true,
|
|
616
|
+
"data-testid": "tabLayout",
|
|
617
|
+
orientation: "vertical",
|
|
618
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout.Tab, {
|
|
619
|
+
title: "Home",
|
|
620
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
621
|
+
children: "Home"
|
|
622
|
+
})
|
|
623
|
+
})
|
|
624
|
+
}));
|
|
625
|
+
var actual = _react.screen.getByTestId('tabLayout');
|
|
626
|
+
var expected = 'collapsed';
|
|
627
|
+
setPortraitOrientation();
|
|
628
|
+
(0, _react.fireEvent)(window, new Event('resize'));
|
|
629
|
+
expect(actual).toHaveClass(expected);
|
|
630
|
+
setLandscapeOrientation();
|
|
631
|
+
(0, _react.fireEvent)(window, new Event('resize'));
|
|
632
|
+
expect(actual).toHaveClass(expected);
|
|
633
|
+
});
|
|
582
634
|
test('should set the tab size for all tabs in horizontal orientation', function () {
|
|
583
635
|
var tabSize = 300;
|
|
584
636
|
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_TabLayout.TabLayoutBase, {
|
|
@@ -35,14 +35,15 @@ var accessibilityDecoratorDefaultProps = {
|
|
|
35
35
|
*/
|
|
36
36
|
var AccessibilityDecorator = exports.AccessibilityDecorator = (0, _hoc["default"])(function (config, Wrapped) {
|
|
37
37
|
// eslint-disable-next-line no-shadow
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
var _AccessibilityDecorator = function AccessibilityDecorator(props) {
|
|
39
|
+
var accessibilityDecoratorProps = (0, _util.setDefaultProps)(props, accessibilityDecoratorDefaultProps);
|
|
40
|
+
(0, _util.checkPropTypes)(_AccessibilityDecorator, accessibilityDecoratorProps);
|
|
41
|
+
var className = accessibilityDecoratorProps.className,
|
|
42
|
+
focusRing = accessibilityDecoratorProps.focusRing,
|
|
43
|
+
highContrast = accessibilityDecoratorProps.highContrast,
|
|
44
|
+
skinVariants = accessibilityDecoratorProps.skinVariants,
|
|
45
|
+
textSize = accessibilityDecoratorProps.textSize,
|
|
46
|
+
rest = _objectWithoutProperties(accessibilityDecoratorProps, _excluded);
|
|
46
47
|
var accessibilityClassName = highContrast ? "enact-a11y-high-contrast enact-text-".concat(textSize) : "enact-text-".concat(textSize);
|
|
47
48
|
accessibilityClassName = focusRing ? "enact-a11y-focus-ring ".concat(accessibilityClassName) : "".concat(accessibilityClassName);
|
|
48
49
|
var combinedClassName = className ? "".concat(className, " ").concat(accessibilityClassName) : accessibilityClassName;
|
|
@@ -75,8 +76,8 @@ var AccessibilityDecorator = exports.AccessibilityDecorator = (0, _hoc["default"
|
|
|
75
76
|
}, rest))
|
|
76
77
|
});
|
|
77
78
|
};
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
_AccessibilityDecorator.displayName = 'AccessibilityDecorator';
|
|
80
|
+
_AccessibilityDecorator.propTypes = {
|
|
80
81
|
/** @lends limestone/ThemeDecorator.AccessibilityDecorator.prototype */
|
|
81
82
|
/**
|
|
82
83
|
* Enables additional features to help users visually differentiate components.
|
|
@@ -146,6 +147,6 @@ var AccessibilityDecorator = exports.AccessibilityDecorator = (0, _hoc["default"
|
|
|
146
147
|
*/
|
|
147
148
|
textSize: _propTypes["default"].oneOf(['normal', 'large'])
|
|
148
149
|
};
|
|
149
|
-
return
|
|
150
|
+
return _AccessibilityDecorator;
|
|
150
151
|
});
|
|
151
152
|
var _default = exports["default"] = AccessibilityDecorator;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.I18nFontDecorator = void 0;
|
|
7
7
|
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
8
|
+
var _util = require("@enact/core/util");
|
|
8
9
|
var _i18n = _interopRequireDefault(require("@enact/i18n"));
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
11
|
var _react = require("react");
|
|
@@ -17,17 +18,18 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
17
18
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
18
19
|
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); }
|
|
19
20
|
var I18nFontDecorator = exports.I18nFontDecorator = (0, _hoc["default"])(function (config, Wrapped) {
|
|
20
|
-
var
|
|
21
|
+
var _I18nDecorator = function I18nDecorator(props) {
|
|
22
|
+
(0, _util.checkPropTypes)(_I18nDecorator, props);
|
|
21
23
|
var ilibLocale = _i18n["default"].getLocale();
|
|
22
24
|
(0, _react.useEffect)(function () {
|
|
23
25
|
(0, _fontGenerator.fontOverrideGenerator)(props.locale || ilibLocale);
|
|
24
26
|
}, [ilibLocale, props.locale]);
|
|
25
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, props));
|
|
26
28
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
_I18nDecorator.displayName = 'I18nFontDecorator';
|
|
30
|
+
_I18nDecorator.propTypes = {
|
|
29
31
|
locale: _propTypes["default"].string
|
|
30
32
|
};
|
|
31
|
-
return
|
|
33
|
+
return _I18nDecorator;
|
|
32
34
|
});
|
|
33
35
|
var _default = exports["default"] = I18nFontDecorator;
|
|
@@ -77,6 +77,13 @@ export interface ThemeDecoratorConfig extends Object {
|
|
|
77
77
|
* Disables use of full screen.
|
|
78
78
|
*/
|
|
79
79
|
disableFullscreen?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* A CSS class name to apply globally to every spottable component when it receives spotlight focus.
|
|
82
|
+
*
|
|
83
|
+
* This is the declarative equivalent of calling `setFocusEffectClass` imperatively. It acts as
|
|
84
|
+
an app-wide default.
|
|
85
|
+
*/
|
|
86
|
+
focusEffectClass?: string;
|
|
80
87
|
/**
|
|
81
88
|
* Enables a floating layer for popup components.
|
|
82
89
|
*
|
|
@@ -117,20 +124,19 @@ applying the decorator.
|
|
|
117
124
|
*/
|
|
118
125
|
spotlight?: boolean;
|
|
119
126
|
}
|
|
120
|
-
export interface ThemeDecoratorProps
|
|
121
|
-
|
|
127
|
+
export interface ThemeDecoratorProps extends Merge<
|
|
128
|
+
Merge<
|
|
122
129
|
Merge<
|
|
123
130
|
Merge<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
ui_resolution_ResolutionDecoratorProps
|
|
127
|
-
>,
|
|
128
|
-
spotlight_SpotlightRootDecorator_SpotlightRootDecoratorProps
|
|
131
|
+
ui_FloatingLayer_FloatingLayerDecoratorProps,
|
|
132
|
+
ui_resolution_ResolutionDecoratorProps
|
|
129
133
|
>,
|
|
130
|
-
|
|
134
|
+
spotlight_SpotlightRootDecorator_SpotlightRootDecoratorProps
|
|
131
135
|
>,
|
|
132
|
-
|
|
133
|
-
|
|
136
|
+
limestone_Skinnable_SkinnableProps
|
|
137
|
+
>,
|
|
138
|
+
AccessibilityDecoratorProps
|
|
139
|
+
> {}
|
|
134
140
|
export function ThemeDecorator<P>(
|
|
135
141
|
config: ThemeDecoratorConfig,
|
|
136
142
|
Component: React.ComponentType<P> | string,
|
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "getLastInputType", {
|
|
|
13
13
|
var _dispatcher = require("@enact/core/dispatcher");
|
|
14
14
|
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
15
15
|
var _keymap = require("@enact/core/keymap");
|
|
16
|
+
var _util = require("@enact/core/util");
|
|
16
17
|
var _I18nDecorator = _interopRequireDefault(require("@enact/i18n/I18nDecorator"));
|
|
17
18
|
var _SpotlightRootDecorator = _interopRequireWildcard(require("@enact/spotlight/SpotlightRootDecorator"));
|
|
18
19
|
var _FloatingLayer = require("@enact/ui/FloatingLayer");
|
|
@@ -69,6 +70,17 @@ var defaultConfig = /** @lends limestone/ThemeDecorator.ThemeDecorator.defaultCo
|
|
|
69
70
|
* @public
|
|
70
71
|
*/
|
|
71
72
|
disableFullscreen: false,
|
|
73
|
+
/**
|
|
74
|
+
* A CSS class name to apply globally to every spottable component when it receives spotlight focus.
|
|
75
|
+
*
|
|
76
|
+
* This is the declarative equivalent of calling `setFocusEffectClass` imperatively. It acts as
|
|
77
|
+
* an app-wide default.
|
|
78
|
+
*
|
|
79
|
+
* @type {String}
|
|
80
|
+
* @default null
|
|
81
|
+
* @public
|
|
82
|
+
*/
|
|
83
|
+
focusEffectClass: null,
|
|
72
84
|
/**
|
|
73
85
|
* Enables a floating layer for popup components.
|
|
74
86
|
*
|
|
@@ -178,15 +190,16 @@ var defaultConfig = /** @lends limestone/ThemeDecorator.ThemeDecorator.defaultCo
|
|
|
178
190
|
*/
|
|
179
191
|
var ThemeDecorator = exports.ThemeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
180
192
|
var accessible = config.accessible,
|
|
181
|
-
|
|
182
|
-
i18n = config.i18n,
|
|
183
|
-
spotlight = config.spotlight,
|
|
193
|
+
disableFullscreen = config.disableFullscreen,
|
|
184
194
|
_float = config["float"],
|
|
195
|
+
focusEffectClass = config.focusEffectClass,
|
|
196
|
+
i18n = config.i18n,
|
|
185
197
|
noAutoFocus = config.noAutoFocus,
|
|
186
198
|
overlay = config.overlay,
|
|
199
|
+
ri = config.ri,
|
|
200
|
+
rootId = config.rootId,
|
|
187
201
|
skin = config.skin,
|
|
188
|
-
|
|
189
|
-
rootId = config.rootId;
|
|
202
|
+
spotlight = config.spotlight;
|
|
190
203
|
|
|
191
204
|
// Apply classes depending on screen type (overlay / fullscreen)
|
|
192
205
|
var bgClassName = (0, _classnames["default"])(_defineProperty({
|
|
@@ -211,6 +224,7 @@ var ThemeDecorator = exports.ThemeDecorator = (0, _hoc["default"])(defaultConfig
|
|
|
211
224
|
}), (0, _I18nFontDecorator["default"])(App));
|
|
212
225
|
}
|
|
213
226
|
if (spotlight) App = (0, _SpotlightRootDecorator["default"])({
|
|
227
|
+
focusEffectClass: focusEffectClass,
|
|
214
228
|
noAutoFocus: noAutoFocus,
|
|
215
229
|
rootId: rootId
|
|
216
230
|
}, App);
|
|
@@ -260,7 +274,8 @@ var ThemeDecorator = exports.ThemeDecorator = (0, _hoc["default"])(defaultConfig
|
|
|
260
274
|
|
|
261
275
|
// set the DOM node ID of the React DOM tree root
|
|
262
276
|
(0, _dispatcher.setDefaultTargetById)(rootId);
|
|
263
|
-
var
|
|
277
|
+
var _Decorator = function Decorator(props) {
|
|
278
|
+
(0, _util.checkPropTypes)(_Decorator, props);
|
|
264
279
|
var skinProp = props.skin,
|
|
265
280
|
rest = _objectWithoutProperties(props, _excluded);
|
|
266
281
|
var skinName = skinProp || 'neutral';
|
|
@@ -292,8 +307,8 @@ var ThemeDecorator = exports.ThemeDecorator = (0, _hoc["default"])(defaultConfig
|
|
|
292
307
|
className: className
|
|
293
308
|
}));
|
|
294
309
|
};
|
|
295
|
-
|
|
296
|
-
|
|
310
|
+
_Decorator.displayName = 'ThemeDecorator';
|
|
311
|
+
_Decorator.propTypes = /** @lends limestone/ThemeDecorator.prototype */{
|
|
297
312
|
/**
|
|
298
313
|
* Assign a skin.
|
|
299
314
|
*
|
|
@@ -302,6 +317,6 @@ var ThemeDecorator = exports.ThemeDecorator = (0, _hoc["default"])(defaultConfig
|
|
|
302
317
|
*/
|
|
303
318
|
skin: _propTypes["default"].string
|
|
304
319
|
};
|
|
305
|
-
return
|
|
320
|
+
return _Decorator;
|
|
306
321
|
});
|
|
307
322
|
var _default = exports["default"] = ThemeDecorator;
|
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
{"name": "qhd", "pxPerRem": 32, "width": 2560, "height": 1440, "aspectRatioName": "hdtv"},
|
|
7
7
|
{"name": "wqhd", "pxPerRem": 32, "width": 3440, "height": 1440, "aspectRatioName": "cinema"},
|
|
8
8
|
{"name": "uhd", "pxPerRem": 48, "width": 3840, "height": 2160, "aspectRatioName": "hdtv", "base": true},
|
|
9
|
+
{"name": "wuhd", "pxPerRem": 48, "width": 5158, "height": 2160, "aspectRatioName": "cinema"},
|
|
9
10
|
{"name": "uhd2", "pxPerRem": 96, "width": 7680, "height": 4320, "aspectRatioName": "hdtv"}
|
|
10
11
|
]
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
:global(.enact-locale-right-to-left) .timePicker .pickers .hourPicker {
|
|
12
12
|
order: 3;
|
|
13
|
-
margin-inline-start:
|
|
13
|
+
margin-inline-start: var(--primitive-spacing-24);
|
|
14
14
|
}
|
|
15
15
|
:global(.enact-locale-right-to-left) .timePicker .pickers .timeSeparator {
|
|
16
16
|
order: 2;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = exports.TimePickerBase = void 0;
|
|
7
7
|
var _kind = _interopRequireDefault(require("@enact/core/kind"));
|
|
8
|
+
var _util = require("@enact/core/util");
|
|
8
9
|
var _react = require("react");
|
|
9
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
11
|
var _$L = _interopRequireDefault(require("../internal/$L"));
|
|
@@ -40,7 +41,8 @@ var hours12 = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '1
|
|
|
40
41
|
* @ui
|
|
41
42
|
* @private
|
|
42
43
|
*/
|
|
43
|
-
var
|
|
44
|
+
var _HourPicker = function HourPicker(props) {
|
|
45
|
+
(0, _util.checkPropTypes)(_HourPicker, props);
|
|
44
46
|
var hasMeridiem = props.hasMeridiem,
|
|
45
47
|
value = props.value,
|
|
46
48
|
rest = _objectWithoutProperties(props, _excluded);
|
|
@@ -63,7 +65,7 @@ var HourPicker = function HourPicker(props) {
|
|
|
63
65
|
children: hours
|
|
64
66
|
}));
|
|
65
67
|
};
|
|
66
|
-
|
|
68
|
+
_HourPicker.propTypes = {
|
|
67
69
|
hasMeridiem: _propTypes["default"].bool,
|
|
68
70
|
value: _propTypes["default"].number
|
|
69
71
|
};
|
|
@@ -314,7 +316,7 @@ var TimePickerBase = exports.TimePickerBase = (0, _kind["default"])({
|
|
|
314
316
|
case 'h':
|
|
315
317
|
case 'k':
|
|
316
318
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.Fragment, {
|
|
317
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
319
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_HourPicker, {
|
|
318
320
|
accessibilityHint: hourAccessibilityHint,
|
|
319
321
|
"aria-label": hourAriaLabel,
|
|
320
322
|
className: _TimePickerModule["default"].hourPicker,
|
|
@@ -30,10 +30,9 @@
|
|
|
30
30
|
.tooltip .tooltipLabel {
|
|
31
31
|
--lime-tooltip-label-width: auto;
|
|
32
32
|
font-family: "Limestone";
|
|
33
|
-
font-size: var(--primitive-font-size-54);
|
|
34
33
|
font-style: normal;
|
|
35
34
|
font-kerning: normal;
|
|
36
|
-
font-size:
|
|
35
|
+
font-size: var(--primitive-font-size-54);
|
|
37
36
|
font-weight: var(--primitive-font-weight-semibold);
|
|
38
37
|
line-height: 1.5rem;
|
|
39
38
|
white-space: nowrap;
|
|
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "useTooltip", {
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
var _hoc = _interopRequireDefault(require("@enact/core/hoc"));
|
|
26
|
+
var _util = require("@enact/core/util");
|
|
26
27
|
var _I18nDecorator = require("@enact/i18n/I18nDecorator");
|
|
27
28
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
28
29
|
var _Tooltip = require("./Tooltip");
|
|
@@ -93,24 +94,28 @@ var defaultConfig = {
|
|
|
93
94
|
var TooltipDecorator = exports.TooltipDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wrapped) {
|
|
94
95
|
var screenEdgeKeepout = config.screenEdgeKeepout,
|
|
95
96
|
tooltipDestinationProp = config.tooltipDestinationProp;
|
|
96
|
-
var
|
|
97
|
+
var _Decorator = function Decorator(props) {
|
|
98
|
+
(0, _util.checkPropTypes)(_Decorator, props);
|
|
97
99
|
var _useTooltip = (0, _useTooltip2.useTooltip)(_objectSpread({
|
|
98
100
|
screenEdgeKeepout: screenEdgeKeepout
|
|
99
101
|
}, props)),
|
|
100
102
|
tooltip = _useTooltip.tooltip,
|
|
101
103
|
handlers = _useTooltip.handlers,
|
|
102
104
|
restProps = _useTooltip.restProps;
|
|
105
|
+
var tooltipRestProps = Object.assign({}, restProps);
|
|
103
106
|
if (tooltip) {
|
|
104
107
|
if (tooltipDestinationProp === 'children') {
|
|
105
|
-
|
|
108
|
+
Object.assign(tooltipRestProps, {
|
|
109
|
+
children: [props.children, tooltip]
|
|
110
|
+
});
|
|
106
111
|
} else {
|
|
107
|
-
|
|
112
|
+
Object.assign(tooltipRestProps, _defineProperty({}, tooltipDestinationProp, tooltip));
|
|
108
113
|
}
|
|
109
114
|
}
|
|
110
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread(_objectSpread({},
|
|
115
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread(_objectSpread({}, tooltipRestProps), handlers));
|
|
111
116
|
};
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
_Decorator.displayName = 'TooltipDecorator';
|
|
118
|
+
_Decorator.propTypes = /** @lends limestone/TooltipDecorator.TooltipDecorator.prototype */{
|
|
114
119
|
/**
|
|
115
120
|
* Disables the component but does not affect tooltip operation.
|
|
116
121
|
*
|
|
@@ -255,6 +260,6 @@ var TooltipDecorator = exports.TooltipDecorator = (0, _hoc["default"])(defaultCo
|
|
|
255
260
|
};
|
|
256
261
|
return (0, _I18nDecorator.I18nContextDecorator)({
|
|
257
262
|
rtlProp: 'rtl'
|
|
258
|
-
},
|
|
263
|
+
}, _Decorator);
|
|
259
264
|
});
|
|
260
265
|
var _default = exports["default"] = TooltipDecorator;
|
|
@@ -30,10 +30,13 @@ describe('useTooltip', function () {
|
|
|
30
30
|
tooltip = _useTooltip.tooltip,
|
|
31
31
|
handlers = _useTooltip.handlers,
|
|
32
32
|
restProps = _useTooltip.restProps;
|
|
33
|
+
var tooltipRestProps = Object.assign({}, restProps);
|
|
33
34
|
if (tooltip) {
|
|
34
|
-
|
|
35
|
+
Object.assign(tooltipRestProps, {
|
|
36
|
+
children: [children, tooltip]
|
|
37
|
+
});
|
|
35
38
|
}
|
|
36
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], _objectSpread(_objectSpread({},
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button["default"], _objectSpread(_objectSpread({}, tooltipRestProps), handlers));
|
|
37
40
|
};
|
|
38
41
|
describe('Tooltip', function () {
|
|
39
42
|
beforeEach(function () {
|