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.
package/dist/index.cjs CHANGED
@@ -5739,6 +5739,7 @@ var CollectionPage = function CollectionPage(props) {
5739
5739
  }) : false), canFilter && showFilter ? /*#__PURE__*/React__default["default"].createElement(CollectionFilters, {
5740
5740
  schema: schema
5741
5741
  }) : null, levels ? /*#__PURE__*/React__default["default"].createElement(CollectionTree, {
5742
+ schema: schema,
5742
5743
  icon: icon,
5743
5744
  levels: levels,
5744
5745
  onSelect: onSelect,
@@ -5922,7 +5923,8 @@ var CollectionTree = function CollectionTree(props) {
5922
5923
  onSelect = props.onSelect,
5923
5924
  sorter = props.sorter,
5924
5925
  _props$searchBy2 = props.searchBy,
5925
- searchBy = _props$searchBy2 === void 0 ? [] : _props$searchBy2;
5926
+ searchBy = _props$searchBy2 === void 0 ? [] : _props$searchBy2,
5927
+ schema = props.schema;
5926
5928
 
5927
5929
  var _useContext3 = React.useContext(PageContext),
5928
5930
  pageContext = _useContext3[0],
@@ -5945,6 +5947,7 @@ var CollectionTree = function CollectionTree(props) {
5945
5947
  }
5946
5948
 
5947
5949
  function group(items, by) {
5950
+ var options = schema[by] ? schema[by].options : null;
5948
5951
  return items.reduce(function (nodes, field) {
5949
5952
  var node = nodes.find(function (n) {
5950
5953
  return n.name === field[by];
@@ -5952,6 +5955,14 @@ var CollectionTree = function CollectionTree(props) {
5952
5955
 
5953
5956
  if (!node) {
5954
5957
  var name = field[by];
5958
+
5959
+ if (options) {
5960
+ var opt = options.find(function (option) {
5961
+ return option.value === field[by];
5962
+ });
5963
+ if (opt) name = opt.label;
5964
+ }
5965
+
5955
5966
  node = {
5956
5967
  name: name,
5957
5968
  items: [],