Expand all

ve.ui.MWTransclusionOutlineTemplateWidget

Extends

Constructor

new ve.ui.MWTransclusionOutlineTemplateWidget(template, [replacesPlaceholder]) #

Container for a template as rendered in the template dialog sidebar. Contains search and visibility inputs, and a list of parameters when available.

Parameters:

Name Type Attributes Default Description
template ve.dm.MWTemplateModel
replacesPlaceholder boolean optional
false

Properties:

Name Type Description
templateModel ve.dm.MWTemplateModel
parameterList ve.ui.MWTransclusionOutlineParameterSelectWidget
Source:
Container for a template as rendered in the template dialog sidebar.

Properties

searchableParameterCountstatic #

Minimum number of parameters required before search and filter options appear.

Properties:

Type Description
number
Source:
Minimum number of parameters required before search and filter options appear.

Methods

createAllParameterCheckboxes()private #

createCheckbox(paramName) → {OO.ui.OptionWidget}private #

Parameters:

Name Type Description
paramName string

Parameter name or alias as used in the model

Source:

Returns:

Type
OO.ui.OptionWidget

filterParameters(query)private #

Narrows the list of checkboxes down to parameters that match the user's input. We search the parameter's primary name, aliases, label, and description. But not e.g. the example value.

Parameters:

Name Type Description
query string

user input

Source:

Fires:

Narrows the list of checkboxes down to parameters that match the user's input.

findCanonicalPosition(paramName) → {number}private #

Parameters:

Name Type Description
paramName string
Source:

Returns:

Type
number

getRelevantTemplateParameters([filter]) → {Array.<string>}private #

Parameters:

Name Type Attributes Default Description
filter string optional
'all'

Either "used", "unused", or "all"

Source:

Returns:

Type
Array.<string>

initializeParameterList()private #

isSelected() → {boolean} #

Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.

Inherited from:
Source:

Returns:

Type
boolean
Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.

onParameterAddedToTemplateModel(param)private #

onParameterRemovedFromTemplateModel(param)private #

onTemplateParameterChoose(item, selected)private #

Parameters:

Name Type Description
item OO.ui.OptionWidget
selected boolean
Source:

onTemplateParameterSpaceDown(item, selected)private #

Parameters:

Name Type Description
item OO.ui.OptionWidget
selected boolean
Source:

onToggleUnusedFields(visibility, [fromClick])private #

Parameters:

Name Type Attributes Description
visibility boolean
fromClick boolean optional
Source:

setParameter([paramName]) #

Parameters:

Name Type Attributes Description
paramName string optional

Parameter name to set, e.g. "param1". Omit to remove setting.

Source:

setSelected(state) #

Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.

Parameters:

Name Type Description
state boolean
Overrides:
Source:
Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.

shouldFiltersBeShown() → {boolean}private #

toggleHasValue(paramName, hasValue) #

Parameters:

Name Type Description
paramName string
hasValue boolean
Source:

toggleParameter(item, selected, soft)private #

Parameters:

Name Type Description
item OO.ui.OptionWidget
selected boolean
soft boolean

If true, focus should stay in the sidebar.

Source:

Fires:

updateButtonAriaDescription(state)private #

updateUnusedParameterToggleState()private #

Events

filterParametersById(visibility) #

Triggered when the user uses the search widget at the top to filter the list of parameters.

Parameters:

Name Type Description
visibility Object.<string, boolean>

Keyed by unique id of the parameter, e.g. something like "part_1/param1". Note this lists only parameters that are currently shown as a checkbox. The spec might contain more parameters (e.g. deprecated).

Source:
Triggered when the user uses the search widget at the top to filter the list of parameters.

transclusionOutlineItemSelected(id, soft) #

Parameters:

Name Type Description
id string

Item ID

soft boolean

If true, focus should stay in the sidebar.

Overrides:
Source:

transclusionPartSoftSelected(partId) #

"Soft" selection with space.

Parameters:

Name Type Description
partId string

Unique id of the {@see ve.dm.MWTransclusionPartModel}, e.g. something like "part_1".

Inherited from:
Source:
"Soft" selection with space.