How to use the type.AppFile.matched function in type

To help you get started, we’ve selected a few type examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github basisjs / basisjs / src / devpanel / view / file-graph / view / file-stat / index.js View on Github external
}
});
var activatedFiles = new MapFilter({
  source: activatedFilesSlots,
  ruleEvents: 'targetChanged',
  map: function(slot){
    return slot.target;
  }
});
var fileByType = new Split({
  source: AppFile.files,
  rule: 'data.type'
});

var Item = Node.subclass({
  selected: Value.query(AppFile.matched, 'dataset').compute(function(node, dataset){
    return (node.dataset || node.delegate) === dataset;
  }),

  template: resource('./template/type.tmpl'),
  binding: {
    type: function(node){
      return node.caption || node.data.id;
    },
    count: function(node){
      return count(node.dataset || node.delegate);
    }
  },
  action: {
    select: function(){
      AppFile.matched.setDataset(this.dataset || this.delegate);
    }
github basisjs / basisjs / src / devpanel / view / file-graph / view / file-stat / index.js View on Github external
select: function(){
      AppFile.matched.setDataset(this.dataset || this.delegate);
    }
  }
github basisjs / basisjs / src / devpanel / view / file-graph / view / graph / index.js View on Github external
function coord(name){
  return function(node){
    return node[name] && node[name].toFixed(2);
  };
}

var GraphNode = Node.subclass({
  matched: false,

  template: resource('./template/node.tmpl'),
  binding: {
    x: coord('x'),
    y: coord('y'),
    type: 'data:',
    hasSelected: Value.query('parentNode.selection.itemCount').as(Boolean),
    matched: Value.query(File.matched, 'dataset')
      .pipe('itemsChanged', function(dataset){
        return basis.array((dataset || File.all).getItems());
      })
      .compute(function(node, matched){
        return matched.indexOf(node.target) !== -1;
      })
  },
  action: {
    hover: function(){
      fileInfoPopup.setDelegate(this);
    },
    unhover: function(){
      fileInfoPopup.setDelegate();
    }
  },