MCPcopy Index your code
hub / github.com/alibaba/lowcode-engine / setConditionGroup

Method setConditionGroup

packages/designer/src/document/node/node.ts:693–720  ·  view source on GitHub ↗
(grp: IPublicModelExclusiveGroup | string | null)

Source from the content-addressed store, hash-verified

691
692 /* istanbul ignore next */
693 setConditionGroup(grp: IPublicModelExclusiveGroup | string | null) {
694 let _grp: IExclusiveGroup | null = null;
695 if (!grp) {
696 this.getExtraProp('conditionGroup', false)?.remove();
697 if (this._conditionGroup) {
698 this._conditionGroup.remove(this);
699 this._conditionGroup = null;
700 }
701 return;
702 }
703 if (!isExclusiveGroup(grp)) {
704 if (this.prevSibling?.conditionGroup?.name === grp) {
705 _grp = this.prevSibling.conditionGroup;
706 } else if (this.nextSibling?.conditionGroup?.name === grp) {
707 _grp = this.nextSibling.conditionGroup;
708 } else if (typeof grp === 'string') {
709 _grp = new ExclusiveGroup(grp);
710 }
711 }
712 if (_grp && this._conditionGroup !== _grp) {
713 this.getExtraProp('conditionGroup', true)?.setValue(_grp.name);
714 if (this._conditionGroup) {
715 this._conditionGroup.remove(this);
716 }
717 this._conditionGroup = _grp;
718 _grp?.add(this);
719 }
720 }
721
722 /* istanbul ignore next */
723 isConditionalVisible(): boolean | undefined {

Callers 1

internalSetParentMethod · 0.95

Calls 5

getExtraPropMethod · 0.95
isExclusiveGroupFunction · 0.90
removeMethod · 0.65
setValueMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected