@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
|
@@ -31,14 +31,14 @@ describe('Media', function () {
|
|
|
31
31
|
mediaPauseStub.mockRestore();
|
|
32
32
|
});
|
|
33
33
|
test('should use the same node when changing the `source`', function () {
|
|
34
|
-
var _render = (0, _react.render)(
|
|
34
|
+
var _render = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
35
35
|
mediaComponent: "video",
|
|
36
36
|
"data-testid": "media-id",
|
|
37
37
|
source: "abc.mp4"
|
|
38
38
|
})),
|
|
39
39
|
rerender = _render.rerender;
|
|
40
40
|
var expected = _react.screen.getByTestId('media-id');
|
|
41
|
-
rerender(
|
|
41
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
42
42
|
mediaComponent: "video",
|
|
43
43
|
"data-testid": "media-id",
|
|
44
44
|
source: "def.mp4"
|
|
@@ -48,7 +48,7 @@ describe('Media', function () {
|
|
|
48
48
|
});
|
|
49
49
|
test('should return the key when a node provided', function () {
|
|
50
50
|
var expected = 'path/file.mp4';
|
|
51
|
-
var actual = (0, _Media.getKeyFromSource)(
|
|
51
|
+
var actual = (0, _Media.getKeyFromSource)(/*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
52
52
|
src: "path/file.mp4",
|
|
53
53
|
type: "video/mp4"
|
|
54
54
|
}));
|
|
@@ -56,7 +56,7 @@ describe('Media', function () {
|
|
|
56
56
|
});
|
|
57
57
|
test('should fire `onCanPlay` when canplay event is fired', function () {
|
|
58
58
|
var handleCanPlay = jest.fn();
|
|
59
|
-
(0, _react.render)(
|
|
59
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
60
60
|
mediaComponent: "video",
|
|
61
61
|
"data-testid": "media-id",
|
|
62
62
|
onCanPlay: handleCanPlay
|
|
@@ -68,7 +68,7 @@ describe('Media', function () {
|
|
|
68
68
|
});
|
|
69
69
|
test('should fire `onCustom` when custom event is fired', function () {
|
|
70
70
|
var handleCustom = jest.fn();
|
|
71
|
-
(0, _react.render)(
|
|
71
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
72
72
|
mediaComponent: "video",
|
|
73
73
|
"data-testid": "media-id",
|
|
74
74
|
onCustom: handleCustom,
|
|
@@ -81,7 +81,7 @@ describe('Media', function () {
|
|
|
81
81
|
});
|
|
82
82
|
test('should call load', function () {
|
|
83
83
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
84
|
-
(0, _react.render)(
|
|
84
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
85
85
|
ref: ref,
|
|
86
86
|
mediaComponent: "video"
|
|
87
87
|
}));
|
|
@@ -90,7 +90,7 @@ describe('Media', function () {
|
|
|
90
90
|
});
|
|
91
91
|
test('should call play', function () {
|
|
92
92
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
93
|
-
(0, _react.render)(
|
|
93
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
94
94
|
ref: ref,
|
|
95
95
|
mediaComponent: "video"
|
|
96
96
|
}));
|
|
@@ -99,7 +99,7 @@ describe('Media', function () {
|
|
|
99
99
|
});
|
|
100
100
|
test('should call pause', function () {
|
|
101
101
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
102
|
-
(0, _react.render)(
|
|
102
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
103
103
|
ref: ref,
|
|
104
104
|
mediaComponent: "video"
|
|
105
105
|
}));
|
|
@@ -108,7 +108,7 @@ describe('Media', function () {
|
|
|
108
108
|
});
|
|
109
109
|
test('should return duration', function () {
|
|
110
110
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
111
|
-
(0, _react.render)(
|
|
111
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
112
112
|
ref: ref,
|
|
113
113
|
mediaComponent: "video",
|
|
114
114
|
"data-testid": "media-id"
|
|
@@ -126,7 +126,7 @@ describe('Media', function () {
|
|
|
126
126
|
});
|
|
127
127
|
test('should return proportionPlayed', function () {
|
|
128
128
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
129
|
-
(0, _react.render)(
|
|
129
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
130
130
|
ref: ref,
|
|
131
131
|
mediaComponent: "video",
|
|
132
132
|
"data-testid": "media-id"
|
|
@@ -146,7 +146,7 @@ describe('Media', function () {
|
|
|
146
146
|
test('should be able to get and set the current time', function () {
|
|
147
147
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
148
148
|
var expected = 3;
|
|
149
|
-
(0, _react.render)(
|
|
149
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
150
150
|
ref: ref,
|
|
151
151
|
mediaComponent: "video"
|
|
152
152
|
}));
|
|
@@ -157,7 +157,7 @@ describe('Media', function () {
|
|
|
157
157
|
test('should be able to get and set the playback rate', function () {
|
|
158
158
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
159
159
|
var expected = 2;
|
|
160
|
-
(0, _react.render)(
|
|
160
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Media.Media, {
|
|
161
161
|
ref: ref,
|
|
162
162
|
mediaComponent: "video"
|
|
163
163
|
}));
|
|
@@ -20,7 +20,7 @@ describe('PlaceholderControllerDecorator', function () {
|
|
|
20
20
|
var Component = (0, _Placeholder.PlaceholderControllerDecorator)(DivComponent);
|
|
21
21
|
describe('config', function () {
|
|
22
22
|
test('should pass \'onScroll\' handler to the wrapped component', function () {
|
|
23
|
-
(0, _react.render)(
|
|
23
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
24
24
|
expect(data).toHaveProperty('onScroll');
|
|
25
25
|
var expected = 'function';
|
|
26
26
|
var actual = typeof data.onScroll;
|
|
@@ -12,7 +12,7 @@ describe('PlaceholderDecorator', function () {
|
|
|
12
12
|
describe('config', function () {
|
|
13
13
|
test('should configure the default style of the placeholder element', function () {
|
|
14
14
|
var controllerRegistry = _Registry["default"].create();
|
|
15
|
-
(0, _react.render)(
|
|
15
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_PlaceholderControllerDecorator.PlaceholderContext.Provider, {
|
|
16
16
|
value: controllerRegistry.register,
|
|
17
17
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
18
18
|
"data-testid": "wrapper",
|
|
@@ -8,7 +8,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
8
8
|
describe('ProgressBar Specs', function () {
|
|
9
9
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
10
10
|
var ref = jest.fn();
|
|
11
|
-
(0, _react.render)(
|
|
11
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
|
|
12
12
|
ref: ref
|
|
13
13
|
}));
|
|
14
14
|
var expected = 'DIV';
|
|
@@ -17,7 +17,7 @@ describe('ProgressBar Specs', function () {
|
|
|
17
17
|
});
|
|
18
18
|
describe('horizontal', function () {
|
|
19
19
|
test('should have width of 0.5', function () {
|
|
20
|
-
(0, _react.render)(
|
|
20
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
|
|
21
21
|
progress: 0.5
|
|
22
22
|
}));
|
|
23
23
|
var progressBar = _react.screen.getByRole('progressbar');
|
|
@@ -27,7 +27,7 @@ describe('ProgressBar Specs', function () {
|
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
test('should have background width of 0.75', function () {
|
|
30
|
-
(0, _react.render)(
|
|
30
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
|
|
31
31
|
backgroundProgress: 0.75
|
|
32
32
|
}));
|
|
33
33
|
var progressBar = _react.screen.getByRole('progressbar');
|
|
@@ -39,7 +39,7 @@ describe('ProgressBar Specs', function () {
|
|
|
39
39
|
});
|
|
40
40
|
describe('vertical', function () {
|
|
41
41
|
test('should have height of 0.5', function () {
|
|
42
|
-
(0, _react.render)(
|
|
42
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
|
|
43
43
|
orientation: "vertical",
|
|
44
44
|
progress: 0.5
|
|
45
45
|
}));
|
|
@@ -50,7 +50,7 @@ describe('ProgressBar Specs', function () {
|
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
test('should have background height of 0.75', function () {
|
|
53
|
-
(0, _react.render)(
|
|
53
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
|
|
54
54
|
backgroundProgress: 0.75,
|
|
55
55
|
orientation: "vertical",
|
|
56
56
|
progress: 0.5
|
|
@@ -64,7 +64,7 @@ describe('ProgressBar Specs', function () {
|
|
|
64
64
|
});
|
|
65
65
|
describe('radial', function () {
|
|
66
66
|
test('should have a radius of 0.5', function () {
|
|
67
|
-
(0, _react.render)(
|
|
67
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
|
|
68
68
|
orientation: "radial",
|
|
69
69
|
progress: 0.5
|
|
70
70
|
}));
|
|
@@ -75,7 +75,7 @@ describe('ProgressBar Specs', function () {
|
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
test('should have background radius of 0.75', function () {
|
|
78
|
-
(0, _react.render)(
|
|
78
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_ProgressBar["default"], {
|
|
79
79
|
backgroundProgress: 0.75,
|
|
80
80
|
orientation: "radial",
|
|
81
81
|
progress: 0.5
|
package/Repeater/Repeater.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ data. See for more information.
|
|
|
31
31
|
*/
|
|
32
32
|
childProp?: string;
|
|
33
33
|
/**
|
|
34
|
-
* Component type to wrap around all
|
|
34
|
+
* Component type to wrap around all the repeated elements.
|
|
35
35
|
*
|
|
36
36
|
* This can be a string describing a DOM node or React component (e.g. `'div'` or `Layout` ).
|
|
37
37
|
*/
|
package/Repeater/Repeater.js
CHANGED
|
@@ -73,7 +73,7 @@ var RepeaterBase = exports.RepeaterBase = (0, _kind["default"])({
|
|
|
73
73
|
*/
|
|
74
74
|
childProp: _propTypes2["default"].string,
|
|
75
75
|
/**
|
|
76
|
-
* Component type to wrap around all
|
|
76
|
+
* Component type to wrap around all the repeated elements.
|
|
77
77
|
*
|
|
78
78
|
* This can be a string describing a DOM node or React component (e.g. `'div'` or `Layout`).
|
|
79
79
|
*
|
|
@@ -28,7 +28,7 @@ describe('Repeater Specs', function () {
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
test('should have a root span element', function () {
|
|
31
|
-
(0, _react.render)(
|
|
31
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
32
32
|
childComponent: "div",
|
|
33
33
|
"data-testid": "repeater",
|
|
34
34
|
children: stringItems
|
|
@@ -38,7 +38,7 @@ describe('Repeater Specs', function () {
|
|
|
38
38
|
expect(rootElementName).toBe(expected);
|
|
39
39
|
});
|
|
40
40
|
test('should accept a nodeName as root element', function () {
|
|
41
|
-
(0, _react.render)(
|
|
41
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
42
42
|
childComponent: "div",
|
|
43
43
|
component: "div",
|
|
44
44
|
"data-testid": "repeater",
|
|
@@ -49,7 +49,7 @@ describe('Repeater Specs', function () {
|
|
|
49
49
|
expect(rootElementName).toBe(expected);
|
|
50
50
|
});
|
|
51
51
|
test('should accept a function as root element', function () {
|
|
52
|
-
(0, _react.render)(
|
|
52
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
53
53
|
childComponent: "div",
|
|
54
54
|
component: CustomRootType,
|
|
55
55
|
"data-testid": "repeater",
|
|
@@ -60,7 +60,7 @@ describe('Repeater Specs', function () {
|
|
|
60
60
|
expect(rootElementName).toBe(expected);
|
|
61
61
|
});
|
|
62
62
|
test('should accept a nodeName as childComponent', function () {
|
|
63
|
-
(0, _react.render)(
|
|
63
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
64
64
|
childComponent: "div",
|
|
65
65
|
"data-testid": "repeater",
|
|
66
66
|
children: stringItems
|
|
@@ -70,7 +70,7 @@ describe('Repeater Specs', function () {
|
|
|
70
70
|
expect(actual).toBe(expected);
|
|
71
71
|
});
|
|
72
72
|
test('should accept a function as childComponent', function () {
|
|
73
|
-
(0, _react.render)(
|
|
73
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
74
74
|
childComponent: CustomType,
|
|
75
75
|
"data-testid": "repeater",
|
|
76
76
|
children: stringItems
|
|
@@ -80,7 +80,7 @@ describe('Repeater Specs', function () {
|
|
|
80
80
|
expect(actual).toBe(expected);
|
|
81
81
|
});
|
|
82
82
|
test('should create a number of children matching the length of items', function () {
|
|
83
|
-
(0, _react.render)(
|
|
83
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
84
84
|
childComponent: "div",
|
|
85
85
|
"data-testid": "repeater",
|
|
86
86
|
children: stringItems
|
|
@@ -90,7 +90,7 @@ describe('Repeater Specs', function () {
|
|
|
90
90
|
expect(actual).toBe(expected);
|
|
91
91
|
});
|
|
92
92
|
test('should support an array of objects as items', function () {
|
|
93
|
-
(0, _react.render)(
|
|
93
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
94
94
|
childComponent: CustomType,
|
|
95
95
|
"data-testid": "repeater",
|
|
96
96
|
children: objItems
|
|
@@ -100,7 +100,7 @@ describe('Repeater Specs', function () {
|
|
|
100
100
|
expect(actual).toBe(expected);
|
|
101
101
|
});
|
|
102
102
|
test('should support passing itemProps to children', function () {
|
|
103
|
-
(0, _react.render)(
|
|
103
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
104
104
|
childComponent: "div",
|
|
105
105
|
"data-testid": "repeater",
|
|
106
106
|
itemProps: {
|
|
@@ -113,7 +113,7 @@ describe('Repeater Specs', function () {
|
|
|
113
113
|
expect(actual).toHaveAttribute('title', expected);
|
|
114
114
|
});
|
|
115
115
|
test('should pass index to each child', function () {
|
|
116
|
-
(0, _react.render)(
|
|
116
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
117
117
|
childComponent: "div",
|
|
118
118
|
"data-testid": "repeater",
|
|
119
119
|
children: stringItems
|
|
@@ -123,7 +123,7 @@ describe('Repeater Specs', function () {
|
|
|
123
123
|
expect(actual).toHaveAttribute('data-index', expected);
|
|
124
124
|
});
|
|
125
125
|
test('should pass data to each child', function () {
|
|
126
|
-
(0, _react.render)(
|
|
126
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
127
127
|
childComponent: "div",
|
|
128
128
|
childProp: "data-str",
|
|
129
129
|
"data-testid": "repeater",
|
|
@@ -134,7 +134,7 @@ describe('Repeater Specs', function () {
|
|
|
134
134
|
expect(actual).toHaveAttribute('data-str', expected);
|
|
135
135
|
});
|
|
136
136
|
test('should pass item as children to each child', function () {
|
|
137
|
-
(0, _react.render)(
|
|
137
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
138
138
|
childComponent: "div",
|
|
139
139
|
"data-testid": "repeater",
|
|
140
140
|
children: stringItems
|
|
@@ -144,7 +144,7 @@ describe('Repeater Specs', function () {
|
|
|
144
144
|
expect(actual).toHaveTextContent(expected);
|
|
145
145
|
});
|
|
146
146
|
test('should set role to list by default', function () {
|
|
147
|
-
(0, _react.render)(
|
|
147
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
148
148
|
childComponent: "div",
|
|
149
149
|
"data-testid": "repeater",
|
|
150
150
|
children: stringItems
|
|
@@ -154,7 +154,7 @@ describe('Repeater Specs', function () {
|
|
|
154
154
|
expect(listElement).toHaveAttribute('role', expected);
|
|
155
155
|
});
|
|
156
156
|
test('should allow role to be overridden', function () {
|
|
157
|
-
(0, _react.render)(
|
|
157
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater.RepeaterBase, {
|
|
158
158
|
childComponent: "div",
|
|
159
159
|
"data-testid": "repeater",
|
|
160
160
|
role: "listbox",
|
|
@@ -166,7 +166,7 @@ describe('Repeater Specs', function () {
|
|
|
166
166
|
});
|
|
167
167
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
168
168
|
var ref = jest.fn();
|
|
169
|
-
(0, _react.render)(
|
|
169
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Repeater["default"], {
|
|
170
170
|
childComponent: "div",
|
|
171
171
|
component: "div",
|
|
172
172
|
ref: ref,
|
|
@@ -21,7 +21,7 @@ describe('Resizable', function () {
|
|
|
21
21
|
describe('config', function () {
|
|
22
22
|
test('should pass \'onClick\' handler to the wrapped component', function () {
|
|
23
23
|
var resizeRegistry = _Registry["default"].create();
|
|
24
|
-
(0, _react.render)(
|
|
24
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext.Provider, {
|
|
25
25
|
value: resizeRegistry.register,
|
|
26
26
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ResizableComponent, {})
|
|
27
27
|
}));
|
|
@@ -30,7 +30,7 @@ describe('useResize', function () {
|
|
|
30
30
|
describe('config', function () {
|
|
31
31
|
test('should pass \'onClick\' handler to the wrapped component', function () {
|
|
32
32
|
var resizeRegistry = _Registry["default"].create();
|
|
33
|
-
(0, _react.render)(
|
|
33
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Resizable.ResizeContext.Provider, {
|
|
34
34
|
value: resizeRegistry.register,
|
|
35
35
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ResizeButtonWithHook, {})
|
|
36
36
|
}));
|
package/Routable/Router.js
CHANGED
|
@@ -160,7 +160,7 @@ var RouterBase = exports.RouterBase = (_Class = /*#__PURE__*/function (_ReactCom
|
|
|
160
160
|
* Routes defined as an object rather than via JSX.
|
|
161
161
|
*
|
|
162
162
|
* If specified, `routes` will take
|
|
163
|
-
*
|
|
163
|
+
* precedence over a JSX definition.
|
|
164
164
|
*
|
|
165
165
|
* ```JavaScript
|
|
166
166
|
* const routes = {
|
|
@@ -67,7 +67,7 @@ describe('Routable', function () {
|
|
|
67
67
|
}));
|
|
68
68
|
}
|
|
69
69
|
var user = _userEvent["default"].setup();
|
|
70
|
-
(0, _react.render)(
|
|
70
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Sample, {}));
|
|
71
71
|
var linkToSecondPage = _react.screen.getByText('Page 2');
|
|
72
72
|
|
|
73
73
|
// click once to navigate to new path
|
|
@@ -40,7 +40,7 @@ describe('Router', function () {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
test('should render a single component matching the {path}', function () {
|
|
43
|
-
(0, _react.render)(
|
|
43
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Router.RouterBase, {
|
|
44
44
|
routes: routes,
|
|
45
45
|
path: "/app"
|
|
46
46
|
}));
|
|
@@ -48,7 +48,7 @@ describe('Router', function () {
|
|
|
48
48
|
expect(view).toBeInTheDocument();
|
|
49
49
|
});
|
|
50
50
|
test('should render an array of components matching the {path}', function () {
|
|
51
|
-
(0, _react.render)(
|
|
51
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Router.RouterBase, {
|
|
52
52
|
routes: routes,
|
|
53
53
|
path: "/app/home"
|
|
54
54
|
}));
|
|
@@ -57,7 +57,7 @@ describe('Router', function () {
|
|
|
57
57
|
expect(view.length).toBe(expected);
|
|
58
58
|
});
|
|
59
59
|
test('should render an array of components matching the {path} as an array', function () {
|
|
60
|
-
(0, _react.render)(
|
|
60
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Router.RouterBase, {
|
|
61
61
|
routes: routes,
|
|
62
62
|
path: ['app', 'home']
|
|
63
63
|
}));
|
|
@@ -69,7 +69,7 @@ describe('Router', function () {
|
|
|
69
69
|
// Modify the console spy to silence error output with
|
|
70
70
|
// an empty mock implementation
|
|
71
71
|
console.error.mockImplementation();
|
|
72
|
-
(0, _react.render)(
|
|
72
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Router.RouterBase, {
|
|
73
73
|
routes: routes,
|
|
74
74
|
path: "/help"
|
|
75
75
|
}));
|
|
@@ -86,7 +86,7 @@ describe('Router', function () {
|
|
|
86
86
|
})
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
|
-
(0, _react.render)(
|
|
89
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Router.Router, {
|
|
90
90
|
routes: routes,
|
|
91
91
|
path: "/app/settings",
|
|
92
92
|
component: component
|
|
@@ -97,7 +97,7 @@ describe('Router', function () {
|
|
|
97
97
|
expect(actual).toBe(expected);
|
|
98
98
|
});
|
|
99
99
|
test('should render an array of components matching the {path} using JSX routes', function () {
|
|
100
|
-
(0, _react.render)(
|
|
100
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Router.Router, {
|
|
101
101
|
path: "/app/home",
|
|
102
102
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Route["default"], {
|
|
103
103
|
path: "app",
|
|
@@ -120,7 +120,7 @@ describe('Router', function () {
|
|
|
120
120
|
expect(actual).toBe(expected);
|
|
121
121
|
});
|
|
122
122
|
test('should render a different component when the routes change for the same {path}', function () {
|
|
123
|
-
var _render = (0, _react.render)(
|
|
123
|
+
var _render = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Router.Router, {
|
|
124
124
|
path: "/app",
|
|
125
125
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Route["default"], {
|
|
126
126
|
path: "app",
|
|
@@ -143,7 +143,7 @@ describe('Router', function () {
|
|
|
143
143
|
"data-testid": "span"
|
|
144
144
|
});
|
|
145
145
|
};
|
|
146
|
-
rerender(
|
|
146
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Router.Router, {
|
|
147
147
|
path: "/app",
|
|
148
148
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Route["default"], {
|
|
149
149
|
path: "app",
|
|
@@ -161,7 +161,7 @@ describe('Router', function () {
|
|
|
161
161
|
// Modify the console spy to silence error output with
|
|
162
162
|
// an empty mock implementation
|
|
163
163
|
console.error.mockImplementation();
|
|
164
|
-
(0, _react.render)(
|
|
164
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Router.Router, {
|
|
165
165
|
path: "/does/not/exist",
|
|
166
166
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Route["default"], {
|
|
167
167
|
path: "app",
|
|
@@ -185,7 +185,7 @@ describe('Router', function () {
|
|
|
185
185
|
// Modify the console spy to silence error output with
|
|
186
186
|
// an empty mock implementation
|
|
187
187
|
console.error.mockImplementation();
|
|
188
|
-
(0, _react.render)(
|
|
188
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Router.Router, {
|
|
189
189
|
path: "/app/home/other",
|
|
190
190
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_Route["default"], {
|
|
191
191
|
path: "app",
|
package/Routable/util.js
CHANGED
|
@@ -11,20 +11,20 @@ var RouteContext = exports.RouteContext = /*#__PURE__*/(0, _react.createContext)
|
|
|
11
11
|
var toSegments = exports.toSegments = function toSegments(path) {
|
|
12
12
|
return Array.isArray(path) ? path : (path || '').split('/').filter(Boolean);
|
|
13
13
|
};
|
|
14
|
-
var
|
|
14
|
+
var _getPaths = function getPaths(routes, base) {
|
|
15
15
|
var result = [];
|
|
16
16
|
Object.keys(routes).filter(function (s) {
|
|
17
17
|
return s[0] !== '$';
|
|
18
18
|
}).forEach(function (p) {
|
|
19
19
|
var path = base + '/' + p;
|
|
20
20
|
result.push(path);
|
|
21
|
-
result = result.concat(
|
|
21
|
+
result = result.concat(_getPaths(routes[p], path));
|
|
22
22
|
});
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
var stringifyRoutes = exports.stringifyRoutes = function stringifyRoutes(routes) {
|
|
26
26
|
var pad = '\n\t';
|
|
27
|
-
var paths =
|
|
27
|
+
var paths = _getPaths(routes, '');
|
|
28
28
|
return pad + paths.join(pad);
|
|
29
29
|
};
|
|
30
30
|
|
|
@@ -17,7 +17,7 @@ describe('Scroller', function () {
|
|
|
17
17
|
});
|
|
18
18
|
describe('Scrollbar visibility', function () {
|
|
19
19
|
test('should render both horizontal and vertical scrollbars when \'horizontalScrollbar\' and \'verticalScrollbar\' are "visible"', function () {
|
|
20
|
-
(0, _react.render)(
|
|
20
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Scroller["default"], {
|
|
21
21
|
"data-testid": "scroller",
|
|
22
22
|
horizontalScrollbar: "visible",
|
|
23
23
|
verticalScrollbar: "visible",
|
|
@@ -29,7 +29,7 @@ describe('Scroller', function () {
|
|
|
29
29
|
expect(verticalScrollbar).toBeInTheDocument();
|
|
30
30
|
});
|
|
31
31
|
test('should render only vertical scrollbar when \'verticalScrollbar\' is "visible" and \'horizontalScrollbar\' is "hidden"', function () {
|
|
32
|
-
(0, _react.render)(
|
|
32
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Scroller["default"], {
|
|
33
33
|
"data-testid": "scroller",
|
|
34
34
|
horizontalScrollbar: "hidden",
|
|
35
35
|
verticalScrollbar: "visible",
|
|
@@ -41,7 +41,7 @@ describe('Scroller', function () {
|
|
|
41
41
|
expect(verticalScrollbar).toBeInTheDocument();
|
|
42
42
|
});
|
|
43
43
|
test('should not render any scrollbar when \'horizontalScrollbar\' and \'verticalScrollbar\' are "hidden"', function () {
|
|
44
|
-
(0, _react.render)(
|
|
44
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Scroller["default"], {
|
|
45
45
|
"data-testid": "scroller",
|
|
46
46
|
horizontalScrollbar: "hidden",
|
|
47
47
|
verticalScrollbar: "hidden",
|
package/Skinnable/Skinnable.js
CHANGED
|
@@ -116,7 +116,7 @@ var defaultConfig = {
|
|
|
116
116
|
*
|
|
117
117
|
* Example:
|
|
118
118
|
* ```
|
|
119
|
-
* const MyApp = ({skinName, ...rest) => (<div {...props}>{skinName}</div>);
|
|
119
|
+
* const MyApp = ({skinName, ...rest}) => (<div {...props}>{skinName}</div>);
|
|
120
120
|
* ...
|
|
121
121
|
* App = Skinnable({
|
|
122
122
|
* prop: 'skinName',
|
|
@@ -167,7 +167,7 @@ var Skinnable = exports.Skinnable = (0, _hoc["default"])(defaultConfig, function
|
|
|
167
167
|
if (variantsProp) {
|
|
168
168
|
rest[variantsProp] = hook.variants;
|
|
169
169
|
}
|
|
170
|
-
return hook.provideSkins(
|
|
170
|
+
return hook.provideSkins(/*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread({}, rest)));
|
|
171
171
|
}
|
|
172
172
|
Skinnable.propTypes = /** @lends ui/Skinnable.Skinnable.prototype */{
|
|
173
173
|
/**
|