update(interactive_area) {
        this.commitState();

        interactive_area.innerHTML = this.getUpdatedTemplate();

        const from_pool_div = interactive_area.querySelector('.from-pool-div');

        document.querySelectorAll('.item-name-input').forEach(item_name_input => {
            const checkbox = document.createElement('input');
            checkbox.type = 'checkbox';
            checkbox.value = item_name_input.value;

            if (this.state.from_pool.includes(checkbox.value)) {
                checkbox.checked = true;
            }

            const label_text = document.createElement('span');
            label_text.innerText = item_name_input.value;

            const label = document.createElement('label');
            label.appendChild(checkbox);
            label.appendChild(label_text);

            from_pool_div.appendChild(label);
        });

        const points_input = interactive_area.querySelector('.points-input');
        if (this.state.points) {
            points_input.value = this.state.points;
        }

        const label_input = interactive_area.querySelector('.label-input');
        if (this.state.item_label) {
            label_input.value = this.state.item_label;
        }
    }
/**
     * Show a usable item-widget.  When `update()` is called the widget will be refreshed to show the current set
     * of item_names found in the main item pool.
     *
     * @param {HTMLDivElement} interactive_area
     */
Show a usable item-widget.  When `update()` is called the widget will be refreshed to show the current set
of item_names found in the main item pool.


Show a usable item - widget . When ` update () ` is called the widget will be refreshed to show the current set of item_names found in the main item pool .
update(interactive_area) {
        this.commitState();
        interactive_area.innerHTML = this.getUpdatedTemplate();
        const from_pool_div = interactive_area.querySelector('.from-pool-div');
        document.querySelectorAll('.item-name-input').forEach(item_name_input => {
            const checkbox = document.createElement('input');
            checkbox.type = 'checkbox';
            checkbox.value = item_name_input.value;
            if (this.state.from_pool.includes(checkbox.value)) {
                checkbox.checked = true;
            }
            const label_text = document.createElement('span');
            label_text.innerText = item_name_input.value;
            const label = document.createElement('label');
            label.appendChild(checkbox);
            label.appendChild(label_text);
            from_pool_div.appendChild(label);
        });
        const points_input = interactive_area.querySelector('.points-input');
        if (this.state.points) {
            points_input.value = this.state.points;
        }
        const label_input = interactive_area.querySelector('.label-input');
        if (this.state.item_label) {
            label_input.value = this.state.item_label;
        }
    }
update ( interactive_area ) { this . commitState ( ) ; interactive_area . innerHTML = this . getUpdatedTemplate ( ) ; const from_pool_div = interactive_area . querySelector ( '.from-pool-div' ) ; document . querySelectorAll ( '.item-name-input' ) . forEach ( item_name_input => { const checkbox = document . createElement ( 'input' ) ; checkbox . type = 'checkbox' ; checkbox . value = item_name_input . value ; if ( this . state . from_pool . includes ( checkbox . value ) ) { checkbox . checked = true ; } const label_text = document . createElement ( 'span' ) ; label_text . innerText = item_name_input . value ; const label = document . createElement ( 'label' ) ; label . appendChild ( checkbox ) ; label . appendChild ( label_text ) ; from_pool_div . appendChild ( label ) ; } ) ; const points_input = interactive_area . querySelector ( '.points-input' ) ; if ( this . state . points ) { points_input . value = this . state . points ; } const label_input = interactive_area . querySelector ( '.label-input' ) ; if ( this . state . item_label ) { label_input . value = this . state . item_label ; } }
Show a usable item-widget.
Show a usable item - widget .