ywana-core8 0.0.254 → 0.0.255

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.umd.js CHANGED
@@ -846,12 +846,12 @@
846
846
  selected = props.selected,
847
847
  onChange = props.onChange;
848
848
  var tabs = React__default["default"].Children.map(children, function (child, index) {
849
- function select() {
850
- if (onChange) onChange(index);
849
+ function select(id) {
850
+ if (onChange) onChange(id || index);
851
851
  }
852
852
 
853
853
  return React__default["default"].cloneElement(child, {
854
- selected: index === selected,
854
+ selected: index === selected || selected === child.props.id,
855
855
  onSelect: select
856
856
  });
857
857
  });
@@ -866,13 +866,14 @@
866
866
  */
867
867
 
868
868
  var Tab = function Tab(props) {
869
- var label = props.label,
869
+ var id = props.id,
870
+ label = props.label,
870
871
  selected = props.selected,
871
872
  actions = props.actions,
872
873
  onSelect = props.onSelect;
873
874
 
874
875
  function select() {
875
- if (onSelect) onSelect();
876
+ if (onSelect) onSelect(id);
876
877
  }
877
878
 
878
879
  var style = selected ? "selected" : "";
@@ -1745,7 +1746,13 @@
1745
1746
  var value = _ref7.value,
1746
1747
  format = _ref7.format,
1747
1748
  options = _ref7.options;
1748
- var option = options ? options.find(function (o) {
1749
+
1750
+ function buildOptions() {
1751
+ var opts = typeof options === 'function' ? options() : options;
1752
+ return opts;
1753
+ }
1754
+
1755
+ var option = options ? buildOptions().find(function (o) {
1749
1756
  return o.value === value;
1750
1757
  }) : null;
1751
1758
  var text = option ? option.label : value;
@@ -4644,7 +4651,6 @@
4644
4651
  if (!content) return /*#__PURE__*/React__default["default"].createElement("div", null, "No Content...");
4645
4652
  var sections = content.sections();
4646
4653
  var value = content.value();
4647
- console.log(value);
4648
4654
  return /*#__PURE__*/React__default["default"].createElement("div", {
4649
4655
  className: "content-viewer"
4650
4656
  }, sections.map(function (section) {
@@ -4674,7 +4680,6 @@
4674
4680
  value = props.value;
4675
4681
  var type = field.type,
4676
4682
  label = field.label;
4677
- console.log('FieldViewer', field, value);
4678
4683
 
4679
4684
  switch (type) {
4680
4685
  case TYPES.STRING: