Extends
Constructor
new ve.ui.MWTransclusionOutlineTemplateWidget(template, [replacesPlaceholder])
#
Hierarchy
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 |
Properties
searchableParameterCountstatic
#
Minimum number of parameters required before search and filter options appear.
Properties:
Type | Description |
---|---|
number |
Methods
createAllParameterCheckboxes()private
#
createCheckbox(paramName) → {OO.ui.OptionWidget}private
#
Parameters:
Name | Type | Description |
---|---|---|
paramName |
string | Parameter name or alias as used in the model |
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 |
Fires:
findCanonicalPosition(paramName) → {number}private
#
Parameters:
Name | Type | Description |
---|---|---|
paramName |
string |
Returns:
- Type
- number
getRelevantTemplateParameters([filter]) → {Array.<string>}private
#
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
filter |
string |
optional |
'all' | Either "used", "unused", or "all" |
Returns:
- Type
- Array.<string>
initializeFilters()private
#
initializeParameterList()private
#
isSelected() → {boolean}
#
Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.
- Inherited from:
- Source:
Returns:
- Type
- boolean
onHeaderKeyPressed(key)private
#
Parameters:
Name | Type | Description |
---|---|---|
key |
number |
- Inherited from:
- Source:
Fires:
onParameterAddedToTemplateModel(param)private
#
Parameters:
Name | Type | Description |
---|---|---|
param |
ve.dm.MWParameterModel |
onParameterRemovedFromTemplateModel(param)private
#
Parameters:
Name | Type | Description |
---|---|---|
param |
ve.dm.MWParameterModel |
onTemplateParameterChoose(item, selected)private
#
Parameters:
Name | Type | Description |
---|---|---|
item |
OO.ui.OptionWidget | |
selected |
boolean |
onTemplateParameterSpaceDown(item, selected)private
#
Parameters:
Name | Type | Description |
---|---|---|
item |
OO.ui.OptionWidget | |
selected |
boolean |
onToggleUnusedFields(visibility, [fromClick])private
#
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
visibility |
boolean | ||
fromClick |
boolean |
optional |
setParameter([paramName])
#
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
paramName |
string |
optional |
Parameter name to set, e.g. "param1". Omit to remove setting. |
setSelected(state)
#
Convenience method, modelled after {@see OO.ui.OptionWidget}, but this isn't one.
Parameters:
Name | Type | Description |
---|---|---|
state |
boolean |
shouldFiltersBeShown() → {boolean}private
#
Returns:
- Type
- boolean
toggleFilters()private
#
toggleHasValue(paramName, hasValue)
#
Parameters:
Name | Type | Description |
---|---|---|
paramName |
string | |
hasValue |
boolean |
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. |
Fires:
updateButtonAriaDescription(state)private
#
Parameters:
Name | Type | Description |
---|---|---|
state |
boolean |
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). |
transclusionOutlineItemSelected(id, soft)
#
Parameters:
Name | Type | Description |
---|---|---|
id |
string | Item ID |
soft |
boolean | If true, focus should stay in the sidebar. |