Constructor
new StreamSelectionAvailabilityUpdater(container, context)
Creates a new StreamSelectionAvailabilityUpdater.
Parameters:
| Name | Type | Description |
|---|---|---|
container |
HTMLElement | Document | The DOM container element to search within for stream controls. |
context |
string | null | The context for stream availability ('consumption' or 'policy'). |
- Source:
Methods
getEnabledStreamsForCurrentContext(codeObj, substanceName, context) → {Array.<string>}
Gets enabled streams for the current context.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
codeObj |
Object | The code object containing substances data. | |
substanceName |
string | The name of the substance to check. | |
context |
string | null | Optional context override. If not provided, uses the context provided at construction. |
- Source:
Returns:
Array of enabled stream names.
- Type
- Array.<string>
getFirstEnabledOption(selectElement) → {string}
Gets the first enabled option from a select element.
Parameters:
| Name | Type | Description |
|---|---|---|
selectElement |
HTMLSelectElement | The select element to check. |
- Source:
Returns:
Value of the first enabled option, or 'sales' as fallback.
- Type
- string
refreshAllStreamTargetDropdowns(codeObj, substanceName)
Refreshes all stream target dropdowns for a specific substance.
Parameters:
| Name | Type | Description |
|---|---|---|
codeObj |
Object | The code object containing substances data. |
substanceName |
string | The name of the substance whose streams changed. |
- Source:
updateAllStreamTargetDropdowns(enabledStreams, filterFn)
Updates all stream target dropdowns within the container.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
enabledStreams |
Array.<string> | Array of enabled stream names. | |
filterFn |
function | null | Optional filter function (deprecated). |
- Source:
updateStreamOptionStates(selectElement, enabledStreams)
Updates stream option disabled states based on enabled streams.
Parameters:
| Name | Type | Description |
|---|---|---|
selectElement |
HTMLSelectElement | The select element to update. |
enabledStreams |
Array.<string> | Array of enabled stream names. |
- Source: