ywana-core8 0.0.554 → 0.0.557

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.
@@ -747,7 +747,8 @@ var Property = function Property(props) {
747
747
  value = props.value,
748
748
  _props$editable = props.editable,
749
749
  editable = _props$editable === void 0 ? false : _props$editable,
750
- onChange = props.onChange;
750
+ onChange = props.onChange,
751
+ options = props.options;
751
752
 
752
753
  function change(event) {
753
754
  if (onChange) {
@@ -760,19 +761,26 @@ var Property = function Property(props) {
760
761
  if (onChange) onChange(id, "");
761
762
  }
762
763
 
764
+ var value2 = value || initial;
765
+
766
+ if (options && Array.isArray(options)) {
767
+ var opt = options.find(function (option) {
768
+ return option.value == value2;
769
+ });
770
+ if (opt) value2 = opt.label;
771
+ }
772
+
763
773
  return /*#__PURE__*/React.createElement("div", {
764
774
  className: "property property-" + id + " " + className
765
775
  }, /*#__PURE__*/React.createElement("div", {
766
776
  className: "property-name"
767
- }, name || label), initial ? /*#__PURE__*/React.createElement("div", {
768
- className: "property-value"
769
- }, initial) : null, /*#__PURE__*/React.createElement("div", {
777
+ }, name || label), /*#__PURE__*/React.createElement("div", {
770
778
  className: "property-value"
771
779
  }, editable ? /*#__PURE__*/React.createElement("input", {
772
780
  type: "text",
773
- value: value,
781
+ value: value2,
774
782
  onChange: change
775
- }) : value, editable && value.length > 0 ? /*#__PURE__*/React.createElement(Icon, {
783
+ }) : value2, editable && value2.length > 0 ? /*#__PURE__*/React.createElement(Icon, {
776
784
  icon: "close",
777
785
  size: "small",
778
786
  clickable: true,
@@ -5991,7 +5999,8 @@ var FieldViewer = function FieldViewer(props) {
5991
5999
  case TYPES.STRING:
5992
6000
  return /*#__PURE__*/React.createElement(Property, {
5993
6001
  label: label,
5994
- value: value
6002
+ value: value,
6003
+ options: field.options
5995
6004
  });
5996
6005
 
5997
6006
  case TYPES.ENTITY: