How to use min-dash - 10 common examples

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 / diagram-js / test / spec / features / keyboard / MoveCanvasSpec.js View on Github external
y: 0
    }, {
      desc: 'up arrow',
      keys: KEYS.UP,
      shiftKey: false,
      x: 0,
      y: -50
    }, {
      desc: 'down arrow',
      keys: KEYS.DOWN,
      shiftKey: false,
      x: 0,
      y: 50
    }];

    forEach(decisionTable, function(testCase) {

      forEach(testCase.keys, function(key) {

        it('should handle ' + testCase.desc, inject(function(canvas, keyboard) {

          // given
          var event = createKeyEvent(key, { shiftKey: testCase.shiftKey });

          // when
          keyboard._keyHandler(event);

          // then
          expect(canvas.viewbox().x).to.eql(testCase.x);
          expect(canvas.viewbox().y).to.eql(testCase.y);
        }));
github bpmn-io / bpmn-js / test / spec / features / copy-paste / BpmnCopyPasteSpec.js View on Github external
var participant = elementRegistry.get('Participant_0x9lnke'),
            task = elementRegistry.get('Task_1'),
            newTask;

        // when
        copyPaste.copy([ task ]);

        copyPaste.paste({
          element: participant,
          point: {
            x: 500,
            y: 50
          }
        });

        newTask = filter(participant.children, function(element) {
          return is(element, 'bpmn:Task');
        })[0];

        // then
        var bo = task.businessObject;
        var copiedBo = newTask.businessObject;


        expect(copiedBo.asyncBefore).to.eql(bo.asyncBefore);
        expect(copiedBo.documentation).to.jsonEqual(bo.documentation);

        var copiedExtensions = copiedBo.extensionElements;

        expect(copiedExtensions).to.jsonEqual(bo.extensionElements);
        expect(copiedExtensions.$parent).to.equal(copiedBo);
      })
github bpmn-io / bpmn-moddle / test / integration / camunda / write.js View on Github external
function write(element, options, callback) {
        if (isFunction(options)) {
          callback = options;
          options = {};
        }

        // skip preamble for tests
        options = assign({ preamble: false }, options);

        moddle.toXML(element, options, callback);
      }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / modeler / features / properties-panel-keyboard-bindings / __tests__ / PropertiesPanelKeyboardBindingsSpec.js View on Github external
function createKeyEvent(key, attrs) {
  var event = document.createEvent('Events') || new document.defaultView.CustomEvent('keyEvent');

  // init and mark as bubbles / cancelable
  event.initEvent('keydown', false, true);

  var keyAttrs = isString(key) ? { key: key } : { keyCode: key, which: key };

  return assign(event, keyAttrs, attrs || {});
}
github bpmn-io / bpmn-js / test / spec / features / modeling / behavior / DropOnFlowBehaviorSpec.js View on Github external
endEventShape,
            dropPosition,
            sequenceFlow
          );

          // then

          // new incoming connection
          expect(newShape.incoming.length).to.equal(1);
          expect(newShape.incoming[0]).to.eql(sequenceFlow);

          // no outgoing edges
          expect(newShape.outgoing.length).to.equal(0);

          // split target at insertion point
          expect(sequenceFlow).to.have.waypoints(flatten([
            originalWaypoints.slice(0, 1),
            { x: 322, y: 120 }
          ]));
        }
      ));
github WPS / domain-story-modeler / app / domain-story-modeler / modeler / DomainStoryElementFactory.js View on Github external
}
      let id = attrs.id;
      attrs.businessObject.get = function(key) {
        if (key == 'id') {
          return id;
        }
      };
      attrs.businessObject.set = function(key, value) {
        if (key == 'id') {
          assign(attrs.businessObject, { id: value });
        }
      };

      // add width and height if shape
      if ((!/:activity$/.test(type) || !/:connection$/.test(type)) && !(/:group$/.test(type) && attrs.height || attrs.width)) {
        assign(attrs, self._getCustomElementSize(type));
      }

      if (!('$instanceOf' in attrs.businessObject)) {
        // ensure we can use ModelUtil#is for type checks
        Object.defineProperty(attrs.businessObject, '$instanceOf', {
          value: function(type) {
            return this.type === type;
          }
        });
      }

      return self.baseCreate(elementType, attrs);
    }

    return self.createBpmnElement(elementType, attrs);
  };
github bpmn-io / bpmn-js-cli / lib / parsers / shapes.js View on Github external
return function(args, options) {

    if (isString(args)) {
      args = args.split(',');
    } else
    if (!isArray(args)) {
      args = [ args ];
    }

    return args.map(function(arg) {

      // assume element passed is shape already
      if (isObject(arg)) {
        return arg;
      }

      var e = elementRegistry.get(arg);
      if (!e) {
        if (options.optional) {
github bpmn-io / diagram-js / lib / features / move / Move.js View on Github external
function start(event, element, activate, context) {
    if (isObject(activate)) {
      context = activate;
      activate = false;
    }

    // do not move connections or the root element
    if (element.waypoints || !element.parent) {
      return;
    }

    var referencePoint = mid(element);

    dragging.init(event, referencePoint, 'shape.move', {
      cursor: 'grabbing',
      autoActivate: activate,
      data: {
        shape: element,
github bpmn-io / cmmn-js / lib / features / search / CmmnSearchProvider.js View on Github external
});

  elements = map(elements, function(element) {
    return {
      primaryTokens: matchAndSplit(labelUtil.getLabel(element), pattern),
      secondaryTokens: matchAndSplit(element.id, pattern),
      element: element
    };
  });

  // exclude non-matched elements
  elements = filter(elements, function(element) {
    return hasMatched(element.primaryTokens) || hasMatched(element.secondaryTokens);
  });

  elements = sortBy(elements, function(element) {
    return labelUtil.getLabel(element.element) + element.element.id;
  });

  return elements;
};
github bpmn-io / diagram-js / lib / features / copy-paste / CopyPaste.js View on Github external
forEach(tree, function(branch, depth) {

    depth = parseInt(depth, 10);

    // sort by priority
    branch = sortBy(branch, 'priority');

    forEach(branch, function(descriptor) {

      // remove priority
      var attrs = assign({}, omit(descriptor, [ 'priority' ]));

      if (cache[ descriptor.parent ]) {
        attrs.parent = cache[ descriptor.parent ];
      } else {
        delete attrs.parent;
      }

      eventBus.fire('copyPaste.pasteElement', {
        cache: cache,
        descriptor: attrs
      });