How to use the min-dash.every function in min-dash

To help you get started, we’ve selected a few min-dash 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 bpmn-io / bpmn-js / lib / draw / BpmnRenderUtil.js View on Github external
function matches(definition, filter) {
    return every(filter, function(val, key) {

      // we want a == conversion here, to be able to catch
      // undefined == false and friends
      /* jshint -W116 */
      return definition[key] == val;
    });
  }
github bpmn-io / dmn-js / packages / dmn-js-drd / src / features / rules / DrdRules.js View on Github external
function canMove(elements, target) {
  if (!isArray(elements)) {
    elements = [ elements ];
  }

  // allow default move check to start move operation
  if (!target) {
    return true;
  }

  if (every(elements, function(element) {
    return isAny(element, [
      'dmn:BusinessKnowledgeModel',
      'dmn:Decision',
      'dmn:InputData',
      'dmn:KnowledgeSource',
      'dmn:TextAnnotation',
      'dmn:InformationRequirement',
      'dmn:AuthorityRequirement',
      'dmn:KnowledgeRequirement',
      'dmn:Association'
    ]);
  }) && is(target, 'dmn:Definitions')) {
    return true;
  }

  return false;
github bpmn-io / table-js / test / spec / features / rules / test-rules / TestRules.js View on Github external
this.addRule('paste', ({ elements, target }) => {
      if (!isArray(elements)) {
        elements = [ elements ];
      }

      if (target instanceof Row) {
        return every(elements, element => element instanceof Row);
      } else if (target instanceof Col) {
        return every(elements, element => element instanceof Col);
      }

      return false;
    });
  }
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / rules / DecisionTableModelingRules.js View on Github external
return every(root, descriptor => {
      if (descriptor.type !== 'row') {
        return false;
      }

      if (descriptor.cells.length !== cols.length) {
        return false;
      }

      return every(descriptor.cells, (cellDescriptor, index) => {
        if (isInput(cols[index])) {
          return cellDescriptor.businessObject.$type === 'dmn:UnaryTests';
        } else {
          return cellDescriptor.businessObject.$type === 'dmn:LiteralExpression';
        }
      });

    });
  }
github bpmn-io / diagram-js / lib / util / Geometry.js View on Github external
export function pointsAlignedVertically(a, b) {
  var points;

  if (isArray(a)) {
    points = a;
  } else {
    points = [ a, b ];
  }

  var firstPoint = points.slice().shift();

  return every(points, function(point) {
    return Math.abs(firstPoint.x - point.x) <= ALIGNED_THRESHOLD;
  });
}
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / rules / DecisionTableModelingRules.js View on Github external
canPasteCols(root, targetCol) {
    const { rows } = this._sheet.getRoot();

    return every(root, descriptor => {
      if (descriptor.type !== 'col') {
        return false;
      }

      if (descriptor.cells.length !== rows.length) {
        return false;
      }

      if (isInput(targetCol)) {
        return descriptor.businessObject.$type === 'dmn:InputClause';
      } else {
        return descriptor.businessObject.$type === 'dmn:OutputClause';
      }
    });
  }
}
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / rules / DecisionTableModelingRules.js View on Github external
canPasteRows(root) {
    const { cols } = this._sheet.getRoot();

    return every(root, descriptor => {
      if (descriptor.type !== 'row') {
        return false;
      }

      if (descriptor.cells.length !== cols.length) {
        return false;
      }

      return every(descriptor.cells, (cellDescriptor, index) => {
        if (isInput(cols[index])) {
          return cellDescriptor.businessObject.$type === 'dmn:UnaryTests';
        } else {
          return cellDescriptor.businessObject.$type === 'dmn:LiteralExpression';
        }
      });
github bpmn-io / bpmn-js / lib / features / rules / BpmnRules.js View on Github external
this.addRule('elements.create', function(context) {
    var elements = context.elements,
        position = context.position,
        target = context.target;

    return every(elements, function(element) {
      if (isConnection(element)) {
        return canConnect(element.source, element.target, element);
      }

      if (element.host) {
        return canAttach(element, element.host, null, position);
      }

      return canCreate(element, target, null, position);
    });
  });