()
| 127 | } |
| 128 | |
| 129 | update() { |
| 130 | let selections = this.selections; |
| 131 | if (this.param.constrain && this.constrainedBy) { |
| 132 | const controllingValue = this.constrainedBy.getValue(); |
| 133 | if (controllingValue) |
| 134 | selections = selections.filter(s => this.param.constrain(controllingValue, s.value)); |
| 135 | else |
| 136 | selections = []; |
| 137 | } |
| 138 | this.editor.clear(); |
| 139 | if (this.nullable) |
| 140 | this.editor.addItem(''); |
| 141 | for (const selection of selections) |
| 142 | this.editor.addItem(selection.name); |
| 143 | if (typeof this.param.selected == 'string') |
| 144 | this.#setSelected(this.param.selected); |
| 145 | else if (this.param.value) |
| 146 | this.setValue(this.param.value); |
| 147 | if (this.description) |
| 148 | this.#updateDescription(); |
| 149 | } |
| 150 | |
| 151 | subscribeOnChange(callback: () => void) { |
| 152 | this.connectYueSignal(this.editor.onSelectionChange, callback); |
no test coverage detected