ywana-core8 0.0.713 → 0.0.714

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.
@@ -691,6 +691,7 @@ var GroupedList = function GroupedList(props) {
691
691
  var _props$items2 = props.items,
692
692
  items = _props$items2 === void 0 ? [] : _props$items2,
693
693
  children = props.children,
694
+ selected = props.selected,
694
695
  onSelect = props.onSelect,
695
696
  groupBy = props.groupBy;
696
697
  var groups = items.reduce(function (groups, item) {
@@ -722,6 +723,7 @@ var GroupedList = function GroupedList(props) {
722
723
  return /*#__PURE__*/React.createElement(ListItem, {
723
724
  key: item.id,
724
725
  item: item,
726
+ selected: selected,
725
727
  onSelect: onSelect
726
728
  });
727
729
  })));
@@ -734,6 +736,7 @@ var GroupedList = function GroupedList(props) {
734
736
 
735
737
  var ListItem = function ListItem(_ref) {
736
738
  var item = _ref.item,
739
+ selected = _ref.selected,
737
740
  onSelect = _ref.onSelect;
738
741
  var id = item.id,
739
742
  icon = item.icon,
@@ -745,7 +748,9 @@ var ListItem = function ListItem(_ref) {
745
748
  if (onSelect) onSelect(id);
746
749
  }
747
750
 
751
+ var style = selected === id ? "selected" : "";
748
752
  return /*#__PURE__*/React.createElement("li", {
753
+ className: "" + style,
749
754
  onClick: select
750
755
  }, icon ? /*#__PURE__*/React.createElement(Icon, {
751
756
  icon: icon,
@@ -10213,7 +10218,8 @@ var DynamicFormField = function DynamicFormField(props) {
10213
10218
 
10214
10219
  var CollectionFilters = function CollectionFilters(props) {
10215
10220
  var schema = props.schema,
10216
- children = props.children;
10221
+ children = props.children,
10222
+ value = props.value;
10217
10223
  var context = useContext(CollectionContext);
10218
10224
  var filters = context.filters;
10219
10225
 
@@ -10222,6 +10228,7 @@ var CollectionFilters = function CollectionFilters(props) {
10222
10228
  setOpen = _useState[1];
10223
10229
 
10224
10230
  useEffect(function () {
10231
+ context.setFilters(value);
10225
10232
  var likes = Object.keys(schema).filter(function (id) {
10226
10233
  return schema[id].like === true;
10227
10234
  });
@@ -10375,6 +10382,7 @@ var CollectionPage = function CollectionPage(props) {
10375
10382
  actions = props.actions,
10376
10383
  canFilter = props.canFilter,
10377
10384
  customFilters = props.customFilters,
10385
+ filtersValue = props.filtersValue,
10378
10386
  listGroupBy = props.listGroupBy,
10379
10387
  listSearchBy = props.listSearchBy,
10380
10388
  listItemRenderer = props.listItemRenderer,
@@ -10387,7 +10395,8 @@ var CollectionPage = function CollectionPage(props) {
10387
10395
  }, /*#__PURE__*/React.createElement(Header, {
10388
10396
  title: title
10389
10397
  }, actions), canFilter ? /*#__PURE__*/React.createElement(CollectionFilters, {
10390
- schema: schema
10398
+ schema: schema,
10399
+ value: filtersValue
10391
10400
  }, customFilters) : null, /*#__PURE__*/React.createElement(CollectionList, {
10392
10401
  itemRenderer: listItemRenderer,
10393
10402
  groupBy: listGroupBy,