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.cjs CHANGED
@@ -851,12 +851,12 @@ var Tabs = function Tabs(props) {
851
851
  selected = props.selected,
852
852
  onChange = props.onChange;
853
853
  var tabs = React__default["default"].Children.map(children, function (child, index) {
854
- function select() {
855
- if (onChange) onChange(index);
854
+ function select(id) {
855
+ if (onChange) onChange(id || index);
856
856
  }
857
857
 
858
858
  return React__default["default"].cloneElement(child, {
859
- selected: index === selected,
859
+ selected: index === selected || selected === child.props.id,
860
860
  onSelect: select
861
861
  });
862
862
  });
@@ -871,13 +871,14 @@ var Tabs = function Tabs(props) {
871
871
  */
872
872
 
873
873
  var Tab = function Tab(props) {
874
- var label = props.label,
874
+ var id = props.id,
875
+ label = props.label,
875
876
  selected = props.selected,
876
877
  actions = props.actions,
877
878
  onSelect = props.onSelect;
878
879
 
879
880
  function select() {
880
- if (onSelect) onSelect();
881
+ if (onSelect) onSelect(id);
881
882
  }
882
883
 
883
884
  var style = selected ? "selected" : "";
@@ -1750,7 +1751,13 @@ var StringCellViewer = function StringCellViewer(_ref7) {
1750
1751
  var value = _ref7.value,
1751
1752
  format = _ref7.format,
1752
1753
  options = _ref7.options;
1753
- var option = options ? options.find(function (o) {
1754
+
1755
+ function buildOptions() {
1756
+ var opts = typeof options === 'function' ? options() : options;
1757
+ return opts;
1758
+ }
1759
+
1760
+ var option = options ? buildOptions().find(function (o) {
1754
1761
  return o.value === value;
1755
1762
  }) : null;
1756
1763
  var text = option ? option.label : value;
@@ -4649,7 +4656,6 @@ var ContentViewer = function ContentViewer(props) {
4649
4656
  if (!content) return /*#__PURE__*/React__default["default"].createElement("div", null, "No Content...");
4650
4657
  var sections = content.sections();
4651
4658
  var value = content.value();
4652
- console.log(value);
4653
4659
  return /*#__PURE__*/React__default["default"].createElement("div", {
4654
4660
  className: "content-viewer"
4655
4661
  }, sections.map(function (section) {
@@ -4679,7 +4685,6 @@ var FieldViewer = function FieldViewer(props) {
4679
4685
  value = props.value;
4680
4686
  var type = field.type,
4681
4687
  label = field.label;
4682
- console.log('FieldViewer', field, value);
4683
4688
 
4684
4689
  switch (type) {
4685
4690
  case TYPES.STRING: