render()

in src/setter/mixed-setter/index.tsx [449:492]


  render() {
    const { className, field } = this.props;
    let contents:
      | {
          setterContent: ReactNode;
          actions: ReactNode;
        }
      | undefined;

    if (this.hasVariableSetter) {
      // polyfill vision variable setter logic
      const setterComponent = getSetter('VariableSetter')?.component as any;
      if (setterComponent && setterComponent.isPopup) {
        contents = this.contentsFromPolyfill(setterComponent);
      }
    }
    if (!contents) {
      const currentSetter = this.getCurrentSetter();
      contents = {
        setterContent: this.renderCurrentSetter(currentSetter),
        actions: this.renderSwitchAction(currentSetter),
      };
    }

    return (
      <div
        ref={(shell) => {
          this.shell = shell;
        }}
        className={classNames('lc-setter-mixed', className)}
      >
        {contents.setterContent}
        <div className="lc-setter-actions">{contents.actions}</div>
        {!!MixedSetterController.config.renderSlot &&
          <div className="lc-action-slot">
            {MixedSetterController.config.renderSlot?.({
              field,
              bindCode: field.getValue()?.value,
            })}
          </div>
        }
      </div>
    );
  }