@pdg/react-form 1.0.61 → 1.0.62

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/dist/index.js CHANGED
@@ -4102,7 +4102,7 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
4102
4102
  React.useEffect(function () {
4103
4103
  if (items) {
4104
4104
  setItemValueLabels(items.reduce(function (res, item) {
4105
- res[item.value] = item.label;
4105
+ res["".concat(item.value)] = item.label;
4106
4106
  return res;
4107
4107
  }, {}));
4108
4108
  setHasEmptyValue(!!items.find(function (_a) {
@@ -4120,7 +4120,7 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
4120
4120
  if (items) {
4121
4121
  return items.reduce(function (res, _a) {
4122
4122
  var value = _a.value;
4123
- res[value.toString()] = value;
4123
+ res["".concat(value)] = value;
4124
4124
  return res;
4125
4125
  }, {});
4126
4126
  }
@@ -4170,13 +4170,13 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
4170
4170
  if (multiple) {
4171
4171
  if (Array.isArray(finalValue)) {
4172
4172
  finalValue = finalValue.map(function (v) {
4173
- var realValue = itemsValues[v.toString()];
4173
+ var realValue = itemsValues["".concat(v)];
4174
4174
  return realValue != null ? realValue : v;
4175
4175
  });
4176
4176
  }
4177
4177
  }
4178
4178
  else {
4179
- var realValue = itemsValues[finalValue.toString()];
4179
+ var realValue = itemsValues["".concat(finalValue)];
4180
4180
  if (realValue != null && finalValue !== realValue) {
4181
4181
  finalValue = realValue;
4182
4182
  }
@@ -4228,7 +4228,7 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
4228
4228
  return React.createElement(material.Chip, { key: value || '$$$EmptyValuePlaceholder$$$', label: 'hahaha', size: 'small' });
4229
4229
  }
4230
4230
  else {
4231
- return React.createElement(material.Chip, { key: value, label: itemValueLabels[value], size: 'small' });
4231
+ return React.createElement(material.Chip, { key: value, label: itemValueLabels["".concat(value)], size: 'small' });
4232
4232
  }
4233
4233
  })));
4234
4234
  }
@@ -4312,7 +4312,7 @@ styleInject(css_248z$f);var FormSelect = ToForwardRefExoticComponent(AutoTypeFor
4312
4312
  isSelectedPlaceholder && (React.createElement(material.MenuItem, { key: '$$$EmptyValuePlaceholder$$$', value: '', disabled: true, sx: { display: 'none' } }, placeholder)),
4313
4313
  items && notEmpty(items) ? (items.map(function (_a) {
4314
4314
  var itemLabel = _a.label, itemValue = _a.value, disabled = _a.disabled;
4315
- return (React.createElement(material.MenuItem, { key: empty(itemValue) ? '$$$EmptyValue$$$' : itemValue, value: itemValue, disabled: disabled },
4315
+ return (React.createElement(material.MenuItem, { key: empty(itemValue) ? '$$$EmptyValue$$$' : "".concat(itemValue), value: typeof itemValue === 'boolean' ? "".concat(itemValue) : itemValue, disabled: disabled },
4316
4316
  multiple && checkbox && Array.isArray(value) && React.createElement(material.Checkbox, { checked: value.includes(itemValue) }),
4317
4317
  itemLabel));
4318
4318
  })) : (React.createElement(material.MenuItem, { value: '' })))));
@@ -5085,7 +5085,7 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
5085
5085
  if (items) {
5086
5086
  return items.reduce(function (res, _a) {
5087
5087
  var value = _a.value;
5088
- res[value.toString()] = value;
5088
+ res["".concat(value)] = value;
5089
5089
  return res;
5090
5090
  }, {});
5091
5091
  }
@@ -5149,13 +5149,13 @@ styleInject(css_248z$d);var FormToggleButtonGroup = ToForwardRefExoticComponent(
5149
5149
  if (multiple) {
5150
5150
  if (Array.isArray(finalValue)) {
5151
5151
  finalValue = finalValue.map(function (v) {
5152
- var realValue = itemsValues[v.toString()];
5152
+ var realValue = itemsValues["".concat(v)];
5153
5153
  return realValue != null ? realValue : v;
5154
5154
  });
5155
5155
  }
5156
5156
  }
5157
5157
  else {
5158
- var realValue = itemsValues[finalValue.toString()];
5158
+ var realValue = itemsValues["".concat(finalValue)];
5159
5159
  if (realValue != null && finalValue !== realValue) {
5160
5160
  finalValue = realValue;
5161
5161
  }
@@ -8112,7 +8112,7 @@ FormTextEditor.defaultProps = FormTextEditorDefaultProps;var FormAutocompleteDef
8112
8112
  }
8113
8113
  }, [getOptionDisabled]);
8114
8114
  // Render ----------------------------------------------------------------------------------------------------------
8115
- return (React.createElement(material.Autocomplete, { options: items || [], className: classNames$1(className, 'FormValueItem', 'FormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, getOptionDisabled: handleGetOptionDisabled, disabled: disabled, readOnly: readOnly, loading: loading || isOnGetItemLoading, loadingText: loadingText, limitTags: limitTags, onChange: function (e, value, reason, details) { return handleChange(value, reason, details); }, renderOption: function (props, option) { return (React.createElement("li", __assign$7({}, props, { key: option.value }), onRenderItem ? onRenderItem(option) : option.label)); }, onInputChange: function (event, newInputValue, reason) {
8115
+ return (React.createElement(material.Autocomplete, { options: items || [], className: classNames$1(className, 'FormValueItem', 'FormAutocomplete'), sx: sx, multiple: multiple, fullWidth: !width && fullWidth, openOnFocus: openOnFocus, disableClearable: disableClearable, disablePortal: disablePortal, noOptionsText: noOptionsText, value: componentValue, style: style, isOptionEqualToValue: function (option, value) { return option.value === value.value; }, getOptionDisabled: handleGetOptionDisabled, disabled: disabled, readOnly: readOnly, loading: loading || isOnGetItemLoading, loadingText: loadingText, limitTags: limitTags, onChange: function (e, value, reason, details) { return handleChange(value, reason, details); }, renderOption: function (props, option) { return (React.createElement("li", __assign$7({}, props, { key: "".concat(option.value) }), onRenderItem ? onRenderItem(option) : option.label)); }, onInputChange: function (event, newInputValue, reason) {
8116
8116
  if (reason === 'input') {
8117
8117
  setInputValue(newInputValue);
8118
8118
  }