The transpile_attribute_name
function is used to map attribute names to their corresponding HTML attribute names. Each key-value pair in the attribute_mapping
dictionary represents a mapping from an attribute name to its corresponding HTML attribute name.
Here is an explanation of the purpose of each key-value pair in the attribute_mapping
:
"idName": "id"
: Represents the attributeidName
which is mapped to the HTML attributeid
."classType": "class"
: Represents the attributeclassType
which is mapped to the HTML attributeclass
."dataValue": "data-value"
: Represents the attributedataValue
which is mapped to the HTML attributedata-value
."hrefLink": "href"
: Represents the attributehrefLink
which is mapped to the HTML attributehref
."srcUrl": "src"
: Represents the attributesrcUrl
which is mapped to the HTML attributesrc
."altText": "alt"
: Represents the attributealtText
which is mapped to the HTML attributealt
."forElement": "for"
: Represents the attributeforElement
which is mapped to the HTML attributefor
."ariaLabel": "aria-label"
: Represents the attributeariaLabel
which is mapped to the HTML attributearia-label
."ariaHidden": "aria-hidden"
: Represents the attributeariaHidden
which is mapped to the HTML attributearia-hidden
."disabledState": "disabled"
: Represents the attributedisabledState
which is mapped to the HTML attributedisabled
."checkedState": "checked"
: Represents the attributecheckedState
which is mapped to the HTML attributechecked
."requiredField": "required"
: Represents the attributerequiredField
which is mapped to the HTML attributerequired
."placeholderText": "placeholder"
: Represents the attributeplaceholderText
which is mapped to the HTML attributeplaceholder
."maxLengthValue": "maxlength"
: Represents the attributemaxLengthValue
which is mapped to the HTML attributemaxlength
."tabIndexValue": "tabindex"
: Represents the attributetabIndexValue
which is mapped to the HTML attributetabindex
."targetFrame": "target"
: Represents the attributetargetFrame
which is mapped to the HTML attributetarget
."relAttribute": "rel"
: Represents the attributerelAttribute
which is mapped to the HTML attributerel
."typeAttribute": "type"
: Represents the attributetypeAttribute
which is mapped to the HTML attributetype
."nameAttribute": "name"
: Represents the attributenameAttribute
which is mapped to the HTML attributename
."valueAttribute": "value"
: Represents the attributevalueAttribute
which is mapped to the HTML attributevalue
."readOnlyState": "readonly"
: Represents the attributereadOnlyState
which is mapped to the HTML attributereadonly
."autocompleteValue": "autocomplete"
: Represents the attributeautocompleteValue
which is mapped to the HTML attributeautocomplete
."patternAttribute": "pattern"
: Represents the attributepatternAttribute
which is mapped to the HTML attributepattern
."stepValue": "step"
: Represents the attributestepValue
which is mapped to the HTML attributestep
."minValue": "min"
: Represents the attributeminValue
which is mapped to the HTML attributemin
."maxValue": "max"
: Represents the attributemaxValue
which is mapped to the HTML attributemax
."multipleFiles": "multiple"
: Represents the attributemultipleFiles
which is mapped to the HTML attributemultiple
."colsNumber": "cols"
: Represents the attributecolsNumber
which is mapped to the HTML attributecols
."rowsNumber": "rows"
: Represents the attributerowsNumber
which is mapped to the HTML attributerows
."wrapAttribute": "wrap"
: Represents the attributewrapAttribute
which is mapped to the HTML attributewrap
."downloadFilename": "download"
: Represents the attributedownloadFilename
which is mapped to the HTML attributedownload
."mediaAttribute": "media"
: Represents the attributemediaAttribute
which is mapped to the HTML attributemedia
."targetBlank": "target"
: Represents the attributetargetBlank
which is mapped to the HTML attributetarget
."targetSelf": "target"
: Represents the attributetargetSelf
which is mapped to the HTML attributetarget
."targetParent": "target"
: Represents the attributetargetParent
which is mapped to the HTML attributetarget
."targetTop": "target"
: Represents the attributetargetTop
which is mapped to the HTML attributetarget
."autoplayAttribute": "autoplay"
: Represents the attributeautoplayAttribute
which is mapped to the HTML attributeautoplay
."controlsAttribute": "controls"
: Represents the attributecontrolsAttribute
which is mapped to the HTML attributecontrols
."loopAttribute": "loop"
: Represents the attributeloopAttribute
which is mapped to the HTML attributeloop
."mutedAttribute": "muted"
: Represents the attributemutedAttribute
which is mapped to the HTML attributemuted
."preloadAttribute": "preload"
: Represents the attributepreloadAttribute
which is mapped to the HTML attributepreload
."posterAttribute": "poster"
: Represents the attributeposterAttribute
which is mapped to the HTML attributeposter
."openNewTab": "target"
: Represents the attributeopenNewTab
which is mapped to the HTML attributetarget
."spellcheckAttribute": "spellcheck"
: Represents the attributespellcheckAttribute
which is mapped to the HTML attributespellcheck
."translateAttribute": "translate"
: Represents the attributetranslateAttribute
which is mapped to the HTML attributetranslate
."contenteditableAttribute": "contenteditable"
: Represents the attributecontenteditableAttribute
which is mapped to the HTML attributecontenteditable
."dirAttribute": "dir"
: Represents the attributedirAttribute
which is mapped to the HTML attributedir
."langAttribute": "lang"
: Represents the attributelangAttribute
which is mapped to the HTML attributelang
."accessKeyAttribute": "accesskey"
: Represents the attributeaccessKeyAttribute
which is mapped to the HTML attributeaccesskey
."draggableAttribute": "draggable"
: Represents the attributedraggableAttribute
which is mapped to the HTML attributedraggable
."hiddenAttribute": "hidden"
: Represents the attributehiddenAttribute
which is mapped to the HTML attributehidden
."roleAttribute": "role"
: Represents the attributeroleAttribute
which is mapped to the HTML attributerole
.
These mappings ensure that the appropriate HTML attribute names are used when transpiling the attributes from the source node to the HTML output.