ywana-core8 0.0.616 → 0.0.619

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.
@@ -5731,6 +5731,7 @@ var CollectionPage = function CollectionPage(props) {
5731
5731
  }) : false), canFilter && showFilter ? /*#__PURE__*/React.createElement(CollectionFilters, {
5732
5732
  schema: schema
5733
5733
  }) : null, levels ? /*#__PURE__*/React.createElement(CollectionTree, {
5734
+ schema: schema,
5734
5735
  icon: icon,
5735
5736
  levels: levels,
5736
5737
  onSelect: onSelect,
@@ -5914,7 +5915,8 @@ var CollectionTree = function CollectionTree(props) {
5914
5915
  onSelect = props.onSelect,
5915
5916
  sorter = props.sorter,
5916
5917
  _props$searchBy2 = props.searchBy,
5917
- searchBy = _props$searchBy2 === void 0 ? [] : _props$searchBy2;
5918
+ searchBy = _props$searchBy2 === void 0 ? [] : _props$searchBy2,
5919
+ schema = props.schema;
5918
5920
 
5919
5921
  var _useContext3 = useContext(PageContext),
5920
5922
  pageContext = _useContext3[0],
@@ -5937,6 +5939,7 @@ var CollectionTree = function CollectionTree(props) {
5937
5939
  }
5938
5940
 
5939
5941
  function group(items, by) {
5942
+ var options = schema[by] ? schema[by].options : null;
5940
5943
  return items.reduce(function (nodes, field) {
5941
5944
  var node = nodes.find(function (n) {
5942
5945
  return n.name === field[by];
@@ -5944,6 +5947,14 @@ var CollectionTree = function CollectionTree(props) {
5944
5947
 
5945
5948
  if (!node) {
5946
5949
  var name = field[by];
5950
+
5951
+ if (options) {
5952
+ var opt = options.find(function (option) {
5953
+ return option.value === field[by];
5954
+ });
5955
+ if (opt) name = opt.label;
5956
+ }
5957
+
5947
5958
  node = {
5948
5959
  name: name,
5949
5960
  items: [],