Add disabled property support to all popup input types (#5441) Adds optional `disabled` boolean property to PopupInputConfiguration JSDoc and implements it across all input types (checkbox, text, textarea, number). When set to true, the input element will be rendered in a disabled state.
Signed| @@ -84,6 +84,7 @@ export const POPUP_RESULT = { | ||
| 84 | 84 | * @property {number?} [min] - The minimum value for number inputs |
| 85 | 85 | * @property {number?} [max] - The maximum value for number inputs |
| 86 | 86 | * @property {number?} [step] - The step value for number inputs |
| 87 | + * @property {boolean?} [disabled=false] - Whether the input should be disabled | |
| 87 | 88 | */ |
| 88 | 89 | |
| 89 | 90 | /** |
| @@ -334,6 +335,7 @@ export class Popup { | ||
| 334 | 335 | inputElement.type = 'checkbox'; |
| 335 | 336 | inputElement.id = input.id; |
| 336 | 337 | inputElement.checked = Boolean(input.defaultState ?? false); |
| 338 | + inputElement.disabled = Boolean(input.disabled ?? false); | |
| 337 | 339 | label.appendChild(inputElement); |
| 338 | 340 | const labelText = document.createElement('span'); |
| 339 | 341 | labelText.innerText = input.label; |
| @@ -359,6 +361,7 @@ export class Popup { | ||
| 359 | 361 | inputElement.id = input.id; |
| 360 | 362 | inputElement.value = String(input.defaultState ?? ''); |
| 361 | 363 | inputElement.placeholder = input.tooltip ?? ''; |
| 364 | + inputElement.disabled = Boolean(input.disabled ?? false); | |
| 362 | 365 | setTitleFromTooltip(inputElement, input.tooltip); |
| 363 | 366 | |
| 364 | 367 | const labelText = document.createElement('span'); |
| @@ -380,6 +383,7 @@ export class Popup { | ||
| 380 | 383 | inputElement.value = String(input.defaultState ?? ''); |
| 381 | 384 | inputElement.rows = input.rows ?? 1; |
| 382 | 385 | inputElement.placeholder = input.tooltip ?? ''; |
| 386 | + inputElement.disabled = Boolean(input.disabled ?? false); | |
| 383 | 387 | setTitleFromTooltip(inputElement, input.tooltip); |
| 384 | 388 | |
| 385 | 389 | const labelText = document.createElement('span'); |
| @@ -404,6 +408,7 @@ export class Popup { | ||
| 404 | 408 | inputElement.min = String(input.min ?? ''); |
| 405 | 409 | inputElement.max = String(input.max ?? ''); |
| 406 | 410 | inputElement.step = String(input.step ?? ''); |
| 411 | + inputElement.disabled = Boolean(input.disabled ?? false); | |
| 407 | 412 | setTitleFromTooltip(inputElement, input.tooltip); |
| 408 | 413 | |
| 409 | 414 | inputElement.addEventListener('change', () => { |