camunda-bpmn-js 0.22.0 → 0.23.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.
@@ -86991,7 +86991,9 @@
86991
86991
  label,
86992
86992
  onChange,
86993
86993
  disabled,
86994
- value = false
86994
+ value = false,
86995
+ onFocus,
86996
+ onBlur
86995
86997
  } = props;
86996
86998
  const [localValue, setLocalValue] = l$1(value);
86997
86999
 
@@ -87020,6 +87022,8 @@
87020
87022
  ref: ref,
87021
87023
  id: prefixId$7(id),
87022
87024
  name: id,
87025
+ onFocus: onFocus,
87026
+ onBlur: onBlur,
87023
87027
  type: "checkbox",
87024
87028
  class: "bio-properties-panel-input",
87025
87029
  onChange: handleChange,
@@ -87040,6 +87044,8 @@
87040
87044
  * @param {String} props.label
87041
87045
  * @param {Function} props.getValue
87042
87046
  * @param {Function} props.setValue
87047
+ * @param {Function} props.onFocus
87048
+ * @param {Function} props.onBlur
87043
87049
  * @param {boolean} [props.disabled]
87044
87050
  */
87045
87051
 
@@ -87052,7 +87058,9 @@
87052
87058
  label,
87053
87059
  getValue,
87054
87060
  setValue,
87055
- disabled
87061
+ disabled,
87062
+ onFocus,
87063
+ onBlur
87056
87064
  } = props;
87057
87065
  const value = getValue(element);
87058
87066
  const error = useError(id);
@@ -87064,6 +87072,8 @@
87064
87072
  id: id,
87065
87073
  label: label,
87066
87074
  onChange: setValue,
87075
+ onFocus: onFocus,
87076
+ onBlur: onBlur,
87067
87077
  value: value
87068
87078
  }, element), error && o$1("div", {
87069
87079
  class: "bio-properties-panel-error",
@@ -87246,6 +87256,7 @@
87246
87256
  feel,
87247
87257
  value = '',
87248
87258
  disabled = false,
87259
+ variables,
87249
87260
  OptionalComponent = OptionalFeelInput
87250
87261
  } = props;
87251
87262
  const [localValue, _setLocalValue] = l$1(value);
@@ -87256,7 +87267,7 @@
87256
87267
  const [focus, _setFocus] = l$1(undefined);
87257
87268
 
87258
87269
  const setFocus = (offset = 0) => {
87259
- const hasFocus = containerRef.current.contains(document.activeElement); // Keep carret position if it is already focused, otherwise focus at the end
87270
+ const hasFocus = containerRef.current.contains(document.activeElement); // Keep caret position if it is already focused, otherwise focus at the end
87260
87271
 
87261
87272
  const position = hasFocus ? document.activeElement.selectionStart : Infinity;
87262
87273
 
@@ -87402,7 +87413,7 @@
87402
87413
  },
87403
87414
  onLint: handleLint,
87404
87415
  value: feelOnlyValue,
87405
- variables: props.variables,
87416
+ variables: variables,
87406
87417
  ref: editorRef
87407
87418
  }) : o$1(OptionalComponent, { ...props,
87408
87419
  onInput: handleLocalInput,
@@ -87418,7 +87429,9 @@
87418
87429
  id,
87419
87430
  disabled,
87420
87431
  onInput,
87421
- value
87432
+ value,
87433
+ onFocus,
87434
+ onBlur
87422
87435
  } = props;
87423
87436
  const inputRef = s(); // To be consistent with the FEEL editor, set focus at start of input
87424
87437
  // this ensures clean editing experience when switching with the keyboard
@@ -87452,8 +87465,8 @@
87452
87465
  disabled: disabled,
87453
87466
  class: "bio-properties-panel-input",
87454
87467
  onInput: e => onInput(e.target.value),
87455
- onFocus: props.onFocus,
87456
- onBlur: props.onBlur,
87468
+ onFocus: onFocus,
87469
+ onBlur: onBlur,
87457
87470
  value: value || ''
87458
87471
  });
87459
87472
  });
@@ -87462,7 +87475,9 @@
87462
87475
  id,
87463
87476
  disabled,
87464
87477
  onInput,
87465
- value
87478
+ value,
87479
+ onFocus,
87480
+ onBlur
87466
87481
  } = props;
87467
87482
  const inputRef = s(); // To be consistent with the FEEL editor, set focus at start of input
87468
87483
  // this ensures clean editing experience when switching with the keyboard
@@ -87489,8 +87504,8 @@
87489
87504
  disabled: disabled,
87490
87505
  class: "bio-properties-panel-input",
87491
87506
  onInput: e => onInput(e.target.value),
87492
- onFocus: props.onFocus,
87493
- onBlur: props.onBlur,
87507
+ onFocus: onFocus,
87508
+ onBlur: onBlur,
87494
87509
  value: value || ''
87495
87510
  });
87496
87511
  });
@@ -87519,7 +87534,11 @@
87519
87534
  getValue,
87520
87535
  setValue,
87521
87536
  validate,
87522
- show = noop
87537
+ show = noop,
87538
+ example,
87539
+ variables,
87540
+ onFocus,
87541
+ onBlur
87523
87542
  } = props;
87524
87543
  const [cachedInvalidValue, setCachedInvalidValue] = l$1(null);
87525
87544
  const [validationError, setValidationError] = l$1(null);
@@ -87559,7 +87578,7 @@
87559
87578
  }
87560
87579
 
87561
87580
  const temporaryError = useError(id);
87562
- const error = temporaryError || validationError || localError;
87581
+ const error = localError || temporaryError || validationError;
87563
87582
  return o$1("div", {
87564
87583
  class: classnames(props.class, 'bio-properties-panel-entry', error ? 'has-error' : ''),
87565
87584
  "data-entry-id": id,
@@ -87571,10 +87590,12 @@
87571
87590
  label: label,
87572
87591
  onInput: onInput,
87573
87592
  onError: onError,
87574
- example: props.example,
87593
+ onFocus: onFocus,
87594
+ onBlur: onBlur,
87595
+ example: example,
87575
87596
  show: show,
87576
87597
  value: value,
87577
- variables: props.variables,
87598
+ variables: variables,
87578
87599
  OptionalComponent: props.OptionalComponent
87579
87600
  }, element), error && o$1("div", {
87580
87601
  class: "bio-properties-panel-error",
@@ -87596,6 +87617,8 @@
87596
87617
  * @param {String} props.label
87597
87618
  * @param {Function} props.getValue
87598
87619
  * @param {Function} props.setValue
87620
+ * @param {Function} props.onFocus
87621
+ * @param {Function} props.onBlur
87599
87622
  * @param {Function} props.validate
87600
87623
  */
87601
87624
 
@@ -87621,7 +87644,9 @@
87621
87644
  onChange,
87622
87645
  options = [],
87623
87646
  value,
87624
- disabled
87647
+ disabled,
87648
+ onFocus,
87649
+ onBlur
87625
87650
  } = props;
87626
87651
  const ref = useShowEntryEvent(id);
87627
87652
  const [localValue, setLocalValue] = l$1(value);
@@ -87656,6 +87681,8 @@
87656
87681
  name: id,
87657
87682
  class: "bio-properties-panel-input",
87658
87683
  onInput: handleChange,
87684
+ onFocus: onFocus,
87685
+ onBlur: onBlur,
87659
87686
  value: localValue,
87660
87687
  disabled: disabled,
87661
87688
  children: options.map((option, idx) => {
@@ -87676,6 +87703,8 @@
87676
87703
  * @param {string} props.label
87677
87704
  * @param {Function} props.getValue
87678
87705
  * @param {Function} props.setValue
87706
+ * @param {Function} props.onFocus
87707
+ * @param {Function} props.onBlur
87679
87708
  * @param {Function} props.getOptions
87680
87709
  * @param {boolean} [props.disabled]
87681
87710
  */
@@ -87690,7 +87719,9 @@
87690
87719
  getValue,
87691
87720
  setValue,
87692
87721
  getOptions,
87693
- disabled
87722
+ disabled,
87723
+ onFocus,
87724
+ onBlur
87694
87725
  } = props;
87695
87726
  const value = getValue(element);
87696
87727
  const options = getOptions(element);
@@ -87703,6 +87734,8 @@
87703
87734
  label: label,
87704
87735
  value: value,
87705
87736
  onChange: setValue,
87737
+ onFocus: onFocus,
87738
+ onBlur: onBlur,
87706
87739
  options: options,
87707
87740
  disabled: disabled
87708
87741
  }, element), error && o$1("div", {
@@ -87732,7 +87765,9 @@
87732
87765
  onInput,
87733
87766
  value = '',
87734
87767
  disabled,
87735
- monospace
87768
+ monospace,
87769
+ onFocus,
87770
+ onBlur
87736
87771
  } = props;
87737
87772
  const [localValue, setLocalValue] = l$1(value);
87738
87773
  const ref = useShowEntryEvent(id);
@@ -87767,8 +87802,8 @@
87767
87802
  spellCheck: "false",
87768
87803
  class: classnames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : ''),
87769
87804
  onInput: handleInput,
87770
- onFocus: props.onFocus,
87771
- onBlur: props.onBlur,
87805
+ onFocus: onFocus,
87806
+ onBlur: onBlur,
87772
87807
  rows: rows,
87773
87808
  value: localValue,
87774
87809
  disabled: disabled
@@ -87784,6 +87819,8 @@
87784
87819
  * @param {string} props.label
87785
87820
  * @param {Function} props.getValue
87786
87821
  * @param {Function} props.setValue
87822
+ * @param {Function} props.onFocus
87823
+ * @param {Function} props.onBlur
87787
87824
  * @param {number} props.rows
87788
87825
  * @param {boolean} props.monospace
87789
87826
  * @param {boolean} [props.disabled]
@@ -87801,7 +87838,9 @@
87801
87838
  setValue,
87802
87839
  rows,
87803
87840
  monospace,
87804
- disabled
87841
+ disabled,
87842
+ onFocus,
87843
+ onBlur
87805
87844
  } = props;
87806
87845
  const value = getValue(element);
87807
87846
  const error = useError(id);
@@ -87813,6 +87852,8 @@
87813
87852
  label: label,
87814
87853
  value: value,
87815
87854
  onInput: setValue,
87855
+ onFocus: onFocus,
87856
+ onBlur: onBlur,
87816
87857
  rows: rows,
87817
87858
  debounce: debounce,
87818
87859
  monospace: monospace,
@@ -87842,6 +87883,8 @@
87842
87883
  id,
87843
87884
  label,
87844
87885
  onInput,
87886
+ onFocus,
87887
+ onBlur,
87845
87888
  value = ''
87846
87889
  } = props;
87847
87890
  const [localValue, setLocalValue] = l$1(value || '');
@@ -87880,8 +87923,8 @@
87880
87923
  disabled: disabled,
87881
87924
  class: "bio-properties-panel-input",
87882
87925
  onInput: handleInput,
87883
- onFocus: props.onFocus,
87884
- onBlur: props.onBlur,
87926
+ onFocus: onFocus,
87927
+ onBlur: onBlur,
87885
87928
  value: localValue
87886
87929
  })]
87887
87930
  });
@@ -87896,6 +87939,8 @@
87896
87939
  * @param {String} props.label
87897
87940
  * @param {Function} props.getValue
87898
87941
  * @param {Function} props.setValue
87942
+ * @param {Function} props.onFocus
87943
+ * @param {Function} props.onBlur
87899
87944
  * @param {Function} props.validate
87900
87945
  */
87901
87946
 
@@ -87910,7 +87955,9 @@
87910
87955
  label,
87911
87956
  getValue,
87912
87957
  setValue,
87913
- validate
87958
+ validate,
87959
+ onFocus,
87960
+ onBlur
87914
87961
  } = props;
87915
87962
  const [cachedInvalidValue, setCachedInvalidValue] = l$1(null);
87916
87963
  const globalError = useError(id);
@@ -87954,6 +88001,8 @@
87954
88001
  id: id,
87955
88002
  label: label,
87956
88003
  onInput: onInput,
88004
+ onFocus: onFocus,
88005
+ onBlur: onBlur,
87957
88006
  value: value
87958
88007
  }, element), error && o$1("div", {
87959
88008
  class: "bio-properties-panel-error",
@@ -87979,7 +88028,9 @@
87979
88028
  label,
87980
88029
  onInput,
87981
88030
  value,
87982
- switcherLabel
88031
+ switcherLabel,
88032
+ onFocus,
88033
+ onBlur
87983
88034
  } = props;
87984
88035
  const [localValue, setLocalValue] = l$1(value);
87985
88036
 
@@ -88013,9 +88064,11 @@
88013
88064
  id: prefixId(id),
88014
88065
  class: "bio-properties-panel-input",
88015
88066
  type: "checkbox",
88067
+ onFocus: onFocus,
88068
+ onBlur: onBlur,
88016
88069
  name: id,
88017
88070
  onInput: handleInput,
88018
- checked: localValue
88071
+ checked: !!localValue
88019
88072
  }), o$1("span", {
88020
88073
  class: "bio-properties-panel-toggle-switch__slider"
88021
88074
  })]
@@ -88035,6 +88088,8 @@
88035
88088
  * @param {String} props.switcherLabel
88036
88089
  * @param {Function} props.getValue
88037
88090
  * @param {Function} props.setValue
88091
+ * @param {Function} props.onFocus
88092
+ * @param {Function} props.onBlur
88038
88093
  */
88039
88094
 
88040
88095
 
@@ -88046,7 +88101,9 @@
88046
88101
  label,
88047
88102
  switcherLabel,
88048
88103
  getValue,
88049
- setValue
88104
+ setValue,
88105
+ onFocus,
88106
+ onBlur
88050
88107
  } = props;
88051
88108
  const value = getValue(element);
88052
88109
  return o$1("div", {
@@ -88057,6 +88114,8 @@
88057
88114
  label: label,
88058
88115
  value: value,
88059
88116
  onInput: setValue,
88117
+ onFocus: onFocus,
88118
+ onBlur: onBlur,
88060
88119
  switcherLabel: switcherLabel
88061
88120
  }), o$1(Description, {
88062
88121
  forId: id,
@@ -94801,6 +94860,10 @@
94801
94860
  id: 'assignmentDefinitionCandidateGroups',
94802
94861
  component: CandidateGroups$1,
94803
94862
  isEdited: isEdited$6
94863
+ }, {
94864
+ id: 'assignmentDefinitionCandidateUsers',
94865
+ component: CandidateUsers$1,
94866
+ isEdited: isEdited$6
94804
94867
  }];
94805
94868
  }
94806
94869
 
@@ -94955,6 +95018,82 @@
94955
95018
  setValue,
94956
95019
  debounce
94957
95020
  });
95021
+ }
95022
+
95023
+ function CandidateUsers$1(props) {
95024
+ const {
95025
+ element
95026
+ } = props;
95027
+ const commandStack = useService('commandStack');
95028
+ const bpmnFactory = useService('bpmnFactory');
95029
+ const translate = useService('translate');
95030
+ const debounce = useService('debounceInput');
95031
+
95032
+ const getValue = () => {
95033
+ return (getAssignmentDefinition(element) || {}).candidateUsers;
95034
+ };
95035
+
95036
+ const setValue = value => {
95037
+ let commands = [];
95038
+ const businessObject = getBusinessObject$1(element);
95039
+ let extensionElements = businessObject.get('extensionElements'); // (1) ensure extension elements
95040
+
95041
+ if (!extensionElements) {
95042
+ extensionElements = createElement$1('bpmn:ExtensionElements', {
95043
+ values: []
95044
+ }, businessObject, bpmnFactory);
95045
+ commands.push({
95046
+ cmd: 'element.updateModdleProperties',
95047
+ context: {
95048
+ element,
95049
+ moddleElement: businessObject,
95050
+ properties: {
95051
+ extensionElements
95052
+ }
95053
+ }
95054
+ });
95055
+ } // (2) ensure assignmentDefinition
95056
+
95057
+
95058
+ let assignmentDefinition = getAssignmentDefinition(element);
95059
+
95060
+ if (!assignmentDefinition) {
95061
+ assignmentDefinition = createElement$1('zeebe:AssignmentDefinition', {}, extensionElements, bpmnFactory);
95062
+ commands.push({
95063
+ cmd: 'element.updateModdleProperties',
95064
+ context: {
95065
+ element,
95066
+ moddleElement: extensionElements,
95067
+ properties: {
95068
+ values: [...extensionElements.get('values'), assignmentDefinition]
95069
+ }
95070
+ }
95071
+ });
95072
+ } // (3) update candidateUsers
95073
+
95074
+
95075
+ commands.push({
95076
+ cmd: 'element.updateModdleProperties',
95077
+ context: {
95078
+ element,
95079
+ moddleElement: assignmentDefinition,
95080
+ properties: {
95081
+ candidateUsers: value
95082
+ }
95083
+ }
95084
+ });
95085
+ commandStack.execute('properties-panel.multi-command-executor', commands);
95086
+ };
95087
+
95088
+ return withVariableContext(FeelEntry)({
95089
+ element,
95090
+ id: 'assignmentDefinitionCandidateUsers',
95091
+ label: translate('Candidate users'),
95092
+ feel: 'optional',
95093
+ getValue,
95094
+ setValue,
95095
+ debounce
95096
+ });
94958
95097
  } // helper ///////////////////////
94959
95098
 
94960
95099
 
@@ -103470,7 +103609,7 @@
103470
103609
 
103471
103610
  /**
103472
103611
  * Zeebe BPMN behavior removing zeebe:AssignmentDefinition elements without
103473
- * zeebe:assignee and zeebe:candidateGroups.
103612
+ * zeebe:assignee, zeebe:candidateGroups or zeebe:candidateUsers.
103474
103613
  */
103475
103614
  class CleanUpBusinessRuleTaskBehavior extends CommandInterceptor {
103476
103615
  constructor(commandStack, eventBus) {
@@ -103492,6 +103631,7 @@
103492
103631
  is$5(element, 'bpmn:UserTask')
103493
103632
  && isUndefined$2(assignmentDefinition.get('zeebe:assignee'))
103494
103633
  && isUndefined$2(assignmentDefinition.get('zeebe:candidateGroups'))
103634
+ && isUndefined$2(assignmentDefinition.get('zeebe:candidateUsers'))
103495
103635
  ) {
103496
103636
  const businessObject = getBusinessObject$1(element);
103497
103637
 
@@ -104505,6 +104645,11 @@
104505
104645
  name: "candidateGroups",
104506
104646
  type: "String",
104507
104647
  isAttr: true
104648
+ },
104649
+ {
104650
+ name: "candidateUsers",
104651
+ type: "String",
104652
+ isAttr: true
104508
104653
  }
104509
104654
  ]
104510
104655
  },