linear-react-components-ui 1.0.17-beta.2 → 1.0.17-beta.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.
@@ -60,6 +60,9 @@ var NumberField = function NumberField(props) {
60
60
  if (props.onChange) props.onChange(event);
61
61
  }
62
62
  };
63
+ (0, _react.useEffect)(function () {
64
+ if (value && value !== numberValue) setNumberValue(value.toString());
65
+ }, [value]);
63
66
  return /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
64
67
  value: numberValue,
65
68
  textAlign: textAlign,
@@ -163,8 +163,14 @@ var MultipleSelect = function MultipleSelect(props) {
163
163
  };
164
164
  var onInputKeyDown = function onInputKeyDown(e) {
165
165
  if (e.keyCode) {
166
- if (e.keyCode === constants.keyCodes.ENTER && selected) {
167
- if (!currents.includes(selected)) onSelect(selected);
166
+ if (e.keyCode === constants.keyCodes.ENTER && selected && opened) {
167
+ if (!currents.some(function (current) {
168
+ return current[idKey] === selected[idKey];
169
+ })) {
170
+ var _e$preventDefault;
171
+ (_e$preventDefault = e.preventDefault) === null || _e$preventDefault === void 0 ? void 0 : _e$preventDefault.call(e);
172
+ onSelect(selected);
173
+ }
168
174
  } else if ([constants.keyCodes.ARROW_UP, constants.keyCodes.ARROW_DOWN].includes(e.keyCode)) {
169
175
  if (!opened) setOpened(true);
170
176
  var index = dataCombo ? dataCombo.findIndex(function (d) {
@@ -190,7 +190,7 @@ var SimpleSelect = function SimpleSelect(props) {
190
190
  };
191
191
  var onInputKeyDown = function onInputKeyDown(e) {
192
192
  if (e.keyCode) {
193
- if (e.keyCode === constants.keyCodes.ENTER && selected) {
193
+ if (e.keyCode === constants.keyCodes.ENTER && selected && opened) {
194
194
  var _e$preventDefault;
195
195
  (_e$preventDefault = e.preventDefault) === null || _e$preventDefault === void 0 ? void 0 : _e$preventDefault.call(e);
196
196
  onSelect(selected);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.0.17-beta.2",
3
+ "version": "1.0.17-beta.3",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",