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
  *
@@ -3783,10 +3803,12 @@
3783
3803
  }
3784
3804
 
3785
3805
  function renderLaneLabel(parentGfx, text, element, attrs = {}) {
3806
+ var isHorizontalLane = isHorizontal(element);
3807
+
3786
3808
  var textBox = renderLabel(parentGfx, text, {
3787
3809
  box: {
3788
3810
  height: 30,
3789
- width: getHeight(element, attrs),
3811
+ width: isHorizontalLane ? getHeight(element, attrs) : getWidth(element, attrs),
3790
3812
  },
3791
3813
  align: 'center-middle',
3792
3814
  style: {
@@ -3794,9 +3816,10 @@
3794
3816
  }
3795
3817
  });
3796
3818
 
3797
- var top = -1 * getHeight(element, attrs);
3798
-
3799
- transform(textBox, 0, -top, 270);
3819
+ if (isHorizontalLane) {
3820
+ var top = -1 * getHeight(element, attrs);
3821
+ transform(textBox, 0, -top, 270);
3822
+ }
3800
3823
  }
3801
3824
 
3802
3825
  function renderActivity(parentGfx, element, attrs = {}) {
@@ -4514,12 +4537,13 @@
4514
4537
  var participant = renderLane(parentGfx, element, attrs);
4515
4538
 
4516
4539
  var expandedParticipant = isExpanded(element);
4540
+ var horizontalParticipant = isHorizontal(element);
4517
4541
 
4518
4542
  var semantic = getBusinessObject(element),
4519
4543
  name = semantic.get('name');
4520
4544
 
4521
4545
  if (expandedParticipant) {
4522
- drawLine(parentGfx, [
4546
+ var waypoints = horizontalParticipant ? [
4523
4547
  {
4524
4548
  x: 30,
4525
4549
  y: 0
@@ -4528,20 +4552,43 @@
4528
4552
  x: 30,
4529
4553
  y: getHeight(element, attrs)
4530
4554
  }
4531
- ], {
4555
+ ] : [
4556
+ {
4557
+ x: 0,
4558
+ y: 30
4559
+ },
4560
+ {
4561
+ x: getWidth(element, attrs),
4562
+ y: 30
4563
+ }
4564
+ ];
4565
+
4566
+ drawLine(parentGfx, waypoints, {
4532
4567
  stroke: getStrokeColor(element, defaultStrokeColor, attrs.stroke),
4533
4568
  strokeWidth: PARTICIPANT_STROKE_WIDTH
4534
4569
  });
4535
4570
 
4536
4571
  renderLaneLabel(parentGfx, name, element, attrs);
4537
4572
  } else {
4538
- renderLabel(parentGfx, name, {
4539
- box: getBounds(element, attrs),
4573
+ var bounds = getBounds(element, attrs);
4574
+
4575
+ if (!horizontalParticipant) {
4576
+ bounds.height = getWidth(element, attrs);
4577
+ bounds.width = getHeight(element, attrs);
4578
+ }
4579
+
4580
+ var textBox = renderLabel(parentGfx, name, {
4581
+ box: bounds,
4540
4582
  align: 'center-middle',
4541
4583
  style: {
4542
4584
  fill: getLabelColor(element, defaultLabelColor, defaultStrokeColor, attrs.stroke)
4543
4585
  }
4544
4586
  });
4587
+
4588
+ if (!horizontalParticipant) {
4589
+ var top = -1 * getHeight(element, attrs);
4590
+ transform(textBox, 0, -top, 270);
4591
+ }
4545
4592
  }
4546
4593
 
4547
4594
  if (semantic.get('participantMultiplicity')) {
@@ -6128,10 +6175,6 @@
6128
6175
  translate: [ 'value', translate ]
6129
6176
  };
6130
6177
 
6131
- function getDefaultExportFromCjs (x) {
6132
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
6133
- }
6134
-
6135
6178
  /**
6136
6179
  * @param {Point} point
6137
6180
  *
@@ -9837,7 +9880,7 @@
9837
9880
  }
9838
9881
 
9839
9882
  /**
9840
- * @typedef {import('./index').InjectAnnotated } InjectAnnotated
9883
+ * @typedef {import('./index.js').InjectAnnotated } InjectAnnotated
9841
9884
  */
9842
9885
 
9843
9886
  /**
@@ -9907,9 +9950,9 @@
9907
9950
  }
9908
9951
 
9909
9952
  /**
9910
- * @typedef { import('./index').ModuleDeclaration } ModuleDeclaration
9911
- * @typedef { import('./index').ModuleDefinition } ModuleDefinition
9912
- * @typedef { import('./index').InjectorContext } InjectorContext
9953
+ * @typedef { import('./index.js').ModuleDeclaration } ModuleDeclaration
9954
+ * @typedef { import('./index.js').ModuleDefinition } ModuleDefinition
9955
+ * @typedef { import('./index.js').InjectorContext } InjectorContext
9913
9956
  */
9914
9957
 
9915
9958
  /**
@@ -10012,11 +10055,20 @@
10012
10055
  };
10013
10056
  }
10014
10057
 
10015
- function instantiate(Type) {
10058
+ /**
10059
+ * Instantiate the given type, injecting dependencies.
10060
+ *
10061
+ * @template T
10062
+ *
10063
+ * @param { Function | [...string[], Function ]} type
10064
+ *
10065
+ * @return T
10066
+ */
10067
+ function instantiate(type) {
10016
10068
  const {
10017
10069
  fn,
10018
10070
  dependencies
10019
- } = fnDef(Type);
10071
+ } = fnDef(type);
10020
10072
 
10021
10073
  // instantiate var args constructor
10022
10074
  const Constructor = Function.prototype.bind.apply(fn, [ null ].concat(dependencies));
@@ -10024,6 +10076,17 @@
10024
10076
  return new Constructor();
10025
10077
  }
10026
10078
 
10079
+ /**
10080
+ * Invoke the given function, injecting dependencies. Return the result.
10081
+ *
10082
+ * @template T
10083
+ *
10084
+ * @param { Function | [...string[], Function ]} func
10085
+ * @param { Object } [context]
10086
+ * @param { Object } [locals]
10087
+ *
10088
+ * @return {T} invocation result
10089
+ */
10027
10090
  function invoke(func, context, locals) {
10028
10091
  const {
10029
10092
  fn,
@@ -12292,6 +12355,10 @@
12292
12355
  }
12293
12356
  };
12294
12357
 
12358
+ function getDefaultExportFromCjs (x) {
12359
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
12360
+ }
12361
+
12295
12362
  var objectRefs = {exports: {}};
12296
12363
 
12297
12364
  var collection = {};