How to use the min-dash.isString 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 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-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 / overlays / Overlays.js View on Github external
Overlays.prototype.get = function(search) {

  if (isString(search)) {
    search = { id: search };
  }

  if (isString(search.element)) {
    search.element = this._elementRegistry.get(search.element);
  }

  if (search.element) {
    var container = this._getOverlayContainer(search.element, true);

    // return a list of overlays when searching by element (+type)
    if (container) {
      return search.type ? filter(container.overlays, matchPattern({ type: search.type })) : container.overlays.slice();
    } else {
      return [];
    }
  } else
  if (search.type) {
    return filter(this._overlays, matchPattern({ type: search.type }));
  } else {
github bpmn-io / diagram-js / lib / features / tooltips / Tooltips.js View on Github external
Tooltips.prototype._addTooltip = function(tooltip) {

  var id = tooltip.id,
      html = tooltip.html,
      htmlContainer,
      tooltipRoot = this._tooltipRoot;

  // unwrap jquery (for those who need it)
  if (html.get && html.constructor.prototype.jquery) {
    html = html.get(0);
  }

  // create proper html elements from
  // tooltip HTML strings
  if (isString(html)) {
    html = domify(html);
  }

  htmlContainer = domify('<div style="position: absolute" class="' + tooltipClass + '" data-tooltip-id="' + id + '">');

  htmlContainer.appendChild(html);

  if (tooltip.type) {
    domClasses(htmlContainer).add('djs-tooltip-' + tooltip.type);
  }

  if (tooltip.className) {
    domClasses(htmlContainer).add(tooltip.className);
  }

  tooltip.htmlContainer = htmlContainer;</div>
github bpmn-io / diagram-js / test / spec / features / grid-snapping / GridSnappingSpec.js View on Github external
function position(event) {
  var orientation;

  if (isString(event)) {
    orientation = event;

    return function(event) {
      var shape = event.shape;

      var x = event.x,
          y = event.y;

      if (/top/.test(orientation)) {
        y -= shape.height / 2;
      }

      if (/right/.test(orientation)) {
        x += shape.width / 2;
      }
github zeebe-io / zeebe-modeler / client / src / app / tabs / bpmn / custom / __tests__ / CustomRulesSpec.js View on Github external
const get = (element) => {

  let actualElement;

  if (isString(element)) {
    actualElement = getBpmnJS().invoke(function(elementRegistry) {
      return elementRegistry.get(element);
    });

    if (!actualElement) {
      throw new Error('element #' + element + ' not found');
    }

    return actualElement;
  }

  return element;
};
github bpmn-io / moddle-xml / lib / write.js View on Github external
ElementSerializer.prototype.addAttribute = function(name, value) {
  var attrs = this.attrs;

  if (isString(value)) {
    value = escapeAttr(value);
  }

  attrs.push({ name: name, value: value });
};
github zeebe-io / zeebe-modeler / client / src / app / tabs / xml / XMLEditor.js View on Github external
function trim(string) {
  if (isString(string)) {
    return string.trim();
  }

  return string;
}
github bpmn-io / diagram-js / lib / features / grid-snapping / behavior / ResizeBehavior.js View on Github external
this.preExecute('shape.resize', function(event) {
    var context = event.context,
        hints = context.hints || {},
        autoResize = hints.autoResize;

    if (!autoResize) {
      return;
    }

    var shape = context.shape,
        newBounds = context.newBounds;

    if (isString(autoResize)) {
      context.newBounds = self.snapComplex(newBounds, autoResize);
    } else {
      context.newBounds = self.snapSimple(shape, newBounds);
    }
  });
}
github bpmn-io / dmn-js / packages / dmn-js-decision-table / src / features / description / Description.js View on Github external
components.onGetComponent('context-menu', (context = {}) => {
      if (context.contextMenuType
        && context.contextMenuType === 'cell-description') {

        const element = elementRegistry.get(context.id);

        const description = getDescription(element);

        if (isString(description)) {
          return DescriptionEditor;
        }
      }
    });