@lanaco/lnc-react-ui 2.1.3 → 2.1.4

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/lib/index.esm.js CHANGED
@@ -53346,7 +53346,7 @@ var iconPaddingBySize = function iconPaddingBySize(size) {
53346
53346
  };
53347
53347
 
53348
53348
  var containerColor = function containerColor(props) {
53349
- if (props.disable) return props.theme.palette.gray[200];
53349
+ if (props.disabled) return props.theme.palette.gray[200];
53350
53350
  if (props.focus) return "white";
53351
53351
  return props.theme.palette[props.color].lighter;
53352
53352
  };
@@ -53458,18 +53458,33 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53458
53458
  };
53459
53459
 
53460
53460
  var onKeyDown = function onKeyDown(e) {
53461
- if (e.keyCode === 27) InputRef.current.blur();
53462
- if (e.keyCode === 38 || e.keyCode === 40) e.preventDefault();
53463
- if (e.keyCode === 38 && cursor > 0) setCursor(cursor - 1);
53464
- if (e.keyCode === 40 && cursor < options.length - 1) setCursor(cursor + 1);
53461
+ //ArrowUp & ArrowDown
53462
+ if (e.keyCode === 38 || e.keyCode === 40) e.preventDefault(); //Esc
53463
+
53464
+ if (e.keyCode === 27) InputRef.current.blur(); //ArrowUp & ArrowDown
53465
+
53466
+ if (options !== null && options.length !== 0 && inFocus) {
53467
+ if (e.keyCode === 38 && cursor > 0) setCursor(cursor - 1);
53468
+ if (e.keyCode === 40 && cursor < options.length - 1) setCursor(cursor + 1);
53469
+ if (e.keyCode === 13) optionSelected([].concat(_toConsumableArray(items), [options[cursor]]));
53465
53470
 
53466
- if (e.key === "Enter" && options.length > 0 && value && value.length > 0) {
53467
- optionSelected([].concat(_toConsumableArray(items), [options[cursor]]));
53471
+ if (e.key === "Backspace" && items.length > 0 && value === "") {
53472
+ handleRemoveItem(items.length - 1);
53473
+ }
53474
+
53475
+ console.log("ARR DOWN");
53476
+ return;
53477
+ }
53478
+
53479
+ if (e.keyCode === 40) {
53480
+ setInFocus(true);
53481
+ setCursor(0);
53482
+ load(e.target.value);
53468
53483
  }
53469
53484
 
53470
53485
  var empty = options === null || options !== null && options.length === 0;
53471
53486
 
53472
- if (e.key === "Enter" && inFocus && empty && loading === false && value !== "") {
53487
+ if (e.key === "Enter" && inFocus && empty && loading === false) {
53473
53488
  onInputBlur();
53474
53489
  }
53475
53490
 
@@ -53528,7 +53543,7 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53528
53543
 
53529
53544
  var empty = options === null || options !== null && options.length === 0;
53530
53545
 
53531
- if (inFocus && empty && loading === false && value !== "") {
53546
+ if (inFocus && empty && loading === false) {
53532
53547
  return /*#__PURE__*/React__default.createElement(FadeIn, null, /*#__PURE__*/React__default.createElement(Content, _extends({}, themeProps, {
53533
53548
  key: 0
53534
53549
  }), /*#__PURE__*/React__default.createElement(ContentItem, _extends({}, themeProps, {
package/lib/index.js CHANGED
@@ -53387,7 +53387,7 @@ var iconPaddingBySize = function iconPaddingBySize(size) {
53387
53387
  };
53388
53388
 
53389
53389
  var containerColor = function containerColor(props) {
53390
- if (props.disable) return props.theme.palette.gray[200];
53390
+ if (props.disabled) return props.theme.palette.gray[200];
53391
53391
  if (props.focus) return "white";
53392
53392
  return props.theme.palette[props.color].lighter;
53393
53393
  };
@@ -53499,18 +53499,33 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53499
53499
  };
53500
53500
 
53501
53501
  var onKeyDown = function onKeyDown(e) {
53502
- if (e.keyCode === 27) InputRef.current.blur();
53503
- if (e.keyCode === 38 || e.keyCode === 40) e.preventDefault();
53504
- if (e.keyCode === 38 && cursor > 0) setCursor(cursor - 1);
53505
- if (e.keyCode === 40 && cursor < options.length - 1) setCursor(cursor + 1);
53502
+ //ArrowUp & ArrowDown
53503
+ if (e.keyCode === 38 || e.keyCode === 40) e.preventDefault(); //Esc
53504
+
53505
+ if (e.keyCode === 27) InputRef.current.blur(); //ArrowUp & ArrowDown
53506
+
53507
+ if (options !== null && options.length !== 0 && inFocus) {
53508
+ if (e.keyCode === 38 && cursor > 0) setCursor(cursor - 1);
53509
+ if (e.keyCode === 40 && cursor < options.length - 1) setCursor(cursor + 1);
53510
+ if (e.keyCode === 13) optionSelected([].concat(_toConsumableArray__default['default'](items), [options[cursor]]));
53506
53511
 
53507
- if (e.key === "Enter" && options.length > 0 && value && value.length > 0) {
53508
- optionSelected([].concat(_toConsumableArray__default['default'](items), [options[cursor]]));
53512
+ if (e.key === "Backspace" && items.length > 0 && value === "") {
53513
+ handleRemoveItem(items.length - 1);
53514
+ }
53515
+
53516
+ console.log("ARR DOWN");
53517
+ return;
53518
+ }
53519
+
53520
+ if (e.keyCode === 40) {
53521
+ setInFocus(true);
53522
+ setCursor(0);
53523
+ load(e.target.value);
53509
53524
  }
53510
53525
 
53511
53526
  var empty = options === null || options !== null && options.length === 0;
53512
53527
 
53513
- if (e.key === "Enter" && inFocus && empty && loading === false && value !== "") {
53528
+ if (e.key === "Enter" && inFocus && empty && loading === false) {
53514
53529
  onInputBlur();
53515
53530
  }
53516
53531
 
@@ -53569,7 +53584,7 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53569
53584
 
53570
53585
  var empty = options === null || options !== null && options.length === 0;
53571
53586
 
53572
- if (inFocus && empty && loading === false && value !== "") {
53587
+ if (inFocus && empty && loading === false) {
53573
53588
  return /*#__PURE__*/React__default['default'].createElement(FadeIn, null, /*#__PURE__*/React__default['default'].createElement(Content, _extends__default['default']({}, themeProps, {
53574
53589
  key: 0
53575
53590
  }), /*#__PURE__*/React__default['default'].createElement(ContentItem, _extends__default['default']({}, themeProps, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",