Skip to content

chore(docs): add missing table docs for cell scope property fields #4246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Oct 14, 2019
Merged
68 changes: 57 additions & 11 deletions docs/components/componentdoc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<b-row tag="header" align-v="center">
<b-col sm="9">
<anchored-heading :id="`comp-ref-${componentName}`" level="3">
<code class="notranslate" translate="no">{{ tag }}</code>
<code class="notranslate bigger" translate="no">{{ tag }}</code>
</anchored-heading>
<b-badge
v-if="componentFunctional"
Expand All @@ -21,8 +21,42 @@
</b-col>
</b-row>

<ul class="component-ref-mini-toc my-3">
<li v-if="aliases && aliases.length > 0">
<a :href="`#comp-ref-${componentName}-aliases`">
<code class="notranslate" translate="no">{{ tag }}</code> Component aliases
</a>
</li>
<li v-if="propsItems && propsItems.length > 0">
<a :href="`#comp-ref-${componentName}-props`">
<code class="notranslate" translate="no">{{ tag }}</code> Properties
</a>
</li>
<li v-if="componentVModel">
<a :href="`#comp-ref-${componentName}-v-model`">
<code class="notranslate" translate="no">{{ tag }}</code> v-model
</a>
</li>
<li v-if="slots && slots.length > 0">
<a :href="`#comp-ref-${componentName}-slots`">
<code class="notranslate" translate="no">{{ tag }}</code> Slots
</a>
</li>
<li v-if="events && events.length > 0">
<a :href="`#comp-ref-${componentName}-events`">
<code class="notranslate" translate="no">{{ tag }}</code> Events
</a>
</li>
<li v-if="rootEventListeners && rootEventListeners.length > 0">
<a :href="`#comp-ref-${componentName}-rootEventListeners`">
<code class="notranslate" translate="no">{{ tag }}</code>
<code class="notranslate" translate="no">$root</code> Event Listeners
</a>
</li>
</ul>

<article v-if="aliases && aliases.length > 0" class="bd-content">
<anchored-heading :id="`comp-ref-${componentName}-aliases`" level="4">
<anchored-heading :id="`comp-ref-${componentName}-aliases`" level="4" class="mb-3">
Component aliases
</anchored-heading>
<p><code class="notranslate" translate="no">{{ tag }}</code> can also be used via the following aliases:</p>
Expand All @@ -40,7 +74,7 @@
</article>

<article v-if="propsItems && propsItems.length > 0" class="bd-content">
<anchored-heading :id="`comp-ref-${componentName}-props`" level="4">
<anchored-heading :id="`comp-ref-${componentName}-props`" level="4" class="mb-3">
Properties
</anchored-heading>
<b-table
Expand Down Expand Up @@ -100,7 +134,7 @@
</article>

<article v-if="componentVModel" class="bd-content">
<anchored-heading :id="`comp-ref-${componentName}-v-model`" level="4">
<anchored-heading :id="`comp-ref-${componentName}-v-model`" level="4" class="mb-3">
v-model
</anchored-heading>
<b-table-lite
Expand All @@ -120,7 +154,7 @@
</article>

<article v-if="slots && slots.length > 0" class="bd-content">
<anchored-heading :id="`comp-ref-${componentName}-slots`" level="4">
<anchored-heading :id="`comp-ref-${componentName}-slots`" level="4" class="mb-3">
Slots
</anchored-heading>
<b-table
Expand All @@ -132,8 +166,9 @@
sort-icon-left
striped
>
<template v-slot:cell(name)="{ value }">
<template v-slot:cell(name)="{ value, item }">
<code class="text-nowrap notranslate" translate="no">{{ value }}</code>
<b-badge v-if="item.version" variant="secondary">v{{ item.version }}+</b-badge>
</template>
<template v-slot:cell(scope)="{ value, toggleDetails }">
<b-button
Expand Down Expand Up @@ -170,8 +205,9 @@
</b-th>
</b-tr>
</template>
<template v-slot:cell(prop)="{ value }">
<template v-slot:cell(prop)="{ value, item }">
<code class="text-nowrap notranslate" translate="no">{{ value }}</code>
<b-badge v-if="item.version" variant="secondary">v{{ item.version }}+</b-badge>
</template>
<template v-slot:cell(type)="{ value }">
<span v-if="value" class="text-nowrap notranslate" translate="no">{{ value }}</span>
Expand All @@ -184,7 +220,7 @@
</article>

<article v-if="events && events.length > 0" class="bd-content">
<anchored-heading :id="`comp-ref-${componentName}-events`" level="4">
<anchored-heading :id="`comp-ref-${componentName}-events`" level="4" class="mb-3">
Events
</anchored-heading>
<b-table
Expand All @@ -195,8 +231,9 @@
responsive="sm"
striped
>
<template v-slot:cell(event)="{ value }">
<template v-slot:cell(event)="{ value, item }">
<code class="notranslate" translate="no">{{ value }}</code>
<b-badge v-if="item.version" variant="secondary">v{{ item.version }}+</b-badge>
</template>
<template v-slot:cell(args)="{ value, item }">
<p
Expand All @@ -214,7 +251,7 @@
</article>

<article v-if="rootEventListeners && rootEventListeners.length > 0" class="bd-content">
<anchored-heading :id="`comp-ref-${componentName}-rootEventListeners`" level="4">
<anchored-heading :id="`comp-ref-${componentName}-rootEventListeners`" level="4" class="mb-3">
<code class="notranslate" translate="no">$root</code> Event Listeners
</anchored-heading>
<p>
Expand All @@ -229,8 +266,9 @@
responsive="sm"
striped
>
<template v-slot:cell(event)="{ value }">
<template v-slot:cell(event)="{ value, item }">
<code class="text-nowrap notranslate" translate="no">{{ value }}</code>
<b-badge v-if="item.version" variant="secondary">v{{ item.version }}+</b-badge>
</template>
<template v-slot:cell(args)="{ value, item }">
<p
Expand All @@ -257,6 +295,14 @@ h3::before {
content: '';
}

code.bigger {
font-size: 105%;
}

ul.component-ref-mini-toc:empty {
display: none;
}

/deep/ .word-wrap-normal {
white-space: normal !important;
word-break: normal !important;
Expand Down
1 change: 1 addition & 0 deletions src/components/table/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ The slot's scope variable (`data` in the above sample) will have the following p
| `item` | Object | The entire raw record data (i.e. `items[index]`) for this row (before any formatter is applied) |
| `value` | Any | The value for this key in the record (`null` or `undefined` if a virtual column), or the output of the field's [`formatter` function](#formatter-callback) |
| `unformatted` | Any | The raw value for this key in the item record (`null` or `undefined` if a virtual column), before being passed to the field's [`formatter` function](#formatter-callback) |
| `field` | Object | The field's normalized field definition object |
| `detailsShowing` | Boolean | Will be `true` if the row's `row-details` scoped slot is visible. See section [Row details support](#row-details-support) below for additional information |
| `toggleDetails` | Function | Can be called to toggle the visibility of the rows `row-details` scoped slot. See section [Row details support](#row-details-support) below for additional information |
| `rowSelected` | Boolean | Will be `true` if the row has been selected. See section [Row select support](#row-select-support) for additional information |
Expand Down
52 changes: 36 additions & 16 deletions src/components/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,11 @@
"prop": "unformatted",
"description": "The raw value for this key in the item record (null or undefined if a virtual column), before being passed to the field's formatter function"
},
{
"prop": "field",
"type": "Object",
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "detailsShowing",
"type": "Boolean",
Expand Down Expand Up @@ -557,6 +562,11 @@
"prop": "unformatted",
"description": "The raw value for this key in the item record (null or undefined if a virtual column), before being passed to the field's formatter function"
},
{
"prop": "field",
"type": "Object",
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "detailsShowing",
"type": "Boolean",
Expand Down Expand Up @@ -587,7 +597,7 @@
{
"prop": "field",
"type": "Object",
"description": "the field's definition object (from the fields prop)"
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "label",
Expand Down Expand Up @@ -623,7 +633,7 @@
{
"prop": "field",
"type": "Object",
"description": "the field's definition object (from the fields prop)"
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "label",
Expand Down Expand Up @@ -660,7 +670,7 @@
{
"prop": "field",
"type": "Object",
"description": "the field's definition object (from the fields prop)"
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "label",
Expand Down Expand Up @@ -691,7 +701,7 @@
{
"prop": "field",
"type": "Object",
"description": "the field's definition object (from the fields prop)"
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "label",
Expand Down Expand Up @@ -721,7 +731,7 @@
{
"prop": "columns",
"type": "Number",
"description": "the number of columns in the table"
"description": "The number of columns in the table"
},
{
"prop": "fields",
Expand Down Expand Up @@ -839,7 +849,7 @@
{
"prop": "columns",
"type": "Number",
"description": "the number of columns in the table"
"description": "The number of columns in the table"
},
{
"prop": "fields",
Expand All @@ -865,7 +875,7 @@
{
"prop": "columns",
"type": "Number",
"description": "the number of columns in the table"
"description": "The number of columns in the table"
},
{
"prop": "fields",
Expand All @@ -881,7 +891,7 @@
{
"prop": "columns",
"type": "Number",
"description": "the number of columns in the table"
"description": "The number of columns in the table"
},
{
"prop": "fields",
Expand All @@ -897,7 +907,7 @@
{
"prop": "columns",
"type": "Number",
"description": "the number of columns in the table"
"description": "The number of columns in the table"
},
{
"prop": "fields",
Expand Down Expand Up @@ -1224,6 +1234,11 @@
"prop": "unformatted",
"description": "The raw value for this key in the item record (null or undefined if a virtual column), before being passed to the field's formatter function"
},
{
"prop": "field",
"type": "Object",
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "detailsShowing",
"type": "Boolean",
Expand Down Expand Up @@ -1258,6 +1273,11 @@
"prop": "unformatted",
"description": "The raw value for this key in the item record (null or undefined if a virtual column), before being passed to the field's formatter function"
},
{
"prop": "field",
"type": "Object",
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "detailsShowing",
"type": "Boolean",
Expand All @@ -1283,7 +1303,7 @@
{
"prop": "field",
"type": "Object",
"description": "the field's definition object (from the fields prop)"
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "label",
Expand All @@ -1309,7 +1329,7 @@
{
"prop": "field",
"type": "Object",
"description": "the field's definition object (from the fields prop)"
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "label",
Expand All @@ -1336,7 +1356,7 @@
{
"prop": "field",
"type": "Object",
"description": "the field's definition object (from the fields prop)"
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "label",
Expand All @@ -1357,7 +1377,7 @@
{
"prop": "field",
"type": "Object",
"description": "the field's definition object (from the fields prop)"
"description": "The field's normalized definition object (from the fields prop)"
},
{
"prop": "label",
Expand All @@ -1377,7 +1397,7 @@
{
"prop": "columns",
"type": "Number",
"description": "the number of columns in the table"
"description": "The number of columns in the table"
},
{
"prop": "fields",
Expand Down Expand Up @@ -1419,7 +1439,7 @@
{
"prop": "columns",
"type": "Number",
"description": "the number of columns in the table"
"description": "The number of columns in the table"
},
{
"prop": "fields",
Expand All @@ -1445,7 +1465,7 @@
{
"prop": "columns",
"type": "Number",
"description": "the number of columns in the table"
"description": "The number of columns in the table"
},
{
"prop": "fields",
Expand Down