@kunpeng-io/bpmn-js-properties-panel 2026.10.4 → 2026.11.2

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.
@@ -3498,6 +3498,120 @@
3498
3498
  properties: { values }
3499
3499
  });
3500
3500
  }
3501
+ // src/provider/kunpeng/properties/AddSignProps.js
3502
+ /**
3503
+ * @typedef { import('@kunpeng-io/properties-panel').EntryDefinition } Entry
3504
+ */
3505
+ /**
3506
+ * 加签配置(仅用户任务):勾选即在 extensionElements 写入 kunpeng:AddSign(声明即允许);
3507
+ * 启用后可配 maxDepth(级联深度上限,1=禁止级联加签,缺省 1)。
3508
+ *
3509
+ * @returns {Array<Entry>} entries
3510
+ */
3511
+ function AddSignProps(props) {
3512
+ const { element } = props;
3513
+ if (!(0, _kunpeng_io_bpmn_js.is)(element, "bpmn:UserTask")) return [];
3514
+ const entries = [{
3515
+ id: "addSignEnabled",
3516
+ component: AddSignEnabled,
3517
+ isEdited: _kunpeng_io_properties_panel.isCheckboxEntryEdited
3518
+ }];
3519
+ if (getAddSign(element)) entries.push({
3520
+ id: "addSignMaxDepth",
3521
+ component: AddSignMaxDepth,
3522
+ isEdited: _kunpeng_io_properties_panel.isNumberFieldEntryEdited
3523
+ });
3524
+ return entries;
3525
+ }
3526
+ function AddSignEnabled(props) {
3527
+ const { element } = props;
3528
+ const commandStack = useService("commandStack");
3529
+ const bpmnFactory = useService("bpmnFactory");
3530
+ const translate = useService("translate");
3531
+ const getValue = () => {
3532
+ return !!getAddSign(element);
3533
+ };
3534
+ const setValue = (value) => {
3535
+ const businessObject = (0, _kunpeng_io_bpmn_js.getBusinessObject)(element);
3536
+ const commands = [];
3537
+ let extensionElements = businessObject.get("extensionElements");
3538
+ if (value && !extensionElements) {
3539
+ extensionElements = createElement("bpmn:ExtensionElements", { values: [] }, businessObject, bpmnFactory);
3540
+ commands.push({
3541
+ cmd: "element.updateModdleProperties",
3542
+ context: {
3543
+ element,
3544
+ moddleElement: businessObject,
3545
+ properties: { extensionElements }
3546
+ }
3547
+ });
3548
+ }
3549
+ if (value) {
3550
+ const addSign = createElement("kunpeng:AddSign", {}, extensionElements, bpmnFactory);
3551
+ commands.push({
3552
+ cmd: "element.updateModdleProperties",
3553
+ context: {
3554
+ element,
3555
+ moddleElement: extensionElements,
3556
+ properties: { values: [...extensionElements.get("values"), addSign] }
3557
+ }
3558
+ });
3559
+ } else {
3560
+ const addSign = getAddSign(element);
3561
+ if (!addSign) return;
3562
+ commands.push({
3563
+ cmd: "element.updateModdleProperties",
3564
+ context: {
3565
+ element,
3566
+ moddleElement: extensionElements,
3567
+ properties: { values: extensionElements.get("values").filter((v) => v !== addSign) }
3568
+ }
3569
+ });
3570
+ }
3571
+ commandStack.execute("properties-panel.multi-command-executor", commands);
3572
+ };
3573
+ return (0, _kunpeng_io_properties_panel.CheckboxEntry)({
3574
+ element,
3575
+ id: "addSignEnabled",
3576
+ label: translate("Allow add sign"),
3577
+ getValue,
3578
+ setValue
3579
+ });
3580
+ }
3581
+ function AddSignMaxDepth(props) {
3582
+ const { element } = props;
3583
+ const commandStack = useService("commandStack");
3584
+ const translate = useService("translate");
3585
+ const getValue = () => {
3586
+ const addSign = getAddSign(element);
3587
+ return addSign ? addSign.get("maxDepth") ?? 1 : 1;
3588
+ };
3589
+ const setValue = (value) => {
3590
+ const addSign = getAddSign(element);
3591
+ if (!addSign) return;
3592
+ commandStack.execute("element.updateModdleProperties", {
3593
+ element,
3594
+ moddleElement: addSign,
3595
+ properties: { maxDepth: value }
3596
+ });
3597
+ };
3598
+ const validate = (value) => {
3599
+ if (value == null || value === "" || Number(value) < 1) return translate("Max depth must be >= 1 (1 = no cascade)");
3600
+ };
3601
+ return (0, _kunpeng_io_properties_panel.NumberFieldEntry)({
3602
+ element,
3603
+ id: "addSignMaxDepth",
3604
+ label: translate("Add sign max depth"),
3605
+ min: 1,
3606
+ step: 1,
3607
+ getValue,
3608
+ setValue,
3609
+ validate
3610
+ });
3611
+ }
3612
+ function getAddSign(element) {
3613
+ return getExtensionElementsList((0, _kunpeng_io_bpmn_js.getBusinessObject)(element), "kunpeng:AddSign")[0];
3614
+ }
3501
3615
  // src/provider/kunpeng/utils/KunpengServiceTaskUtil.js
3502
3616
  var OPTIONAL_JOB_WORKER_ELEMENTS = [
3503
3617
  "bpmn:AdHocSubProcess",
@@ -8284,6 +8398,7 @@
8284
8398
  AdHocSubProcessImplementationGroup,
8285
8399
  TaskDefinitionGroup,
8286
8400
  AssignmentDefinitionGroup,
8401
+ AddSignGroup,
8287
8402
  ActiveElementsGroup,
8288
8403
  FormGroup,
8289
8404
  ConditionGroup,
@@ -8360,6 +8475,15 @@
8360
8475
  };
8361
8476
  return group.entries.length ? group : null;
8362
8477
  }
8478
+ function AddSignGroup(element, injector) {
8479
+ const group = {
8480
+ id: "addSign",
8481
+ label: injector.get("translate")("Add sign"),
8482
+ entries: [...AddSignProps({ element })],
8483
+ component: _kunpeng_io_properties_panel.Group
8484
+ };
8485
+ return group.entries.length ? group : null;
8486
+ }
8363
8487
  function TaskDefinitionGroup(element, injector) {
8364
8488
  const group = {
8365
8489
  id: "taskDefinition",