@pingux/astro 1.23.0-alpha.2 → 1.23.0-alpha.3

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.
@@ -172,7 +172,7 @@ var ArrayField = function ArrayField(props) {
172
172
  }
173
173
  }, [isControlled]);
174
174
  var onFieldAdd = (0, _react.useCallback)(function () {
175
- if (onAddRef.current) {
175
+ if (isControlled) {
176
176
  return onAddRef.current();
177
177
  }
178
178
 
@@ -181,7 +181,7 @@ var ArrayField = function ArrayField(props) {
181
181
 
182
182
  return (0, _concat["default"])(_context = []).call(_context, oldValues, [createEmptyField()]);
183
183
  });
184
- }, [createEmptyField]);
184
+ }, [createEmptyField, isControlled]);
185
185
 
186
186
  var _useLabel = (0, _label.useLabel)(_objectSpread({}, props)),
187
187
  raLabelProps = _useLabel.labelProps;
@@ -79,7 +79,11 @@ test('adds one text field and new empty field is added', function () {
79
79
  });
80
80
  test('onAdd callback is fired when adding field', function () {
81
81
  var onAdd = jest.fn();
82
+ var value = defaultData;
83
+ var defaultValue = null;
82
84
  getComponent({
85
+ value: value,
86
+ defaultValue: defaultValue,
83
87
  onAdd: onAdd,
84
88
  renderField: renderField
85
89
  });
@@ -54,7 +54,8 @@ var CollapsiblePanelItem = /*#__PURE__*/(0, _react.forwardRef)(function (props,
54
54
  fill: 'inherit'
55
55
  }
56
56
  },
57
- onPress: onPress
57
+ onPress: onPress,
58
+ "aria-label": "icon"
58
59
  }, iconElement)));
59
60
  });
60
61
  CollapsiblePanelItem.propTypes = {
@@ -150,6 +150,8 @@ var Default = function Default() {
150
150
  searchValue = _useState4[0],
151
151
  setSearchValue = _useState4[1];
152
152
 
153
+ var checkBoxRef = (0, _react.useRef)(null);
154
+
153
155
  var _useFilter = (0, _i18n.useFilter)({
154
156
  sensitivity: 'base'
155
157
  }),
@@ -325,7 +327,11 @@ var Default = function Default() {
325
327
  },
326
328
  isSelected: (0, _some["default"])(selectedItems).call(selectedItems, function (el) {
327
329
  return el.key === item.key;
328
- })
330
+ }),
331
+ ref: checkBoxRef,
332
+ onClick: function onClick() {
333
+ return checkBoxRef.current.focus();
334
+ }
329
335
  }));
330
336
  })), (0, _react2.jsx)(_.CollapsiblePanel, {
331
337
  items: selectedItems,
@@ -118,7 +118,7 @@ var ArrayField = function ArrayField(props) {
118
118
  }
119
119
  }, [isControlled]);
120
120
  var onFieldAdd = useCallback(function () {
121
- if (onAddRef.current) {
121
+ if (isControlled) {
122
122
  return onAddRef.current();
123
123
  }
124
124
 
@@ -127,7 +127,7 @@ var ArrayField = function ArrayField(props) {
127
127
 
128
128
  return _concatInstanceProperty(_context = []).call(_context, oldValues, [createEmptyField()]);
129
129
  });
130
- }, [createEmptyField]);
130
+ }, [createEmptyField, isControlled]);
131
131
 
132
132
  var _useLabel = useLabel(_objectSpread({}, props)),
133
133
  raLabelProps = _useLabel.labelProps;
@@ -66,7 +66,11 @@ test('adds one text field and new empty field is added', function () {
66
66
  });
67
67
  test('onAdd callback is fired when adding field', function () {
68
68
  var onAdd = jest.fn();
69
+ var value = defaultData;
70
+ var defaultValue = null;
69
71
  getComponent({
72
+ value: value,
73
+ defaultValue: defaultValue,
70
74
  onAdd: onAdd,
71
75
  renderField: renderField
72
76
  });
@@ -30,7 +30,8 @@ var CollapsiblePanelItem = /*#__PURE__*/forwardRef(function (props, ref) {
30
30
  fill: 'inherit'
31
31
  }
32
32
  },
33
- onPress: onPress
33
+ onPress: onPress,
34
+ "aria-label": "icon"
34
35
  }, iconElement)));
35
36
  });
36
37
  CollapsiblePanelItem.propTypes = {
@@ -16,7 +16,7 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
16
16
 
17
17
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
18
18
 
19
- import React, { useMemo, useState } from 'react';
19
+ import React, { useMemo, useState, useRef } from 'react';
20
20
  import { useFilter } from '@react-aria/i18n';
21
21
  import AccountIcon from 'mdi-react/AccountIcon';
22
22
  import AccountGroupIcon from 'mdi-react/AccountGroupIcon';
@@ -106,6 +106,8 @@ export var Default = function Default() {
106
106
  searchValue = _useState4[0],
107
107
  setSearchValue = _useState4[1];
108
108
 
109
+ var checkBoxRef = useRef(null);
110
+
109
111
  var _useFilter = useFilter({
110
112
  sensitivity: 'base'
111
113
  }),
@@ -281,7 +283,11 @@ export var Default = function Default() {
281
283
  },
282
284
  isSelected: _someInstanceProperty(selectedItems).call(selectedItems, function (el) {
283
285
  return el.key === item.key;
284
- })
286
+ }),
287
+ ref: checkBoxRef,
288
+ onClick: function onClick() {
289
+ return checkBoxRef.current.focus();
290
+ }
285
291
  }));
286
292
  })), ___EmotionJSX(CollapsiblePanel, {
287
293
  items: selectedItems,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.23.0-alpha.2",
3
+ "version": "1.23.0-alpha.3",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "ux-development@pingidentity.com",
6
6
  "license": "Apache-2.0",