public function generate(): string
    {
        $setID = (string)$this->attributes['data-set-id'];
        $getState = $this->vHandler->get->get($setID.'_state', Variables::TYPE_INT) == 1;
        $postState = $this->vHandler->post->get($setID.'_state', Variables::TYPE_INT) == 1;
        $expanded = $getState || $postState;
        $this->attributes['class'] .= $expanded === true ? ' expanded' : '';

        $title = [];
        $title[] = Tags::span($this->name, ['class' => 'name']);
        $title[] = Tags::span('',
            ['class' => 'expand', 'title' => $this->getConstant('TXT_PANEL_DATA_FORM_SET_EXPAND')]);
        $title[] = Tags::span('',
            ['class' => 'collapse', 'title' => $this->getConstant('TXT_PANEL_DATA_FORM_SET_COLLAPSE')]);
        $title[] = Controlls\Text::inputHidden($setID.'_state', (int)$expanded, ['method-get' => true, 'id' => '']);

        $elements = [];
        foreach ($this->elements as $element) {
            /** @noinspection PhpUndefinedMethodInspection */
            $elements[] = $element->generate();
        }

        $set = [];
        $set[] = Tags::div($title, ['class' => 'title cf']);
        $set[] = Tags::div($elements, ['class' => 'content border-radius-5']);

        return Tags::div($set, $this->attributes);
    }