camunda-bpmn-js 3.10.1 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -713,6 +713,26 @@
713
713
  return true;
714
714
  }
715
715
 
716
+ /**
717
+ * @param {Element} element
718
+ *
719
+ * @return {boolean}
720
+ */
721
+ function isHorizontal(element) {
722
+
723
+ if (!is$1(element, 'bpmn:Participant') && !is$1(element, 'bpmn:Lane')) {
724
+ return undefined;
725
+ }
726
+
727
+ var isHorizontal = getDi(element).isHorizontal;
728
+
729
+ if (isHorizontal === undefined) {
730
+ return true;
731
+ }
732
+
733
+ return isHorizontal;
734
+ }
735
+
716
736
  /**
717
737
  * @param {Element} element
718
738
  *
@@ -3772,10 +3792,12 @@
3772
3792
  }
3773
3793
 
3774
3794
  function renderLaneLabel(parentGfx, text, element, attrs = {}) {
3795
+ var isHorizontalLane = isHorizontal(element);
3796
+
3775
3797
  var textBox = renderLabel(parentGfx, text, {
3776
3798
  box: {
3777
3799
  height: 30,
3778
- width: getHeight(element, attrs),
3800
+ width: isHorizontalLane ? getHeight(element, attrs) : getWidth(element, attrs),
3779
3801
  },
3780
3802
  align: 'center-middle',
3781
3803
  style: {
@@ -3783,9 +3805,10 @@
3783
3805
  }
3784
3806
  });
3785
3807
 
3786
- var top = -1 * getHeight(element, attrs);
3787
-
3788
- transform(textBox, 0, -top, 270);
3808
+ if (isHorizontalLane) {
3809
+ var top = -1 * getHeight(element, attrs);
3810
+ transform(textBox, 0, -top, 270);
3811
+ }
3789
3812
  }
3790
3813
 
3791
3814
  function renderActivity(parentGfx, element, attrs = {}) {
@@ -4503,12 +4526,13 @@
4503
4526
  var participant = renderLane(parentGfx, element, attrs);
4504
4527
 
4505
4528
  var expandedParticipant = isExpanded(element);
4529
+ var horizontalParticipant = isHorizontal(element);
4506
4530
 
4507
4531
  var semantic = getBusinessObject(element),
4508
4532
  name = semantic.get('name');
4509
4533
 
4510
4534
  if (expandedParticipant) {
4511
- drawLine(parentGfx, [
4535
+ var waypoints = horizontalParticipant ? [
4512
4536
  {
4513
4537
  x: 30,
4514
4538
  y: 0
@@ -4517,20 +4541,43 @@
4517
4541
  x: 30,
4518
4542
  y: getHeight(element, attrs)
4519
4543
  }
4520
- ], {
4544
+ ] : [
4545
+ {
4546
+ x: 0,
4547
+ y: 30
4548
+ },
4549
+ {
4550
+ x: getWidth(element, attrs),
4551
+ y: 30
4552
+ }
4553
+ ];
4554
+
4555
+ drawLine(parentGfx, waypoints, {
4521
4556
  stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
4522
4557
  strokeWidth: PARTICIPANT_STROKE_WIDTH
4523
4558
  });
4524
4559
 
4525
4560
  renderLaneLabel(parentGfx, name, element, attrs);
4526
4561
  } else {
4527
- renderLabel(parentGfx, name, {
4528
- box: getBounds(element, attrs),
4562
+ var bounds = getBounds(element, attrs);
4563
+
4564
+ if (!horizontalParticipant) {
4565
+ bounds.height = getWidth(element, attrs);
4566
+ bounds.width = getHeight(element, attrs);
4567
+ }
4568
+
4569
+ var textBox = renderLabel(parentGfx, name, {
4570
+ box: bounds,
4529
4571
  align: 'center-middle',
4530
4572
  style: {
4531
4573
  fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
4532
4574
  }
4533
4575
  });
4576
+
4577
+ if (!horizontalParticipant) {
4578
+ var top = -1 * getHeight(element, attrs);
4579
+ transform(textBox, 0, -top, 270);
4580
+ }
4534
4581
  }
4535
4582
 
4536
4583
  if (semantic.get('participantMultiplicity')) {
@@ -6117,10 +6164,6 @@
6117
6164
  translate: [ 'value', translate ]
6118
6165
  };
6119
6166
 
6120
- function getDefaultExportFromCjs (x) {
6121
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
6122
- }
6123
-
6124
6167
  /**
6125
6168
  * @param {Point} point
6126
6169
  *
@@ -9805,7 +9848,7 @@
9805
9848
  }
9806
9849
 
9807
9850
  /**
9808
- * @typedef {import('./index').InjectAnnotated } InjectAnnotated
9851
+ * @typedef {import('./index.js').InjectAnnotated } InjectAnnotated
9809
9852
  */
9810
9853
 
9811
9854
  /**
@@ -9875,9 +9918,9 @@
9875
9918
  }
9876
9919
 
9877
9920
  /**
9878
- * @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
9879
- * @typedef { import('./index').ModuleDefinition } ModuleDefinition
9880
- * @typedef { import('./index').InjectorContext } InjectorContext
9921
+ * @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration
9922
+ * @typedef { import('./index.js').ModuleDefinition } ModuleDefinition
9923
+ * @typedef { import('./index.js').InjectorContext } InjectorContext
9881
9924
  */
9882
9925
 
9883
9926
  /**
@@ -9980,11 +10023,20 @@
9980
10023
  };
9981
10024
  }
9982
10025
 
9983
- function instantiate(Type) {
10026
+ /**
10027
+ * Instantiate the given type, injecting dependencies.
10028
+ *
10029
+ * @template T
10030
+ *
10031
+ * @param { Function | [...string[], Function ]} type
10032
+ *
10033
+ * @return T
10034
+ */
10035
+ function instantiate(type) {
9984
10036
  const {
9985
10037
  fn,
9986
10038
  dependencies
9987
- } = fnDef(Type);
10039
+ } = fnDef(type);
9988
10040
 
9989
10041
  // instantiate var args constructor
9990
10042
  const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
@@ -9992,6 +10044,17 @@
9992
10044
  return new Constructor();
9993
10045
  }
9994
10046
 
10047
+ /**
10048
+ * Invoke the given function, injecting dependencies. Return the result.
10049
+ *
10050
+ * @template T
10051
+ *
10052
+ * @param { Function | [...string[], Function ]} func
10053
+ * @param { Object } [context]
10054
+ * @param { Object } [locals]
10055
+ *
10056
+ * @return {T} invocation result
10057
+ */
9995
10058
  function invoke(func, context, locals) {
9996
10059
  const {
9997
10060
  fn,
@@ -12260,6 +12323,10 @@
12260
12323
  }
12261
12324
  };
12262
12325
 
12326
+ function getDefaultExportFromCjs (x) {
12327
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
12328
+ }
12329
+
12263
12330
  var objectRefs = {exports: {}};
12264
12331
 
12265
12332
  var collection = {};