mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-26 04:32:44 +08:00

* use ES6 import / export * UTILS: export individual utilities * TESTS: localize TestHelper includes BREAKING CHANGE: * all utilities export independent functions * library sources got ported to ES6. You must now use a ES module bundler such as Browserify + babelify or Webpack to consume this library (or parts of it).
37 lines
850 B
JavaScript
37 lines
850 B
JavaScript
'use strict';
|
|
|
|
import {
|
|
filter
|
|
} from 'min-dash';
|
|
|
|
import {
|
|
isAny
|
|
} from '../modeling/util/ModelingUtil';
|
|
|
|
|
|
/**
|
|
* Registers element exclude filters for elements that
|
|
* currently do not support distribution.
|
|
*/
|
|
export default function BpmnDistributeElements(distributeElements) {
|
|
|
|
distributeElements.registerFilter(function(elements) {
|
|
return filter(elements, function(element) {
|
|
var cannotDistribute = isAny(element, [
|
|
'bpmn:Association',
|
|
'bpmn:BoundaryEvent',
|
|
'bpmn:DataInputAssociation',
|
|
'bpmn:DataOutputAssociation',
|
|
'bpmn:Lane',
|
|
'bpmn:MessageFlow',
|
|
'bpmn:Participant',
|
|
'bpmn:SequenceFlow',
|
|
'bpmn:TextAnnotation'
|
|
]);
|
|
|
|
return !(element.labelTarget || cannotDistribute);
|
|
});
|
|
});
|
|
}
|
|
|
|
BpmnDistributeElements.$inject = [ 'distributeElements' ]; |