ywana-core8 0.0.617 → 0.0.620

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
@@ -5941,20 +5941,28 @@
5941
5941
  }
5942
5942
 
5943
5943
  function group(items, by) {
5944
- var options = schema[by].options;
5944
+ var options = schema[by] ? schema[by].options : null;
5945
5945
  return items.reduce(function (nodes, field) {
5946
5946
  var node = nodes.find(function (n) {
5947
5947
  return n.name === field[by];
5948
5948
  });
5949
5949
 
5950
5950
  if (!node) {
5951
- var name = options ? options.find(function (option) {
5952
- return option.value === field[by];
5953
- }) : field[by];
5951
+ var name = field[by];
5952
+ var title = field[by];
5953
+
5954
+ if (options) {
5955
+ var opt = options.find(function (option) {
5956
+ return option.value === field[by];
5957
+ });
5958
+ if (opt) title = opt.label;
5959
+ }
5960
+
5954
5961
  node = {
5955
5962
  name: name,
5956
5963
  items: [],
5957
- field: by
5964
+ field: by,
5965
+ title: title
5958
5966
  };
5959
5967
  nodes.push(node);
5960
5968
  }
@@ -5975,7 +5983,7 @@
5975
5983
 
5976
5984
  function renderNodes(nodes) {
5977
5985
  return nodes.map(function (node) {
5978
- var title = typeof node.name === 'boolean' ? node.field + " = " + node.name : node.name;
5986
+ var title = typeof node.name === 'boolean' ? node.field + " = " + node.name : node.title;
5979
5987
  return /*#__PURE__*/React__default["default"].createElement(TreeNode, {
5980
5988
  key: node.name,
5981
5989
  icon: null,