@enact/ui 5.0.0-alpha.3 → 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 +12 -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 +1 -1
- package/FloatingLayer/FloatingLayerDecorator.js +1 -1
- package/FloatingLayer/tests/FloatingLayer-specs.js +6 -6
- 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/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/tests/Layout-specs.js +10 -10
- package/Marquee/MarqueeController.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/tests/Repeater-specs.js +14 -14
- package/Resizable/tests/Resizable-specs.js +1 -1
- package/Resizable/tests/useResize-specs.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 +1 -1
- package/Skinnable/tests/Skinnable-specs.js +19 -19
- package/Skinnable/tests/useSkins-specs.js +14 -14
- 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/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/tests/Touchable-specs.js +36 -36
- package/Touchable/tests/useTouch-specs.js +15 -15
- package/Transition/tests/Transition-specs.js +11 -11
- package/ViewManager/tests/View-specs.js +13 -13
- package/ViewManager/tests/ViewManager-specs.js +50 -50
- package/VirtualList/VirtualListBasic.js +1 -1
- 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/tests/ResolutionDecorator-specs.js +2 -2
- package/styles/mixins.less +0 -2
- package/useControlledState/tests/useControlledState-specs.js +10 -10
- package/useScroll/ScrollAnimator.js +3 -3
- package/useScroll/useScroll.js +3 -0
|
@@ -8,7 +8,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
8
8
|
describe('Announce', function () {
|
|
9
9
|
test('should have an announce method on the component', function () {
|
|
10
10
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
11
|
-
(0, _react.render)(
|
|
11
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Announce["default"], {
|
|
12
12
|
ref: ref
|
|
13
13
|
}));
|
|
14
14
|
var node = ref.current;
|
|
@@ -19,7 +19,7 @@ describe('Announce', function () {
|
|
|
19
19
|
test('should update the aria-label with the provided message', function () {
|
|
20
20
|
var ref = /*#__PURE__*/(0, _react2.createRef)();
|
|
21
21
|
var message = 'message';
|
|
22
|
-
(0, _react.render)(
|
|
22
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Announce["default"], {
|
|
23
23
|
ref: ref
|
|
24
24
|
}));
|
|
25
25
|
var node = ref.current;
|
|
@@ -14,7 +14,7 @@ describe('AnnounceDecorator', function () {
|
|
|
14
14
|
};
|
|
15
15
|
test('should pass a function in the announce prop', function () {
|
|
16
16
|
var Component = (0, _AnnounceDecorator["default"])(Div);
|
|
17
|
-
(0, _react.render)(
|
|
17
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
18
18
|
var expected = 'function';
|
|
19
19
|
var actual = typeof announceProps.announce;
|
|
20
20
|
expect(actual).toBe(expected);
|
|
@@ -24,7 +24,7 @@ describe('AnnounceDecorator', function () {
|
|
|
24
24
|
var Component = (0, _AnnounceDecorator["default"])({
|
|
25
25
|
prop: prop
|
|
26
26
|
}, Div);
|
|
27
|
-
(0, _react.render)(
|
|
27
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
28
28
|
var expected = 'function';
|
|
29
29
|
var actual = typeof announceProps[prop];
|
|
30
30
|
expect(actual).toBe(expected);
|
|
@@ -25,12 +25,12 @@ describe('useAnnounce', function () {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
test('should return an announce function', function () {
|
|
28
|
-
(0, _react.render)(
|
|
28
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
29
29
|
var expected = 'function';
|
|
30
30
|
expect(announceType).toBe(expected);
|
|
31
31
|
});
|
|
32
32
|
test('should return a single element in children', function () {
|
|
33
|
-
(0, _react.render)(
|
|
33
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
34
34
|
var expected = 1;
|
|
35
35
|
var baseElementChildrenCount = _react.screen.getByTestId('announce').children.length;
|
|
36
36
|
expect(baseElementChildrenCount).toBe(expected);
|
|
@@ -41,7 +41,7 @@ describe('useAnnounce', function () {
|
|
|
41
41
|
// TODO: find a relevant scenario that works on testing-library
|
|
42
42
|
test.skip('should set the value passed to announce into the ARIA role="alert" node', function () {
|
|
43
43
|
var text = '__NOTIFY__';
|
|
44
|
-
(0, _react.render)(
|
|
44
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
45
45
|
"data-testid": "announce-test"
|
|
46
46
|
}));
|
|
47
47
|
var component = _react.screen.getByTestId('announce-test');
|
|
@@ -10,7 +10,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
10
10
|
describe('BodyText Specs', function () {
|
|
11
11
|
test('should render a single <p> tag', function () {
|
|
12
12
|
var msg = 'Hello BodyText!';
|
|
13
|
-
(0, _react.render)(
|
|
13
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_BodyText["default"], {
|
|
14
14
|
children: msg
|
|
15
15
|
}));
|
|
16
16
|
var expected = 'P';
|
|
@@ -19,14 +19,14 @@ describe('BodyText Specs', function () {
|
|
|
19
19
|
});
|
|
20
20
|
test('should render BodyText with content', function () {
|
|
21
21
|
var content = 'Hello BodyText!';
|
|
22
|
-
(0, _react.render)(
|
|
22
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_BodyText["default"], {
|
|
23
23
|
children: content
|
|
24
24
|
}));
|
|
25
25
|
var bodyText = _react.screen.getByText(content);
|
|
26
26
|
expect(bodyText).toBeInTheDocument();
|
|
27
27
|
});
|
|
28
28
|
test('should not include the centered class by default', function () {
|
|
29
|
-
(0, _react.render)(
|
|
29
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_BodyText.BodyTextBase, {
|
|
30
30
|
"data-testid": "bodyText"
|
|
31
31
|
}));
|
|
32
32
|
var bodyText = _react.screen.getByTestId('bodyText');
|
|
@@ -34,7 +34,7 @@ describe('BodyText Specs', function () {
|
|
|
34
34
|
expect(bodyText).not.toHaveClass(expected);
|
|
35
35
|
});
|
|
36
36
|
test('should include the centered class if `centered` is true', function () {
|
|
37
|
-
(0, _react.render)(
|
|
37
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_BodyText["default"], {
|
|
38
38
|
centered: true,
|
|
39
39
|
"data-testid": "bodyText"
|
|
40
40
|
}));
|
|
@@ -44,7 +44,7 @@ describe('BodyText Specs', function () {
|
|
|
44
44
|
});
|
|
45
45
|
test('should support changing the component element to a functional component', function () {
|
|
46
46
|
var component = _Layout.Cell;
|
|
47
|
-
(0, _react.render)(
|
|
47
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_BodyText.BodyTextBase, {
|
|
48
48
|
component: component,
|
|
49
49
|
"data-testid": "bodyText"
|
|
50
50
|
}));
|
|
@@ -54,7 +54,7 @@ describe('BodyText Specs', function () {
|
|
|
54
54
|
});
|
|
55
55
|
test('should support changing the component element to a different DOM node', function () {
|
|
56
56
|
var componentTag = 'address';
|
|
57
|
-
(0, _react.render)(
|
|
57
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_BodyText.BodyTextBase, {
|
|
58
58
|
component: componentTag,
|
|
59
59
|
"data-testid": "bodyText"
|
|
60
60
|
}));
|
|
@@ -11,7 +11,7 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
|
|
|
11
11
|
describe('Button', function () {
|
|
12
12
|
test('should return a DOM node reference for `componentRef`', function () {
|
|
13
13
|
var ref = jest.fn();
|
|
14
|
-
(0, _react.render)(
|
|
14
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
15
15
|
ref: ref
|
|
16
16
|
}));
|
|
17
17
|
var expected = 'DIV';
|
|
@@ -19,7 +19,7 @@ describe('Button', function () {
|
|
|
19
19
|
expect(actual).toBe(expected);
|
|
20
20
|
});
|
|
21
21
|
test('should have \'disabled\' HTML attribute when \'disabled\' prop is provided', function () {
|
|
22
|
-
(0, _react.render)(
|
|
22
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
23
23
|
disabled: true,
|
|
24
24
|
children: "I am a disabled Button"
|
|
25
25
|
}));
|
|
@@ -27,13 +27,13 @@ describe('Button', function () {
|
|
|
27
27
|
expect(button).toHaveAttribute('disabled');
|
|
28
28
|
});
|
|
29
29
|
test('should have default minWidth class', function () {
|
|
30
|
-
(0, _react.render)(
|
|
30
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.ButtonBase, {}));
|
|
31
31
|
var button = _react.screen.getByRole('button');
|
|
32
32
|
var expected = 'minWidth';
|
|
33
33
|
expect(button).toHaveClass(expected);
|
|
34
34
|
});
|
|
35
35
|
test('should have selected class when selected prop is set to true', function () {
|
|
36
|
-
(0, _react.render)(
|
|
36
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.ButtonBase, {
|
|
37
37
|
selected: true
|
|
38
38
|
}));
|
|
39
39
|
var button = _react.screen.getByRole('button');
|
|
@@ -41,7 +41,7 @@ describe('Button', function () {
|
|
|
41
41
|
expect(button).toHaveClass(expected);
|
|
42
42
|
});
|
|
43
43
|
test('should have pressed class when pressed prop is set to true', function () {
|
|
44
|
-
(0, _react.render)(
|
|
44
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.ButtonBase, {
|
|
45
45
|
pressed: true
|
|
46
46
|
}));
|
|
47
47
|
var button = _react.screen.getByRole('button');
|
|
@@ -49,7 +49,7 @@ describe('Button', function () {
|
|
|
49
49
|
expect(button).toHaveClass(expected);
|
|
50
50
|
});
|
|
51
51
|
test('should have large class when size prop is set to large', function () {
|
|
52
|
-
(0, _react.render)(
|
|
52
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.ButtonBase, {
|
|
53
53
|
size: "large"
|
|
54
54
|
}));
|
|
55
55
|
var button = _react.screen.getByRole('button');
|
|
@@ -57,7 +57,7 @@ describe('Button', function () {
|
|
|
57
57
|
expect(button).toHaveClass(expected);
|
|
58
58
|
});
|
|
59
59
|
test('should have small class when size prop is set to small', function () {
|
|
60
|
-
(0, _react.render)(
|
|
60
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.ButtonBase, {
|
|
61
61
|
size: "small"
|
|
62
62
|
}));
|
|
63
63
|
var button = _react.screen.getByRole('button');
|
|
@@ -65,7 +65,7 @@ describe('Button', function () {
|
|
|
65
65
|
expect(button).toHaveClass(expected);
|
|
66
66
|
});
|
|
67
67
|
test('should have hasIcon class when icon prop is defined', function () {
|
|
68
|
-
(0, _react.render)(
|
|
68
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
69
69
|
icon: true,
|
|
70
70
|
children: "Hello Button!"
|
|
71
71
|
}));
|
|
@@ -76,7 +76,7 @@ describe('Button', function () {
|
|
|
76
76
|
test('should call onClick', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
77
77
|
var handleCLick = jest.fn();
|
|
78
78
|
var user = _userEvent["default"].setup();
|
|
79
|
-
(0, _react.render)(
|
|
79
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
80
80
|
onClick: handleCLick,
|
|
81
81
|
children: "Hello Button!"
|
|
82
82
|
}));
|
|
@@ -88,7 +88,7 @@ describe('Button', function () {
|
|
|
88
88
|
test('should not call onClick when button is disabled', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
89
89
|
var handleClick = jest.fn();
|
|
90
90
|
var user = _userEvent["default"].setup();
|
|
91
|
-
(0, _react.render)(
|
|
91
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
92
92
|
disabled: true,
|
|
93
93
|
onClick: handleClick,
|
|
94
94
|
children: "Hello Button!"
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
The following is a curated list of changes in the Enact ui module, newest changes on the top.
|
|
4
4
|
|
|
5
|
+
## [5.0.0-alpha.4] - 2025-01-21
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `ui/VirtualList` to not abnormally scroll when `dataSize` and `itemSizes` changed
|
|
10
|
+
|
|
11
|
+
## [4.9.5] - 2024-12-11
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- `ui/VirtualList` to not abnormally scroll when `dataSize` and `itemSizes` changed
|
|
16
|
+
|
|
5
17
|
## [5.0.0-alpha.3] - 2024-12-02
|
|
6
18
|
|
|
7
19
|
### Fixed
|
|
@@ -1446,7 +1458,6 @@ libraries.
|
|
|
1446
1458
|
|
|
1447
1459
|
- Renamed `ui/Group` prop `select` to `childSelect` and added prop `select` to support selection types
|
|
1448
1460
|
|
|
1449
|
-
|
|
1450
1461
|
## [1.0.0-alpha.2] - 2016-10-21
|
|
1451
1462
|
|
|
1452
1463
|
This version includes a lot of refactoring from the previous release. Developers need to switch to the new enact-dev command-line tool.
|
|
@@ -45,7 +45,7 @@ describe('Cancelable', function () {
|
|
|
45
45
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
46
46
|
onCancel: 'onCustomEvent'
|
|
47
47
|
}, Component);
|
|
48
|
-
(0, _react.render)(
|
|
48
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
49
49
|
onCustomEvent: handleCancel
|
|
50
50
|
}));
|
|
51
51
|
var component = _react.screen.getByTestId('cancelable');
|
|
@@ -63,7 +63,7 @@ describe('Cancelable', function () {
|
|
|
63
63
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
64
64
|
onCancel: handleCancel
|
|
65
65
|
}, Component);
|
|
66
|
-
(0, _react.render)(
|
|
66
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {}));
|
|
67
67
|
var component = _react.screen.getByTestId('cancelable');
|
|
68
68
|
_react.fireEvent.keyUp(component, makeKeyEvent(27));
|
|
69
69
|
var expected = 1;
|
|
@@ -79,7 +79,7 @@ describe('Cancelable', function () {
|
|
|
79
79
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
80
80
|
onCancel: handleCancel
|
|
81
81
|
}, Component);
|
|
82
|
-
(0, _react.render)(
|
|
82
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {}));
|
|
83
83
|
var component = _react.screen.getByTestId('cancelable');
|
|
84
84
|
_react.fireEvent.keyUp(component, makeKeyEvent(42));
|
|
85
85
|
expect(handleCancel).not.toHaveBeenCalled();
|
|
@@ -91,7 +91,7 @@ describe('Cancelable', function () {
|
|
|
91
91
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
92
92
|
onCancel: handleCancel
|
|
93
93
|
}, Component);
|
|
94
|
-
(0, _react.render)(
|
|
94
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
95
95
|
onKeyUp: handleCancelParent,
|
|
96
96
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {})
|
|
97
97
|
}));
|
|
@@ -106,7 +106,7 @@ describe('Cancelable', function () {
|
|
|
106
106
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
107
107
|
onCancel: handleCancel
|
|
108
108
|
}, Component);
|
|
109
|
-
(0, _react.render)(
|
|
109
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
110
110
|
onKeyUp: handleCancelParent,
|
|
111
111
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {})
|
|
112
112
|
}));
|
|
@@ -121,7 +121,7 @@ describe('Cancelable', function () {
|
|
|
121
121
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
122
122
|
onCancel: returnsTrue
|
|
123
123
|
}, Component);
|
|
124
|
-
(0, _react.render)(
|
|
124
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
125
125
|
onKeyUp: handleKeyUp
|
|
126
126
|
}));
|
|
127
127
|
var component = _react.screen.getByTestId('cancelable');
|
|
@@ -138,7 +138,7 @@ describe('Cancelable', function () {
|
|
|
138
138
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
139
139
|
onCancel: handleCancel
|
|
140
140
|
}, Component);
|
|
141
|
-
(0, _react.render)(
|
|
141
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {}));
|
|
142
142
|
var component = _react.screen.getByTestId('cancelable');
|
|
143
143
|
_react.fireEvent.keyUp(component, makeKeyEvent(461));
|
|
144
144
|
(0, _Cancelable.removeCancelHandler)(customCancelHandler);
|
|
@@ -150,7 +150,7 @@ describe('Cancelable', function () {
|
|
|
150
150
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
151
151
|
onCancel: handleCancel
|
|
152
152
|
}, Component);
|
|
153
|
-
(0, _react.render)(
|
|
153
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
154
154
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
155
155
|
"data-testid": "second",
|
|
156
156
|
className: "second"
|
|
@@ -166,7 +166,7 @@ describe('Cancelable', function () {
|
|
|
166
166
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
167
167
|
onCancel: handleCancel
|
|
168
168
|
}, Component);
|
|
169
|
-
(0, _react.render)(
|
|
169
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
170
170
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
171
171
|
"data-testid": "second",
|
|
172
172
|
className: "second"
|
|
@@ -182,7 +182,7 @@ describe('Cancelable', function () {
|
|
|
182
182
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
183
183
|
onCancel: 'onCustomEvent'
|
|
184
184
|
}, Component);
|
|
185
|
-
(0, _react.render)(
|
|
185
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
186
186
|
onCustomEvent: handleCancel,
|
|
187
187
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
188
188
|
"data-testid": "second",
|
|
@@ -200,7 +200,7 @@ describe('Cancelable', function () {
|
|
|
200
200
|
var Comp = (0, _Cancelable.Cancelable)({
|
|
201
201
|
onCancel: 'onCustomEvent'
|
|
202
202
|
}, Component);
|
|
203
|
-
(0, _react.render)(
|
|
203
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
204
204
|
onCustomEvent: handleCancel,
|
|
205
205
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
206
206
|
"data-testid": "second",
|
|
@@ -235,7 +235,7 @@ describe('Cancelable', function () {
|
|
|
235
235
|
modal: true,
|
|
236
236
|
onCancel: handleCancel
|
|
237
237
|
}, Component);
|
|
238
|
-
(0, _react.render)(
|
|
238
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {}));
|
|
239
239
|
document.dispatchEvent(makeKeyboardEvent(27));
|
|
240
240
|
var expected = 1;
|
|
241
241
|
expect(handleCancel).toHaveBeenCalledTimes(expected);
|
|
@@ -256,8 +256,8 @@ describe('Cancelable', function () {
|
|
|
256
256
|
modal: true,
|
|
257
257
|
onCancel: append('second')
|
|
258
258
|
}, Component);
|
|
259
|
-
(0, _react.render)(
|
|
260
|
-
(0, _react.render)(
|
|
259
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(First, {}));
|
|
260
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Second, {}));
|
|
261
261
|
document.dispatchEvent(makeKeyboardEvent(27));
|
|
262
262
|
var expected = ['second', 'first'];
|
|
263
263
|
expect(results).toEqual(expected);
|
|
@@ -278,7 +278,7 @@ describe('Cancelable', function () {
|
|
|
278
278
|
modal: true,
|
|
279
279
|
onCancel: append('second')
|
|
280
280
|
}, Component);
|
|
281
|
-
(0, _react.render)(
|
|
281
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(First, {
|
|
282
282
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Second, {})
|
|
283
283
|
}));
|
|
284
284
|
document.dispatchEvent(makeKeyboardEvent(27));
|
|
@@ -295,8 +295,8 @@ describe('Cancelable', function () {
|
|
|
295
295
|
modal: true,
|
|
296
296
|
onCancel: stop
|
|
297
297
|
}, Component);
|
|
298
|
-
(0, _react.render)(
|
|
299
|
-
(0, _react.render)(
|
|
298
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(First, {}));
|
|
299
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Second, {}));
|
|
300
300
|
document.dispatchEvent(makeKeyboardEvent(27));
|
|
301
301
|
expect(handleCancel).not.toHaveBeenCalled();
|
|
302
302
|
});
|
|
@@ -19,7 +19,7 @@ describe('Changeable', function () {
|
|
|
19
19
|
describe('#config', function () {
|
|
20
20
|
test('should pass \'value\' to the wrapped component', function () {
|
|
21
21
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
22
|
-
(0, _react.render)(
|
|
22
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
23
23
|
var expected = '';
|
|
24
24
|
var actual = _react.screen.getByTestId('changeable');
|
|
25
25
|
expect(actual).toHaveTextContent(expected);
|
|
@@ -29,14 +29,14 @@ describe('Changeable', function () {
|
|
|
29
29
|
var Component = (0, _Changeable["default"])({
|
|
30
30
|
prop: prop
|
|
31
31
|
}, DivComponent);
|
|
32
|
-
(0, _react.render)(
|
|
32
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
33
33
|
defaultId: testValue
|
|
34
34
|
}));
|
|
35
35
|
expect(data).toHaveProperty(prop, testValue);
|
|
36
36
|
});
|
|
37
37
|
test('should pass \'onChange\' handler to the wrapped component', function () {
|
|
38
38
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
39
|
-
(0, _react.render)(
|
|
39
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
40
40
|
expect(data).toHaveProperty('onChange');
|
|
41
41
|
var expected = 'function';
|
|
42
42
|
var actual = typeof data.onChange;
|
|
@@ -47,7 +47,7 @@ describe('Changeable', function () {
|
|
|
47
47
|
var Component = (0, _Changeable["default"])({
|
|
48
48
|
change: handle
|
|
49
49
|
}, DivComponent);
|
|
50
|
-
(0, _react.render)(
|
|
50
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {}));
|
|
51
51
|
expect(data).toHaveProperty(handle);
|
|
52
52
|
var expected = 'function';
|
|
53
53
|
var actual = typeof data.onClick;
|
|
@@ -57,7 +57,7 @@ describe('Changeable', function () {
|
|
|
57
57
|
describe('#prop', function () {
|
|
58
58
|
test('should use defaultValue prop when value prop is omitted', function () {
|
|
59
59
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
60
|
-
(0, _react.render)(
|
|
60
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
61
61
|
defaultValue: 1
|
|
62
62
|
}));
|
|
63
63
|
var expected = '1';
|
|
@@ -67,7 +67,7 @@ describe('Changeable', function () {
|
|
|
67
67
|
test('should warn when \'defaultValue\' and \'value\' props are provided', function () {
|
|
68
68
|
var spy = jest.spyOn(console, 'error').mockImplementation(function () {});
|
|
69
69
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
70
|
-
(0, _react.render)(
|
|
70
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
71
71
|
defaultValue: 10,
|
|
72
72
|
value: 5
|
|
73
73
|
}));
|
|
@@ -78,7 +78,7 @@ describe('Changeable', function () {
|
|
|
78
78
|
test('should use defaultValue prop when value prop is null', function () {
|
|
79
79
|
var spy = jest.spyOn(console, 'error').mockImplementation(function () {});
|
|
80
80
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
81
|
-
(0, _react.render)(
|
|
81
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
82
82
|
defaultValue: 1,
|
|
83
83
|
value: null
|
|
84
84
|
}));
|
|
@@ -90,12 +90,12 @@ describe('Changeable', function () {
|
|
|
90
90
|
test('should use value prop when value changed from truthy to null', function () {
|
|
91
91
|
var spy = jest.spyOn(console, 'error').mockImplementation(function () {});
|
|
92
92
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
93
|
-
var _render = (0, _react.render)(
|
|
93
|
+
var _render = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
94
94
|
defaultValue: 1,
|
|
95
95
|
value: 2
|
|
96
96
|
})),
|
|
97
97
|
rerender = _render.rerender;
|
|
98
|
-
rerender(
|
|
98
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
99
99
|
defaultValue: 1,
|
|
100
100
|
value: null
|
|
101
101
|
}));
|
|
@@ -108,7 +108,7 @@ describe('Changeable', function () {
|
|
|
108
108
|
var spy = jest.spyOn(console, 'error').mockImplementation(function () {});
|
|
109
109
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
110
110
|
// eslint-disable-next-line no-undefined
|
|
111
|
-
(0, _react.render)(
|
|
111
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
112
112
|
defaultValue: 1,
|
|
113
113
|
value: undefined
|
|
114
114
|
}));
|
|
@@ -120,14 +120,14 @@ describe('Changeable', function () {
|
|
|
120
120
|
test('should use value prop when value changed from truthy to undefined', function () {
|
|
121
121
|
var spy = jest.spyOn(console, 'error').mockImplementation(function () {});
|
|
122
122
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
123
|
-
var _render2 = (0, _react.render)(
|
|
123
|
+
var _render2 = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
124
124
|
defaultValue: 1,
|
|
125
125
|
value: 2
|
|
126
126
|
})),
|
|
127
127
|
rerender = _render2.rerender;
|
|
128
128
|
|
|
129
129
|
// eslint-disable-next-line no-undefined
|
|
130
|
-
rerender(
|
|
130
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
131
131
|
defaultValue: 1,
|
|
132
132
|
value: undefined
|
|
133
133
|
}));
|
|
@@ -139,7 +139,7 @@ describe('Changeable', function () {
|
|
|
139
139
|
test('should use value prop when defined but falsy', function () {
|
|
140
140
|
var spy = jest.spyOn(console, 'error').mockImplementation(function () {});
|
|
141
141
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
142
|
-
(0, _react.render)(
|
|
142
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
143
143
|
defaultValue: 1,
|
|
144
144
|
value: 0
|
|
145
145
|
}));
|
|
@@ -151,7 +151,7 @@ describe('Changeable', function () {
|
|
|
151
151
|
test('should use value prop when both value and defaultValue are defined', function () {
|
|
152
152
|
var spy = jest.spyOn(console, 'error').mockImplementation(function () {});
|
|
153
153
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
154
|
-
(0, _react.render)(
|
|
154
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
155
155
|
defaultValue: 1,
|
|
156
156
|
value: 2
|
|
157
157
|
}));
|
|
@@ -164,7 +164,7 @@ describe('Changeable', function () {
|
|
|
164
164
|
test('should invoke passed \'onChange\' handler', function () {
|
|
165
165
|
var handleChange = jest.fn();
|
|
166
166
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
167
|
-
(0, _react.render)(
|
|
167
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
168
168
|
onChange: handleChange
|
|
169
169
|
}));
|
|
170
170
|
(0, _react.act)(function () {
|
|
@@ -177,7 +177,7 @@ describe('Changeable', function () {
|
|
|
177
177
|
test('should not invoke passed \'onChange\' handler when \'disabled\'', function () {
|
|
178
178
|
var handleChange = jest.fn();
|
|
179
179
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
180
|
-
(0, _react.render)(
|
|
180
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
181
181
|
onChange: handleChange,
|
|
182
182
|
disabled: true
|
|
183
183
|
}));
|
|
@@ -191,7 +191,7 @@ describe('Changeable', function () {
|
|
|
191
191
|
test('should update \'value\' when \'onChange\' invoked and is not controlled', function () {
|
|
192
192
|
var handleChange = jest.fn();
|
|
193
193
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
194
|
-
(0, _react.render)(
|
|
194
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
195
195
|
defaultValue: 0,
|
|
196
196
|
onChange: handleChange
|
|
197
197
|
}));
|
|
@@ -206,7 +206,7 @@ describe('Changeable', function () {
|
|
|
206
206
|
});
|
|
207
207
|
test('should not update \'value\' when \'onChange\' invoked and is not controlled but disabled', function () {
|
|
208
208
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
209
|
-
(0, _react.render)(
|
|
209
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
210
210
|
defaultValue: 0,
|
|
211
211
|
disabled: true
|
|
212
212
|
}));
|
|
@@ -221,7 +221,7 @@ describe('Changeable', function () {
|
|
|
221
221
|
});
|
|
222
222
|
test('should not update \'value\' when \'onChange\' invoked and is controlled', function () {
|
|
223
223
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
224
|
-
(0, _react.render)(
|
|
224
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
225
225
|
value: 0
|
|
226
226
|
}));
|
|
227
227
|
(0, _react.act)(function () {
|
|
@@ -235,11 +235,11 @@ describe('Changeable', function () {
|
|
|
235
235
|
});
|
|
236
236
|
test('should update \'value\' with new props when is controlled', function () {
|
|
237
237
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
238
|
-
var _render3 = (0, _react.render)(
|
|
238
|
+
var _render3 = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
239
239
|
value: 0
|
|
240
240
|
})),
|
|
241
241
|
rerender = _render3.rerender;
|
|
242
|
-
rerender(
|
|
242
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
243
243
|
value: 1
|
|
244
244
|
}));
|
|
245
245
|
var expected = '1';
|
|
@@ -250,11 +250,11 @@ describe('Changeable', function () {
|
|
|
250
250
|
// eslint-disable-next-line
|
|
251
251
|
console.error = function () {};
|
|
252
252
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
253
|
-
var _render4 = (0, _react.render)(
|
|
253
|
+
var _render4 = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
254
254
|
defaultValue: 0
|
|
255
255
|
})),
|
|
256
256
|
rerender = _render4.rerender;
|
|
257
|
-
rerender(
|
|
257
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
258
258
|
defaultValue: 0,
|
|
259
259
|
value: 1
|
|
260
260
|
}));
|
|
@@ -264,11 +264,11 @@ describe('Changeable', function () {
|
|
|
264
264
|
});
|
|
265
265
|
test('should not update the value with new defaultProp when is not controlled', function () {
|
|
266
266
|
var Component = (0, _Changeable["default"])(DivComponent);
|
|
267
|
-
var _render5 = (0, _react.render)(
|
|
267
|
+
var _render5 = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
268
268
|
defaultValue: 0
|
|
269
269
|
})),
|
|
270
270
|
rerender = _render5.rerender;
|
|
271
|
-
rerender(
|
|
271
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
272
272
|
defaultValue: 1
|
|
273
273
|
}));
|
|
274
274
|
var expected = '0';
|
|
@@ -72,6 +72,6 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
72
72
|
var ComponentOverride = exports.ComponentOverride = function ComponentOverride(_ref) {
|
|
73
73
|
var Component = _ref.component,
|
|
74
74
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
75
|
-
return Component && ((0, _reactIs.isValidElementType)(Component) && /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({}, props)) || /*#__PURE__*/(0, _react.isValidElement)(Component) && (
|
|
75
|
+
return Component && ((0, _reactIs.isValidElementType)(Component) && /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({}, props)) || /*#__PURE__*/(0, _react.isValidElement)(Component) && (/*#__PURE__*/(0, _react.cloneElement)(Component, props))) || null;
|
|
76
76
|
};
|
|
77
77
|
var _default = exports["default"] = ComponentOverride;
|
|
@@ -165,7 +165,7 @@ var FloatingLayerBase = exports.FloatingLayerBase = /*#__PURE__*/function (_Comp
|
|
|
165
165
|
delete rest.onDismiss;
|
|
166
166
|
delete rest.onOpen;
|
|
167
167
|
if (open && this.state.readyToRender) {
|
|
168
|
-
return /*#__PURE__*/_reactDom["default"].createPortal(
|
|
168
|
+
return /*#__PURE__*/_reactDom["default"].createPortal(/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({
|
|
169
169
|
className: mergedClassName
|
|
170
170
|
}, rest), {}, {
|
|
171
171
|
children: [scrimType !== 'none' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Scrim["default"], {
|
|
@@ -84,7 +84,7 @@ var FloatingLayerDecorator = exports.FloatingLayerDecorator = (0, _hoc["default"
|
|
|
84
84
|
className: className,
|
|
85
85
|
floatLayerId: floatLayerId
|
|
86
86
|
});
|
|
87
|
-
return hook.provideFloatingLayer(
|
|
87
|
+
return hook.provideFloatingLayer(/*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapped, _objectSpread(_objectSpread({}, rest), {}, {
|
|
88
88
|
className: wrappedClassName
|
|
89
89
|
}), "floatWrapped"));
|
|
90
90
|
}
|
|
@@ -9,7 +9,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
9
9
|
describe('FloatingLayer Specs', function () {
|
|
10
10
|
var Root = (0, _FloatingLayerDecorator["default"])('div');
|
|
11
11
|
test('should not render if FloatingLayer is not open', function () {
|
|
12
|
-
(0, _react.render)(
|
|
12
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
13
13
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayerBase, {
|
|
14
14
|
"data-testid": "floatingLayer",
|
|
15
15
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -21,7 +21,7 @@ describe('FloatingLayer Specs', function () {
|
|
|
21
21
|
expect(floatingLayerContainer).not.toBeInTheDocument();
|
|
22
22
|
});
|
|
23
23
|
test('should render if FloatingLayer is open', function () {
|
|
24
|
-
(0, _react.render)(
|
|
24
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
25
25
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayerBase, {
|
|
26
26
|
"data-testid": "floatingLayer",
|
|
27
27
|
open: true,
|
|
@@ -35,7 +35,7 @@ describe('FloatingLayer Specs', function () {
|
|
|
35
35
|
});
|
|
36
36
|
test('should fire onOpen event with type when FloatingLayer is open', function () {
|
|
37
37
|
var handleOpen = jest.fn();
|
|
38
|
-
(0, _react.render)(
|
|
38
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
39
39
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayerBase, {
|
|
40
40
|
onOpen: handleOpen,
|
|
41
41
|
open: true,
|
|
@@ -54,7 +54,7 @@ describe('FloatingLayer Specs', function () {
|
|
|
54
54
|
});
|
|
55
55
|
test('should fire onClose event with type when FloatingLayer is closed', function () {
|
|
56
56
|
var handleClose = jest.fn();
|
|
57
|
-
var _render = (0, _react.render)(
|
|
57
|
+
var _render = (0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
58
58
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayerBase, {
|
|
59
59
|
onClose: handleClose,
|
|
60
60
|
open: true,
|
|
@@ -64,7 +64,7 @@ describe('FloatingLayer Specs', function () {
|
|
|
64
64
|
})
|
|
65
65
|
})),
|
|
66
66
|
rerender = _render.rerender;
|
|
67
|
-
rerender(
|
|
67
|
+
rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
68
68
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayerBase, {
|
|
69
69
|
onClose: handleClose,
|
|
70
70
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
@@ -80,7 +80,7 @@ describe('FloatingLayer Specs', function () {
|
|
|
80
80
|
});
|
|
81
81
|
test('should fire onDismiss event with type and detail info when FloatingLayer is closed', function () {
|
|
82
82
|
var handleDismiss = jest.fn();
|
|
83
|
-
(0, _react.render)(
|
|
83
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
|
|
84
84
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FloatingLayer.FloatingLayer, {
|
|
85
85
|
onDismiss: handleDismiss,
|
|
86
86
|
open: true,
|