@react-typed-forms/schemas 11.9.0 → 11.10.1

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.js CHANGED
@@ -1591,15 +1591,22 @@ function defaultDataProps(_ref4) {
1591
1591
  var className = cc(definition.styleClass);
1592
1592
  var required = !!definition.required;
1593
1593
  var fieldOptions = schemaInterface.getOptions(field);
1594
- var allowed = (_allowedOptions$value = allowedOptions == null ? void 0 : allowedOptions.value) != null ? _allowedOptions$value : [];
1594
+ var _allowed = (_allowedOptions$value = allowedOptions == null ? void 0 : allowedOptions.value) != null ? _allowedOptions$value : [];
1595
+ var allowed = Array.isArray(_allowed) ? _allowed : [_allowed];
1595
1596
  return _extends({
1596
1597
  definition: definition,
1597
1598
  childDefinitions: (_definition$children = definition.children) != null ? _definition$children : [],
1598
1599
  control: control,
1599
1600
  field: field,
1600
1601
  id: "c" + control.uniqueId,
1601
- options: fieldOptions && allowed.length > 0 ? fieldOptions.filter(function (x) {
1602
- return allowed.includes(x.value);
1602
+ options: allowed.length > 0 ? allowed.map(function (x) {
1603
+ var _fieldOptions$find;
1604
+ return typeof x === "object" ? x : (_fieldOptions$find = fieldOptions == null ? void 0 : fieldOptions.find(function (y) {
1605
+ return y.value == x;
1606
+ })) != null ? _fieldOptions$find : {
1607
+ name: x.toString(),
1608
+ value: x
1609
+ };
1603
1610
  }) : fieldOptions,
1604
1611
  readonly: !!formOptions.readonly,
1605
1612
  renderOptions: (_definition$renderOpt = definition.renderOptions) != null ? _definition$renderOpt : {