children: Array()

in src/components/form-items/stars.ts [33:54]


      children: Array(5)
        .fill(undefined)
        .map((n, index) =>
          DomBuilder.getInstance().build({
            type: 'div',
            testId: props.optionTestId,
            classNames: [ 'mynah-feedback-form-star', ...(props.value === (index + 1).toString() ? [ 'selected' ] : []) ],
            events: {
              click: (e: MouseEvent) => {
                (this.starsContainer.querySelector('.selected') as ExtendedHTMLElement)?.removeClass(
                  'selected'
                );
                (e.currentTarget as ExtendedHTMLElement).addClass('selected');
                if (props.onChange !== undefined) {
                  props.onChange((index + 1).toString());
                }
                this.setValue((index + 1) as StarValues);
              },
            },
            attributes: { star: (index + 1).toString() },
            children: [ new Icon({ icon: MynahIcons.STAR }).render ],
          })