@pingux/astro 1.34.0-alpha.0 → 1.34.0-alpha.2
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/CHANGELOG.md +13 -0
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +2 -0
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +35 -0
- package/lib/components/MultivaluesField/MultivaluesField.js +2 -0
- package/lib/components/MultivaluesField/MultivaluesField.test.js +29 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,19 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [1.33.1](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.33.0...@pingux/astro@1.33.1) (2022-11-01)
|
7
|
+
|
8
|
+
|
9
|
+
### Bug Fixes
|
10
|
+
|
11
|
+
* [UIP-5638] LinkedListView - fix label font size ([aa9dfbe](https://gitlab.corp.pingidentity.com/ux/pingux/commit/aa9dfbed209fa782f66bd01396b396003a4db030))
|
12
|
+
* [UIP-5796] Fix checkbox getting focus indicator on click within a modal ([2fcc515](https://gitlab.corp.pingidentity.com/ux/pingux/commit/2fcc5154bb6eef4cb1191ad5a4c6830cf7b7b3e1))
|
13
|
+
* [UIP-5839] Fix support for checkbox indeterminism ([eef26e6](https://gitlab.corp.pingidentity.com/ux/pingux/commit/eef26e653948d0059e07475cb9056fd606955068))
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
6
19
|
# [1.33.0](https://gitlab.corp.pingidentity.com/ux/pingux/compare/@pingux/astro@1.32.1...@pingux/astro@1.33.0) (2022-10-27)
|
7
20
|
|
8
21
|
|
@@ -55,6 +55,24 @@ var getComponent = function getComponent() {
|
|
55
55
|
})));
|
56
56
|
};
|
57
57
|
|
58
|
+
var getComponentInForm = function getComponentInForm() {
|
59
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
60
|
+
var onFormSubmit = arguments.length > 1 ? arguments[1] : undefined;
|
61
|
+
|
62
|
+
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
63
|
+
_ref2$renderFn = _ref2.renderFn,
|
64
|
+
renderFn = _ref2$renderFn === void 0 ? _testWrapper.render : _ref2$renderFn;
|
65
|
+
|
66
|
+
return renderFn((0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)("form", {
|
67
|
+
onSubmit: onFormSubmit
|
68
|
+
}, (0, _react2.jsx)(_index.MultivaluesField, (0, _extends2["default"])({}, defaultProps, props), function (item) {
|
69
|
+
return (0, _react2.jsx)(_index.Item, {
|
70
|
+
key: item.key,
|
71
|
+
"data-id": item.name
|
72
|
+
}, item.name);
|
73
|
+
}))));
|
74
|
+
};
|
75
|
+
|
58
76
|
beforeAll(function () {
|
59
77
|
jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(function () {
|
60
78
|
return 1000;
|
@@ -570,4 +588,21 @@ test('popover closes on input blur', function () {
|
|
570
588
|
|
571
589
|
expect(_testWrapper.screen.queryByRole('listbox')).not.toBeInTheDocument();
|
572
590
|
expect(_testWrapper.screen.queryByRole('option')).not.toBeInTheDocument();
|
591
|
+
});
|
592
|
+
test('form does not submit when adding custom value', function () {
|
593
|
+
var onFormSubmit = jest.fn();
|
594
|
+
getComponentInForm({}, onFormSubmit);
|
595
|
+
|
596
|
+
var input = _testWrapper.screen.getByRole('combobox');
|
597
|
+
|
598
|
+
expect(input).toHaveValue('');
|
599
|
+
var value = 'custom';
|
600
|
+
|
601
|
+
_userEvent["default"].type(input, value);
|
602
|
+
|
603
|
+
expect(input).toHaveValue(value);
|
604
|
+
|
605
|
+
_userEvent["default"].type(input, '{enter}');
|
606
|
+
|
607
|
+
expect(onFormSubmit).not.toHaveBeenCalled();
|
573
608
|
});
|
@@ -41,6 +41,24 @@ var getComponent = function getComponent() {
|
|
41
41
|
})));
|
42
42
|
};
|
43
43
|
|
44
|
+
var getComponentInForm = function getComponentInForm() {
|
45
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
46
|
+
var onFormSubmit = arguments.length > 1 ? arguments[1] : undefined;
|
47
|
+
|
48
|
+
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
49
|
+
_ref2$renderFn = _ref2.renderFn,
|
50
|
+
renderFn = _ref2$renderFn === void 0 ? render : _ref2$renderFn;
|
51
|
+
|
52
|
+
return renderFn(___EmotionJSX(OverlayProvider, null, ___EmotionJSX("form", {
|
53
|
+
onSubmit: onFormSubmit
|
54
|
+
}, ___EmotionJSX(MultivaluesField, _extends({}, defaultProps, props), function (item) {
|
55
|
+
return ___EmotionJSX(Item, {
|
56
|
+
key: item.key,
|
57
|
+
"data-id": item.name
|
58
|
+
}, item.name);
|
59
|
+
}))));
|
60
|
+
};
|
61
|
+
|
44
62
|
beforeAll(function () {
|
45
63
|
jest.spyOn(window.HTMLElement.prototype, 'clientWidth', 'get').mockImplementation(function () {
|
46
64
|
return 1000;
|
@@ -420,4 +438,15 @@ test('popover closes on input blur', function () {
|
|
420
438
|
userEvent.click(document.body);
|
421
439
|
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
422
440
|
expect(screen.queryByRole('option')).not.toBeInTheDocument();
|
441
|
+
});
|
442
|
+
test('form does not submit when adding custom value', function () {
|
443
|
+
var onFormSubmit = jest.fn();
|
444
|
+
getComponentInForm({}, onFormSubmit);
|
445
|
+
var input = screen.getByRole('combobox');
|
446
|
+
expect(input).toHaveValue('');
|
447
|
+
var value = 'custom';
|
448
|
+
userEvent.type(input, value);
|
449
|
+
expect(input).toHaveValue(value);
|
450
|
+
userEvent.type(input, '{enter}');
|
451
|
+
expect(onFormSubmit).not.toHaveBeenCalled();
|
423
452
|
});
|