|
| 1 | +<section class="{{@type}}"> |
| 2 | + {{!-- TODO: Fix this link for a11y --}} |
| 3 | + <h3 class="class-field-description--link" data-anchor="{{@field.name}}" role="link" {{on "click" (fn this.updateAnchor @field.name)}}> |
| 4 | + <a class="anchor" {{!-- template-lint-disable link-href-attributes --}}> |
| 5 | + {{svg-jar 'fa-link' class="class-field-description--link-hover" width="20px" height="20px"}} |
| 6 | + </a> |
| 7 | + <span class="{{@type}}-name">{{@field.name}}</span> |
| 8 | + {{#if @field.params}} |
| 9 | + <span class="args"> |
| 10 | + ({{join ", " (map-by "name" @field.params)}}) |
| 11 | + </span> |
| 12 | + {{/if}} |
| 13 | + {{#if @field.return}} |
| 14 | + <span class="return-type">{{@field.return.type}}</span> |
| 15 | + {{/if}} |
| 16 | + {{#if @field.access}} |
| 17 | + <span class="access">{{@field.access}}</span> |
| 18 | + {{/if}} |
| 19 | + {{#if @field.deprecated}} |
| 20 | + <span class="access">deprecated</span> |
| 21 | + {{/if}} |
| 22 | + </h3> |
| 23 | + {{#if @model.module}} |
| 24 | + <div class="attributes"> |
| 25 | + <div class="attribute"> |
| 26 | + <span class="attribute-label">Module:</span> |
| 27 | + <span class="attribute-value"><LinkTo @route="project-version.modules.module" @models={{array @model.projectVersion.compactVersion @model.module}}>{{@model.module}}</LinkTo></span> |
| 28 | + </div> |
| 29 | + </div> |
| 30 | + {{/if}} |
| 31 | + <p class="github-link" data-test-file={{@field.file}}> |
| 32 | + {{#if @field.inherited}} |
| 33 | + Inherited from |
| 34 | + <a href="{{github-link @model.project.id @model.projectVersion.version @field.file @field.line}}" target="_blank" rel="noopener noreferrer"> |
| 35 | + {{@field.inheritedFrom}} {{@field.file}}:{{@field.line}} |
| 36 | + </a> |
| 37 | + {{else}} |
| 38 | + Defined in |
| 39 | + <a href="{{github-link @model.project.id @model.projectVersion.version @field.file @field.line}}" target="_blank" rel="noopener noreferrer"> |
| 40 | + {{@field.file}}:{{@field.line}} |
| 41 | + </a> |
| 42 | + {{/if}} |
| 43 | + </p> |
| 44 | + {{#if @field.since}} |
| 45 | + <p class="field-since"> |
| 46 | + Available since v{{@field.since}} |
| 47 | + </p> |
| 48 | + {{/if}} |
| 49 | + {{#if (and (eq @field.static 1) (eq @field.itemtype "method") this.hasImportExample)}} |
| 50 | + <ImportExample @item={{concat "{ " @field.name " }"}} @package={{@field.class}} /> |
| 51 | + {{/if}} |
| 52 | + <dl class="parameters"> |
| 53 | + {{#each @field.params as |param|}} |
| 54 | + <div class="parameter"> |
| 55 | + <dt>{{param.name}}</dt> |
| 56 | + <dd class="parameter-type">{{param.type}}</dd> |
| 57 | + <dd>{{param.description}}</dd> |
| 58 | + {{#if param.props}} |
| 59 | + <dl class="parameters"> |
| 60 | + {{#each param.props as |prop|}} |
| 61 | + <div class="prop"> |
| 62 | + <dt>{{prop.name}}</dt> |
| 63 | + <dd class="parameter-type">{{prop.type}}</dd> |
| 64 | + <dd>{{prop.description}}</dd> |
| 65 | + </div> |
| 66 | + {{/each}} |
| 67 | + </dl> |
| 68 | + {{/if}} |
| 69 | + </div> |
| 70 | + {{/each}} |
| 71 | + {{#if @field.return}} |
| 72 | + <div class="return"> |
| 73 | + <dt>returns</dt> |
| 74 | + <dd class="return-type">{{@field.return.type}}</dd> |
| 75 | + <dd>{{@field.return.description}}</dd> |
| 76 | + </div> |
| 77 | + {{/if}} |
| 78 | + </dl> |
| 79 | + {{html-safe @field.description}} |
| 80 | +</section> |
0 commit comments