@bigbinary/neetoui 5.0.4 → 5.0.5

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/index.d.ts CHANGED
@@ -324,6 +324,7 @@ export type SelectProps = {
324
324
  id?: string;
325
325
  loadOptions?: boolean;
326
326
  labelProps?: LabelProps;
327
+ optionRemapping?: { label?: string, value?: string }
327
328
  [key: string]: any;
328
329
  };
329
330
 
package/index.js CHANGED
@@ -28024,7 +28024,7 @@ var AsyncCreatableSelect = /*#__PURE__*/forwardRef$1(function (props, ref) {
28024
28024
  }, selectProps));
28025
28025
  });
28026
28026
 
28027
- var _excluded$b = ["size", "label", "required", "error", "helpText", "className", "innerRef", "isCreateable", "strategy", "id", "labelProps", "value", "defaultValue", "components"];
28027
+ var _excluded$b = ["size", "label", "required", "error", "helpText", "className", "innerRef", "isCreateable", "strategy", "id", "labelProps", "value", "defaultValue", "components", "optionRemapping"];
28028
28028
  function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
28029
28029
  function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty$7(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28030
28030
  var SIZES$3 = {
@@ -28067,6 +28067,8 @@ var Select = function Select(_ref) {
28067
28067
  value = _ref.value,
28068
28068
  defaultValue = _ref.defaultValue,
28069
28069
  componentOverrides = _ref.components,
28070
+ _ref$optionRemapping = _ref.optionRemapping,
28071
+ optionRemapping = _ref$optionRemapping === void 0 ? {} : _ref$optionRemapping,
28070
28072
  otherProps = _objectWithoutProperties$1(_ref, _excluded$b);
28071
28073
  var inputId = useId(id);
28072
28074
  var Parent = StateManagedSelect;
@@ -28076,6 +28078,12 @@ var Select = function Select(_ref) {
28076
28078
  if (otherProps.loadOptions) {
28077
28079
  Parent = isCreateable ? AsyncCreatableSelect : AsyncSelect;
28078
28080
  }
28081
+ if (optionRemapping.value) {
28082
+ otherProps.getOptionValue = prop(optionRemapping.value);
28083
+ }
28084
+ if (optionRemapping.label) {
28085
+ otherProps.getOptionLabel = prop(optionRemapping.label);
28086
+ }
28079
28087
  var portalProps = strategy === STRATEGIES.fixed && {
28080
28088
  menuPortalTarget: document.body,
28081
28089
  styles: {