ywana-core8 0.0.552 → 0.0.555

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) {
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,
@@ -2619,7 +2627,7 @@ var Calendar = function Calendar(props) {
2619
2627
  setPosition(today);
2620
2628
  }, []);
2621
2629
  useEffect(function () {
2622
- if (onChange) {
2630
+ if (position && onChange) {
2623
2631
  var _firstDayOfMonth = position.clone().startOf('month');
2624
2632
 
2625
2633
  var _firstDayOfRange = _firstDayOfMonth.clone().startOf('isoweek');
@@ -3786,7 +3794,8 @@ var View = function View(props) {
3786
3794
  };
3787
3795
  var TabbedView = function TabbedView(props) {
3788
3796
  var title = props.title,
3789
- className = props.className;
3797
+ className = props.className,
3798
+ selected = props.selected;
3790
3799
 
3791
3800
  var _useState2 = useState(0),
3792
3801
  tab = _useState2[0],
@@ -3799,6 +3808,9 @@ var TabbedView = function TabbedView(props) {
3799
3808
  label: child.props.label
3800
3809
  });
3801
3810
  });
3811
+ useEffect(function () {
3812
+ if (selected && selected !== tab) setTab(selected);
3813
+ }, [selected]);
3802
3814
  var toolbar = /*#__PURE__*/React.createElement(Tabs, {
3803
3815
  selected: tab,
3804
3816
  onChange: function onChange(tab) {
@@ -5987,7 +5999,8 @@ var FieldViewer = function FieldViewer(props) {
5987
5999
  case TYPES.STRING:
5988
6000
  return /*#__PURE__*/React.createElement(Property, {
5989
6001
  label: label,
5990
- value: value
6002
+ value: value,
6003
+ options: field.options
5991
6004
  });
5992
6005
 
5993
6006
  case TYPES.ENTITY: