@lanaco/lnc-react-ui 2.1.2 → 2.1.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.
package/lib/index.esm.js CHANGED
@@ -53419,6 +53419,8 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53419
53419
  disabled = props.disabled,
53420
53420
  id = props.id,
53421
53421
  className = props.className,
53422
+ mapIdTo = props.mapIdTo,
53423
+ mapValueTo = props.mapValueTo,
53422
53424
  size = props.size,
53423
53425
  color = props.color,
53424
53426
  theme = props.theme;
@@ -53520,7 +53522,7 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53520
53522
  return optionSelected([].concat(_toConsumableArray(items), [item]));
53521
53523
  },
53522
53524
  hover: cursor === i
53523
- }), item.value);
53525
+ }), item[mapValueTo]);
53524
53526
  })));
53525
53527
  }
53526
53528
 
@@ -53551,10 +53553,10 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53551
53553
  }, /*#__PURE__*/React__default.createElement(ItemWrapper, _extends({}, themeProps, {
53552
53554
  key: key,
53553
53555
  first: key === 0,
53554
- title: x.value
53556
+ title: x[mapValueTo]
53555
53557
  }), /*#__PURE__*/React__default.createElement(Item, _extends({}, themeProps, {
53556
- id: x.id,
53557
- text: x.value,
53558
+ id: x[mapIdTo],
53559
+ text: x[mapValueTo],
53558
53560
  onRemove: function onRemove() {
53559
53561
  return handleRemoveItem(key);
53560
53562
  }
@@ -53599,7 +53601,9 @@ MultiSelectDropdown.defaultProps = {
53599
53601
  size: "small",
53600
53602
  color: "primary",
53601
53603
  notItemsFoundText: "No items found...",
53602
- theme: theme
53604
+ theme: theme,
53605
+ mapIdTo: "id",
53606
+ mapValueTo: "value"
53603
53607
  };
53604
53608
  MultiSelectDropdown.propTypes = {
53605
53609
  theme: PropTypes.object.isRequired,
@@ -53611,6 +53615,8 @@ MultiSelectDropdown.propTypes = {
53611
53615
  className: PropTypes.string,
53612
53616
  items: PropTypes.array,
53613
53617
  options: PropTypes.array,
53618
+ mapIdTo: PropTypes.string,
53619
+ mapValueTo: PropTypes.string,
53614
53620
  notItemsFoundText: PropTypes.string,
53615
53621
  size: PropTypes.oneOf(["small", "medium", "large"]),
53616
53622
  color: PropTypes.oneOf(["primary", "secondary", "success", "error", "warning", "gray", "background", "transparent"])
package/lib/index.js CHANGED
@@ -53460,6 +53460,8 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53460
53460
  disabled = props.disabled,
53461
53461
  id = props.id,
53462
53462
  className = props.className,
53463
+ mapIdTo = props.mapIdTo,
53464
+ mapValueTo = props.mapValueTo,
53463
53465
  size = props.size,
53464
53466
  color = props.color,
53465
53467
  theme = props.theme;
@@ -53561,7 +53563,7 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53561
53563
  return optionSelected([].concat(_toConsumableArray__default['default'](items), [item]));
53562
53564
  },
53563
53565
  hover: cursor === i
53564
- }), item.value);
53566
+ }), item[mapValueTo]);
53565
53567
  })));
53566
53568
  }
53567
53569
 
@@ -53592,10 +53594,10 @@ var MultiSelectDropdown = function MultiSelectDropdown(props) {
53592
53594
  }, /*#__PURE__*/React__default['default'].createElement(ItemWrapper, _extends__default['default']({}, themeProps, {
53593
53595
  key: key,
53594
53596
  first: key === 0,
53595
- title: x.value
53597
+ title: x[mapValueTo]
53596
53598
  }), /*#__PURE__*/React__default['default'].createElement(Item, _extends__default['default']({}, themeProps, {
53597
- id: x.id,
53598
- text: x.value,
53599
+ id: x[mapIdTo],
53600
+ text: x[mapValueTo],
53599
53601
  onRemove: function onRemove() {
53600
53602
  return handleRemoveItem(key);
53601
53603
  }
@@ -53640,7 +53642,9 @@ MultiSelectDropdown.defaultProps = {
53640
53642
  size: "small",
53641
53643
  color: "primary",
53642
53644
  notItemsFoundText: "No items found...",
53643
- theme: theme
53645
+ theme: theme,
53646
+ mapIdTo: "id",
53647
+ mapValueTo: "value"
53644
53648
  };
53645
53649
  MultiSelectDropdown.propTypes = {
53646
53650
  theme: PropTypes__default['default'].object.isRequired,
@@ -53652,6 +53656,8 @@ MultiSelectDropdown.propTypes = {
53652
53656
  className: PropTypes__default['default'].string,
53653
53657
  items: PropTypes__default['default'].array,
53654
53658
  options: PropTypes__default['default'].array,
53659
+ mapIdTo: PropTypes__default['default'].string,
53660
+ mapValueTo: PropTypes__default['default'].string,
53655
53661
  notItemsFoundText: PropTypes__default['default'].string,
53656
53662
  size: PropTypes__default['default'].oneOf(["small", "medium", "large"]),
53657
53663
  color: PropTypes__default['default'].oneOf(["primary", "secondary", "success", "error", "warning", "gray", "background", "transparent"])
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanaco/lnc-react-ui",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",