@enact/ui 5.0.0-alpha.3 → 5.0.0-alpha.5
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/AnnounceDecorator.js +2 -2
- 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/BodyText.js +2 -2
- package/BodyText/tests/BodyText-specs.js +6 -6
- package/Button/Button.js +2 -2
- package/Button/tests/Button-specs.js +10 -10
- package/CHANGELOG.md +22 -1
- package/Cancelable/tests/Cancelable-specs.js +19 -19
- package/Card/Card.d.ts +77 -0
- package/Card/Card.js +215 -0
- package/Card/Card.module.css +31 -0
- package/Card/package.json +3 -0
- package/Card/tests/Card-specs.js +90 -0
- package/Changeable/tests/Changeable-specs.js +25 -25
- package/ComponentOverride/ComponentOverride.js +3 -3
- package/FloatingLayer/FloatingLayer.js +3 -3
- package/FloatingLayer/FloatingLayerDecorator.js +3 -3
- package/FloatingLayer/Scrim.js +2 -2
- 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/Group.js +2 -2
- package/Group/GroupItem.js +2 -2
- package/Group/tests/Group-specs.js +11 -11
- package/Heading/Heading.js +2 -2
- package/Heading/tests/Heading-specs.js +14 -14
- package/Icon/Icon.js +3 -2
- package/Icon/tests/Icon-specs.js +9 -9
- package/Image/Image.js +2 -2
- package/Image/tests/Image-specs.js +5 -5
- package/ImageItem/ImageItem.js +2 -2
- package/ImageItem/tests/ImageItem-specs.js +11 -11
- package/Item/Item.js +2 -2
- package/Item/tests/Item-specs.js +7 -7
- package/LabeledIcon/LabeledIcon.js +3 -3
- package/LabeledIcon/tests/LabeledIcon-specs.js +4 -4
- package/Layout/Cell.js +2 -2
- package/Layout/Layout.js +2 -2
- package/Layout/tests/Layout-specs.js +10 -10
- package/Marquee/MarqueeBase.js +2 -2
- package/Marquee/MarqueeController.js +1 -1
- package/Marquee/MarqueeDecorator.js +2 -2
- package/Marquee/tests/Marquee-specs.js +44 -44
- package/Measurable/tests/Measurable-specs.js +3 -3
- package/Media/Media.js +3 -3
- 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/ProgressBar.js +2 -2
- package/ProgressBar/tests/ProgressBar-specs.js +7 -7
- package/Repeater/Repeater.js +2 -2
- 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/Link.js +2 -2
- package/Routable/Routable.js +2 -2
- package/Routable/Router.js +2 -2
- package/Routable/tests/Routable-specs.js +1 -1
- package/Routable/tests/Router-specs.js +10 -10
- package/Routable/util.js +3 -3
- package/Scroller/ScrollerBasic.js +2 -2
- package/Scroller/tests/Scroller-specs.js +3 -3
- package/Skinnable/Skinnable.js +3 -3
- package/Skinnable/tests/Skinnable-specs.js +19 -19
- package/Skinnable/tests/useSkins-specs.js +14 -14
- package/Slider/Knob.js +2 -2
- package/Slider/Slider.js +2 -2
- 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/Spinner.js +2 -2
- package/Spinner/tests/Spinner-specs.js +5 -5
- package/ToggleIcon/ToggleIcon.js +2 -2
- package/ToggleIcon/tests/ToggleIcon-specs.js +5 -5
- package/Toggleable/Toggleable.js +2 -2
- package/Toggleable/tests/Toggleable-specs.js +41 -41
- package/Toggleable/useToggle.js +2 -2
- package/Touchable/Touchable.js +2 -2
- package/Touchable/tests/Touchable-specs.js +38 -38
- package/Touchable/tests/useTouch-specs.js +17 -17
- package/Transition/Transition.js +2 -2
- package/Transition/tests/Transition-specs.js +11 -11
- package/ViewManager/ViewManager.js +2 -2
- package/ViewManager/tests/View-specs.js +13 -13
- package/ViewManager/tests/ViewManager-specs.js +50 -50
- package/VirtualList/VirtualListBasic.js +3 -3
- package/VirtualList/tests/VirtualGridList-native-specs.js +8 -8
- package/VirtualList/tests/VirtualGridList-specs.js +25 -25
- package/VirtualList/tests/VirtualList-native-specs.js +9 -9
- package/VirtualList/tests/VirtualList-specs.js +31 -31
- 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 +7 -7
- package/resolution/index.d.ts +5 -1
- package/resolution/resolution.js +5 -1
- package/resolution/tests/ResolutionDecorator-specs.js +2 -2
- package/resolution/tests/resolution-specs.js +46 -19
- package/styles/mixins.less +0 -2
- package/useControlledState/tests/useControlledState-specs.js +10 -10
- package/useScroll/ScrollAnimator.js +3 -3
- package/useScroll/Scrollbar.js +2 -2
- package/useScroll/ScrollbarTrack.js +2 -2
- package/useScroll/useScroll.js +5 -2
|
@@ -42,8 +42,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
42
42
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
43
43
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
44
44
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
45
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
46
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
45
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
46
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
47
47
|
var defaultConfig = {
|
|
48
48
|
/**
|
|
49
49
|
* Configures the prop name to pass the announce function.
|
|
@@ -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');
|
package/BodyText/BodyText.js
CHANGED
|
@@ -32,8 +32,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
32
32
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
33
33
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
34
34
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
35
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
36
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
35
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
36
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
37
37
|
var BodyTextBase = exports.BodyTextBase = (0, _kind["default"])({
|
|
38
38
|
name: 'ui:BodyText',
|
|
39
39
|
propTypes: /** @lends ui/BodyText.BodyTextBase.prototype */{
|
|
@@ -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
|
}));
|
package/Button/Button.js
CHANGED
|
@@ -15,8 +15,8 @@ var _ButtonModule = _interopRequireDefault(require("./Button.module.css"));
|
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
var _excluded = ["children", "componentRef", "css", "decoration", "disabled", "icon"];
|
|
17
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
18
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
19
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
18
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
19
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
20
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
22
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -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,28 @@
|
|
|
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.5] - 2025-04-04
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- `ui/Card` component
|
|
10
|
+
|
|
11
|
+
## [4.9.6] - 2025-03-27
|
|
12
|
+
|
|
13
|
+
No significant changes.
|
|
14
|
+
|
|
15
|
+
## [5.0.0-alpha.4] - 2025-01-21
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- `ui/VirtualList` to not abnormally scroll when `dataSize` and `itemSizes` changed
|
|
20
|
+
|
|
21
|
+
## [4.9.5] - 2024-12-11
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- `ui/VirtualList` to not abnormally scroll when `dataSize` and `itemSizes` changed
|
|
26
|
+
|
|
5
27
|
## [5.0.0-alpha.3] - 2024-12-02
|
|
6
28
|
|
|
7
29
|
### Fixed
|
|
@@ -1446,7 +1468,6 @@ libraries.
|
|
|
1446
1468
|
|
|
1447
1469
|
- Renamed `ui/Group` prop `select` to `childSelect` and added prop `select` to support selection types
|
|
1448
1470
|
|
|
1449
|
-
|
|
1450
1471
|
## [1.0.0-alpha.2] - 2016-10-21
|
|
1451
1472
|
|
|
1452
1473
|
This version includes a lot of refactoring from the previous release. Developers need to switch to the new enact-dev command-line tool.
|
|
@@ -9,8 +9,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
9
9
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
10
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
11
11
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var
|
|
13
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.
|
|
12
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
13
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
14
14
|
describe('Cancelable', function () {
|
|
15
15
|
// Suite-wide setup
|
|
16
16
|
var Component = function Component(_ref) {
|
|
@@ -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
|
});
|
package/Card/Card.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Type definitions for ui/Card
|
|
2
|
+
|
|
3
|
+
import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
7
|
+
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
8
|
+
|
|
9
|
+
export interface CardBaseProps {
|
|
10
|
+
/**
|
|
11
|
+
* Determines whether the caption will be placed over the image or not.
|
|
12
|
+
*/
|
|
13
|
+
captionOverlay?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The caption node to be displayed with the image.
|
|
16
|
+
*/
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Called with a reference to the root component.
|
|
20
|
+
*
|
|
21
|
+
* When using , the `ref` prop is forwarded to this component
|
|
22
|
+
as `componentRef` .
|
|
23
|
+
*/
|
|
24
|
+
componentRef?: object | Function;
|
|
25
|
+
/**
|
|
26
|
+
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
27
|
+
corresponding internal elements and states of this component.
|
|
28
|
+
*
|
|
29
|
+
* The following classes are supported.
|
|
30
|
+
*/
|
|
31
|
+
css?: object;
|
|
32
|
+
/**
|
|
33
|
+
* The component used to render the image component.
|
|
34
|
+
*/
|
|
35
|
+
imageComponent?: React.ComponentType | JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* The layout orientation of the component.
|
|
38
|
+
*/
|
|
39
|
+
orientation?: "horizontal" | "vertical";
|
|
40
|
+
/**
|
|
41
|
+
* A placeholder image to be displayed before the image is loaded.
|
|
42
|
+
*/
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Applies a selected visual effect to the image.
|
|
46
|
+
*/
|
|
47
|
+
selected?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* String value or object of values used to determine which image will appear on a specific
|
|
50
|
+
screenSize.
|
|
51
|
+
*/
|
|
52
|
+
src?: string | object;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* A basic card without any behavior.
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
export class CardBase extends React.Component<
|
|
59
|
+
Merge<React.HTMLProps<HTMLElement>, CardBaseProps>
|
|
60
|
+
> {}
|
|
61
|
+
|
|
62
|
+
export interface CardDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
63
|
+
export function CardDecorator<P>(
|
|
64
|
+
Component: React.ComponentType<P> | string,
|
|
65
|
+
): React.ComponentType<P & CardDecoratorProps>;
|
|
66
|
+
|
|
67
|
+
export interface CardProps
|
|
68
|
+
extends Omit<Merge<CardBaseProps, CardDecoratorProps>, "componentRef"> {}
|
|
69
|
+
/**
|
|
70
|
+
* A minimally styled Card ready for customization by a theme.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
export class Card extends React.Component<
|
|
74
|
+
Merge<React.HTMLProps<HTMLElement>, CardProps>
|
|
75
|
+
> {}
|
|
76
|
+
|
|
77
|
+
export default Card;
|