@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 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
 
@@ -272,6 +272,8 @@ var MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
272
272
  switch (e.key) {
273
273
  case 'Enter':
274
274
  {
275
+ e.preventDefault();
276
+
275
277
  if (selectionManager.focusedKey) {
276
278
  var key = selectionManager.focusedKey;
277
279
 
@@ -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
  });
@@ -220,6 +220,8 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
220
220
  switch (e.key) {
221
221
  case 'Enter':
222
222
  {
223
+ e.preventDefault();
224
+
223
225
  if (selectionManager.focusedKey) {
224
226
  var key = selectionManager.focusedKey;
225
227
 
@@ -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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.34.0-alpha.0",
3
+ "version": "1.34.0-alpha.2",
4
4
  "description": "PingUX themeable React component library",
5
5
  "repository": {
6
6
  "type": "git",