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

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.
@@ -4344,6 +4344,11 @@
4344
4344
  component: ConditionExpression,
4345
4345
  isEdited: _kunpeng_io_properties_panel.isFeelEntryEdited
4346
4346
  });
4347
+ if (isDefaultableSource(element.source)) conditionProps.push({
4348
+ id: "defaultFlow",
4349
+ component: DefaultFlowToggle,
4350
+ isEdited: _kunpeng_io_properties_panel.isToggleSwitchEntryEdited
4351
+ });
4347
4352
  return conditionProps;
4348
4353
  }
4349
4354
  function ConditionExpression(props) {
@@ -4357,7 +4362,7 @@
4357
4362
  const businessObject = (0, _kunpeng_io_bpmn_js.getBusinessObject)(element);
4358
4363
  const source = element.source;
4359
4364
  if (source.businessObject.default === businessObject) commands.push({
4360
- cmd: "element.updateProperties",
4365
+ cmd: "properties.update",
4361
4366
  context: {
4362
4367
  element: source,
4363
4368
  properties: { "default": void 0 }
@@ -4365,7 +4370,7 @@
4365
4370
  });
4366
4371
  const formalExpressionElement = value && value != "" ? createElement("bpmn:FormalExpression", { body: value }, businessObject, bpmnFactory) : void 0;
4367
4372
  commands.push({
4368
- cmd: "element.updateProperties",
4373
+ cmd: "properties.update",
4369
4374
  context: {
4370
4375
  element,
4371
4376
  properties: { conditionExpression: formalExpressionElement }
@@ -4383,14 +4388,67 @@
4383
4388
  debounce
4384
4389
  });
4385
4390
  }
4391
+ function DefaultFlowToggle(props) {
4392
+ const { element } = props;
4393
+ const commandStack = useService("commandStack"), translate = useService("translate");
4394
+ const businessObject = (0, _kunpeng_io_bpmn_js.getBusinessObject)(element);
4395
+ const source = element.source;
4396
+ const getValue = () => {
4397
+ return source.businessObject.default === businessObject;
4398
+ };
4399
+ const setValue = (value) => {
4400
+ const commands = [];
4401
+ if (value) {
4402
+ if (businessObject.get("conditionExpression")) commands.push({
4403
+ cmd: "properties.update",
4404
+ context: {
4405
+ element,
4406
+ properties: { conditionExpression: void 0 }
4407
+ }
4408
+ });
4409
+ commands.push({
4410
+ cmd: "properties.update",
4411
+ context: {
4412
+ element: source,
4413
+ properties: { "default": businessObject }
4414
+ }
4415
+ });
4416
+ } else if (source.businessObject.default === businessObject) commands.push({
4417
+ cmd: "properties.update",
4418
+ context: {
4419
+ element: source,
4420
+ properties: { "default": void 0 }
4421
+ }
4422
+ });
4423
+ if (commands.length) commandStack.execute("properties-panel.multi-command-executor", commands);
4424
+ };
4425
+ const isDefault = getValue();
4426
+ return (0, _kunpeng_io_properties_panel.ToggleSwitchEntry)({
4427
+ element,
4428
+ id: "defaultFlow",
4429
+ label: translate("Default flow"),
4430
+ switcherLabel: isDefault ? translate("On") : translate("Off"),
4431
+ getValue,
4432
+ setValue
4433
+ });
4434
+ }
4386
4435
  var CONDITIONAL_SOURCES = [
4387
4436
  "bpmn:Activity",
4388
4437
  "bpmn:ExclusiveGateway",
4389
4438
  "bpmn:InclusiveGateway"
4390
4439
  ];
4440
+ var DEFAULTABLE_SOURCES = [
4441
+ "bpmn:ExclusiveGateway",
4442
+ "bpmn:InclusiveGateway",
4443
+ "bpmn:ComplexGateway",
4444
+ "bpmn:Activity"
4445
+ ];
4391
4446
  function isConditionalSource(element) {
4392
4447
  return (0, _kunpeng_io_bpmn_js.isAny)(element, CONDITIONAL_SOURCES);
4393
4448
  }
4449
+ function isDefaultableSource(element) {
4450
+ return (0, _kunpeng_io_bpmn_js.isAny)(element, DEFAULTABLE_SOURCES);
4451
+ }
4394
4452
  /**
4395
4453
  * getConditionExpression - get the body value of a condition expression for a given element
4396
4454
  *