@enact/ui 5.0.0-alpha.2 → 5.0.0-alpha.4
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/AnnounceDecorator/tests/Announce-specs.js +2 -2
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +2 -2
- package/AnnounceDecorator/tests/useAnnounce-specs.js +3 -3
- package/BodyText/tests/BodyText-specs.js +6 -6
- package/Button/tests/Button-specs.js +10 -10
- package/CHANGELOG.md +28 -1
- package/Cancelable/Cancelable.d.ts +1 -1
- package/Cancelable/Cancelable.js +2 -2
- package/Cancelable/cancelHandler.js +1 -1
- package/Cancelable/tests/Cancelable-specs.js +17 -17
- package/Changeable/tests/Changeable-specs.js +25 -25
- package/ComponentOverride/ComponentOverride.js +1 -1
- package/FloatingLayer/FloatingLayer.js +2 -2
- package/FloatingLayer/FloatingLayerDecorator.js +1 -1
- package/FloatingLayer/tests/FloatingLayer-specs.js +7 -7
- package/FloatingLayer/tests/Scrim-specs.js +2 -2
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +3 -3
- package/Group/tests/Group-specs.js +11 -11
- package/Heading/Heading.d.ts +1 -1
- package/Heading/Heading.js +1 -1
- package/Heading/tests/Heading-specs.js +14 -14
- package/Icon/tests/Icon-specs.js +9 -9
- package/Image/tests/Image-specs.js +5 -5
- package/ImageItem/tests/ImageItem-specs.js +11 -11
- package/Item/tests/Item-specs.js +7 -7
- package/LabeledIcon/LabeledIcon.js +1 -1
- package/LabeledIcon/tests/LabeledIcon-specs.js +4 -4
- package/Layout/Cell.js +2 -2
- package/Layout/Layout.d.ts +1 -1
- package/Layout/Layout.js +2 -2
- package/Layout/tests/Layout-specs.js +10 -10
- package/Marquee/MarqueeController.js +1 -1
- package/Marquee/MarqueeDecorator.js +1 -1
- package/Marquee/tests/Marquee-specs.js +44 -44
- package/Measurable/tests/Measurable-specs.js +3 -3
- package/Media/Media.js +1 -1
- package/Media/tests/Media-specs.js +12 -12
- package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +1 -1
- package/Placeholder/tests/PlaceholderDecorator-specs.js +1 -1
- package/ProgressBar/tests/ProgressBar-specs.js +7 -7
- package/Repeater/Repeater.d.ts +1 -1
- package/Repeater/Repeater.js +1 -1
- package/Repeater/tests/Repeater-specs.js +14 -14
- package/Resizable/tests/Resizable-specs.js +1 -1
- package/Resizable/tests/useResize-specs.js +1 -1
- package/Routable/Router.js +1 -1
- package/Routable/tests/Routable-specs.js +1 -1
- package/Routable/tests/Router-specs.js +10 -10
- package/Routable/util.js +3 -3
- package/Scroller/tests/Scroller-specs.js +3 -3
- package/Skinnable/Skinnable.js +2 -2
- package/Skinnable/tests/Skinnable-specs.js +19 -19
- package/Skinnable/tests/useSkins-specs.js +14 -14
- package/Skinnable/util.js +1 -1
- package/Slider/Knob.js +1 -1
- package/Slider/Slider.d.ts +4 -4
- package/Slider/Slider.js +3 -3
- package/Slider/tests/Slider-specs.js +7 -7
- package/Slottable/tests/Slottable-specs.js +10 -10
- package/Slottable/tests/useSlots-specs.js +10 -10
- package/Slottable/useSlots.js +2 -2
- package/Spinner/tests/Spinner-specs.js +5 -5
- package/ToggleIcon/tests/ToggleIcon-specs.js +5 -5
- package/Toggleable/tests/Toggleable-specs.js +41 -41
- package/Touchable/ClickAllow.js +1 -1
- package/Touchable/config.js +1 -1
- package/Touchable/tests/Touchable-specs.js +36 -36
- package/Touchable/tests/useTouch-specs.js +15 -15
- package/Transition/Transition.d.ts +3 -3
- package/Transition/Transition.js +5 -5
- package/Transition/tests/Transition-specs.js +13 -13
- package/ViewManager/Arranger.js +3 -3
- package/ViewManager/ViewManager.d.ts +3 -3
- package/ViewManager/tests/View-specs.js +13 -13
- package/ViewManager/tests/ViewManager-specs.js +50 -50
- package/VirtualList/VirtualListBasic.js +1 -6
- package/VirtualList/tests/VirtualGridList-native-specs.js +6 -6
- package/VirtualList/tests/VirtualGridList-specs.js +23 -23
- package/VirtualList/tests/VirtualList-native-specs.js +7 -7
- package/VirtualList/tests/VirtualList-specs.js +29 -29
- package/internal/IdProvider/tests/IdProvider-specs.js +2 -2
- package/internal/IdProvider/tests/useId-specs.js +6 -6
- package/internal/Pure/tests/Pure-specs.js +5 -5
- package/package.json +6 -6
- package/resolution/index.d.ts +1 -1
- package/resolution/resolution.js +1 -1
- package/resolution/tests/ResolutionDecorator-specs.js +2 -2
- package/styles/mixins.less +3 -5
- package/useControlledState/tests/useControlledState-specs.js +10 -10
- package/useScroll/ScrollAnimator.js +3 -3
- package/useScroll/useScroll.js +3 -0
|
@@ -19,7 +19,7 @@ var iconComponent = function iconComponent(_ref) {
|
|
|
19
19
|
};
|
|
20
20
|
describe('LabeledIcon Specs', function () {
|
|
21
21
|
test('should insert the icon source into the icon when using the prop approach', function () {
|
|
22
|
-
(0, _react.render)(
|
|
22
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
|
|
23
23
|
icon: iconName,
|
|
24
24
|
iconComponent: iconComponent,
|
|
25
25
|
children: iconLabel
|
|
@@ -30,7 +30,7 @@ describe('LabeledIcon Specs', function () {
|
|
|
30
30
|
expect(icon.textContent).toBe(expected);
|
|
31
31
|
});
|
|
32
32
|
test('should insert the icon source into the icon slot element', function () {
|
|
33
|
-
(0, _react.render)(
|
|
33
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_LabeledIcon["default"], {
|
|
34
34
|
iconComponent: iconComponent,
|
|
35
35
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("icon", {
|
|
36
36
|
children: iconName
|
|
@@ -42,7 +42,7 @@ describe('LabeledIcon Specs', function () {
|
|
|
42
42
|
expect(icon.textContent).toBe(expected);
|
|
43
43
|
});
|
|
44
44
|
test('should insert custom icon components into the icon slot', function () {
|
|
45
|
-
(0, _react.render)(
|
|
45
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_LabeledIcon["default"], {
|
|
46
46
|
iconComponent: iconComponent,
|
|
47
47
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("icon", {
|
|
48
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon["default"], {
|
|
@@ -56,7 +56,7 @@ describe('LabeledIcon Specs', function () {
|
|
|
56
56
|
});
|
|
57
57
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
58
58
|
var ref = jest.fn();
|
|
59
|
-
(0, _react.render)(
|
|
59
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_LabeledIcon["default"], {
|
|
60
60
|
icon: iconName,
|
|
61
61
|
iconComponent: iconComponent,
|
|
62
62
|
ref: ref
|
package/Layout/Cell.js
CHANGED
|
@@ -122,7 +122,7 @@ var CellBase = exports.CellBase = (0, _kind["default"])({
|
|
|
122
122
|
* the maximum size, shrinking as necessary, to fit the content.
|
|
123
123
|
*
|
|
124
124
|
* When used in conjunction with {@link ui/Layout.CellBase.grow|grow}, the size will be the
|
|
125
|
-
*
|
|
125
|
+
* minimum size, growing as necessary, to fit the container.
|
|
126
126
|
*
|
|
127
127
|
* E.g.
|
|
128
128
|
* * `size="400px"` -> cell will be 400px, regardless of the dimensions of your content
|
|
@@ -179,7 +179,7 @@ var CellBase = exports.CellBase = (0, _kind["default"])({
|
|
|
179
179
|
return _objectSpread(_objectSpread({}, _style), {}, {
|
|
180
180
|
alignSelf: toFlexAlign(align),
|
|
181
181
|
flexBasis: shrink ? null : size,
|
|
182
|
-
// Setting 100% below in the presence of `shrink`` and
|
|
182
|
+
// Setting 100% below in the presence of `shrink`` and absence of `size` prevents overflow
|
|
183
183
|
'--cell-size': cellSize
|
|
184
184
|
});
|
|
185
185
|
}
|
package/Layout/Layout.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ for more details.
|
|
|
69
69
|
the maximum size, shrinking as necessary, to fit the content.
|
|
70
70
|
*
|
|
71
71
|
* When used in conjunction with , the size will be the
|
|
72
|
-
|
|
72
|
+
minimum size, growing as necessary, to fit the container.
|
|
73
73
|
*
|
|
74
74
|
* E.g.
|
|
75
75
|
* * `size="400px"` -> cell will be 400px, regardless of the dimensions of your content
|
package/Layout/Layout.js
CHANGED
|
@@ -41,7 +41,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
41
41
|
* A convenient tool for laying-out content using `Layout`, `Cell`, `Row`, and `Column`.
|
|
42
42
|
*
|
|
43
43
|
* Layout is a powerful and versatile tool used for arranging content on the screen. On a conceptual
|
|
44
|
-
* level, it mixes the best parts of HTML tables
|
|
44
|
+
* level, it mixes the best parts of HTML tables with the best parts of HTML framesets, both of
|
|
45
45
|
* which were largely abandoned for their drawbacks, ignoring their strengths. A `Layout` is simply
|
|
46
46
|
* a container for `Cell`, the only "legal" child. Conversely, `Cell` may only be used in a
|
|
47
47
|
* `Layout`. Cells in a Layout can either be positioned next to each other (horizontally) or
|
|
@@ -50,7 +50,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
|
50
50
|
*
|
|
51
51
|
* The `Row` and `Column` layout presets describe the direction of layout for their children. This
|
|
52
52
|
* can sometimes cause confusion. A `Row` of children naturally forms a _layout_ whose children can
|
|
53
|
-
* have the _appearance_ of columns. To keep things clear, think about the layout rather than
|
|
53
|
+
* have the _appearance_ of columns. To keep things clear, think about the layout rather than
|
|
54
54
|
* what the children themselves represent.
|
|
55
55
|
*
|
|
56
56
|
* `Layout` is an implementation of flex-box, but with built-in rails, properties, and features to
|
|
@@ -24,7 +24,7 @@ describe('Layout Specs', function () {
|
|
|
24
24
|
value = _ref2[0],
|
|
25
25
|
resolved = _ref2[1];
|
|
26
26
|
test("should apply '".concat(resolved, "' style value given an align prop value of \"").concat(value, "\""), function () {
|
|
27
|
-
(0, _react.render)(
|
|
27
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
|
|
28
28
|
align: value,
|
|
29
29
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
30
30
|
children: "Body"
|
|
@@ -38,7 +38,7 @@ describe('Layout Specs', function () {
|
|
|
38
38
|
});
|
|
39
39
|
});
|
|
40
40
|
test('should apply a class for inline', function () {
|
|
41
|
-
(0, _react.render)(
|
|
41
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
|
|
42
42
|
inline: true,
|
|
43
43
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
44
44
|
children: "Body"
|
|
@@ -58,7 +58,7 @@ describe('Layout Specs', function () {
|
|
|
58
58
|
vals.forEach(function (value) {
|
|
59
59
|
test("should apply classes for ".concat(prop), function () {
|
|
60
60
|
var propValue = _defineProperty({}, prop, value);
|
|
61
|
-
(0, _react.render)(
|
|
61
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], _objectSpread(_objectSpread({}, propValue), {}, {
|
|
62
62
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
63
63
|
children: "Body"
|
|
64
64
|
})
|
|
@@ -75,7 +75,7 @@ describe('Layout Specs', function () {
|
|
|
75
75
|
cellBooleanPropClasses.forEach(function (prop) {
|
|
76
76
|
test("should apply a class for ".concat(prop), function () {
|
|
77
77
|
var props = _defineProperty({}, prop, true);
|
|
78
|
-
(0, _react.render)(
|
|
78
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, _objectSpread(_objectSpread({}, props), {}, {
|
|
79
79
|
children: "Body"
|
|
80
80
|
})));
|
|
81
81
|
var layout = _react.screen.getByText('Body');
|
|
@@ -91,7 +91,7 @@ describe('Layout Specs', function () {
|
|
|
91
91
|
vals.forEach(function (value) {
|
|
92
92
|
test("should apply flexBasis styles the size prop value ".concat(value), function () {
|
|
93
93
|
var propValue = _defineProperty({}, prop, value);
|
|
94
|
-
(0, _react.render)(
|
|
94
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
|
|
95
95
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, _objectSpread(_objectSpread({}, propValue), {}, {
|
|
96
96
|
children: "Body"
|
|
97
97
|
}))
|
|
@@ -105,7 +105,7 @@ describe('Layout Specs', function () {
|
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
107
|
test('should apply a class for grow', function () {
|
|
108
|
-
(0, _react.render)(
|
|
108
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
109
109
|
children: "Body"
|
|
110
110
|
}));
|
|
111
111
|
var cell = _react.screen.getByText('Body');
|
|
@@ -113,7 +113,7 @@ describe('Layout Specs', function () {
|
|
|
113
113
|
expect(cell).toHaveClass(expected);
|
|
114
114
|
});
|
|
115
115
|
test('should apply classes for grow and size and flexBasis styles the size prop value 100px', function () {
|
|
116
|
-
(0, _react.render)(
|
|
116
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
|
|
117
117
|
style: {
|
|
118
118
|
width: "300px"
|
|
119
119
|
},
|
|
@@ -134,7 +134,7 @@ describe('Layout Specs', function () {
|
|
|
134
134
|
});
|
|
135
135
|
});
|
|
136
136
|
test('should not be apply a class for grow when using shrink', function () {
|
|
137
|
-
(0, _react.render)(
|
|
137
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
138
138
|
grow: true,
|
|
139
139
|
shrink: true,
|
|
140
140
|
children: "Body"
|
|
@@ -145,7 +145,7 @@ describe('Layout Specs', function () {
|
|
|
145
145
|
});
|
|
146
146
|
test('should return a DOM node reference for `componentRef` on `Layout`', function () {
|
|
147
147
|
var ref = jest.fn();
|
|
148
|
-
(0, _react.render)(
|
|
148
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
|
|
149
149
|
ref: ref
|
|
150
150
|
}));
|
|
151
151
|
var expected = 'DIV';
|
|
@@ -154,7 +154,7 @@ describe('Layout Specs', function () {
|
|
|
154
154
|
});
|
|
155
155
|
test('should return a DOM node reference for `componentRef` on `Cell`', function () {
|
|
156
156
|
var ref = jest.fn();
|
|
157
|
-
(0, _react.render)(
|
|
157
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
|
|
158
158
|
ref: ref
|
|
159
159
|
}));
|
|
160
160
|
var expected = 'DIV';
|
|
@@ -60,7 +60,7 @@ var MarqueeController = exports.MarqueeController = (0, _hoc["default"])(default
|
|
|
60
60
|
onFocus: handleFocus
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
return provideMarqueeControllerContext(
|
|
63
|
+
return provideMarqueeControllerContext(/*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, wrappedProps)));
|
|
64
64
|
};
|
|
65
65
|
});
|
|
66
66
|
var _default = exports["default"] = MarqueeController;
|
|
@@ -721,7 +721,7 @@ var MarqueeDecorator = exports.MarqueeDecorator = (0, _hoc["default"])(defaultCo
|
|
|
721
721
|
* Calculates if the marquee should animate
|
|
722
722
|
*
|
|
723
723
|
* @param {Number} distance Amount of overflow in pixels
|
|
724
|
-
* @returns {Boolean} `true` if it should
|
|
724
|
+
* @returns {Boolean} `true` if it should animate
|
|
725
725
|
*/
|
|
726
726
|
}, {
|
|
727
727
|
key: "shouldAnimate",
|
|
@@ -50,7 +50,7 @@ afterEach(function () {
|
|
|
50
50
|
});
|
|
51
51
|
describe('Marquee', function () {
|
|
52
52
|
test('should determine the correct directionality of latin text on initial render', function () {
|
|
53
|
-
(0, _react.render)(
|
|
53
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
54
54
|
children: ltrText
|
|
55
55
|
}));
|
|
56
56
|
var marquee = _react.screen.getByText(ltrText);
|
|
@@ -60,7 +60,7 @@ describe('Marquee', function () {
|
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
test('should determine the correct directionality of non-latin text on initial render', function () {
|
|
63
|
-
(0, _react.render)(
|
|
63
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
64
64
|
children: rtlText
|
|
65
65
|
}));
|
|
66
66
|
var marquee = _react.screen.getByText(rtlText);
|
|
@@ -70,7 +70,7 @@ describe('Marquee', function () {
|
|
|
70
70
|
});
|
|
71
71
|
});
|
|
72
72
|
test('should force the directionality text if forceDirection is specified', function () {
|
|
73
|
-
(0, _react.render)(
|
|
73
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
74
74
|
forceDirection: "ltr",
|
|
75
75
|
children: rtlText
|
|
76
76
|
}));
|
|
@@ -81,12 +81,12 @@ describe('Marquee', function () {
|
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
83
|
test('should switch directionality when the text content changes after initial render', function () {
|
|
84
|
-
var _render = (0, _react.render)(
|
|
84
|
+
var _render = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
85
85
|
children: ltrText
|
|
86
86
|
})),
|
|
87
87
|
rerender = _render.rerender;
|
|
88
88
|
var marquee = _react.screen.getByText(ltrText);
|
|
89
|
-
rerender(
|
|
89
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
90
90
|
children: rtlText
|
|
91
91
|
}));
|
|
92
92
|
var expected = 'rtl';
|
|
@@ -95,13 +95,13 @@ describe('Marquee', function () {
|
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
97
|
test('should not switch directionality when the text content changes after initial render and the forceDirection property was already set', function () {
|
|
98
|
-
var _render2 = (0, _react.render)(
|
|
98
|
+
var _render2 = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
99
99
|
forceDirection: "ltr",
|
|
100
100
|
children: ltrText
|
|
101
101
|
})),
|
|
102
102
|
rerender = _render2.rerender;
|
|
103
103
|
var marquee = _react.screen.getByText(ltrText);
|
|
104
|
-
rerender(
|
|
104
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
105
105
|
forceDirection: "ltr",
|
|
106
106
|
children: rtlText
|
|
107
107
|
}));
|
|
@@ -111,7 +111,7 @@ describe('Marquee', function () {
|
|
|
111
111
|
});
|
|
112
112
|
});
|
|
113
113
|
test('should override direction to RTL when forceDirection is set and locale is LTR', function () {
|
|
114
|
-
(0, _react.render)(
|
|
114
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
115
115
|
"data-testid": "marquee",
|
|
116
116
|
forceDirection: "rtl",
|
|
117
117
|
locale: "ltr"
|
|
@@ -123,7 +123,7 @@ describe('Marquee', function () {
|
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
test('should not override direction to RTL when forceDirection is "locale" and locale is LTR', function () {
|
|
126
|
-
var _render3 = (0, _react.render)(
|
|
126
|
+
var _render3 = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
127
127
|
forceDirection: "locale",
|
|
128
128
|
children: ltrText
|
|
129
129
|
})),
|
|
@@ -133,7 +133,7 @@ describe('Marquee', function () {
|
|
|
133
133
|
expect(marquee).toHaveStyle({
|
|
134
134
|
'direction': expected
|
|
135
135
|
});
|
|
136
|
-
rerender(
|
|
136
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
137
137
|
forceDirection: "locale",
|
|
138
138
|
children: rtlText
|
|
139
139
|
}));
|
|
@@ -142,7 +142,7 @@ describe('Marquee', function () {
|
|
|
142
142
|
});
|
|
143
143
|
});
|
|
144
144
|
test('should override direction to LTR when forceDirection is set and locale is RTL', function () {
|
|
145
|
-
(0, _react.render)(
|
|
145
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
146
146
|
"data-testid": "marquee",
|
|
147
147
|
forceDirection: "ltr",
|
|
148
148
|
locale: "rtl"
|
|
@@ -154,7 +154,7 @@ describe('Marquee', function () {
|
|
|
154
154
|
});
|
|
155
155
|
});
|
|
156
156
|
test('should have direction of RTL when forceDirection is RTL and locale is RTL', function () {
|
|
157
|
-
(0, _react.render)(
|
|
157
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
158
158
|
"data-testid": "marquee",
|
|
159
159
|
forceDirection: "rtl",
|
|
160
160
|
locale: "rtl"
|
|
@@ -166,7 +166,7 @@ describe('Marquee', function () {
|
|
|
166
166
|
});
|
|
167
167
|
});
|
|
168
168
|
test('should have direction of LTR when forceDirection is LTR and locale is LTR', function () {
|
|
169
|
-
(0, _react.render)(
|
|
169
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
170
170
|
"data-testid": "marquee",
|
|
171
171
|
forceDirection: "ltr",
|
|
172
172
|
locale: "ltr"
|
|
@@ -178,7 +178,7 @@ describe('Marquee', function () {
|
|
|
178
178
|
});
|
|
179
179
|
});
|
|
180
180
|
test('should convert percentage values of marqueeSpacing to absolute values', function (done) {
|
|
181
|
-
(0, _react.render)(
|
|
181
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
182
182
|
"data-testid": "marquee",
|
|
183
183
|
marqueeOn: "render",
|
|
184
184
|
marqueeOnRenderDelay: 10,
|
|
@@ -195,7 +195,7 @@ describe('Marquee', function () {
|
|
|
195
195
|
done();
|
|
196
196
|
});
|
|
197
197
|
test('should pass absolute values of marqueeSpacing', function (done) {
|
|
198
|
-
(0, _react.render)(
|
|
198
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
199
199
|
"data-testid": "marquee",
|
|
200
200
|
marqueeOn: "render",
|
|
201
201
|
marqueeOnRenderDelay: 10,
|
|
@@ -213,7 +213,7 @@ describe('Marquee', function () {
|
|
|
213
213
|
});
|
|
214
214
|
test('should warn when marquees are nested', function () {
|
|
215
215
|
var spy = jest.spyOn(console, 'error').mockImplementation(function () {});
|
|
216
|
-
(0, _react.render)(
|
|
216
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
217
217
|
marqueeOn: "render",
|
|
218
218
|
marqueeOnRenderDelay: 10,
|
|
219
219
|
marqueeSpacing: 80,
|
|
@@ -229,7 +229,7 @@ describe('Marquee', function () {
|
|
|
229
229
|
expect(spy).toHaveBeenCalled();
|
|
230
230
|
});
|
|
231
231
|
test('should not animate when marquee is disabled', function () {
|
|
232
|
-
(0, _react.render)(
|
|
232
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
233
233
|
marqueeDisabled: true,
|
|
234
234
|
children: ltrText
|
|
235
235
|
}));
|
|
@@ -238,7 +238,7 @@ describe('Marquee', function () {
|
|
|
238
238
|
expect(marquee).not.toHaveClass(expected);
|
|
239
239
|
});
|
|
240
240
|
test('should start marquee on focus if `marqueeOn` is focus', function () {
|
|
241
|
-
(0, _react.render)(
|
|
241
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
242
242
|
marqueeOn: "focus",
|
|
243
243
|
marqueeDelay: 10,
|
|
244
244
|
children: ltrText
|
|
@@ -253,7 +253,7 @@ describe('Marquee', function () {
|
|
|
253
253
|
});
|
|
254
254
|
});
|
|
255
255
|
test('should start marquee on hover if `marqueeOn` is hover', function () {
|
|
256
|
-
(0, _react.render)(
|
|
256
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
257
257
|
marqueeOn: "hover",
|
|
258
258
|
marqueeDelay: 10,
|
|
259
259
|
children: ltrText
|
|
@@ -269,7 +269,7 @@ describe('Marquee', function () {
|
|
|
269
269
|
});
|
|
270
270
|
test('should forward `blur` event', function () {
|
|
271
271
|
var spy = jest.fn();
|
|
272
|
-
(0, _react.render)(
|
|
272
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
273
273
|
marqueeOn: "focus",
|
|
274
274
|
marqueeDelay: 10,
|
|
275
275
|
onBlur: spy,
|
|
@@ -285,7 +285,7 @@ describe('Marquee', function () {
|
|
|
285
285
|
});
|
|
286
286
|
test('should forward `mouseleave` event', function () {
|
|
287
287
|
var spy = jest.fn();
|
|
288
|
-
(0, _react.render)(
|
|
288
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
289
289
|
marqueeOn: "hover",
|
|
290
290
|
marqueeDelay: 10,
|
|
291
291
|
onMouseLeave: spy,
|
|
@@ -308,7 +308,7 @@ describe('Marquee', function () {
|
|
|
308
308
|
disconnect: jest.fn()
|
|
309
309
|
};
|
|
310
310
|
});
|
|
311
|
-
(0, _react.render)(
|
|
311
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
312
312
|
children: ltrText
|
|
313
313
|
}));
|
|
314
314
|
(0, _react.act)(function () {
|
|
@@ -322,7 +322,7 @@ describe('Marquee', function () {
|
|
|
322
322
|
describe('MarqueeBase', function () {
|
|
323
323
|
// Computed Property Tests
|
|
324
324
|
test('should not include the animate class when animating is false', function () {
|
|
325
|
-
(0, _react.render)(
|
|
325
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
326
326
|
"data-testid": "marquee"
|
|
327
327
|
}));
|
|
328
328
|
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
@@ -330,7 +330,7 @@ describe('MarqueeBase', function () {
|
|
|
330
330
|
expect(marquee).not.toHaveClass(expected);
|
|
331
331
|
});
|
|
332
332
|
test('should include the animate class when animating is true', function () {
|
|
333
|
-
(0, _react.render)(
|
|
333
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
334
334
|
animating: true,
|
|
335
335
|
"data-testid": "marquee"
|
|
336
336
|
}));
|
|
@@ -339,7 +339,7 @@ describe('MarqueeBase', function () {
|
|
|
339
339
|
expect(marquee).toHaveClass(expected);
|
|
340
340
|
});
|
|
341
341
|
test('should not transition when animating is false', function () {
|
|
342
|
-
(0, _react.render)(
|
|
342
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
343
343
|
"data-testid": "marquee"
|
|
344
344
|
}));
|
|
345
345
|
var marquee = _react.screen.getByTestId('marquee').children.item(0);
|
|
@@ -348,7 +348,7 @@ describe('MarqueeBase', function () {
|
|
|
348
348
|
});
|
|
349
349
|
});
|
|
350
350
|
test('should transition when animating is true', function () {
|
|
351
|
-
(0, _react.render)(
|
|
351
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
352
352
|
animating: true,
|
|
353
353
|
"data-testid": "marquee"
|
|
354
354
|
}));
|
|
@@ -358,7 +358,7 @@ describe('MarqueeBase', function () {
|
|
|
358
358
|
});
|
|
359
359
|
});
|
|
360
360
|
test('should set RTL direction in LTR context when the text directionality is RTL', function () {
|
|
361
|
-
(0, _react.render)(
|
|
361
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
362
362
|
"data-testid": "marquee",
|
|
363
363
|
rtl: true
|
|
364
364
|
}), {
|
|
@@ -373,7 +373,7 @@ describe('MarqueeBase', function () {
|
|
|
373
373
|
});
|
|
374
374
|
});
|
|
375
375
|
test('should set LTR direction in RTL when the text directionality is LTR', function () {
|
|
376
|
-
(0, _react.render)(
|
|
376
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
377
377
|
"data-testid": "marquee"
|
|
378
378
|
}), {
|
|
379
379
|
context: {
|
|
@@ -387,7 +387,7 @@ describe('MarqueeBase', function () {
|
|
|
387
387
|
});
|
|
388
388
|
});
|
|
389
389
|
test('should transition from the right with LTR text (a negative translate value)', function () {
|
|
390
|
-
(0, _react.render)(
|
|
390
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
391
391
|
animating: true,
|
|
392
392
|
"data-testid": "marquee",
|
|
393
393
|
distance: 100
|
|
@@ -399,7 +399,7 @@ describe('MarqueeBase', function () {
|
|
|
399
399
|
});
|
|
400
400
|
});
|
|
401
401
|
test('should transition from the left with RTL text (a positive translate value)', function () {
|
|
402
|
-
(0, _react.render)(
|
|
402
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
403
403
|
animating: true,
|
|
404
404
|
"data-testid": "marquee",
|
|
405
405
|
distance: 100,
|
|
@@ -412,7 +412,7 @@ describe('MarqueeBase', function () {
|
|
|
412
412
|
});
|
|
413
413
|
});
|
|
414
414
|
test('should duplicate from content when promoted and a non-zero distance', function () {
|
|
415
|
-
(0, _react.render)(
|
|
415
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
416
416
|
"data-testid": "marquee",
|
|
417
417
|
distance: 100,
|
|
418
418
|
willAnimate: true,
|
|
@@ -422,7 +422,7 @@ describe('MarqueeBase', function () {
|
|
|
422
422
|
expect(marquee).toHaveTextContent('TextText');
|
|
423
423
|
});
|
|
424
424
|
test('should not duplicate from content when promoted and a zero distance', function () {
|
|
425
|
-
(0, _react.render)(
|
|
425
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
426
426
|
distance: 0,
|
|
427
427
|
willAnimate: true,
|
|
428
428
|
children: "Text"
|
|
@@ -431,7 +431,7 @@ describe('MarqueeBase', function () {
|
|
|
431
431
|
expect(marquee).toBeInTheDocument();
|
|
432
432
|
});
|
|
433
433
|
test('should not duplicate from content when not promoted and a non-zero distance', function () {
|
|
434
|
-
(0, _react.render)(
|
|
434
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
435
435
|
distance: 100,
|
|
436
436
|
children: "Text"
|
|
437
437
|
}));
|
|
@@ -440,7 +440,7 @@ describe('MarqueeBase', function () {
|
|
|
440
440
|
});
|
|
441
441
|
test('should add aria-label with content when promoted and a non-zero distance', function () {
|
|
442
442
|
var text = 'Text';
|
|
443
|
-
(0, _react.render)(
|
|
443
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
444
444
|
"data-testid": "marquee",
|
|
445
445
|
distance: 100,
|
|
446
446
|
willAnimate: true,
|
|
@@ -452,7 +452,7 @@ describe('MarqueeBase', function () {
|
|
|
452
452
|
});
|
|
453
453
|
test('should not override aria-label with content when promoted and a non-zero distance', function () {
|
|
454
454
|
var aria = 'Custom';
|
|
455
|
-
(0, _react.render)(
|
|
455
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
456
456
|
"aria-label": aria,
|
|
457
457
|
"data-testid": "marquee",
|
|
458
458
|
distance: 100,
|
|
@@ -464,7 +464,7 @@ describe('MarqueeBase', function () {
|
|
|
464
464
|
expect(marquee).toHaveAttribute('aria-label', expected);
|
|
465
465
|
});
|
|
466
466
|
test('should concatenate string children when promoted and a non-zero distance', function () {
|
|
467
|
-
(0, _react.render)(
|
|
467
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_index.MarqueeBase, {
|
|
468
468
|
"data-testid": "marquee",
|
|
469
469
|
distance: 100,
|
|
470
470
|
willAnimate: true,
|
|
@@ -475,7 +475,7 @@ describe('MarqueeBase', function () {
|
|
|
475
475
|
expect(marquee).toHaveAttribute('aria-label', expected);
|
|
476
476
|
});
|
|
477
477
|
test('should not concatenate non-string children when promoted and a non-zero distance', function () {
|
|
478
|
-
(0, _react.render)(
|
|
478
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_index.MarqueeBase, {
|
|
479
479
|
"data-testid": "marquee",
|
|
480
480
|
distance: 100,
|
|
481
481
|
willAnimate: true,
|
|
@@ -489,7 +489,7 @@ describe('MarqueeBase', function () {
|
|
|
489
489
|
});
|
|
490
490
|
test('should not throw exception for null children when promoted and a non-zero distance - ENYO-6362', function () {
|
|
491
491
|
var renderSubject = function renderSubject() {
|
|
492
|
-
return (0, _react.render)(
|
|
492
|
+
return (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.MarqueeBase, {
|
|
493
493
|
distance: 100,
|
|
494
494
|
willAnimate: true,
|
|
495
495
|
children: null
|
|
@@ -500,7 +500,7 @@ describe('MarqueeBase', function () {
|
|
|
500
500
|
});
|
|
501
501
|
describe('MarqueeController', function () {
|
|
502
502
|
test('should start marquee on all children on render if `marqueeOn` is render', function () {
|
|
503
|
-
(0, _react.render)(
|
|
503
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Controller, {
|
|
504
504
|
children: ltrArray.map(function (children, index) {
|
|
505
505
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
506
506
|
marqueeDelay: 10,
|
|
@@ -523,7 +523,7 @@ describe('MarqueeController', function () {
|
|
|
523
523
|
});
|
|
524
524
|
});
|
|
525
525
|
test('should start marquee on all children when one is focused and `marqueeOn` is focus', function () {
|
|
526
|
-
(0, _react.render)(
|
|
526
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Controller, {
|
|
527
527
|
children: ltrArray.map(function (children, index) {
|
|
528
528
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
529
529
|
marqueeDelay: 10,
|
|
@@ -549,7 +549,7 @@ describe('MarqueeController', function () {
|
|
|
549
549
|
});
|
|
550
550
|
});
|
|
551
551
|
test('should start marquee on all children when one is hovered and `marqueeOn` is hover', function () {
|
|
552
|
-
(0, _react.render)(
|
|
552
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Controller, {
|
|
553
553
|
children: ltrArray.map(function (children, index) {
|
|
554
554
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
555
555
|
marqueeDelay: 10,
|
|
@@ -576,7 +576,7 @@ describe('MarqueeController', function () {
|
|
|
576
576
|
});
|
|
577
577
|
test('should forward `blur` event when one of the children is blurred and `marqueeOn` is focus', function () {
|
|
578
578
|
var spy = jest.fn();
|
|
579
|
-
(0, _react.render)(
|
|
579
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Controller, {
|
|
580
580
|
onBlur: spy,
|
|
581
581
|
children: ltrArray.map(function (children, index) {
|
|
582
582
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
@@ -596,7 +596,7 @@ describe('MarqueeController', function () {
|
|
|
596
596
|
});
|
|
597
597
|
test('should forward `mouseleave` event when one of the children is unhovered and `marqueeOn` is hover', function () {
|
|
598
598
|
var spy = jest.fn();
|
|
599
|
-
(0, _react.render)(
|
|
599
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Controller, {
|
|
600
600
|
onMouseLeave: spy,
|
|
601
601
|
children: ltrArray.map(function (children, index) {
|
|
602
602
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
@@ -615,7 +615,7 @@ describe('MarqueeController', function () {
|
|
|
615
615
|
expect(spy).toHaveBeenCalledTimes(2);
|
|
616
616
|
});
|
|
617
617
|
test('should set a minimum value for reset delay when `marqueeDelay` is less than 40', function () {
|
|
618
|
-
(0, _react.render)(
|
|
618
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Controller, {
|
|
619
619
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Marquee, {
|
|
620
620
|
marqueeDelay: 0,
|
|
621
621
|
marqueeOn: "render",
|
|
@@ -60,7 +60,7 @@ describe('Measurable', function () {
|
|
|
60
60
|
value: function disconnect() {}
|
|
61
61
|
}]);
|
|
62
62
|
}();
|
|
63
|
-
(0, _react.render)(
|
|
63
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(MeasurableComponent, {}));
|
|
64
64
|
(0, _react.act)(function () {
|
|
65
65
|
listener([{
|
|
66
66
|
target: {
|
|
@@ -89,7 +89,7 @@ describe('Measurable', function () {
|
|
|
89
89
|
value: function observe() {}
|
|
90
90
|
}]);
|
|
91
91
|
}();
|
|
92
|
-
(0, _react.render)(
|
|
92
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(MeasurableComponent, {}));
|
|
93
93
|
(0, _react.act)(function () {
|
|
94
94
|
listener([{
|
|
95
95
|
addedNodes: [],
|
|
@@ -109,7 +109,7 @@ describe('Measurable', function () {
|
|
|
109
109
|
});
|
|
110
110
|
describe('useMeasurable', function () {
|
|
111
111
|
test('should pass \'controlsRef\' prop to the wrapped component', function () {
|
|
112
|
-
(0, _react.render)(
|
|
112
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(UseMeasurableComponent, {}));
|
|
113
113
|
expect(data).toHaveProperty('controlsRef');
|
|
114
114
|
});
|
|
115
115
|
});
|
package/Media/Media.js
CHANGED
|
@@ -60,7 +60,7 @@ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf
|
|
|
60
60
|
*/
|
|
61
61
|
var getKeyFromSource = exports.getKeyFromSource = function getKeyFromSource() {
|
|
62
62
|
var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
63
|
-
if (
|
|
63
|
+
if (/*#__PURE__*/(0, _react.isValidElement)(source)) {
|
|
64
64
|
return _react.Children.toArray(source).filter(function (s) {
|
|
65
65
|
return !!s;
|
|
66
66
|
}).map(function (s) {
|