Date: Wed, 24 Jul 2019 03:24:09 -0300
Subject: [PATCH 13/78] chore(docs/utils): don't match versions preceded by `<`
(#3744)
---
docs/markdown/intro/README.md | 31 ++++++++++++++++---------------
docs/pages/docs/index.js | 15 ++++++++++++++-
docs/utils/index.js | 2 +-
3 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/docs/markdown/intro/README.md b/docs/markdown/intro/README.md
index fe1bddb48c1..7d097dccc81 100644
--- a/docs/markdown/intro/README.md
+++ b/docs/markdown/intro/README.md
@@ -3,10 +3,11 @@
> Get started with BootstrapVue, based on the world's most popular framework - Bootstrap v4, for
> building responsive, mobile-first sites using Vue.js.
-- [Vue.js](https://vuejs.org/) `v2.6` is required, `v{{ vueVersion }}` is recommended
-- [Bootstrap](https://getbootstrap.com/) `v4.3` is required, `v{{ bootstrapVersion }}` is
+- [Vue.js](https://vuejs.org/) `v{{ vueVersionMinor }}` is required, `v{{ vueVersion }}` is
recommended
-- [PortalVue](https://portal-vue.linusb.org/) `v2.1` is required by
+- [Bootstrap](https://getbootstrap.com/) `v{{ bootstrapVersionMinor }}` is required,
+ `v{{ bootstrapVersion }}` is recommended
+- [PortalVue](https://portal-vue.linusb.org/) `v{{ portalVueVersionMinor }}` is required by
[Toasts](/docs/components/toast), `v{{ portalVueVersion }}` is recommended
- [jQuery](https://jquery.com/) is **not** required
@@ -18,13 +19,14 @@ would be:
- [Vue Guide](https://vuejs.org/v2/guide/)
- [Vue API](https://vuejs.org/v2/api/)
-- [Bootstrap v4.3 documentation](https://getbootstrap.com/)
+- [Bootstrap v{{bootstrapVersionMinor}} documentation](https://getbootstrap.com/)
## Documentation information
In many of the examples shown in BootstrapVue's documentation, you may see the use of CSS classes
-such as `ml-2`, `py-1`, etc. These are Bootstrap v4.3 utility classes that help control padding,
-margins, positioning and more. You can find information on these classes in the
+such as ml-2, py-1, etc. These are
+Bootstrap v{{bootstrapVersionMinor}} utility classes that help control padding, margins, positioning
+and more. You can find information on these classes in the
[Utility Classes](/docs/reference/utility-classes) reference section.
Many of the examples in this documentation are _live_ and can be edited in-place for for an enhanced
@@ -35,13 +37,13 @@ various components and export your results to JSFiddle, CodePen, and/or CodeSand
## Important HTML globals
-Bootstrap v4.3 CSS employs a handful of important global styles and settings that you'll need to be
-aware of when using it, all of which are almost exclusively geared towards the normalization of
-cross browser styles. Refer to the following sub-sections for details.
+Bootstrap v{{bootstrapVersionMajor}} CSS employs a handful of important global styles and settings
+that you'll need to be aware of when using it, all of which are almost exclusively geared towards
+the normalization of cross browser styles. Refer to the following sub-sections for details.
### HTML5 doctype
-Bootstrap requires the use of the HTML5 doctype. Without it, you _may_ see some funky incomplete
+Bootstrap requires the use of the `HTML5` doctype. Without it, you _may_ see some funky incomplete
styling, but including it shouldn't cause any considerable hiccups.
```html
@@ -53,10 +55,9 @@ styling, but including it shouldn't cause any considerable hiccups.
### Responsive meta tag
-Bootstrap v4.3 is developed for mobile first, a strategy in which code is optimized for mobile
-devices first and then scales up components as necessary using CSS media queries. To ensure proper
-rendering and touch zooming for all devices, **add the responsive viewport meta** tag to your
-`
`.
+Bootstrap is developed for mobile first, a strategy in which code is optimized for mobile devices
+first and then scales up components as necessary using CSS media queries. To ensure proper rendering
+and touch zooming for all devices, **add the responsive viewport meta** tag to your ``.
```html
@@ -84,7 +85,7 @@ Learn more about [box model and sizing at CSS Tricks](https://css-tricks.com/box
### Style reboot
-For improved cross-browser rendering, Bootstrap v4.3 uses
+For improved cross-browser rendering, Bootstrap v{{ bootstrapVersionMinor }} uses
[Reboot](https://getbootstrap.com/docs/4.3/content/reboot/) to correct inconsistencies across
browsers and devices while providing slightly more opinionated resets to common
HTML elements.
diff --git a/docs/pages/docs/index.js b/docs/pages/docs/index.js
index 29c92742fe3..87ce05247cb 100644
--- a/docs/pages/docs/index.js
+++ b/docs/pages/docs/index.js
@@ -10,6 +10,11 @@ import {
} from '~/content'
import readme from '~/markdown/intro/README.md'
+// RegExp to grab the minor version from a full version
+const minorRE = /^(\d+\.\d+)(\..+)$/
+// RegExp to grab the major version from a full version
+const majorRE = /^(\d+)(\.\d+\..+)$/
+
export default {
name: 'BDVDocs',
layout: 'docs',
@@ -23,11 +28,19 @@ export default {
data() {
return {
bootstrapVersion,
+ bootstrapVersionMinor: bootstrapVersion.replace(minorRE, '$1'),
+ bootstrapVersionMajor: bootstrapVersion.replace(majorRE, '$1'),
defaultConfig,
nuxtVersion,
+ nuxtVersionMinor: nuxtVersion.replace(minorRE, '$1'),
+ nuxtVersionMajor: nuxtVersion.replace(majorRE, '$1'),
portalVueVersion,
+ portalVueVersionMinor: portalVueVersion.replace(minorRE, '$1'),
+ portalVueVersionMajor: portalVueVersion.replace(majorRE, '$1'),
readme,
- vueVersion
+ vueVersion,
+ vueVersionMinor: '2.5',
+ vueVersionMajor: vueVersion.replace(majorRE, '$1')
}
}
}
diff --git a/docs/utils/index.js b/docs/utils/index.js
index 8d2bf71b33a..eabaea61d7d 100644
--- a/docs/utils/index.js
+++ b/docs/utils/index.js
@@ -2,7 +2,7 @@ import kebabCase from 'lodash/kebabCase'
// Parse a fully qualified version from a string
export const parseVersion = version => {
- const matches = version.match(/([0-9]+\.[0-9]+\.[0-9]+)/g)
+ const matches = version.match(/([0-9]+\.[0-9]+\.[0-9]+)/)
const matchesCount = matches.length
return matchesCount > 0 ? matches[matchesCount - 1] : ''
}
From f53360d5e6b06e2462f2fba296e3cdc6a31180dc Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Wed, 24 Jul 2019 13:48:41 -0300
Subject: [PATCH 14/78] feat(b-table, b-table-lite): new field scoped slot
naming convention + new fallback scoped slots, deprecated old field slot
convention (closes #3731) (#3741)
---
docs/components/componentdoc.vue | 22 +-
docs/components/importdoc.vue | 16 +-
src/components/table/README.md | 347 ++++++++++--------
.../table/helpers/mixin-tbody-row.js | 36 +-
src/components/table/helpers/mixin-thead.js | 29 +-
src/components/table/package.json | 92 +++--
src/mixins/normalize-slot.js | 10 +-
src/utils/normalize-slot.js | 23 +-
src/utils/normalize-slot.spec.js | 12 +
9 files changed, 367 insertions(+), 220 deletions(-)
diff --git a/docs/components/componentdoc.vue b/docs/components/componentdoc.vue
index a30ed016b43..e91007d0670 100644
--- a/docs/components/componentdoc.vue
+++ b/docs/components/componentdoc.vue
@@ -50,12 +50,15 @@
bordered
striped
>
-
+
{{ value }}RequiredDeprecatedDeprecation
+
+ {{ value }}
+
-
+
{{ value }}
-
+
{{ value }}
-
+
{{ value }}
@@ -57,13 +57,13 @@
bordered
striped
>
-
+
{{ value }}
-
+
{{ value }}
-
+
{{ value }}
@@ -103,12 +103,12 @@
bordered
striped
>
-
+
{{ value }}DEPRECATEDPREFERRED
-
+
{{ value }}
diff --git a/src/components/table/README.md b/src/components/table/README.md
index 2700e6622c9..e99172b4684 100644
--- a/src/components/table/README.md
+++ b/src/components/table/README.md
@@ -359,8 +359,8 @@ const fields = [
## Primary key
-`` provides an additional prop `primary-key`, which you can use to identify the field key
-that _uniquely_ identifies the row.
+`` provides an additional prop `primary-key`, which you can use to identify the _name_ of
+the field key that _uniquely_ identifies the row.
The value specified by the primary column key **must be** either a `string` or `number`, and **must
be unique** across all rows in the table.
@@ -800,9 +800,20 @@ function.
### Scoped field slots
-Scoped slots give you greater control over how the record data appears. If you want to add an extra
-field which does not exist in the records, just add it to the `fields` array, And then reference the
-field(s) in the scoped slot(s).
+CHANGED in 2.0.0-rc.28
+
+Scoped field slots give you greater control over how the record data appears. If you want to add an
+extra field which does not exist in the records, just add it to the `fields` array, And then
+reference the field(s) in the scoped slot(s). Scoped field slots use the following naming syntax:
+`'[' + field key + ']'`.
+
+NEW in 2.0.0-rc.28 You can use the default _fall-back_
+scoped slot `'[]'` to format any cells that do not have an explicit scoped slot provided.
+
+DEPRECATION in 2.0.0-rc.28 Versions prior to
+`2.0.0-rc.28` did not surround the field key with square brackets. Using the old field slot names
+have been deprecated in favour of the new bracketed syntax, and support will be removed in a future
+release. Users are encouraged to switch to the new bracketed syntax.
**Example: Custom data rendering with scoped slots**
@@ -811,19 +822,24 @@ field(s) in the scoped slot(s).
@@ -936,7 +952,7 @@ formatted value as a string (HTML strings are not supported)
-
+
{{ data.value }}
@@ -993,67 +1009,77 @@ formatted value as a string (HTML strings are not supported)
```
-## Custom empty and emptyfiltered rendering via slots
+## Header and Footer custom rendering via scoped slots
-Aside from using `empty-text`, `empty-filtered-text`, `empty-html`, and `empty-filtered-html`, it is
-also possible to provide custom rendering for tables that have no data to display using named slots.
+CHANGED in 2.0.0-rc.28
-In order for these slots to be shown, the `show-empty` attribute must be set and `items` must be
-either falsy or an array of length 0.
+It is also possible to provide custom rendering for the tables `thead` and `tfoot` elements. Note by
+default the table footer is not rendered unless `foot-clone` is set to `true`.
-```html
-
-
-
-
{{ scope.emptyText }}
-
-
-
{{ scope.emptyFilteredText }}
-
-
-
-```
+Scoped slots for the header and footer cells uses a special naming convention of `'HEAD[]'`
+and `'FOOT[]'` respectively. if a `'FOOT[...]'` slot for a field is not provided, but a
+`'HEAD[...]'` slot is provided, then the footer will use the `'HEAD[...]'` slot content.
-The slot can optionally be scoped. The slot's scope (`scope` in the above example) will have the
-following properties:
+NEW in 2.0.0-rc.28 You can use a default _fall-back_
+scoped slot `'HEAD[]'` or `'FOOT[]'` to format any header or footer cells that do not have an
+explicit scoped slot provided.
-| Property | Type | Description |
-| ------------------- | ------ | -------------------------------------------------- |
-| `emptyHtml` | String | The `empty-html` prop |
-| `emptyText` | String | The `empty-text` prop |
-| `emptyFilteredHtml` | String | The `empty-filtered-html` prop |
-| `emptyFilteredText` | String | The `empty-filtered-text` prop |
-| `fields` | Array | The `fields` prop |
-| `items` | Array | The `items` prop. Exposed here to check null vs [] |
+DEPRECATION in 2.0.0-rc.28 Versions prior to
+`2.0.0-rc.28` used slot names `'HEAD_'` and `'FOOT_'`. Using the old slot names has been
+deprecated in favour of the new bracketed syntax, and support will be removed in a future release.
+Users are encouraged to switch to the new bracketed syntax.
-## Header and Footer custom rendering via scoped slots
+```html
+
+
+
+
+
+ {{ data.value.first }} {{ data.value.last }}
+
-It is also possible to provide custom rendering for the tables `thead` and `tfoot` elements. Note by
-default the table footer is not rendered unless `foot-clone` is set to `true`.
+
+
+ {{ data.label }}
+
-Scoped slots for the header and footer cells uses a special naming convention of `HEAD_`
-and `FOOT_` respectively. if a `FOOT_` slot for a field is not provided, but a `HEAD_`
-slot is provided, then the footer will use the `HEAD_` slot content.
+
+
+ {{ data.label }}
+
-```html
-
+
```
The slots can be optionally scoped (`data` in the above example), and will have the following
@@ -1065,7 +1091,7 @@ properties:
| `field` | Object | the field's object (from the `fields` prop) |
| `label` | String | The fields label value (also available as `data.field.label`) |
-When placing inputs, buttons, selects or links within a `HEAD_` or `FOOT_` slot, note that
+When placing inputs, buttons, selects or links within a `HEAD[...]` or `FOOT[...]` slot, note that
`head-clicked` event will not be emitted when the input, select, textarea is clicked (unless they
are disabled). `head-clicked` will never be emitted when clicking on links or buttons inside the
scoped slots (even when disabled)
@@ -1130,91 +1156,38 @@ Slot `thead-top` can be optionally scoped, receiving an object with the followin
| `columns` | Number | The number of columns in the rendered table |
| `fields` | Array | Array of field definition objects (normalized to the array of objects format) |
-## Row select support
-
-You can make rows selectable, by using the prop `selectable`.
-
-Users can easily change the selecting mode by setting the `select-mode` prop.
+## Custom empty and emptyfiltered rendering via slots
-- `multi`: each click will select/deselect the row (default mode)
-- `single`: only a single row can be selected at one time
-- `range`: any row clicked is selected, any other deselected. the SHIFT key selects a range of rows,
- and CTRL/CMD click will toggle the selected row.
+Aside from using `empty-text`, `empty-filtered-text`, `empty-html`, and `empty-filtered-html`, it is
+also possible to provide custom rendering for tables that have no data to display using named slots.
-When a table is `selectable` and the user clicks on a row, `` will emit the `row-selected`
-event, passing a single argument which is the complete list of selected items. **Treat this argument
-as read-only.**
+In order for these slots to be shown, the `show-empty` attribute must be set and `items` must be
+either falsy or an array of length 0.
```html
-
-
-
-
-
-
-
-
-
- ✔
-
-
-
- {{ selected }}
-
-
-
-
-
-
+
+
+
+
{{ scope.emptyText }}
+
+
+
{{ scope.emptyFilteredText }}
+
+
+
```
-When table is selectable, it will have class `b-table-selectable`, and one of the following three
-classes (depending on which mode is in use), on the `
` element:
-
-- `b-table-select-single`
-- `b-table-select-multi`
-- `b-table-select-range`
-
-When at least one row is selected the class `b-table-selecting` will be active on the `
`
-element.
-
-**Notes:**
+The slot can optionally be scoped. The slot's scope (`scope` in the above example) will have the
+following properties:
-- _Paging, filtering, or sorting will clear the selection. The `row-selected` event will be emitted
- with an empty array if needed._
-- _Selected rows will have a class of `b-row-selected` added to them._
-- _When the table is in `selectable` mode, all data item `
` elements will be in the document tab
- sequence (`tabindex="0"`) for accessibility reasons._
+| Property | Type | Description |
+| ------------------- | ------ | -------------------------------------------------- |
+| `emptyHtml` | String | The `empty-html` prop |
+| `emptyText` | String | The `empty-text` prop |
+| `emptyFilteredHtml` | String | The `empty-filtered-html` prop |
+| `emptyFilteredText` | String | The `empty-filtered-text` prop |
+| `fields` | Array | The `fields` prop |
+| `items` | Array | The `items` prop. Exposed here to check null vs [] |
## Row details support
@@ -1252,7 +1225,7 @@ initially showing.
-
+
{{ row.detailsShowing ? 'Hide' : 'Show'}} Details
@@ -1307,6 +1280,92 @@ initially showing.
```
+## Row select support
+
+You can make rows selectable, by using the prop `selectable`.
+
+Users can easily change the selecting mode by setting the `select-mode` prop.
+
+- `multi`: each click will select/deselect the row (default mode)
+- `single`: only a single row can be selected at one time
+- `range`: any row clicked is selected, any other deselected. the SHIFT key selects a range of rows,
+ and CTRL/CMD click will toggle the selected row.
+
+When a table is `selectable` and the user clicks on a row, `` will emit the `row-selected`
+event, passing a single argument which is the complete list of selected items. **Treat this argument
+as read-only.**
+
+```html
+
+
+
+
+
+
+
+
+
+ ✔
+
+
+
+ {{ selected }}
+
+
+
+
+
+
+```
+
+When table is selectable, it will have class `b-table-selectable`, and one of the following three
+classes (depending on which mode is in use), on the `
` element:
+
+- `b-table-select-single`
+- `b-table-select-multi`
+- `b-table-select-range`
+
+When at least one row is selected the class `b-table-selecting` will be active on the `
`
+element.
+
+**Notes:**
+
+- _Paging, filtering, or sorting will clear the selection. The `row-selected` event will be emitted
+ with an empty array if needed._
+- _Selected rows will have a class of `b-row-selected` added to them._
+- _When the table is in `selectable` mode, all data item `
` elements will be in the document tab
+ sequence (`tabindex="0"`) for accessibility reasons._
+
## Sorting
ENHANCED in v2.0.0-rc.25
@@ -2071,15 +2130,15 @@ differences between operating systems, this too is not a preventable default beh
:sort-direction="sortDirection"
@filtered="onFiltered"
>
-
+
{{ row.value.first }} {{ row.value.last }}
-
+
{{ row.value ? 'Yes :)' : 'No :(' }}
-
+
Info modal
diff --git a/src/components/table/helpers/mixin-tbody-row.js b/src/components/table/helpers/mixin-tbody-row.js
index 333dd365ff1..8cdf6c9f574 100644
--- a/src/components/table/helpers/mixin-tbody-row.js
+++ b/src/components/table/helpers/mixin-tbody-row.js
@@ -6,6 +6,8 @@ import { isFunction, isNull, isString, isUndefined } from '../../../utils/inspec
import filterEvent from './filter-event'
import textSelectionActive from './text-selection-active'
+const detailsSlotName = 'row-details'
+
export default {
props: {
tbodyTrClass: {
@@ -173,21 +175,19 @@ export default {
},
// Render helpers
renderTbodyRowCell(field, colIndex, item, rowIndex) {
- const h = this.$createElement
-
// Renders a TD or TH for a row's field
- const $scoped = this.$scopedSlots
- const detailsSlot = $scoped['row-details']
+ const h = this.$createElement
+ const hasDetailsSlot = this.hasNormalizedSlot(detailsSlotName)
const formatted = this.getFormattedValue(item, field)
const data = {
// For the Vue key, we concatenate the column index and
- // field key (as field keys can be duplicated)
+ // field key (as field keys could be duplicated)
key: `row-${rowIndex}-cell-${colIndex}-${field.key}`,
class: this.tdClasses(field, item),
attrs: this.tdAttrs(field, item, colIndex)
}
const toggleDetailsFn = () => {
- if (detailsSlot) {
+ if (hasDetailsSlot) {
this.$set(item, '_showDetails', !item._showDetails)
}
}
@@ -204,7 +204,11 @@ export default {
// Add in rowSelected scope property if selectable rows supported
slotScope.rowSelected = Boolean(this.selectedRows[rowIndex])
}
- let $childNodes = $scoped[field.key] ? $scoped[field.key](slotScope) : toString(formatted)
+ // TODO:
+ // Using `field.key` as scoped slot name is deprecated, to be removed in future release
+ // New format uses the square bracketed naming convention
+ let $childNodes =
+ this.normalizeSlot([`[${field.key}]`, '[]', field.key], slotScope) || toString(formatted)
if (this.isStacked) {
// We wrap in a DIV to ensure rendered as a single cell when visually stacked!
$childNodes = [h('div', {}, [$childNodes])]
@@ -215,12 +219,11 @@ export default {
renderTbodyRow(item, rowIndex) {
// Renders an item's row (or rows if details supported)
const h = this.$createElement
- const $scoped = this.$scopedSlots
const fields = this.computedFields
const tableStriped = this.striped
+ const hasDetailsSlot = this.hasNormalizedSlot(detailsSlotName)
+ const rowShowDetails = Boolean(item._showDetails && hasDetailsSlot)
const hasRowClickHandler = this.$listeners['row-clicked'] || this.selectable
- const $detailsSlot = $scoped['row-details']
- const rowShowDetails = Boolean(item._showDetails && $detailsSlot)
// We can return more than one TR if rowDetails enabled
const $rows = []
@@ -228,7 +231,7 @@ export default {
// Details ID needed for aria-describedby when details showing
const detailsId = rowShowDetails ? this.safeId(`_details_${rowIndex}_`) : null
const toggleDetailsFn = () => {
- if ($detailsSlot) {
+ if (hasDetailsSlot) {
this.$set(item, '_showDetails', !item._showDetails)
}
}
@@ -302,8 +305,9 @@ export default {
},
on: {
...handlers,
- // TODO: Instantiate the following handlers only if we have registered
- // listeners i.e. this.$listeners['row-middle-clicked'], etc.
+ // TODO:
+ // Instantiate the following handlers only if we have registered
+ // listeners i.e. `this.$listeners['row-middle-clicked']`, etc.
auxclick: evt => {
if (evt.which === 2) {
this.middleMouseRowClicked(evt, item, rowIndex)
@@ -340,7 +344,7 @@ export default {
}
// Render the details slot
const $details = h('td', { attrs: tdAttrs }, [
- $detailsSlot({
+ this.normalizeSlot(detailsSlotName, {
item: item,
index: rowIndex,
fields: fields,
@@ -368,7 +372,7 @@ export default {
staticClass: 'b-table-details',
class: [
isFunction(this.tbodyTrClass)
- ? this.tbodyTrClass(item, 'row-details')
+ ? this.tbodyTrClass(item, detailsSlotName)
: this.tbodyTrClass
],
attrs: trAttrs
@@ -376,7 +380,7 @@ export default {
[$details]
)
)
- } else if ($detailsSlot) {
+ } else if (hasDetailsSlot) {
// Only add the placeholder if a the table has a row-details slot defined (but not shown)
$rows.push(h())
if (tableStriped) {
diff --git a/src/components/table/helpers/mixin-thead.js b/src/components/table/helpers/mixin-thead.js
index 50ac7c1556f..4aea3fd2799 100644
--- a/src/components/table/helpers/mixin-thead.js
+++ b/src/components/table/helpers/mixin-thead.js
@@ -27,7 +27,7 @@ export default {
},
methods: {
fieldClasses(field) {
- // header field (th) classes
+ // Header field (
) classes
return [
field.variant ? 'table-' + field.variant : '',
field.class ? field.class : '',
@@ -39,7 +39,7 @@ export default {
// If table is busy (via provider) then don't propagate
return
} else if (filterEvent(evt)) {
- // clicked on a non-disabled control so ignore
+ // Clicked on a non-disabled control so ignore
return
} else if (textSelectionActive(this.$el)) {
// User is selecting text, so ignore
@@ -60,7 +60,7 @@ export default {
return h()
}
- // Helper function to generate a field TH cell
+ // Helper function to generate a field
cell
const makeCell = (field, colIndex) => {
let ariaLabel = null
if (!field.label.trim() && !field.headerTitle) {
@@ -102,17 +102,30 @@ export default {
on: handlers
}
const fieldScope = { label: field.label, column: field.key, field: field }
- const slot =
- isFoot && this.hasNormalizedSlot(`FOOT_${field.key}`)
- ? this.normalizeSlot(`FOOT_${field.key}`, fieldScope)
- : this.normalizeSlot(`HEAD_${field.key}`, fieldScope)
+ let slot
+ if (
+ isFoot &&
+ this.hasNormalizedSlot([`FOOT[${field.key}]`, 'FOOT[]', `FOOT_${field.key}`])
+ ) {
+ // TODO: `FOOT_${field.key}` is deprecated, to be removed in future release
+ slot = this.normalizeSlot(
+ [`FOOT[${field.key}]`, 'FOOT[]', `FOOT_${field.key}`],
+ fieldScope
+ )
+ } else {
+ // TODO: `HEAD_${field.key}` is deprecated, to be removed in future release
+ slot = this.normalizeSlot(
+ [`HEAD[${field.key}]`, 'HEAD[]', `HEAD_${field.key}`],
+ fieldScope
+ )
+ }
if (!slot) {
data.domProps = htmlOrText(field.labelHtml)
}
return h('th', data, slot || field.label)
}
- // Generate the array of TH cells
+ // Generate the array of
cells
const $cells = fields.map(makeCell).filter(th => th)
// Genrate the row(s)
diff --git a/src/components/table/package.json b/src/components/table/package.json
index bd0801c43cf..78119a921ed 100644
--- a/src/components/table/package.json
+++ b/src/components/table/package.json
@@ -198,28 +198,40 @@
],
"slots": [
{
- "name": "table-caption",
- "description": "Content to display in the table's caption element"
+ "name": "[key]",
+ "description": "Scoped slot for custom data rendering of field data. 'key' is hte fields key name. See docs for scoped data"
},
{
- "name": "table-colgroup",
- "description": "Slot to place custom colgroup and col elements (optionally scoped: columns - number of columns, fields - array of field definition objects)"
+ "name": "[]",
+ "description": "Default scoped slot for custom data rendering of field data. See docs for scoped data"
},
{
- "name": "table-busy",
- "description": "Optional slot to place loading message when table is in the busy state"
+ "name": "HEAD[key]",
+ "description": "Scoped slot for custom rendering of field header. 'key' is hte fields key name. See docs for scoped header"
+ },
+ {
+ "name": "HEAD[]",
+ "description": "Default scoped slot for custom rendering of field header. See docs for scoped header"
+ },
+ {
+ "name": "FOOT[key]",
+ "description": "Scoped slot for custom rendering of field footer. 'key' is hte fields key name. See docs for scoped footer"
+ },
+ {
+ "name": "FOOT[]",
+ "description": "Default scoped slot for custom rendering of field footer. See docs for scoped footer"
},
{
- "name": "[field]",
- "description": "Scoped slot for custom data rendering of field data. See docs for scoped data"
+ "name": "table-caption",
+ "description": "Content to display in the table's caption element"
},
{
- "name": "HEAD_[field]",
- "description": "Scoped slot for custom rendering of field header. See docs for scoped header"
+ "name": "table-colgroup",
+ "description": "Slot to place custom colgroup and col elements (optionally scoped: columns - number of columns, fields - array of field definition objects)"
},
{
- "name": "FOOT_[field]",
- "description": "Scoped slot for custom rendering of field footer. See docs for scoped footer"
+ "name": "table-busy",
+ "description": "Optional slot to place loading message when table is in the busy state"
},
{
"name": "row-details",
@@ -244,6 +256,18 @@
{
"name": "bottom-row",
"description": "Fixed bottom row slot for user supplied TD cells (Optionally Scoped: columns - number of TDs to provide, fields - array of field definition objects)"
+ },
+ {
+ "name": "key",
+ "description": "DEPRECATED in 2.0.0-rc.28. Use slot '[key]' instead"
+ },
+ {
+ "name": "HEAD_key",
+ "description": "DEPRECATED in 2.0.0-rc.28. Use slot 'HEAD[key]' instead"
+ },
+ {
+ "name": "FOOT_key",
+ "description": "DEPRECATED in 2.0.0-rc.28. Use slot 'FOOT[key]' instead"
}
]
},
@@ -383,24 +407,36 @@
],
"slots": [
{
- "name": "table-caption",
- "description": "Content to display in the table's caption element"
+ "name": "[key]",
+ "description": "Scoped slot for custom data rendering of field data. 'key' is hte fields key name. See docs for scoped data"
},
{
- "name": "table-colgroup",
- "description": "Slot to place custom colgroup and col elements (optionally scoped: columns - number of columns, fields - array of field definition objects)"
+ "name": "[]",
+ "description": "Default scoped slot for custom data rendering of field data. See docs for scoped data"
+ },
+ {
+ "name": "HEAD[key]",
+ "description": "Scoped slot for custom rendering of field header. 'key' is hte fields key name. See docs for scoped header"
+ },
+ {
+ "name": "HEAD[]",
+ "description": "Default scoped slot for custom rendering of field header. See docs for scoped header"
+ },
+ {
+ "name": "FOOT[key]",
+ "description": "Scoped slot for custom rendering of field footer. 'key' is hte fields key name. See docs for scoped footer"
},
{
- "name": "[field]",
- "description": "Scoped slot for custom data rendering of field data. See docs for scoped data"
+ "name": "FOOT[]",
+ "description": "Default scoped slot for custom rendering of field footer. See docs for scoped footer"
},
{
- "name": "HEAD_[field]",
- "description": "Scoped slot for custom rendering of field header. See docs for scoped header"
+ "name": "table-caption",
+ "description": "Content to display in the table's caption element"
},
{
- "name": "FOOT_[field]",
- "description": "Scoped slot for custom rendering of field footer. See docs for scoped footer"
+ "name": "table-colgroup",
+ "description": "Slot to place custom colgroup and col elements (optionally scoped: columns - number of columns, fields - array of field definition objects)"
},
{
"name": "row-details",
@@ -409,6 +445,18 @@
{
"name": "thead-top",
"description": "Slot above the column headers in the `thead` element for user-supplied rows (optionally scoped: columns - number of TDs to provide, fields - array of field definition objects)"
+ },
+ {
+ "name": "key",
+ "description": "DEPRECATED in 2.0.0-rc.28. Use slot '[key]' instead"
+ },
+ {
+ "name": "HEAD_key",
+ "description": "DEPRECATED in 2.0.0-rc.28. Use slot 'HEAD[key]' instead"
+ },
+ {
+ "name": "FOOT_key",
+ "description": "DEPRECATED in 2.0.0-rc.28. Use slot 'FOOT[key]' instead"
}
]
}
diff --git a/src/mixins/normalize-slot.js b/src/mixins/normalize-slot.js
index be72a7ec9fb..12798bdb420 100644
--- a/src/mixins/normalize-slot.js
+++ b/src/mixins/normalize-slot.js
@@ -3,14 +3,16 @@ import { concat } from '../utils/array'
export default {
methods: {
- hasNormalizedSlot(name) {
+ hasNormalizedSlot(names) {
// Returns true if the either a $scopedSlot or $slot exists with the specified name
- return hasNormalizedSlot(name, this.$scopedSlots, this.$slots)
+ // `names` can be a string name or an array of names
+ return hasNormalizedSlot(names, this.$scopedSlots, this.$slots)
},
- normalizeSlot(name, scope = {}) {
+ normalizeSlot(names, scope = {}) {
// Returns an array of rendered vNodes if slot found.
// Returns undefined if not found.
- const vNodes = normalizeSlot(name, scope, this.$scopedSlots, this.$slots)
+ // `names` can be a string name or an array of names
+ const vNodes = normalizeSlot(names, scope, this.$scopedSlots, this.$slots)
return vNodes ? concat(vNodes) : vNodes
}
}
diff --git a/src/utils/normalize-slot.js b/src/utils/normalize-slot.js
index ee7d1f1b2ce..b9c33c8f51f 100644
--- a/src/utils/normalize-slot.js
+++ b/src/utils/normalize-slot.js
@@ -1,3 +1,4 @@
+import { concat } from './array'
import { isFunction } from './inspect'
// Note for functional components:
@@ -8,28 +9,36 @@ import { isFunction } from './inspect'
/**
* Returns true if either scoped or unscoped named slot exists
*
- * @param {String} name
+ * @param {String, Array} name or name[]
* @param {Object} scopedSlots
* @param {Object} slots
* @returns {Array|undefined} vNodes
*/
-const hasNormalizedSlot = (name, $scopedSlots = {}, $slots = {}) => {
+const hasNormalizedSlot = (names, $scopedSlots = {}, $slots = {}) => {
+ // Ensure names is an array
+ names = concat(names).filter(Boolean)
// Returns true if the either a $scopedSlot or $slot exists with the specified name
- return Boolean($scopedSlots[name] || $slots[name])
+ return names.some(name => $scopedSlots[name] || $slots[name])
}
/**
* Returns vNodes for named slot either scoped or unscoped
*
- * @param {String} name
+ * @param {String, Array} name or name[]
* @param {String} scope
* @param {Object} scopedSlots
* @param {Object} slots
* @returns {Array|undefined} vNodes
*/
-const normalizeSlot = (name, scope = {}, $scopedSlots = {}, $slots = {}) => {
- // Note: in Vue 2.6.x, all names slots are also scoped slots
- const slot = $scopedSlots[name] || $slots[name]
+const normalizeSlot = (names, scope = {}, $scopedSlots = {}, $slots = {}) => {
+ // Ensure names is an array
+ names = concat(names).filter(Boolean)
+ let slot
+ for (let i = 0; i < names.length && !slot; i++) {
+ const name = names[i]
+ slot = $scopedSlots[name] || $slots[name]
+ }
+ // Note: in Vue 2.6.x, all named slots are also scoped slots
return isFunction(slot) ? slot(scope) : slot
}
diff --git a/src/utils/normalize-slot.spec.js b/src/utils/normalize-slot.spec.js
index 5edf1b5644d..05787c093b8 100644
--- a/src/utils/normalize-slot.spec.js
+++ b/src/utils/normalize-slot.spec.js
@@ -47,5 +47,17 @@ describe('utils/normalizeSlot', () => {
// Returns undefined if slot name not found
result = normalizeSlot('baz', {}, $scoped, $slots)
expect(result).not.toBeDefined()
+
+ // Works with array (named slot)
+ result = normalizeSlot(['none', 'default'], { a: ' foo' }, undefined, $slots)
+ expect(result).toBe('bar')
+
+ // Works with arrays (scoped slot)
+ result = normalizeSlot(['none', 'default'], { a: ' bar' }, $scoped, {})
+ expect(result).toBe('foo bar')
+
+ // Returns undefined if slot name not found with array
+ result = normalizeSlot(['baz', 'bar'], {}, $scoped, $slots)
+ expect(result).not.toBeDefined()
})
})
From 2b6bdc7d5321779434a8443a55e4453239aa92bf Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Wed, 24 Jul 2019 14:39:26 -0300
Subject: [PATCH 15/78] chore(docs): fix prettier warning on componentdoc.vue
---
docs/components/componentdoc.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/components/componentdoc.vue b/docs/components/componentdoc.vue
index e91007d0670..b1cb25ef1fc 100644
--- a/docs/components/componentdoc.vue
+++ b/docs/components/componentdoc.vue
@@ -130,8 +130,8 @@
{{ arg.arg }} -
@@ -165,8 +165,8 @@
{{ arg.arg }}
From 4008c0b85bb754eadcc75475612bc93a73c359d9 Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Thu, 25 Jul 2019 10:58:09 -0300
Subject: [PATCH 16/78] chore(docs): convert clicks on internal docs links to
`$router.push()` or `scrollIntoView` (#3748)
---
docs/components/section.js | 70 ++++++++++++++++++++++++++++++-
src/components/table/README.md | 44 +++++++++----------
src/components/table/package.json | 12 +++---
3 files changed, 97 insertions(+), 29 deletions(-)
diff --git a/docs/components/section.js b/docs/components/section.js
index df40badbdb0..b71663fefe1 100644
--- a/docs/components/section.js
+++ b/docs/components/section.js
@@ -1,4 +1,69 @@
import { mergeData } from 'vue-functional-data-merge'
+import { offsetTop, scrollTo } from '~/utils'
+
+// -- Utility handlers --
+
+// Scroll an in-page link target into view
+// this is the same as in toc.vue (as an instance method)
+const scrollIntoView = (evt, href) => {
+ evt.preventDefault()
+ evt.stopPropagation()
+ // We use an attribute `querySelector()` rather than `getElementByID()`,
+ // as some auto-generated ID's are invalid or may not be unique
+ const id = (href || '').replace(/#/g, '')
+ const $el = document.body.querySelector(`[id="${id}"]`)
+ if ($el) {
+ // Get the document scrolling element
+ const scroller = document.scrollingElement || document.documentElement || document.body
+ // Scroll heading into view (minus offset to account for nav top height
+ scrollTo(scroller, offsetTop($el) - 70, 100, () => {
+ // Set a tab index so we can focus header for a11y support
+ $el.tabIndex = -1
+ // Focus the heading
+ $el.focus()
+ })
+ }
+}
+
+// Convert local links to router push or scrollIntoView
+const linkToRouter = evt => {
+ if (!evt || evt.type !== 'click') {
+ return
+ }
+ const target = evt.target && evt.target.closest ? evt.target.closest('a[href]') : null
+ if (
+ !target ||
+ evt.type !== 'click' ||
+ target.__vue__ ||
+ target.closest('.bd-example') ||
+ target.closest('pre') ||
+ evt.defaultPrevented
+ ) {
+ // Early exit if click inside an example, not a link, or
+ // default prevented or is a Vue instance
+ return
+ }
+ const href = target.getAttribute('href')
+ if (href && href.indexOf('/') === 0 && href.indexOf('//') !== 0) {
+ // if local page-to-page-docs link, convert click to `$router.push()`
+ evt.preventDefault()
+ if (typeof window !== 'undefined' && window.$nuxt) {
+ // Since we are a functional component, we can't use this.$router
+ window.$nuxt.$router.push(href)
+ }
+ } else if (href && href.indexOf('#') === 0) {
+ // Even though we are on teh same page, we do a router push so that
+ // a history state is saved. Router pushes to in page links
+ // does not cause a scroll though, so we use scrollIntoView as well
+ if (typeof window !== 'undefined' && window.$nuxt) {
+ // Since we are a functional component, we can't use this.$router
+ window.$nuxt.$router.push(href)
+ }
+ // In page anchor link, so use scrollIntoView utility method
+ scrollIntoView(evt, href)
+ }
+ // Else, normal browser link handling (i.e. external links)
+}
export default {
name: 'BDVSection',
@@ -22,7 +87,10 @@ export default {
props.tag,
mergeData(data, {
class: ['bd-content'],
- directives
+ directives,
+ on: {
+ click: linkToRouter
+ }
}),
[children]
)
diff --git a/src/components/table/README.md b/src/components/table/README.md
index e99172b4684..42892ec2f87 100644
--- a/src/components/table/README.md
+++ b/src/components/table/README.md
@@ -58,12 +58,12 @@ data). Field names are automatically "humanized" by converting `kebab-case`, `sn
- `isActive` becomes `Is Active`
These titles will be displayed in the table header, in the order they appear in the **first** record
-of data. See the [**Fields**](#fields-column-definitions-) section below for customizing how field
+of data. See the [Fields](#fields-column-definitions) section below for customizing how field
headings appear.
**Note:** Field order is not guaranteed. Fields will typically appear in the order they were defined
in the first row, but this may not always be the case depending on the version of browser in use.
-See section [**Fields (column definitions)**](#fields-column-definitions-) below to see how to
+See section [Fields (column definitions)](#fields-column-definitions) below to see how to
guarantee the order of fields, and to override the headings generated.
Record data may also have additional special reserved name keys for colorizing rows and individual
@@ -121,7 +121,7 @@ Provider functions can also be asynchronous:
array as the only argument to the callback,
- By returning a `Promise` that resolves to an array.
-See the [**"Using Items Provider functions"**](#using-items-provider-functions) section below for
+See the ["Using Items Provider functions"](#using-items-provider-functions) section below for
more details.
### Table item notes and warnings
@@ -139,7 +139,7 @@ more details.
The `fields` prop is used to customize the table columns headings, and in which order the columns of
data are displayed. The field object keys (i.e. `age` or `first_name` as shown below) are used to
extract the value from each item (record) row, and to provide additional features such as enabling
-[**sorting**](#sorting) on the column, etc.
+[sorting](#sorting) on the column, etc.
Fields can be provided as a _simple array_, an _array of objects_, or an _object_. **Internally the
fields data will be normalized into the _array of objects_ format**. Events or slots that include
@@ -321,9 +321,9 @@ The following field properties are recognized:
| `headerTitle` | String | Text to place on the fields header `
` attribute `title`. Defaults to no `title` attribute. |
| `headerAbbr` | String | Text to place on the fields header `
` attribute `abbr`. Set this to the unabbreviated version of the label (or title) if label (or title) is an abbreviation. Defaults to no `abbr` attribute. |
| `class` | String or Array | Class name (or array of class names) to add to `
` **and** `
` in the column. |
-| `formatter` | String or Function | A formatter callback function, can be used instead of (or in conjunction with) slots for real table fields (i.e. fields, that have corresponding data at items array). Refer to [**Custom Data Rendering**](#custom-data-rendering) for more details. |
-| `sortable` | Boolean | Enable sorting on this column. Refer to the [**Sorting**](#sorting) Section for more details. |
-| `sortDirection` | String | Set the initial sort direction on this column when it becomes sorted. Refer to the [**Change initial sort direction**](#Change-initial-sort-direction) Section for more details. |
+| `formatter` | String or Function | A formatter callback function, can be used instead of (or in conjunction with) slots for real table fields (i.e. fields, that have corresponding data at items array). Refer to [Custom Data Rendering](#custom-data-rendering) for more details. |
+| `sortable` | Boolean | Enable sorting on this column. Refer to the [Sorting](#sorting) Section for more details. |
+| `sortDirection` | String | Set the initial sort direction on this column when it becomes sorted. Refer to the [Change initial sort direction](#Change-initial-sort-direction) Section for more details. |
| `tdClass` | String or Array or Function | Class name (or array of class names) to add to `
` data `
` cells in the column. If custom classes per cell are required, a callback function can be specified instead. |
| `thClass` | String or Array | Class name (or array of class names) to add to ``/`
` heading `
` cell. |
| `thStyle` | Object | JavaScript object representing CSS styles you would like to apply to the table ``/`
` field `
`. |
@@ -342,7 +342,7 @@ The following field properties are recognized:
via the named scoped slots for custom data, header, and footer rendering._
For information and usage about scoped slots and formatters, refer to the
-[**Custom Data Rendering**](#custom-data-rendering) section below.
+[Custom Data Rendering](#custom-data-rendering) section below.
Feel free to mix and match simple array and object array together:
@@ -409,12 +409,12 @@ place a unique `:key` on your element/components in your custom formatted field
| `hover` | Boolean | To enable a hover highlighting state on table rows within a `
` |
| `dark` | Boolean | Invert the colors — with light text on dark backgrounds (equivalent to Bootstrap v4 class `.table-dark`) |
| `fixed` | Boolean | Generate a table with equal fixed-width columns (`table-layout: fixed;`) |
-| `foot-clone` | Boolean | Turns on the table footer, and defaults with the same contents a the table header |
-| `no-footer-sorting` | Boolean | When `foot-clone` is true and the table is sortable, disables the sorting icons and click behaviour on the footer heading cells. Refer to the [**Sorting**](#sorting) section below for more details. |
-| `responsive` | Boolean or String | Generate a responsive table to make it scroll horizontally. Set to `true` for an always responsive table, or set it to one of the breakpoints `'sm'`, `'md'`, `'lg'`, or `'xl'` to make the table responsive (horizontally scroll) only on screens smaller than the breakpoint. See [**Responsive tables**](#responsive-tables) below for details. |
-| `stacked` | Boolean or String | Generate a responsive stacked table. Set to `true` for an always stacked table, or set it to one of the breakpoints `'sm'`, `'md'`, `'lg'`, or `'xl'` to make the table visually stacked only on screens smaller than the breakpoint. See [**Stacked tables**](#stacked-tables) below for details. |
+| `responsive` | Boolean or String | Generate a responsive table to make it scroll horizontally. Set to `true` for an always responsive table, or set it to one of the breakpoints `'sm'`, `'md'`, `'lg'`, or `'xl'` to make the table responsive (horizontally scroll) only on screens smaller than the breakpoint. See [Responsive tables](#responsive-tables) below for details. |
+| `stacked` | Boolean or String | Generate a responsive stacked table. Set to `true` for an always stacked table, or set it to one of the breakpoints `'sm'`, `'md'`, `'lg'`, or `'xl'` to make the table visually stacked only on screens smaller than the breakpoint. See [Stacked tables](#stacked-tables) below for details. |
| `head-variant` | String | Use `'light'` or `'dark'` to make table header appear light or dark gray, respectively |
| `foot-variant` | String | Use `'light'` or `'dark'` to make table footer appear light or dark gray, respectively. If not set, `head-variant` will be used. Has no effect if `foot-clone` is not set |
+| `foot-clone` | Boolean | Turns on the table footer, and defaults with the same contents a the table header |
+| `no-footer-sorting` | Boolean | When `foot-clone` is true and the table is sortable, disables the sorting icons and click behaviour on the footer heading cells. Refer to the [Sorting](#sorting) section below for more details. |
**Example: Basic table styles**
@@ -634,8 +634,8 @@ The prop `stacked` takes precedence over the `responsive` prop.
- Custom rendered header slots will not be shown, rather, the fields' `label` will be used.
- The table **cannot** be sorted by clicking the rendered field labels. You will need to provide an
external control to select the field to sort by and the sort direction. See the
- [**Sorting**](#sorting) section below for sorting control information, as well as the
- [**complete example**](#complete-example) at the bottom of this page for an example of controlling
+ [Sorting](#sorting) section below for sorting control information, as well as the
+ [complete example](#complete-example) at the bottom of this page for an example of controlling
sorting via the use of form controls.
- The slots `top-row` and `bottom-row` will be hidden when visually stacked.
- The table caption, if provided, will always appear at the top of the table when visually stacked.
@@ -783,7 +783,7 @@ the table's busy state is `true`. The slot will be placed in a `
` element wi
```
-Also see the [**Using Items Provider Functions**](#using-items-provider-functions) below for
+Also see the [Using Items Provider Functions](#using-items-provider-functions) below for
additional information on the `busy` state.
**Notes:**
@@ -882,9 +882,9 @@ 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 (see below for information on field `formatter` callback functions) |
| `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 |
-| `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 |
+| `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 |
**Notes:**
@@ -1370,7 +1370,7 @@ element.
ENHANCED in v2.0.0-rc.25
-As mentioned in the [**Fields**](#fields-column-definitions-) section above, you can make columns
+As mentioned in the [Fields](#fields-column-definitions) section above, you can make columns
sortable. Clicking on a sortable column header will sort the column in ascending direction (smallest
first), while clicking on it again will switch the direction of sorting. Clicking on a non-sortable
column will clear the sorting. The prop `no-sort-reset` can be used to disable this feature.
@@ -1462,7 +1462,7 @@ sorts _before_ `z`) or Swedish set `sort-compare-locale="sv"` (in Swedish, `ä`
[Intl support](https://nodejs.org/api/intl.html) for handling locales, other than the default, to
prevent [SSR hydration mismatch](https://ssr.vuejs.org/guide/hydration.html) errors.
-Refer to the [**Sort-compare routine**](#sort-compare-routine) section below for details on sorting
+Refer to the [Sort-compare routine](#sort-compare-routine) section below for details on sorting
by presentational data.
```html
@@ -1771,7 +1771,7 @@ table#table-transition-example .flip-list-move {
## Using items provider functions
-As mentioned under the [**Items**](#items-record-data-) prop section, it is possible to use a
+As mentioned under the [Items](#items-record-data) prop section, it is possible to use a
function to provide the row data (items), by specifying a function reference via the `items` prop.
The provider function is called with the following signature:
@@ -1995,7 +1995,7 @@ export default {
```
You can also obtain the current sortBy and sortDesc values by using the `:sort-by.sync` and
-`:sort-desc.sync` two-way props respectively (see section [**Sorting**](#sorting) above for
+`:sort-desc.sync` two-way props respectively (see section [Sorting](#sorting) above for
details).
```html
diff --git a/src/components/table/package.json b/src/components/table/package.json
index 78119a921ed..e8b8ce710ce 100644
--- a/src/components/table/package.json
+++ b/src/components/table/package.json
@@ -199,7 +199,7 @@
"slots": [
{
"name": "[key]",
- "description": "Scoped slot for custom data rendering of field data. 'key' is hte fields key name. See docs for scoped data"
+ "description": "Scoped slot for custom data rendering of field data. 'key' is the fields key name. See docs for scoped data"
},
{
"name": "[]",
@@ -207,7 +207,7 @@
},
{
"name": "HEAD[key]",
- "description": "Scoped slot for custom rendering of field header. 'key' is hte fields key name. See docs for scoped header"
+ "description": "Scoped slot for custom rendering of field header. 'key' is the fields key name. See docs for scoped header"
},
{
"name": "HEAD[]",
@@ -215,7 +215,7 @@
},
{
"name": "FOOT[key]",
- "description": "Scoped slot for custom rendering of field footer. 'key' is hte fields key name. See docs for scoped footer"
+ "description": "Scoped slot for custom rendering of field footer. 'key' is the fields key name. See docs for scoped footer"
},
{
"name": "FOOT[]",
@@ -408,7 +408,7 @@
"slots": [
{
"name": "[key]",
- "description": "Scoped slot for custom data rendering of field data. 'key' is hte fields key name. See docs for scoped data"
+ "description": "Scoped slot for custom data rendering of field data. 'key' is the fields key name. See docs for scoped data"
},
{
"name": "[]",
@@ -416,7 +416,7 @@
},
{
"name": "HEAD[key]",
- "description": "Scoped slot for custom rendering of field header. 'key' is hte fields key name. See docs for scoped header"
+ "description": "Scoped slot for custom rendering of field header. 'key' is the fields key name. See docs for scoped header"
},
{
"name": "HEAD[]",
@@ -424,7 +424,7 @@
},
{
"name": "FOOT[key]",
- "description": "Scoped slot for custom rendering of field footer. 'key' is hte fields key name. See docs for scoped footer"
+ "description": "Scoped slot for custom rendering of field footer. 'key' is the fields key name. See docs for scoped footer"
},
{
"name": "FOOT[]",
From f261987cb692d7f62b1bfe830f4827c86304adde Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Thu, 25 Jul 2019 18:57:32 -0300
Subject: [PATCH 17/78] chore(deps): update devdependency eslint-plugin-jest to
^22.13.7 (#3758)
---
package.json | 2 +-
yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index c8110da9beb..5cc9aa0a8b6 100644
--- a/package.json
+++ b/package.json
@@ -103,7 +103,7 @@
"eslint-config-standard": "^13.0.1",
"eslint-config-vue": "^2.0.2",
"eslint-plugin-import": "^2.18.2",
- "eslint-plugin-jest": "^22.13.6",
+ "eslint-plugin-jest": "^22.13.7",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-prettier": "^3.1.0",
diff --git a/yarn.lock b/yarn.lock
index eacfa3b7a9b..f3e03ebacd8 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4949,10 +4949,10 @@ eslint-plugin-import@^2.18.2:
read-pkg-up "^2.0.0"
resolve "^1.11.0"
-eslint-plugin-jest@^22.13.6:
- version "22.13.6"
- resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.13.6.tgz#85630e7709fe1ecbe0099956590af32d5e157448"
- integrity sha512-wn3n9Djj+Dyi8AS1kvGOXpzUJfs9SJYhoZxIb49y4cwHRPaSgDHzSJPZX3sliZ3k8l6bYVeEGW76QvvqoOjSEw==
+eslint-plugin-jest@^22.13.7:
+ version "22.13.7"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.13.7.tgz#08516e7c77dd2a95d41dadd4e2ed9b7b29d18ce6"
+ integrity sha512-ckgSt9YHwgYd0PgMGtdYei4dfjsPmKnQlNs+Hr238sLKiLXODu38nbumtpDloa6uqUN/NVzHGYG9lV+X7iUv6Q==
dependencies:
"@typescript-eslint/experimental-utils" "^1.13.0"
From 722f9db371634d5185db0f7fef99cc1c735b6e8d Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Fri, 26 Jul 2019 10:26:25 -0300
Subject: [PATCH 18/78] feat(b-form-file, b-form-checkbox, b-form-radio): make
input element inherit non-prop attributes (addresses #3752) (#3754)
---
src/components/form-checkbox/form-checkbox.spec.js | 14 ++++++++++++++
src/components/form-file/form-file.js | 2 ++
src/components/form-file/form-file.spec.js | 14 ++++++++++++++
src/components/form-radio/form-radio.spec.js | 14 ++++++++++++++
src/mixins/form-radio-check.js | 2 ++
5 files changed, 46 insertions(+)
diff --git a/src/components/form-checkbox/form-checkbox.spec.js b/src/components/form-checkbox/form-checkbox.spec.js
index 31cb6e9a79a..38e1fb4dafa 100644
--- a/src/components/form-checkbox/form-checkbox.spec.js
+++ b/src/components/form-checkbox/form-checkbox.spec.js
@@ -279,6 +279,20 @@ describe('form-checkbox', () => {
wrapper.destroy()
})
+ it('has custom attributes transferred to input element', async () => {
+ const wrapper = mount(BFormCheckbox, {
+ propsData: {
+ id: 'foo',
+ foo: 'bar'
+ }
+ })
+ const input = wrapper.find('input')
+ expect(input.attributes('foo')).toBeDefined()
+ expect(input.attributes('foo')).toEqual('bar')
+
+ wrapper.destroy()
+ })
+
it('default has class custom-control-inline when prop inline=true', async () => {
const wrapper = mount(BFormCheckbox, {
propsData: {
diff --git a/src/components/form-file/form-file.js b/src/components/form-file/form-file.js
index bf240d8046c..71c0879baab 100644
--- a/src/components/form-file/form-file.js
+++ b/src/components/form-file/form-file.js
@@ -14,6 +14,7 @@ const NAME = 'BFormFile'
export const BFormFile = /*#__PURE__*/ Vue.extend({
name: NAME,
mixins: [idMixin, formMixin, formStateMixin, formCustomMixin, normalizeSlotMixin],
+ inheritAttrs: false,
model: {
prop: 'value',
event: 'input'
@@ -261,6 +262,7 @@ export const BFormFile = /*#__PURE__*/ Vue.extend({
this.stateClass
],
attrs: {
+ ...this.$attrs,
type: 'file',
id: this.safeId(),
name: this.name,
diff --git a/src/components/form-file/form-file.spec.js b/src/components/form-file/form-file.spec.js
index 000f8975816..6633e9d1feb 100644
--- a/src/components/form-file/form-file.spec.js
+++ b/src/components/form-file/form-file.spec.js
@@ -135,6 +135,20 @@ describe('form-file', () => {
wrapper.destroy()
})
+ it('default has custom attributes transferred input element', async () => {
+ const wrapper = mount(BFormFile, {
+ propsData: {
+ id: 'foo',
+ foo: 'bar'
+ }
+ })
+ const input = wrapper.find('input')
+ expect(input.attributes('foo')).toBeDefined()
+ expect(input.attributes('foo')).toEqual('bar')
+
+ wrapper.destroy()
+ })
+
it('default has class focus when input focused', async () => {
const wrapper = mount(BFormFile, {
propsData: {
diff --git a/src/components/form-radio/form-radio.spec.js b/src/components/form-radio/form-radio.spec.js
index 169ae68b456..99e10bcc3d3 100644
--- a/src/components/form-radio/form-radio.spec.js
+++ b/src/components/form-radio/form-radio.spec.js
@@ -261,6 +261,20 @@ describe('form-radio', () => {
wrapper.destroy()
})
+ it('has custom attributes transferred to input element', async () => {
+ const wrapper = mount(BFormRadio, {
+ propsData: {
+ id: 'foo',
+ foo: 'bar'
+ }
+ })
+ const input = wrapper.find('input')
+ expect(input.attributes('foo')).toBeDefined()
+ expect(input.attributes('foo')).toEqual('bar')
+
+ wrapper.destroy()
+ })
+
it('default has class custom-control-inline when prop inline=true', async () => {
const wrapper = mount(BFormRadio, {
propsData: {
diff --git a/src/mixins/form-radio-check.js b/src/mixins/form-radio-check.js
index da9d386afcf..69b4f71cbc5 100644
--- a/src/mixins/form-radio-check.js
+++ b/src/mixins/form-radio-check.js
@@ -3,6 +3,7 @@ import normalizeSlotMixin from './normalize-slot'
// @vue/component
export default {
mixins: [normalizeSlotMixin],
+ inheritAttrs: false,
model: {
prop: 'checked',
event: 'input'
@@ -198,6 +199,7 @@ export default {
}
],
attrs: {
+ ...this.$attrs,
id: this.safeId(),
type: this.isRadio ? 'radio' : 'checkbox',
name: this.getName,
From 57aa5b00f6a104be4ce12618a93c603d63da205a Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Fri, 26 Jul 2019 11:24:53 -0300
Subject: [PATCH 19/78] chore(docs): automatically add `rel` and `target`
attrs to external links + link formatting (#3743)
---
CONTRIBUTING.md | 24 ++++----
README.md | 22 +++----
.../reference/accessibility/README.md | 28 ++++-----
.../reference/utility-classes/README.md | 59 ++++++++-----------
docs/nuxt.config.js | 29 ++++++++-
src/components/table/README.md | 22 +++----
6 files changed, 96 insertions(+), 88 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 53f9c0fcabc..0f98bf75b9a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -61,7 +61,7 @@ open collective by the core contributors and the person who filed the expense wi
Thank you to all the people who have already contributed to bootstrap-vue!
-
+
### Backers
@@ -69,7 +69,7 @@ Thank you to all the people who have already contributed to bootstrap-vue!
Thank you to all our backers! [[Become a backer](https://opencollective.com/bootstrap-vue#backer)]
-
+
### Sponsors
@@ -78,14 +78,14 @@ Thank you to all our sponsors! (please ask your company to also support this ope
[becoming a sponsor](https://opencollective.com/bootstrap-vue#sponsor))
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index 579438650e1..8f7d94126e3 100644
--- a/README.md
+++ b/README.md
@@ -67,23 +67,23 @@ Support this project by becoming a sponsor.
Your logo will show up here with a link to your website.
[[Become a sponsor](https://opencollective.com/bootstrap-vue#sponsor)]
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
Backers
Thank you to all our backers! 🙏
[[Become a backer](https://opencollective.com/bootstrap-vue#backer)]
-
+
Contributors
diff --git a/docs/markdown/reference/accessibility/README.md b/docs/markdown/reference/accessibility/README.md
index 14608db6417..e7e58711b5e 100644
--- a/docs/markdown/reference/accessibility/README.md
+++ b/docs/markdown/reference/accessibility/README.md
@@ -10,9 +10,10 @@ components. But the overall accessibility of any project built with Bootstrap an
depends in large part on the author's markup, additional styling, and scripting they've included.
However, provided that these have been implemented correctly, it should be perfectly possible to
create websites and applications with BootstrapVue that fulfill
-WCAG
-2.0 (A/AA/AAA), Section 508 and similar accessibility
-standards and requirements.
+
+ WCAG 2.0
+(A/AA/AAA), Section 508
+and similar accessibility standards and requirements.
## Structural markup
@@ -28,7 +29,7 @@ practices and limitations.
BootstrapVue's interactive components — such as modal dialogs, dropdown menus and custom tooltips —
are designed to work for touch, mouse and keyboard users. Through the use of relevant
-
+
WAI-ARIA
roles and attributes, these components should also be understandable and operable using
assistive technologies (such as screen readers).
@@ -84,15 +85,10 @@ reduced motion (no animation) setting enabled in your operating system control p
## Additional resources
-- Bootstrap
- v4 Accessibility Documentation
-- Web Content Accessibility Guidelines (WCAG)
- 2.0
-- The A11Y Project
-- MDN
- accessibility documentation
-- Tenon.io Accessibility Checker
-- Colour
- Contrast Analyser (CCA)
-- "HTML CodeSniffer"
- bookmarklet for identifying accessibility issues
+- [Bootstrap v4 Accessibility Documentation](https://getbootstrap.com/docs/4.3/getting-started/accessibility/)
+- [Web Content Accessibility Guidelines (WCAG) 2.0](https://www.w3.org/TR/WCAG20/)
+- [The A11Y Project](https://a11yproject.com/)
+- [MDN accessibility documentation](https://developer.mozilla.org/en-US/docs/Web/Accessibility)
+- [Tenon.io Accessibility Checker](https://tenon.io/)
+- [Colour Contrast Analyser (CCA)](https://developer.paciellogroup.com/resources/contrastanalyser/)
+- ["HTML CodeSniffer" bookmarklet for identifying accessibility issues](https://github.com/squizlabs/HTML_CodeSniffer)
diff --git a/docs/markdown/reference/utility-classes/README.md b/docs/markdown/reference/utility-classes/README.md
index e074f82babf..fb36ffd6ec0 100644
--- a/docs/markdown/reference/utility-classes/README.md
+++ b/docs/markdown/reference/utility-classes/README.md
@@ -7,43 +7,30 @@
The following are convenience links to Bootstrap v4's documentation:
-- Border
- utilities
-- Clearfix
- utilities
-- Close icon
- utilities
-- Color utilities
-- Display
- utilities
-- Embed utilities
-- Flex utilities
-- Float utilities
-- Image
- replacement utilities
-- Overflow
- utilities
-- Position
- utilities
-- Screen
- reader utilities
-- Shadows
- utilities
-- Sizing utilities
-- Spacing
- utilities
-- Stretched
- link utilities
-- Text utilities
-- Vertical
- align utilities
-- Visibility
- utilities
+- [Border utilities](https://getbootstrap.com/docs/4.3/utilities/borders/)
+- [Clearfix utilities](https://getbootstrap.com/docs/4.3/utilities/clearfix/)
+- [Close icon utilities](https://getbootstrap.com/docs/4.3/utilities/close-icon/)
+- [Color utilities](https://getbootstrap.com/docs/4.3/utilities/colors/)
+- [Display utilities](https://getbootstrap.com/docs/4.3/utilities/display/)
+- [Embed utilities](https://getbootstrap.com/docs/4.3/utilities/embed/)
+- [Flex utilities](https://getbootstrap.com/docs/4.3/utilities/flex/)
+- [Float utilities](https://getbootstrap.com/docs/4.3/utilities/float/)
+- [Image replacement utilities](https://getbootstrap.com/docs/4.3/utilities/image-replacement/)
+- [Overflow utilities](https://getbootstrap.com/docs/4.3/utilities/overflow/)
+- [Position utilities](https://getbootstrap.com/docs/4.3/utilities/position/)
+- [Screen reader utilities](https://getbootstrap.com/docs/4.3/utilities/screen-readers/)
+- [Shadow utilities](https://getbootstrap.com/docs/4.3/utilities/shadows/)
+- [Sizing utilities](https://getbootstrap.com/docs/4.3/utilities/sizing/)
+- [Spacing utilities](https://getbootstrap.com/docs/4.3/utilities/spacing/)
+- [Stretched link utilities](https://getbootstrap.com/docs/4.3/utilities/stretched-link/)
+- [Text utilities](https://getbootstrap.com/docs/4.3/utilities/text/)
+- [Vertical align utilities](https://getbootstrap.com/docs/4.3/utilities/vertical-align/)
+- [Visibility utilities](https://getbootstrap.com/docs/4.3/utilities/visibility/)
Bootstrap v4 also has defined typography styles and classes for various native HTML elements. You
can find out more at the following links:
-- Reboot
-- Typography
-- Code
-- Figures
+- [Reboot](https://getbootstrap.com/docs/4.3/content/reboot/)
+- [Typography](https://getbootstrap.com/docs/4.3/content/typography/)
+- [Code](https://getbootstrap.com/docs/4.3/content/code/)
+- [Figures](https://getbootstrap.com/docs/4.3/content/figures/)
diff --git a/docs/nuxt.config.js b/docs/nuxt.config.js
index e9b88971b58..0c4fcb4acb5 100644
--- a/docs/nuxt.config.js
+++ b/docs/nuxt.config.js
@@ -34,9 +34,34 @@ renderer.code = (code, language) => {
return `
${highlighted}
`
}
-// Instruct google translate not to translate `` content
+// Instruct google translate not to translate `` content, and
+// don't let browsers wrap the contents across lines
renderer.codespan = text => {
- return `${text}`
+ return `${text}`
+}
+
+// Custom link renderer, to update bootstrap docs version in href
+// Only applies to markdown links (not explicit `...` tags
+renderer.link = (href, title, text) => {
+ let target = ''
+ let rel = ''
+ let classAttr = ''
+ href = href || '#'
+ title = title ? ` title="${title}"` : ''
+ text = text || ''
+ if (href.indexOf('http') === 0 || href.indexOf('//') === 0) {
+ // External links
+ // Open in a new window (will reduce bounce rates in analytics)
+ target = ' target="_blank"'
+ // We add in rel="noopener" to all external links for security and performance reasons
+ // https://developers.google.com/web/tools/lighthouse/audits/noopener
+ rel = ' rel="noopener"'
+ // External links use the default link style
+ } else if (href.indexOf('/') === 0 || href.indexOf('#') === 0) {
+ // Internal docs links
+ classAttr = ' class="font-weight-bold"'
+ }
+ return `${text}`
}
// Custom heading implementation for markdown renderer
diff --git a/src/components/table/README.md b/src/components/table/README.md
index 42892ec2f87..b4543cc61bc 100644
--- a/src/components/table/README.md
+++ b/src/components/table/README.md
@@ -333,13 +333,13 @@ The following field properties are recognized:
**Notes:**
-- _Field properties, if not present, default to `null` (falsey) unless otherwise stated above._
-- _`class`, `thClass`, `tdClass` etc. will not work with classes that are defined in scoped CSS_
-- _For information on the syntax supported by `thStyle`, see
+- Field properties, if not present, default to `null` (falsey) unless otherwise stated above.
+- `class`, `thClass`, `tdClass` etc. will not work with classes that are defined in scoped CSS.
+- For information on the syntax supported by `thStyle`, see
[Class and Style Bindings](https://vuejs.org/v2/guide/class-and-style.html#Binding-Inline-Styles)
- in the Vue.js guide._
-- _Any additional properties added to the field objects will be left intact - so you can access them
- via the named scoped slots for custom data, header, and footer rendering._
+ in the Vue.js guide.
+- Any additional properties added to the field objects will be left intact - so you can access them
+ via the named scoped slots for custom data, header, and footer rendering.
For information and usage about scoped slots and formatters, refer to the
[Custom Data Rendering](#custom-data-rendering) section below.
@@ -1360,11 +1360,11 @@ element.
**Notes:**
-- _Paging, filtering, or sorting will clear the selection. The `row-selected` event will be emitted
- with an empty array if needed._
-- _Selected rows will have a class of `b-row-selected` added to them._
-- _When the table is in `selectable` mode, all data item `
` elements will be in the document tab
- sequence (`tabindex="0"`) for accessibility reasons._
+- Paging, filtering, or sorting will clear the selection. The `row-selected` event will be emitted
+ with an empty array if needed.
+- Selected rows will have a class of `b-row-selected` added to them.
+- When the table is in `selectable` mode, all data item `
` elements will be in the document tab
+ sequence (`tabindex="0"`) for accessibility reasons.
## Sorting
From 1a9c6883ace162878d44281ad53eceabd2c3c238 Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Fri, 26 Jul 2019 12:15:16 -0300
Subject: [PATCH 20/78] fix(table): better detection of active text selection
during click events (#3763)
Ignore when text selection contents are empty
---
src/components/table/helpers/text-selection-active.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/table/helpers/text-selection-active.js b/src/components/table/helpers/text-selection-active.js
index eff5edb3e62..219db24ab85 100644
--- a/src/components/table/helpers/text-selection-active.js
+++ b/src/components/table/helpers/text-selection-active.js
@@ -7,7 +7,7 @@ import { getSel, isElement } from '../../../utils/dom'
// contained within the element
const textSelectionActive = (el = document) => {
const sel = getSel()
- return sel && sel.toString() !== '' && sel.containsNode && isElement(el)
+ return sel && sel.toString().trim() !== '' && sel.containsNode && isElement(el)
? sel.containsNode(el, true)
: false
}
From 3e841e7804936cf710dbaf37284922d0d1f7b660 Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Fri, 26 Jul 2019 13:21:00 -0300
Subject: [PATCH 21/78] chore(docs): minor tweak to in-page link handling
(#3767)
---
docs/components/section.js | 7 -------
1 file changed, 7 deletions(-)
diff --git a/docs/components/section.js b/docs/components/section.js
index b71663fefe1..747dc5f25a3 100644
--- a/docs/components/section.js
+++ b/docs/components/section.js
@@ -52,13 +52,6 @@ const linkToRouter = evt => {
window.$nuxt.$router.push(href)
}
} else if (href && href.indexOf('#') === 0) {
- // Even though we are on teh same page, we do a router push so that
- // a history state is saved. Router pushes to in page links
- // does not cause a scroll though, so we use scrollIntoView as well
- if (typeof window !== 'undefined' && window.$nuxt) {
- // Since we are a functional component, we can't use this.$router
- window.$nuxt.$router.push(href)
- }
// In page anchor link, so use scrollIntoView utility method
scrollIntoView(evt, href)
}
From ccb80b4772c036a4cdf7df4bba35260c2d12e0e5 Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Fri, 26 Jul 2019 15:19:57 -0300
Subject: [PATCH 22/78] chore(bv-modal): make `msgBox` method private (#3768)
---
src/components/modal/helpers/bv-modal.js | 36 ++++++++++++------------
src/components/modal/index.d.ts | 13 ++++-----
2 files changed, 23 insertions(+), 26 deletions(-)
diff --git a/src/components/modal/helpers/bv-modal.js b/src/components/modal/helpers/bv-modal.js
index e177361aeec..0a543c3fd4d 100644
--- a/src/components/modal/helpers/bv-modal.js
+++ b/src/components/modal/helpers/bv-modal.js
@@ -94,7 +94,7 @@ const plugin = Vue => {
// Method to generate the on-demand modal message box
// Returns a promise that resolves to a value returned by the resolve
- const asyncMsgBox = (props, $parent, resolver = defaultResolver) => {
+ const asyncMsgBox = ($parent, props, resolver = defaultResolver) => {
if (warnNotClient(PROP_NAME) || warnNoPromiseSupport(PROP_NAME)) {
/* istanbul ignore next */
return
@@ -155,6 +155,21 @@ const plugin = Vue => {
})
}
+ // Private utility method to open a user defined message box and returns a promise.
+ // Not to be used directly by consumers, as this method may change calling syntax
+ const makeMsgBox = ($parent, content, options = {}, resolver) => {
+ if (
+ !content ||
+ warnNoPromiseSupport(PROP_NAME) ||
+ warnNotClient(PROP_NAME) ||
+ !isFunction(resolver)
+ ) {
+ /* istanbul ignore next */
+ return
+ }
+ return asyncMsgBox($parent, { ...filterOptions(options), msgBoxContent: content }, resolver)
+ }
+
// BvModal instance class
class BvModal {
constructor(vm) {
@@ -187,21 +202,6 @@ const plugin = Vue => {
// IE 11 and others do not support Promise natively, so users
// should have a Polyfill loaded (which they need anyways for IE 11 support)
- // Opens a user defined message box and returns a promise
- // Not yet documented
- msgBox(content, options = {}, resolver) {
- if (
- !content ||
- warnNoPromiseSupport(PROP_NAME) ||
- warnNotClient(PROP_NAME) ||
- !isFunction(resolver)
- ) {
- /* istanbul ignore next */
- return
- }
- return asyncMsgBox({ ...filterOptions(options), msgBoxContent: content }, this._vm, resolver)
- }
-
// Open a message box with OK button only and returns a promise
msgBoxOk(message, options = {}) {
// Pick the modal props we support from options
@@ -213,7 +213,7 @@ const plugin = Vue => {
hideFooter: false,
msgBoxContent: message
}
- return this.msgBox(message, props, bvModalEvt => {
+ return makeMsgBox(this._vm, message, props, bvModalEvt => {
// Always resolve to true for OK
return true
})
@@ -231,7 +231,7 @@ const plugin = Vue => {
cancelDisabled: false,
hideFooter: false
}
- return this.msgBox(message, props, bvModalEvt => {
+ return makeMsgBox(this._vm, message, props, bvModalEvt => {
const trigger = bvModalEvt.trigger
return trigger === 'ok' ? true : trigger === 'cancel' ? false : null
})
diff --git a/src/components/modal/index.d.ts b/src/components/modal/index.d.ts
index 7484523864a..3959750c6f9 100644
--- a/src/components/modal/index.d.ts
+++ b/src/components/modal/index.d.ts
@@ -69,17 +69,17 @@ export interface BvModalMsgBoxResolver {
}
export interface BvModalMsgBoxShortcutMethod {
- (message: string | VNode | Array, options?: BvMsgBoxOptions): Promise
+ (message: string | Array, options?: BvMsgBoxOptions): Promise
// Future
// (options?: BvMsgBoxOptions): Promise
- // (message: string | VNode | Array, title: string | VNode | Array, options?: BvMsgBoxOptions): Promise
+ // (message: string | Array, title: string | Array, options?: BvMsgBoxOptions): Promise
}
-// Not yet documented
+// Not yet documented or implemented (Future)
// export interface BvModalMsgBoxMethod {
// (options: BvMsgBoxOptions, resolver: BvModalMsgBoxResolver): Promise
-// (message: string | VNode | Array, options: BvMsgBoxOptions, resolver: BvModalMsgBoxResolver): Promise
-// (message: string | VNode | Array, title: string | VNode | Array, options: BvMsgBoxOptions, resolver: BvModalMsgBoxResolver): Promise
+// (message: string | Array, options: BvMsgBoxOptions, resolver: BvModalMsgBoxResolver): Promise
+// (message: string | Array, title: string | Array, options: BvMsgBoxOptions, resolver: BvModalMsgBoxResolver): Promise
// }
export interface BvModal {
@@ -89,9 +89,6 @@ export interface BvModal {
// Show Confirm MsgBox
msgBoxConfirm: BvModalMsgBoxShortcutMethod
- // Show general MsgBox (not yet documented)
- // msgBox: BvModalMsgBoxMethod
-
// Show a modal by id
show: (id: string) => void
From ba6a94ae2a1434d6eac48bc8a0729503cf9ca482 Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Fri, 26 Jul 2019 15:50:10 -0300
Subject: [PATCH 23/78] chore: update pull request template (#3769)
---
.github/PULL_REQUEST_TEMPLATE.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index fa4e26ebe73..1446f26b4b7 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -30,6 +30,7 @@ A clear and concise description of what the pull request does.
**If new features/enhancement/fixes are added or changed:**
- [ ] Includes documentation updates (including updating the component's `package.json` for slot and event changes)
+- [ ] Includes any needed TypeScript declaration file updates
- [ ] New/updated tests are included and passing (if required)
- [ ] Existing test suites are passing
- [ ] The changes have not impacted the functionality of other components or directives
From fc51b071e5a31a3202e8f95a3f4126bdd071b35a Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Fri, 26 Jul 2019 16:04:14 -0300
Subject: [PATCH 24/78] chore(deps): update devdependency eslint-plugin-jest to
^22.14.0 (#3770)
---
package.json | 2 +-
yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 5cc9aa0a8b6..90f46cef1c2 100644
--- a/package.json
+++ b/package.json
@@ -103,7 +103,7 @@
"eslint-config-standard": "^13.0.1",
"eslint-config-vue": "^2.0.2",
"eslint-plugin-import": "^2.18.2",
- "eslint-plugin-jest": "^22.13.7",
+ "eslint-plugin-jest": "^22.14.0",
"eslint-plugin-markdown": "^1.0.0",
"eslint-plugin-node": "^9.1.0",
"eslint-plugin-prettier": "^3.1.0",
diff --git a/yarn.lock b/yarn.lock
index f3e03ebacd8..80b4c533d82 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4949,10 +4949,10 @@ eslint-plugin-import@^2.18.2:
read-pkg-up "^2.0.0"
resolve "^1.11.0"
-eslint-plugin-jest@^22.13.7:
- version "22.13.7"
- resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.13.7.tgz#08516e7c77dd2a95d41dadd4e2ed9b7b29d18ce6"
- integrity sha512-ckgSt9YHwgYd0PgMGtdYei4dfjsPmKnQlNs+Hr238sLKiLXODu38nbumtpDloa6uqUN/NVzHGYG9lV+X7iUv6Q==
+eslint-plugin-jest@^22.14.0:
+ version "22.14.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-22.14.0.tgz#f9b09837f665cfe360b55c08866904255294cc16"
+ integrity sha512-Xtc9ZTtxdYFC7vu0PHxDeQ9lOMQ8gjwMmSQq/ni83TdflgL3eVh/qg3t99I7gcDxpeXfcp+lHu9C0vN3QAhATw==
dependencies:
"@typescript-eslint/experimental-utils" "^1.13.0"
From 5a4e428014f231304ba5952740a2d1ea294abf4e Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Fri, 26 Jul 2019 18:51:08 -0300
Subject: [PATCH 25/78] chore(config): correct unknown prop warning format
---
src/utils/config-set.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/utils/config-set.js b/src/utils/config-set.js
index e958275fd86..3a4c29855a2 100644
--- a/src/utils/config-set.js
+++ b/src/utils/config-set.js
@@ -65,7 +65,7 @@ class BvConfig {
props.forEach(prop => {
/* istanbul ignore if */
if (!hasOwnProperty(DEFAULTS[cmpName], prop)) {
- warn(`config: unknown config property "${cmpName}.{$prop}"`)
+ warn(`config: unknown config property "${cmpName}.${prop}"`)
} else {
// TODO: If we pre-populate the config with defaults, we can skip this line
this.$_config[cmpName] = this.$_config[cmpName] || {}
From d3e7f1b5373bd49291cbdd0f2e396cfeedd6adeb Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Fri, 26 Jul 2019 23:39:56 -0300
Subject: [PATCH 26/78] chore(docs): update navbar brand logo (#3760)
---
docs/components/header.vue | 32 ++++++++++++--------------------
1 file changed, 12 insertions(+), 20 deletions(-)
diff --git a/docs/components/header.vue b/docs/components/header.vue
index 526d6905c3e..bfd1a619055 100644
--- a/docs/components/header.vue
+++ b/docs/components/header.vue
@@ -9,30 +9,22 @@
>
From 197b86cf9183bd4d351a2d74634489522d82f7cd Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Fri, 26 Jul 2019 23:55:57 -0300
Subject: [PATCH 27/78] chore(config): add a few comment notes to the default
config (#3774)
---
src/utils/config-defaults.js | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/utils/config-defaults.js b/src/utils/config-defaults.js
index 46dfb0a7868..248c4adb9d5 100644
--- a/src/utils/config-defaults.js
+++ b/src/utils/config-defaults.js
@@ -1,19 +1,26 @@
import { deepFreeze } from './object'
// General BootstrapVue configuration
+
+// NOTES:
+//
+// The global config SHALL NOT be used to set defaults for Boolean props, as the props
+// would loose their semanitc meaning, and force people writing 3rd party components to
+// explicity set a true or false value using the v-bind syntax on boolean props.
//
+// Supported config values: String, Array, Object, null or undefined, depending on the
+// prop's supported type(s).
+
// BREAKPOINT DEFINITIONS
//
// Some components (BCol and BFormGroup) generate props based on breakpoints, and this
// occurs when the component is first loaded (evaluated), which may happen before the
// config is created/modified
//
-// To get around this we make these components async (lazy evaluation)
+// To get around this we make these components' props async (lazy evaluation)
// The component definition is only called/executed when the first access to the
// component is used (and cached on subsequent uses)
//
-// See: https://vuejs.org/v2/guide/components-dynamic-async.html#Async-Components
-//
// PROP DEFAULTS
//
// For default values on props, we use the default value factory function approach so
@@ -25,6 +32,8 @@ import { deepFreeze } from './object'
// default: () => getConfigComponent('BAlert', 'variant')
// }
// }
+//
+// We also provide a cached getter for breakpoints, which are "frozen" on first access
// prettier-ignore
export default deepFreeze({
From 57990753ef1c1177e29a5d9d1e136ef5b7e5e198 Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Sun, 28 Jul 2019 12:52:42 -0300
Subject: [PATCH 28/78] feat(toast): add SCSS variable for default toast
background opacity + standardize a few BootstrapVue SCSS variable names
(#3775)
---
src/_variables.scss | 63 ++++++++--
src/components/popover/_popover.scss | 10 +-
src/components/table/_table.scss | 174 ++++++++++++++-------------
src/components/toast/README.md | 11 +-
src/components/toast/_toast.scss | 15 ++-
src/components/tooltip/_tooltip.scss | 6 +-
src/utils/config-defaults.js | 3 +-
7 files changed, 170 insertions(+), 112 deletions(-)
diff --git a/src/_variables.scss b/src/_variables.scss
index 399128df4ab..d4b671ce25f 100644
--- a/src/_variables.scss
+++ b/src/_variables.scss
@@ -1,37 +1,82 @@
// BootstrapVue custom SCSS variables
+//
+// Users can override thes variables in their custom SCSS
+//
// --- Tables ---
+
+// Table busy state
$b-table-busy-opacity: 0.55 !default;
+
+// Table sorting
$b-table-sort-icon-null: "\2195" !default; // Up-Down arrow
$b-table-sort-icon-ascending: "\2193" !default; // Down arrow
$b-table-sort-icon-descending: "\2191" !default; // Up arrow
$b-table-sort-icon-margin-left: 0.5em !default;
$b-table-sort-icon-width: 0.5em !default;
+
+// Flag to enable table stacked CSS generation
+$bv-enable-table-stacked: true !default;
+// Table stacked defaults
$b-table-stacked-heading-width: 40% !default;
$b-table-stacked-gap: 1rem !default;
// --- Toasts ---
+
+// Toaster defaults
$b-toaster-zindex: 1100 !default;
$b-toaster-offset-top: 0.5rem !default;
$b-toaster-offset-bottom: $b-toaster-offset-top !default;
$b-toaster-offset-left: $b-toaster-offset-top !default;
$b-toaster-offset-right: $b-toaster-offset-top !default;
-// --- Toast variant levels wrt theme color value ---
+// Default toast opacity
+// Value from 0 to 1, or 0% to 100%
+// Bootstrap default is 0.85 (extracted from the `$toast-background-color` value)
+// Bootstrap does not have this as a variable, so we add it in.
+$b-toast-background-opacity: alpha($toast-background-color) !default;
+
+// Toast variant levels wrt theme color value
$b-toast-bg-level: $alert-bg-level !default;
$b-toast-border-level: $alert-border-level !default;
$b-toast-color-level: $alert-color-level !default;
-// --- Enable tooltip variants ---
+// --- Tooltips ---
+
+// Flag to enable tooltip variant CSS generation
$bv-enable-tooltip-variants: true !default;
-// --- Tooltip background variant level wrt theme color value ---
-$bv-tooltip-bg-level: 0 !default;
+// Tooltip background variant level wrt theme color value
+$b-tooltip-bg-level: 0 !default;
+// Deprecated
+$bv-tooltip-bg-level: null !default;
+@if $bv-tooltip-bg-level {
+ @warn("Variable '\$bv-tooltip-bg-level' has been deprecated. Use '\$b-tooltip-bg-level' instead.");
+ $b-tooltip-bg-level: $bv-tooltip-bg-level;
+}
+
+// --- Popovers ---
-// --- Enable popover variants ---
+// Flag to enable popover variant CSS genearation
$bv-enable-popover-variants: true !default;
-// --- Popover variant levels wrt theme color value ---
-$bv-popover-bg-level: $alert-bg-level !default;
-$bv-popover-border-level: $alert-border-level !default;
-$bv-popover-color-level: $alert-color-level !default;
+// Popover variant levels wrt theme color value
+$b-popover-bg-level: $alert-bg-level !default;
+$b-popover-border-level: $alert-border-level !default;
+$b-popover-color-level: $alert-color-level !default;
+// Deprecated
+$bv-popover-bg-level: null !default;
+@if $bv-popover-bg-level {
+ @warn("Variable '\$bv-popover-bg-level' has been deprecated. Use '\$b-popover-bg-level' instead.");
+ $b-popover-bg-level: $bv-popover-bg-level;
+}
+$bv-popover-border-level: null !default;
+@if $bv-popover-border-level {
+ @warn("Variable '\$bv-popover-border-level' has been deprecated. Use '\$b-popover-border-level' instead.");
+ $b-popover-border-level: $bv-popover-border-level;
+}
+$bv-popover-color-level: null !default;
+@if $bv-popover-color-level {
+ @warn("Variable '\$bv-popover-color-level' has been deprecated. Use '\$b-popover-color-level' instead.");
+ $b-popover-color-level: $bv-popover-color-level;
+}
diff --git a/src/components/popover/_popover.scss b/src/components/popover/_popover.scss
index 0356cd48377..31adedc2e3a 100644
--- a/src/components/popover/_popover.scss
+++ b/src/components/popover/_popover.scss
@@ -1,9 +1,9 @@
@if $bv-enable-popover-variants {
- @each $color, $value in $theme-colors {
- .b-popover-#{$color} {
- $po-bg-color: theme-color-level($color, $bv-popover-bg-level);
- $po-border-color: theme-color-level($color, $bv-popover-border-level);
- $po-color: theme-color-level($color, $bv-popover-color-level);
+ @each $variant, $value in $theme-colors {
+ .b-popover-#{$variant} {
+ $po-bg-color: theme-color-level($variant, $b-popover-bg-level);
+ $po-border-color: theme-color-level($variant, $b-popover-border-level);
+ $po-color: theme-color-level($variant, $b-popover-color-level);
$po-header-bg: darken($po-bg-color, 3%);
$po-header-color: color-yiq($po-header-bg);
$po-arrow-color: $po-bg-color;
diff --git a/src/components/table/_table.scss b/src/components/table/_table.scss
index 491b39c764c..b3fe844aa07 100644
--- a/src/components/table/_table.scss
+++ b/src/components/table/_table.scss
@@ -69,88 +69,107 @@
}
}
-// --- Stacked tables ---
+// --- Selectable rows ---
.table.b-table {
- &.b-table-stacked {
- @each $breakpoint in map-keys($grid-breakpoints) {
- $next: breakpoint-next($breakpoint, $grid-breakpoints);
- $infix: breakpoint-infix($next, $grid-breakpoints);
-
- {$infix} {
- @include media-breakpoint-down($breakpoint) {
- display: block;
- width: 100%;
-
- // Convert to blocks when stacked
- > caption,
- > tbody,
- > tbody > tr,
- > tbody > tr > td,
- > tbody > tr > td {
- display: block;
- }
+ &.b-table-selectable {
+ & > tbody > tr {
+ cursor: pointer;
+ }
- // Hide when stacked
- > thead,
- > tfoot {
- display: none;
+ &.b-table-selecting {
+ // Disabled text-selection when in range mode when
+ // at least one row selected
+ &.b-table-select-range > tbody > tr {
+ user-select: none;
+ }
+ }
+ }
+}
+
+// --- Stacked tables ---
+@if $bv-enable-table-stacked {
+ .table.b-table {
+ &.b-table-stacked {
+ @each $breakpoint in map-keys($grid-breakpoints) {
+ $next: breakpoint-next($breakpoint, $grid-breakpoints);
+ $infix: breakpoint-infix($next, $grid-breakpoints);
+
+ {$infix} {
+ @include media-breakpoint-down($breakpoint) {
+ display: block;
+ width: 100%;
+
+ // Convert to blocks when stacked
+ > caption,
+ > tbody,
+ > tbody > tr,
+ > tbody > tr > td,
+ > tbody > tr > td {
+ display: block;
+ }
- > tr.b-table-top-row,
- > tr.b-table-bottom-row {
+ // Hide when stacked
+ > thead,
+ > tfoot {
display: none;
+
+ > tr.b-table-top-row,
+ > tr.b-table-bottom-row {
+ display: none;
+ }
}
- }
- // Caption positioning
- > caption {
- caption-side: top !important;
- }
+ // Caption positioning
+ > caption {
+ caption-side: top !important;
+ }
- > tbody {
- > tr {
- // Turn cells with labels into micro-grids
- > [data-label] {
- // Cell header label pseudo element
- &::before {
- content: attr(data-label);
- display: inline-block;
- width: $b-table-stacked-heading-width;
- float: left;
- text-align: right;
- overflow-wrap: break-word;
- font-weight: bold;
- font-style: normal;
- padding: 0;
- margin: 0;
+ > tbody {
+ > tr {
+ // Turn cells with labels into micro-grids
+ > [data-label] {
+ // Cell header label pseudo element
+ &::before {
+ content: attr(data-label);
+ display: inline-block;
+ width: $b-table-stacked-heading-width;
+ float: left;
+ text-align: right;
+ overflow-wrap: break-word;
+ font-weight: bold;
+ font-style: normal;
+ padding: 0;
+ margin: 0;
+ }
+
+ // Add clearfix in-case field label wraps
+ &::after {
+ display: block;
+ clear: both;
+ content: "";
+ }
+
+ // Cell value (we wrap the cell value in a div when stacked)
+ > div {
+ display: inline-block;
+ width: calc(100% - #{$b-table-stacked-heading-width});
+ // Add "gap" between "cells"
+ padding: 0 0 0 $b-table-stacked-gap;
+ margin: 0;
+ }
}
- // Add clearfix in-case field label wraps
- &::after {
- display: block;
- clear: both;
- content: "";
+ // Dont show the fixed top/bottom rows
+ &.top-row,
+ &.bottom-row {
+ display: none;
}
- // Cell value (we wrap the cell value in a div when stacked)
- > div {
- display: inline-block;
- width: calc(100% - #{$b-table-stacked-heading-width});
- // Add "gap" between "cells"
- padding: 0 0 0 $b-table-stacked-gap;
- margin: 0;
+ // Give the top cell of each "row" a heavy border
+ > :first-child {
+ border-top-width: (3 * $table-border-width);
}
}
-
- // Dont show the fixed top/bottom rows
- &.top-row,
- &.bottom-row {
- display: none;
- }
-
- // Give the top cell of each "row" a heavy border
- > :first-child {
- border-top-width: (3 * $table-border-width);
- }
}
}
}
@@ -158,20 +177,3 @@
}
}
}
-
-// --- Selectable rows ---
-.table.b-table {
- &.b-table-selectable {
- & > tbody > tr {
- cursor: pointer;
- }
-
- &.b-table-selecting {
- // Disabled text-selection when in range mode when
- // at least one row selected
- &.b-table-select-range > tbody > tr {
- user-select: none;
- }
- }
- }
-}
diff --git a/src/components/toast/README.md b/src/components/toast/README.md
index 15fc4077c16..192e22a66c3 100644
--- a/src/components/toast/README.md
+++ b/src/components/toast/README.md
@@ -150,13 +150,18 @@ example of passing an array of `VNodes` as the message and title.
### Transparency
Toasts have a semi-transparent background by default. To disable the default transparency, just set
-the `solid` prop to `true`
+the `solid` prop to `true` to remove the alpha channel from the background color.
+
+Transparency can also be altered via the BootstrapVue custom SCSS variable
+`$b-toast-background-opacity` when using the SCSS files rather than CSS files. Refer to the
+[Theming](/docs/reference/theming) reference section.
### Variants
BootstrapVue toasts provide custom CSS to define color variants. Variants follow the standard
-Bootstrap v4 variant names. If you have custom SCSS defined Bootstrap color variants, the toast
-custom SCSS will automatically create toast variants for you.
+Bootstrap v4 variant names. If you have custom SCSS defined Bootstrap color theme variants, the
+toast custom SCSS will automatically create toast variants for you (refer to the
+[Theming](/docs/reference/theming) reference section).
```html
diff --git a/src/components/toast/_toast.scss b/src/components/toast/_toast.scss
index 83d7d5e5732..b803a1bcdac 100644
--- a/src/components/toast/_toast.scss
+++ b/src/components/toast/_toast.scss
@@ -7,9 +7,16 @@
max-width: $toast-max-width;
backface-visibility: hidden;
background-clip: padding-box;
+
z-index: 1;
@include border-radius($toast-border-radius);
+ .toast {
+ // Allow us to override Bootstrap's default toast opacity
+ // As they do not provide it as a variable
+ background-color: rgba($toast-background-color, $b-toast-background-opacity);
+ }
+
&:not(:last-child) {
margin-bottom: $toast-padding-x;
}
@@ -38,14 +45,14 @@
@mixin b-toast-variant($background, $border, $color) {
// Based on alert-variant mixin
.toast {
- background-color: rgba(lighten($background, 5%), 0.85);
- border-color: rgba($border, 0.85);
+ background-color: rgba(lighten($background, 5%), $b-toast-background-opacity);
+ border-color: rgba($border, $b-toast-background-opacity);
color: $color;
.toast-header {
color: $color;
- background-color: rgba($background, 0.85);
- border-bottom-color: rgba($border, 0.85);
+ background-color: rgba($background, $b-toast-background-opacity);
+ border-bottom-color: rgba($border, $b-toast-background-opacity);
}
// .toast-body[href] {
diff --git a/src/components/tooltip/_tooltip.scss b/src/components/tooltip/_tooltip.scss
index abf1d651041..86036863f27 100644
--- a/src/components/tooltip/_tooltip.scss
+++ b/src/components/tooltip/_tooltip.scss
@@ -1,8 +1,8 @@
// Create custom variants for tooltips
@if $bv-enable-tooltip-variants {
- @each $color, $value in $theme-colors {
- .tooltip.b-tooltip-#{$color} {
- $tip-bg-color: theme-color-level($color, $bv-tooltip-bg-level);
+ @each $variant, $value in $theme-colors {
+ .tooltip.b-tooltip-#{$variant} {
+ $tip-bg-color: theme-color-level($variant, $b-tooltip-bg-level);
$tip-text-color: color-yiq($tip-bg-color);
&.bs-tooltip-top {
diff --git a/src/utils/config-defaults.js b/src/utils/config-defaults.js
index 248c4adb9d5..2c804fde066 100644
--- a/src/utils/config-defaults.js
+++ b/src/utils/config-defaults.js
@@ -146,8 +146,7 @@ export default deepFreeze({
variant: null,
toastClass: null,
headerClass: null,
- bodyClass: null,
- solid: false
+ bodyClass: null
},
BToaster: {
ariaLive: null,
From 324593740ed9e5337dbcc8ffe7a47a7dd7f58322 Mon Sep 17 00:00:00 2001
From: Chettapong Pinsuwan
Date: Mon, 29 Jul 2019 22:54:35 +0700
Subject: [PATCH 29/78] chore(docs): correct end tag in example (#3777)
---
src/components/popover/README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/popover/README.md b/src/components/popover/README.md
index 2abd5afd709..9571948aea9 100644
--- a/src/components/popover/README.md
+++ b/src/components/popover/README.md
@@ -687,7 +687,7 @@ to deal with on mobile devices (such as smart-phones).
:state="input2state"
:options="options"
size="sm"
- >
+ >
From 69a13fd4e5d18b5b7da51ca36778d79c11b518f2 Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Mon, 29 Jul 2019 17:14:26 -0300
Subject: [PATCH 30/78] chore(docs): style tweaks for landing page (#3776)
---
docs/assets/scss/styles.scss | 4 +
docs/pages/index.vue | 265 +++++++++++++++++++++++++++++++----
2 files changed, 240 insertions(+), 29 deletions(-)
diff --git a/docs/assets/scss/styles.scss b/docs/assets/scss/styles.scss
index 65e6c7c68c2..371d0d5fd3d 100644
--- a/docs/assets/scss/styles.scss
+++ b/docs/assets/scss/styles.scss
@@ -62,6 +62,10 @@
}
}
+.bd-navbar {
+ box-shadow: 0 0.25rem 0.25rem rgba(0,0,0,.25), inset 0 -1px 5px rgba(0,0,0,.25);
+}
+
.bd-toc {
@media (min-width: 768px) {
border-left: 1px solid rgba(0, 0, 0, 0.1);
diff --git a/docs/pages/index.vue b/docs/pages/index.vue
index 41ff080333e..4f7d7e109bb 100644
--- a/docs/pages/index.vue
+++ b/docs/pages/index.vue
@@ -1,25 +1,75 @@
-
+
-
+
-
-
-
-
+
+
-
+
BootstrapVue
With BootstrapVue you can build responsive,
- mobile-first projects on the web using Vue.js
+ mobile-first projects on the web using Vue.js
and the world's most popular front-end CSS library —
- Bootstrap v4.
+ Bootstrap v4.
@@ -59,7 +109,8 @@
- Vue.js (pronounced /vjuː/, like view)
+ Vue.js
+ (pronounced /vjuː/, like view)
is a progressive framework for building user interfaces.
@@ -80,8 +131,8 @@
With over 40 available plugins and more than 75 custom UI components,
BootstrapVue provides one of the most
comprehensive implementations of the
- Bootstrap v4.3 component and grid system
- available for Vue.js v2.6+, complete with
+ Bootstrap v{{ bootstrapVersionMinor }} component and grid system
+ available for Vue.js v{{ vueVersionMinor }}, complete with
extensive and automated
WAI-ARIA
@@ -242,7 +293,8 @@
- Built with Vue.js v2.6 and Bootstrap SCSS v4.3
+ Built with Vue.js v{{ vueVersionMinor }} and
+ Bootstrap SCSS v{{ bootstrapVersionMinor }}
@@ -415,6 +467,35 @@
From 429a9fedb9031d93a0e5f0f9915727515c461d86 Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Mon, 29 Jul 2019 22:23:51 -0300
Subject: [PATCH 31/78] chore(docs): minor alignment update to landing page
(#3779)
---
docs/pages/index.vue | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/docs/pages/index.vue b/docs/pages/index.vue
index 4f7d7e109bb..51dcf69606b 100644
--- a/docs/pages/index.vue
+++ b/docs/pages/index.vue
@@ -87,7 +87,7 @@
-
+ Bootstrap v4 is the
world's most popular framework for building responsive, mobile-first sites.
@@ -102,13 +102,14 @@
height="30px"
focusable="false"
role="img"
+ class="media-vue-logo"
>
Vue.js logo
-
+ Vue.js
(pronounced /vjuː/, like view)
is a progressive framework for building user interfaces.
@@ -494,6 +495,13 @@
text-decoration: underline;
}
}
+
+ // Add shadow to the media aside logos
+ .media {
+ svg {
+ filter: drop-shadow(1px 1px 2px #000000f0);
+ }
+ }
}
.text-vue-green {
From 6432f22ef5b38e4343a2197b01f228e99878ff1a Mon Sep 17 00:00:00 2001
From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com>
Date: Tue, 30 Jul 2019 09:49:43 +0200
Subject: [PATCH 32/78] chore(deps): update devdependency standard-version to
v7 (#3780)
---
package.json | 2 +-
yarn.lock | 190 ++++++++++++++++++++++++++++++++-------------------
2 files changed, 120 insertions(+), 72 deletions(-)
diff --git a/package.json b/package.json
index 90f46cef1c2..10b242e8d82 100644
--- a/package.json
+++ b/package.json
@@ -128,7 +128,7 @@
"rollup-plugin-commonjs": "^10.0.1",
"rollup-plugin-node-resolve": "^5.2.0",
"sass-loader": "^7.1.0",
- "standard-version": "^6.0.1",
+ "standard-version": "^7.0.0",
"terser": "^4.1.2",
"vue": "^2.6.10",
"vue-jest": "^3.0.4",
diff --git a/yarn.lock b/yarn.lock
index 80b4c533d82..b726b998333 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3418,6 +3418,15 @@ cliui@^4.0.0:
strip-ansi "^4.0.0"
wrap-ansi "^2.0.0"
+cliui@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5"
+ integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==
+ dependencies:
+ string-width "^3.1.0"
+ strip-ansi "^5.2.0"
+ wrap-ansi "^5.1.0"
+
clone-deep@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-0.3.0.tgz#348c61ae9cdbe0edfe053d91ff4cc521d790ede8"
@@ -3748,31 +3757,31 @@ conventional-changelog-codemirror@^2.0.1:
dependencies:
q "^1.5.1"
-conventional-changelog-config-spec@1.0.0:
- version "1.0.0"
- resolved "https://registry.yarnpkg.com/conventional-changelog-config-spec/-/conventional-changelog-config-spec-1.0.0.tgz#fc17bf0ab7b7f2a6b0c91bccc1bd55819d3ee79e"
- integrity sha512-RR3479x5Qw7XWkmNDYx/kOnsQJW+FZBIakURG/Dg7FkTaCrGjAkgfH96pQs9SyOEZI07USEXy7FjUDWYP8bt3Q==
+conventional-changelog-config-spec@2.0.0:
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.0.0.tgz#a9e8c9225d4a922d25f4ac501e454274ae4ad0b3"
+ integrity sha512-zQmcBP/pR8tN5MSv+nXG9hOmy+Z6rgEquBerpoEbOKTFPLoxBy/adeUUpshrMpqdZ/ycqbT2AgdTtiIu/9IHGg==
-conventional-changelog-conventionalcommits@^3.0.2:
- version "3.0.2"
- resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-3.0.2.tgz#3a380a14ecd6f5056da6d460e30dd6c0c9f1aebe"
- integrity sha512-w1+fQSDnm/7+sPKIYC5nfRVYDszt+6HdWizrigSqWFVIiiBVzkHGeqDLMSHc+Qq9qssHVAxAak5206epZyK87A==
+conventional-changelog-conventionalcommits@^4.0.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.1.0.tgz#eb7d47a9c5f1a6f9846a649482294e4ac50d7683"
+ integrity sha512-J3xolGrH8PTxpCqueHOuZtv3Cp73SQOWiBQzlsaugZAZ+hZgcJBonmC+1bQbfGs2neC2S18p2L1Gx+nTEglJTQ==
dependencies:
compare-func "^1.3.1"
q "^1.5.1"
-conventional-changelog-core@^3.2.2:
- version "3.2.2"
- resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.2.2.tgz#de41e6b4a71011a18bcee58e744f6f8f0e7c29c0"
- integrity sha512-cssjAKajxaOX5LNAJLB+UOcoWjAIBvXtDMedv/58G+YEmAXMNfC16mmPl0JDOuVJVfIqM0nqQiZ8UCm8IXbE0g==
+conventional-changelog-core@^3.2.3:
+ version "3.2.3"
+ resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-3.2.3.tgz#b31410856f431c847086a7dcb4d2ca184a7d88fb"
+ integrity sha512-LMMX1JlxPIq/Ez5aYAYS5CpuwbOk6QFp8O4HLAcZxe3vxoCtABkhfjetk8IYdRB9CDQGwJFLR3Dr55Za6XKgUQ==
dependencies:
- conventional-changelog-writer "^4.0.5"
- conventional-commits-parser "^3.0.2"
+ conventional-changelog-writer "^4.0.6"
+ conventional-commits-parser "^3.0.3"
dateformat "^3.0.0"
get-pkg-repo "^1.0.0"
git-raw-commits "2.0.0"
git-remote-origin-url "^2.0.0"
- git-semver-tags "^2.0.2"
+ git-semver-tags "^2.0.3"
lodash "^4.2.1"
normalize-package-data "^2.3.5"
q "^1.5.1"
@@ -3821,15 +3830,20 @@ conventional-changelog-preset-loader@^2.1.1:
resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.1.1.tgz#65bb600547c56d5627d23135154bcd9a907668c4"
integrity sha512-K4avzGMLm5Xw0Ek/6eE3vdOXkqnpf9ydb68XYmCc16cJ99XMMbc2oaNMuPwAsxVK6CC1yA4/I90EhmWNj0Q6HA==
-conventional-changelog-writer@^4.0.5:
- version "4.0.6"
- resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.6.tgz#24db578ac8e7c89a409ef9bba12cf3c095990148"
- integrity sha512-ou/sbrplJMM6KQpR5rKFYNVQYesFjN7WpNGdudQSWNi6X+RgyFUcSv871YBYkrUYV9EX8ijMohYVzn9RUb+4ag==
+conventional-changelog-preset-loader@^2.2.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.2.0.tgz#571e2b3d7b53d65587bea9eedf6e37faa5db4fcc"
+ integrity sha512-zXB+5vF7D5Y3Cb/rJfSyCCvFphCVmF8mFqOdncX3BmjZwAtGAPfYrBcT225udilCKvBbHgyzgxqz2GWDB5xShQ==
+
+conventional-changelog-writer@^4.0.6:
+ version "4.0.7"
+ resolved "https://registry.yarnpkg.com/conventional-changelog-writer/-/conventional-changelog-writer-4.0.7.tgz#e4b7d9cbea902394ad671f67108a71fa90c7095f"
+ integrity sha512-p/wzs9eYaxhFbrmX/mCJNwJuvvHR+j4Fd0SQa2xyAhYed6KBiZ780LvoqUUvsayP4R1DtC27czalGUhKV2oabw==
dependencies:
compare-func "^1.3.1"
conventional-commits-filter "^2.0.2"
dateformat "^3.0.0"
- handlebars "^4.1.0"
+ handlebars "^4.1.2"
json-stringify-safe "^5.0.1"
lodash "^4.2.1"
meow "^4.0.0"
@@ -3837,16 +3851,16 @@ conventional-changelog-writer@^4.0.5:
split "^1.0.0"
through2 "^3.0.0"
-conventional-changelog@3.1.8:
- version "3.1.8"
- resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.8.tgz#091382b5a0820bf8ec8e75ad2664a3688c31b07d"
- integrity sha512-fb3/DOLLrQdNqN0yYn/lT6HcNsAa9A+VTDBqlZBMQcEPPIeJIMI+DBs3yu+eiYOLi22w9oShq3nn/zN6qm1Hmw==
+conventional-changelog@3.1.9:
+ version "3.1.9"
+ resolved "https://registry.yarnpkg.com/conventional-changelog/-/conventional-changelog-3.1.9.tgz#5a6a19dadc1e4080c2db8dcddd00a6c0077c55a4"
+ integrity sha512-JbNVm1iGZ3aXxcFZjqKNDNfdgchQjSltWc8rvSniMrkHLsub9Wn20/JLdJNTBM74dt1IA2M+v/mzServ6N37YA==
dependencies:
conventional-changelog-angular "^5.0.3"
conventional-changelog-atom "^2.0.1"
conventional-changelog-codemirror "^2.0.1"
- conventional-changelog-conventionalcommits "^3.0.2"
- conventional-changelog-core "^3.2.2"
+ conventional-changelog-conventionalcommits "^4.0.0"
+ conventional-changelog-core "^3.2.3"
conventional-changelog-ember "^2.0.2"
conventional-changelog-eslint "^3.0.2"
conventional-changelog-express "^2.0.1"
@@ -3862,7 +3876,7 @@ conventional-commits-filter@^2.0.2:
lodash.ismatch "^4.4.0"
modify-values "^1.0.0"
-conventional-commits-parser@^3.0.2:
+conventional-commits-parser@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz#c3f972fd4e056aa8b9b4f5f3d0e540da18bf396d"
integrity sha512-KaA/2EeUkO4bKjinNfGUyqPTX/6w9JGshuQRik4r/wJz7rUw3+D3fDG6sZSEqJvKILzKXFQuFkpPLclcsAuZcg==
@@ -3875,17 +3889,17 @@ conventional-commits-parser@^3.0.2:
through2 "^3.0.0"
trim-off-newlines "^1.0.0"
-conventional-recommended-bump@5.0.0:
- version "5.0.0"
- resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-5.0.0.tgz#019d45a1f3d2cc14a26e9bad1992406ded5baa23"
- integrity sha512-CsfdICpbUe0pmM4MTG90GPUqnFgB1SWIR2HAh+vS+JhhJdPWvc0brs8oadWoYGhFOQpQwe57JnvzWEWU0m2OSg==
+conventional-recommended-bump@6.0.0:
+ version "6.0.0"
+ resolved "https://registry.yarnpkg.com/conventional-recommended-bump/-/conventional-recommended-bump-6.0.0.tgz#bdafad56bc32bc04d58dbbd8bd6b750375500edc"
+ integrity sha512-iIHkDOuWCC49J/E4WXvXBCCrO2NoGqwjfhm2iUOHPPEik8TVHxczt/hFaWY+4MXeZ/nC53BNfjmlr8+EXOrlvA==
dependencies:
concat-stream "^2.0.0"
- conventional-changelog-preset-loader "^2.1.1"
+ conventional-changelog-preset-loader "^2.2.0"
conventional-commits-filter "^2.0.2"
- conventional-commits-parser "^3.0.2"
+ conventional-commits-parser "^3.0.3"
git-raw-commits "2.0.0"
- git-semver-tags "^2.0.2"
+ git-semver-tags "^3.0.0"
meow "^4.0.0"
q "^1.5.1"
@@ -5526,12 +5540,13 @@ find-pkg@^0.1.0:
dependencies:
find-file-up "^0.1.2"
-find-up@3.0.0, find-up@^3.0.0:
- version "3.0.0"
- resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
- integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==
+find-up@4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19"
+ integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==
dependencies:
- locate-path "^3.0.0"
+ locate-path "^5.0.0"
+ path-exists "^4.0.0"
find-up@^1.0.0:
version "1.1.2"
@@ -5548,6 +5563,13 @@ find-up@^2.0.0, find-up@^2.1.0:
dependencies:
locate-path "^2.0.0"
+find-up@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
+ integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==
+ dependencies:
+ locate-path "^3.0.0"
+
flat-cache@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0"
@@ -5912,13 +5934,21 @@ git-repo-name@^0.6.0:
lazy-cache "^1.0.4"
remote-origin-url "^0.5.1"
-git-semver-tags@2.0.2, git-semver-tags@^2.0.2:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.2.tgz#f506ec07caade191ac0c8d5a21bdb8131b4934e3"
- integrity sha512-34lMF7Yo1xEmsK2EkbArdoU79umpvm0MfzaDkSNYSJqtM5QLAVTPWgpiXSVI5o/O9EvZPSrP4Zvnec/CqhSd5w==
+git-semver-tags@3.0.0, git-semver-tags@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-3.0.0.tgz#fe10147824657662c82efd9341f0fa59f74ddcba"
+ integrity sha512-T4C/gJ9k2Bnxz+PubtcyiMtUUKrC+Nh9Q4zaECcnmVMwJgPhrNyP/Rf+YpdRqsJbCV/+kYrCH24Xg+IeAmbOPg==
dependencies:
meow "^4.0.0"
- semver "^5.5.0"
+ semver "^6.0.0"
+
+git-semver-tags@^2.0.3:
+ version "2.0.3"
+ resolved "https://registry.yarnpkg.com/git-semver-tags/-/git-semver-tags-2.0.3.tgz#48988a718acf593800f99622a952a77c405bfa34"
+ integrity sha512-tj4FD4ww2RX2ae//jSrXZzrocla9db5h0V7ikPl1P/WwoZar9epdUhwR7XHXSgc+ZkNq72BEEerqQuicoEQfzA==
+ dependencies:
+ meow "^4.0.0"
+ semver "^6.0.0"
git-up@^4.0.0:
version "4.0.1"
@@ -6100,7 +6130,7 @@ gzip-size@^5.0.0:
duplexer "^0.1.1"
pify "^4.0.1"
-handlebars@^4.1.0, handlebars@^4.1.2:
+handlebars@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67"
integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==
@@ -7897,6 +7927,13 @@ locate-path@^3.0.0:
p-locate "^3.0.0"
path-exists "^3.0.0"
+locate-path@^5.0.0:
+ version "5.0.0"
+ resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
+ integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==
+ dependencies:
+ p-locate "^4.1.0"
+
lodash._reinterpolate@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
@@ -9034,7 +9071,7 @@ os-locale@^1.4.0:
dependencies:
lcid "^1.0.0"
-os-locale@^3.0.0, os-locale@^3.1.0:
+os-locale@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a"
integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==
@@ -9102,7 +9139,7 @@ p-limit@^1.1.0:
dependencies:
p-try "^1.0.0"
-p-limit@^2.0.0:
+p-limit@^2.0.0, p-limit@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2"
integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==
@@ -9123,6 +9160,13 @@ p-locate@^3.0.0:
dependencies:
p-limit "^2.0.0"
+p-locate@^4.1.0:
+ version "4.1.0"
+ resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07"
+ integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==
+ dependencies:
+ p-limit "^2.2.0"
+
p-reduce@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa"
@@ -9380,6 +9424,11 @@ path-exists@^3.0.0:
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=
+path-exists@^4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
+ integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
+
path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
@@ -11197,10 +11246,10 @@ semver@5.5.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==
-semver@6.0.0:
- version "6.0.0"
- resolved "https://registry.yarnpkg.com/semver/-/semver-6.0.0.tgz#05e359ee571e5ad7ed641a6eec1e547ba52dea65"
- integrity sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==
+semver@6.3.0:
+ version "6.3.0"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
+ integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2:
version "6.2.0"
@@ -11864,25 +11913,25 @@ stackframe@^1.0.4:
resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.0.4.tgz#357b24a992f9427cba6b545d96a14ed2cbca187b"
integrity sha512-to7oADIniaYwS3MhtCa/sQhrxidCCQiF/qp4/m5iN3ipf0Y7Xlri0f6eG29r08aL7JYl8n32AF3Q5GYBZ7K8vw==
-standard-version@^6.0.1:
- version "6.0.1"
- resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-6.0.1.tgz#ad50e9770b73090d2f8f692e520d906813a3cefe"
- integrity sha512-+09AwTbyLKyUwefiZSccgarp24okvH9A229NOVSpYTKWcxBxqZqdYmtQaJ8UET9mjPXRxP84vonJU4YMqCyBTQ==
+standard-version@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/standard-version/-/standard-version-7.0.0.tgz#4ce10ea5d20270ed4a32b22d15cce5fd1f1a5bbb"
+ integrity sha512-pbFXM9vutnxTkSGkqSWQeYCMYqWmFBaLUNdEc/sJDQnMgwB0Csw3CZeeDhi62VoVS3P8mQiYbvXGZWyOBWxUbw==
dependencies:
chalk "2.4.2"
- conventional-changelog "3.1.8"
- conventional-changelog-config-spec "1.0.0"
- conventional-recommended-bump "5.0.0"
+ conventional-changelog "3.1.9"
+ conventional-changelog-config-spec "2.0.0"
+ conventional-recommended-bump "6.0.0"
detect-indent "6.0.0"
detect-newline "3.0.0"
dotgitignore "2.1.0"
figures "3.0.0"
- find-up "3.0.0"
+ find-up "4.1.0"
fs-access "1.0.1"
- git-semver-tags "2.0.2"
- semver "6.0.0"
+ git-semver-tags "3.0.0"
+ semver "6.3.0"
stringify-package "1.0.0"
- yargs "13.2.2"
+ yargs "13.3.0"
state-toggle@^1.0.0:
version "1.0.2"
@@ -11983,7 +12032,7 @@ string-width@^1.0.1, string-width@^1.0.2:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"
-string-width@^3.0.0:
+string-width@^3.0.0, string-width@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==
@@ -13549,7 +13598,7 @@ yargs-parser@^11.1.1:
camelcase "^5.0.0"
decamelize "^1.2.0"
-yargs-parser@^13.0.0:
+yargs-parser@^13.1.1:
version "13.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0"
integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==
@@ -13564,22 +13613,21 @@ yargs-parser@^5.0.0:
dependencies:
camelcase "^3.0.0"
-yargs@13.2.2:
- version "13.2.2"
- resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.2.2.tgz#0c101f580ae95cea7f39d927e7770e3fdc97f993"
- integrity sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==
+yargs@13.3.0:
+ version "13.3.0"
+ resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.0.tgz#4c657a55e07e5f2cf947f8a366567c04a0dedc83"
+ integrity sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==
dependencies:
- cliui "^4.0.0"
+ cliui "^5.0.0"
find-up "^3.0.0"
get-caller-file "^2.0.1"
- os-locale "^3.1.0"
require-directory "^2.1.1"
require-main-filename "^2.0.0"
set-blocking "^2.0.0"
string-width "^3.0.0"
which-module "^2.0.0"
y18n "^4.0.0"
- yargs-parser "^13.0.0"
+ yargs-parser "^13.1.1"
yargs@^12.0.1, yargs@^12.0.2:
version "12.0.5"
From 971685060aaced1463e14cf6447021490a6d51ba Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Tue, 30 Jul 2019 10:52:14 -0300
Subject: [PATCH 33/78] feat(b-table): make sorting by formated value opt-in
per field + add TypeScript declarations for locale options (#3778)
---
src/components/table/README.md | 310 ++++++++++--------
src/components/table/helpers/mixin-sorting.js | 8 +-
src/components/table/index.d.ts | 36 +-
src/components/table/table-sorting.spec.js | 3 +-
4 files changed, 211 insertions(+), 146 deletions(-)
diff --git a/src/components/table/README.md b/src/components/table/README.md
index b4543cc61bc..34d726e8bc3 100644
--- a/src/components/table/README.md
+++ b/src/components/table/README.md
@@ -63,8 +63,8 @@ headings appear.
**Note:** Field order is not guaranteed. Fields will typically appear in the order they were defined
in the first row, but this may not always be the case depending on the version of browser in use.
-See section [Fields (column definitions)](#fields-column-definitions) below to see how to
-guarantee the order of fields, and to override the headings generated.
+See section [Fields (column definitions)](#fields-column-definitions) below to see how to guarantee
+the order of fields, and to override the headings generated.
Record data may also have additional special reserved name keys for colorizing rows and individual
cells (variants), and for triggering additional row detail. The supported optional item record
@@ -121,8 +121,8 @@ Provider functions can also be asynchronous:
array as the only argument to the callback,
- By returning a `Promise` that resolves to an array.
-See the ["Using Items Provider functions"](#using-items-provider-functions) section below for
-more details.
+See the ["Using Items Provider functions"](#using-items-provider-functions) section below for more
+details.
### Table item notes and warnings
@@ -314,27 +314,30 @@ typically be in the order they were defined in the object, although **field orde
The following field properties are recognized:
-| Property | Type | Description |
-| --------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `key` | String | The key for selecting data from the record in the items array. Required when setting the `fields` via an array of objects. |
-| `label` | String | Appears in the columns table header (and footer if `foot-clone` is set). Defaults to the field's key (in humanized format) if not provided. It's possible to use empty labels by assigning an empty string `""` but be sure you also set `headerTitle` to provide non-sighted users a hint about the column contents. |
-| `headerTitle` | String | Text to place on the fields header `
` attribute `title`. Defaults to no `title` attribute. |
-| `headerAbbr` | String | Text to place on the fields header `
` attribute `abbr`. Set this to the unabbreviated version of the label (or title) if label (or title) is an abbreviation. Defaults to no `abbr` attribute. |
-| `class` | String or Array | Class name (or array of class names) to add to `
` **and** `
` in the column. |
-| `formatter` | String or Function | A formatter callback function, can be used instead of (or in conjunction with) slots for real table fields (i.e. fields, that have corresponding data at items array). Refer to [Custom Data Rendering](#custom-data-rendering) for more details. |
-| `sortable` | Boolean | Enable sorting on this column. Refer to the [Sorting](#sorting) Section for more details. |
-| `sortDirection` | String | Set the initial sort direction on this column when it becomes sorted. Refer to the [Change initial sort direction](#Change-initial-sort-direction) Section for more details. |
-| `tdClass` | String or Array or Function | Class name (or array of class names) to add to `
` data `
` cells in the column. If custom classes per cell are required, a callback function can be specified instead. |
-| `thClass` | String or Array | Class name (or array of class names) to add to ``/`
` heading `
` cell. |
-| `thStyle` | Object | JavaScript object representing CSS styles you would like to apply to the table ``/`
` field `
`. |
-| `variant` | String | Apply contextual class to all the `
` **and** `
` in the column - `active`, `success`, `info`, `warning`, `danger`. These variants map to classes `thead-${variant}` (in the header), `table-${variant}` (in the body), or `bg-${variant}` (when table prop `dark` is set). |
-| `tdAttr` | Object or Function | JavaScript object representing additional attributes to apply to the `
` field `
` cell. If custom attributes per cell are required, a callback function can be specified instead. |
-| `isRowHeader` | Boolean | When set to `true`, the field's item data cell will be rendered with `
` rather than the default of `
`. |
+| Property | Type | Description |
+| ----------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `key` | String | The key for selecting data from the record in the items array. Required when setting the `fields` via an array of objects. |
+| `label` | String | Appears in the columns table header (and footer if `foot-clone` is set). Defaults to the field's key (in humanized format) if not provided. It's possible to use empty labels by assigning an empty string `""` but be sure you also set `headerTitle` to provide non-sighted users a hint about the column contents. |
+| `headerTitle` | String | Text to place on the fields header `
` attribute `title`. Defaults to no `title` attribute. |
+| `headerAbbr` | String | Text to place on the fields header `
` attribute `abbr`. Set this to the unabbreviated version of the label (or title) if label (or title) is an abbreviation. Defaults to no `abbr` attribute. |
+| `class` | String or Array | Class name (or array of class names) to add to `
` **and** `
` in the column. |
+| `formatter` | String or Function | A formatter callback function, can be used instead of (or in conjunction with) slots for real table fields (i.e. fields, that have corresponding data at items array). Refer to [Custom Data Rendering](#custom-data-rendering) for more details. |
+| `sortable` | Boolean | Enable sorting on this column. Refer to the [Sorting](#sorting) Section for more details. |
+| `sortDirection` | String | Set the initial sort direction on this column when it becomes sorted. Refer to the [Change initial sort direction](#Change-initial-sort-direction) Section for more details. |
+| `sortByFormatted` | Boolean | NEW in 2.0.0-rc.28 Sort the column by the result of the field's `formatter` callback function. Default is `false`. Has no effect if the field does not have a `formatter`. Refer to the [Sorting](#sorting) Section for more details. |
+| `tdClass` | String or Array or Function | Class name (or array of class names) to add to `
` data `
` cells in the column. If custom classes per cell are required, a callback function can be specified instead. |
+| `thClass` | String or Array | Class name (or array of class names) to add to ``/`
` heading `
` cell. |
+| `thStyle` | Object | JavaScript object representing CSS styles you would like to apply to the table ``/`
` field `
`. |
+| `variant` | String | Apply contextual class to all the `
` **and** `
` in the column - `active`, `success`, `info`, `warning`, `danger`. These variants map to classes `thead-${variant}` (in the header), `table-${variant}` (in the body), or `bg-${variant}` (when table prop `dark` is set). |
+| `tdAttr` | Object or Function | JavaScript object representing additional attributes to apply to the `
` field `
` cell. If custom attributes per cell are required, a callback function can be specified instead. |
+| `isRowHeader` | Boolean | When set to `true`, the field's item data cell will be rendered with `
` rather than the default of `
`. |
**Notes:**
- Field properties, if not present, default to `null` (falsey) unless otherwise stated above.
-- `class`, `thClass`, `tdClass` etc. will not work with classes that are defined in scoped CSS.
+- `class`, `thClass`, `tdClass` etc. will not work with classes that are defined in scoped CSS,
+ unless you are using VueLoader's
+ [Deep selector](https://vue-loader.vuejs.org/guide/scoped-css.html#child-component-root-elements).
- For information on the syntax supported by `thStyle`, see
[Class and Style Bindings](https://vuejs.org/v2/guide/class-and-style.html#Binding-Inline-Styles)
in the Vue.js guide.
@@ -399,21 +402,21 @@ place a unique `:key` on your element/components in your custom formatted field
`` provides several props to alter the style of the table:
-| prop | Type | Description |
-| ------------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `striped` | Boolean | Add zebra-striping to the table rows within the `` |
-| `bordered` | Boolean | For borders on all sides of the table and cells. |
-| `borderless` | Boolean | removes inner borders from table. |
-| `outlined` | Boolean | For a thin border on all sides of the table. Has no effect if `bordered` is set. |
-| `small` | Boolean | To make tables more compact by cutting cell padding in half. |
-| `hover` | Boolean | To enable a hover highlighting state on table rows within a `` |
-| `dark` | Boolean | Invert the colors — with light text on dark backgrounds (equivalent to Bootstrap v4 class `.table-dark`) |
-| `fixed` | Boolean | Generate a table with equal fixed-width columns (`table-layout: fixed;`) |
+| prop | Type | Description |
+| ------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `striped` | Boolean | Add zebra-striping to the table rows within the `` |
+| `bordered` | Boolean | For borders on all sides of the table and cells. |
+| `borderless` | Boolean | removes inner borders from table. |
+| `outlined` | Boolean | For a thin border on all sides of the table. Has no effect if `bordered` is set. |
+| `small` | Boolean | To make tables more compact by cutting cell padding in half. |
+| `hover` | Boolean | To enable a hover highlighting state on table rows within a `` |
+| `dark` | Boolean | Invert the colors — with light text on dark backgrounds (equivalent to Bootstrap v4 class `.table-dark`) |
+| `fixed` | Boolean | Generate a table with equal fixed-width columns (`table-layout: fixed;`) |
| `responsive` | Boolean or String | Generate a responsive table to make it scroll horizontally. Set to `true` for an always responsive table, or set it to one of the breakpoints `'sm'`, `'md'`, `'lg'`, or `'xl'` to make the table responsive (horizontally scroll) only on screens smaller than the breakpoint. See [Responsive tables](#responsive-tables) below for details. |
| `stacked` | Boolean or String | Generate a responsive stacked table. Set to `true` for an always stacked table, or set it to one of the breakpoints `'sm'`, `'md'`, `'lg'`, or `'xl'` to make the table visually stacked only on screens smaller than the breakpoint. See [Stacked tables](#stacked-tables) below for details. |
-| `head-variant` | String | Use `'light'` or `'dark'` to make table header appear light or dark gray, respectively |
-| `foot-variant` | String | Use `'light'` or `'dark'` to make table footer appear light or dark gray, respectively. If not set, `head-variant` will be used. Has no effect if `foot-clone` is not set |
-| `foot-clone` | Boolean | Turns on the table footer, and defaults with the same contents a the table header |
+| `head-variant` | String | Use `'light'` or `'dark'` to make table header appear light or dark gray, respectively |
+| `foot-variant` | String | Use `'light'` or `'dark'` to make table footer appear light or dark gray, respectively. If not set, `head-variant` will be used. Has no effect if `foot-clone` is not set |
+| `foot-clone` | Boolean | Turns on the table footer, and defaults with the same contents a the table header |
| `no-footer-sorting` | Boolean | When `foot-clone` is true and the table is sortable, disables the sorting icons and click behaviour on the footer heading cells. Refer to the [Sorting](#sorting) section below for more details. |
**Example: Basic table styles**
@@ -783,8 +786,8 @@ the table's busy state is `true`. The slot will be placed in a `
` element wi
```
-Also see the [Using Items Provider Functions](#using-items-provider-functions) below for
-additional information on the `busy` state.
+Also see the [Using Items Provider Functions](#using-items-provider-functions) below for additional
+information on the `busy` state.
**Notes:**
@@ -1016,9 +1019,10 @@ formatted value as a string (HTML strings are not supported)
It is also possible to provide custom rendering for the tables `thead` and `tfoot` elements. Note by
default the table footer is not rendered unless `foot-clone` is set to `true`.
-Scoped slots for the header and footer cells uses a special naming convention of `'HEAD[]'`
-and `'FOOT[]'` respectively. if a `'FOOT[...]'` slot for a field is not provided, but a
-`'HEAD[...]'` slot is provided, then the footer will use the `'HEAD[...]'` slot content.
+Scoped slots for the header and footer cells uses a special naming convention of
+`'HEAD[]'` and `'FOOT[]'` respectively. if a `'FOOT[...]'` slot for a field is
+not provided, but a `'HEAD[...]'` slot is provided, then the footer will use the `'HEAD[...]'` slot
+content.
NEW in 2.0.0-rc.28 You can use a default _fall-back_
scoped slot `'HEAD[]'` or `'FOOT[]'` to format any header or footer cells that do not have an
@@ -1126,20 +1130,20 @@ is inserted before the header cells row, and is not encapsulated by `
..
data() {
return {
items: [
- { name: "Stephen Hawking", id: 1, type1: false, type2a: true, type2b: false, type2c: false, type3: false },
- { name: "Johnny Appleseed", id: 2, type1: false, type2a: true, type2b: true, type2c: false, type3: false },
- { name: "George Washington", id: 3, type1: false, type2a: false, type2b: false, type2c: false, type3: true },
- { name: "Albert Einstein", id: 4, type1: true, type2a: false, type2b: false, type2c: true, type3: false },
- { name: "Isaac Newton", id: 5, type1: true, type2a: true, type2b: false, type2c: true, type3: false },
+ { name: 'Stephen Hawking', id: 1, type1: false, type2a: true, type2b: false, type2c: false, type3: false },
+ { name: 'Johnny Appleseed', id: 2, type1: false, type2a: true, type2b: true, type2c: false, type3: false },
+ { name: 'George Washington', id: 3, type1: false, type2a: false, type2b: false, type2c: false, type3: true },
+ { name: 'Albert Einstein', id: 4, type1: true, type2a: false, type2b: false, type2c: true, type3: false },
+ { name: 'Isaac Newton', id: 5, type1: true, type2a: true, type2b: false, type2c: true, type3: false },
],
fields: [
- "name",
- { key: "id", label: "ID" },
- { key: "type1", label: "Type 1" },
- { key: "type2a", label: "Type 2A" },
- { key: "type2b", label: "Type 2B" },
- { key: "type2c", label: "Type 2C" },
- { key: "type3", label: "Type 3" }
+ 'name',
+ { key: 'id', label: 'ID' },
+ { key: 'type1', label: 'Type 1' },
+ { key: 'type2a', label: 'Type 2A' },
+ { key: 'type2b', label: 'Type 2B' },
+ { key: 'type2c', label: 'Type 2C' },
+ { key: 'type3', label: 'Type 3' }
]
}
}
@@ -1399,72 +1403,6 @@ When the prop `foot-clone` is set, the footer headings will also allow sorting b
you have custom formatted footer field headers. To disable the sort icons and sorting via heading
clicks in the footer, set the `no-footer-sorting` prop to true.
-The internal sort-compare routine uses `String.prototype.localeCompare()` for comparing the
-stringified column value (if value type is not `Number` or `Date`). `localeCompare()` accepts a
-`locale` string and an `options` object for controlling how strings are sorted. The default options
-used is `{ numeric: true }`, and locale is `undefined` (which uses the browser default locale).
-
-NEW in v2.0.0-rc.25 You can change the locale via the
-`sort-compare-locale` prop to set the locale for sorting, as well as pass sort options via the
-`sort-compare-options` prop. Valid sort option properties are:
-
-- `localeMatcher`: The locale matching algorithm to use. Possible values are `'lookup'` and
- `'best fit'`. The default is `'best fit'`. For information about this option, see the
- [MDN Intl page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation)
- for details.
-- `sensitivity`: Which differences in the strings should lead to non-zero compare result values.
- Possible values are:
- - `'base'`: Only strings that differ in base letters compare as unequal. Examples: `a ≠ b`,
- `a = á`, `a = A`.
- - `'accent'`: Only strings that differ in base letters or accents and other diacritic marks
- compare as unequal. Examples: `a ≠ b`, `a ≠ á`, `a = A`.
- - `'case'`: Only strings that differ in base letters or case compare as unequal. Examples:
- `a ≠ b`, `a = á`, `a ≠ A`.
- - `'variant'`: **(default)** Strings that differ in base letters, accents and other diacritic
- marks, or case compare as unequal. Other differences may also be taken into consideration.
- Examples: `a ≠ b`, `a ≠ á`, `a ≠ A`.
-- `ignorePunctuation`: Whether punctuation should be ignored. Possible values are `true` and
- `false`. The default is `false`.
-- `numeric`: Whether numeric collation should be used, such that `'1' < '2' < '10'`. Possible values
- are `true` and `false`. The default is `false`. Implementations are not required to support this
- property.
-- `caseFirst`: Whether upper case or lower case should sort first. Possible values are `'upper'`,
- `'lower'`, or `'false'` (use the locale's default). The default is `'false'`. Implementations are
- not required to support this property.
-- `'usage'`: Always set to `'sort'` by ``
-
-**Example 1:** If you want to sort German words, set `sort-compare-locale="de"` (in German, `ä`
-sorts _before_ `z`) or Swedish set `sort-compare-locale="sv"` (in Swedish, `ä` sorts _after_ `z`)
-
-**Example 2:** To compare numbers that are strings numerically, and to ignore case and accents:
-
-```html
-
-```
-
-**Notes:**
-
-- The built-in `sort-compare` routine **cannot** sort sort based on the custom rendering of the
- field data (scoped slots are used only for presentation only, and do not affect the underlying
- data).
-- NEW in v2.0.0-rc.25 Fields that have a
- [`formatter` function](#formatter-callback) (virtual field or regular field) will be sorted by the
- value returned via the formatter function.
-- Refer to
- [MDN `String.prototype.localeCompare()` documentation](https://developer.mozilla.org/enUS/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)
- for details on the options object property values.
-- Refer to
- [MDN locales documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument)
- for details on locale values.
-- Not all browsers (or Node.js) support the `locale` and `options` with
- `String.prototype.localeCompare()`. Refer to [Can I Use](https://caniuse.com/#feat=localecompare)
- for browser support. For Node.js, you may need to add in
- [Intl support](https://nodejs.org/api/intl.html) for handling locales, other than the default, to
- prevent [SSR hydration mismatch](https://ssr.vuejs.org/guide/hydration.html) errors.
-
-Refer to the [Sort-compare routine](#sort-compare-routine) section below for details on sorting
-by presentational data.
-
```html
@@ -1513,15 +1451,100 @@ by presentational data.
ENHANCED in v2.0.0-rc.25
-The built-in default `sort-compare` function sorts the specified field `key` based on the data in
-the underlying record object (formatted value if a field has a formatter function). The field value
-is first stringified if it is an object, and then sorted.
+The internal built-in default `sort-compare` function sorts the specified field `key` based on the
+data in the underlying record object (or by formatted value if a field has a formatter function, and
+the field has its `sortByFormatted` property is set to `true`). The field value is first stringified
+if it is an object and then sorted.
+
+**Notes:**
+
+- The built-in `sort-compare` routine **cannot** sort sort based on the custom rendering of the
+ field data: scoped slots are used only for _presentation only_, and do not affect the underlying
+ data.
+- NEW in v2.0.0-rc.25
+ CHANGED in v2.0.0-rc.28 Fields that have a
+ [`formatter` function](#formatter-callback) (virtual field or regular field) can be sorted by the
+ value returned via the formatter function if the [field](#field-definition-reference) property
+ `sortByFormatted` is set to `true`. The default is `false` which will sort by the original field
+ value. This is only applicable for the built-in sort-compare routine.
+
+For customizing the sort-compare handling, refer to the
+[Custom sort-compare routine](#custom-sort-compare-routine) section below.
-The default `sort-compare` routine **cannot** sort based on the custom rendering of the field data
-(scoped slots are used only for presentation). For this reason, you can provide your own custom sort
-compare routine by passing a function reference to the prop `sort-compare`.
+### Internal sorting and locale handling
-The `sort-compare` routine is passed seven (7) arguments:
+The internal sort-compare routine uses
+[`String.prototype.localeCompare()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)
+for comparing the stringified column value (if values being compared are not both `Number` or both
+`Date` types). The browser native `localeCompare()` method accepts a `locale` string (or array of
+strings) and an `options` object for controlling how strings are sorted. The default options used is
+`{ numeric: true }`, and the locale is `undefined` (which uses the browser default locale).
+
+NEW in v2.0.0-rc.25 You can change the locale (or
+locales) via the `sort-compare-locale` prop to set the locale(s) for sorting, as well as pass sort
+options via the `sort-compare-options` prop.
+
+The `sort-compare-locale` prop defaults to `undefined`, which uses the browser (or Node.js runtime)
+default locale. The prop `sort-compare-locale` can either accept a
+[BCP 47 language tag](http://tools.ietf.org/html/rfc5646) string or an array of such tags. For more
+details on locales, please see
+[Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation)
+on MDN.
+
+The `sort-compare-options` prop accepts an object containing any of the following properties:
+
+- `localeMatcher`: The locale matching algorithm to use. Possible values are `'lookup'` and
+ `'best fit'`. The default is `'best fit'`. For information about this option, see the
+ [MDN Intl page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation)
+ for details.
+- `sensitivity`: Which differences in the strings should lead to _non-zero_ compare result values.
+ Possible values are:
+ - `'base'`: Only strings that differ in base letters compare as unequal. Examples: `a ≠ b`,
+ `a = á`, `a = A`.
+ - `'accent'`: Only strings that differ in base letters or accents and other diacritic marks
+ compare as unequal. Examples: `a ≠ b`, `a ≠ á`, `a = A`.
+ - `'case'`: Only strings that differ in base letters or case compare as unequal. Examples:
+ `a ≠ b`, `a = á`, `a ≠ A`.
+ - `'variant'`: **(default)** Strings that differ in base letters, accents and other diacritic
+ marks, or case compare as unequal. Other differences _may also_ be taken into consideration.
+ Examples: `a ≠ b`, `a ≠ á`, `a ≠ A`.
+- `ignorePunctuation`: Whether punctuation should be ignored. Possible values are `true` and
+ `false`. The default is `false`.
+- `numeric`: Whether numeric collation should be used, such that `'1' < '2' < '10'`. Possible values
+ are `true` and `false`. The default is `false`. Note that implementations (browsers, runtimes) are
+ not required to support this property, and therefore it might be ignored.
+- `caseFirst`: Whether upper case or lower case should sort first. Possible values are `'upper'`,
+ `'lower'`, or `'false'` (use the locale's default). The default is `'false'`. Implementations are
+ not required to support this property.
+- `'usage'`: **Always** set to `'sort'` by ``
+
+**Example 1:** If you want to sort German words, set `sort-compare-locale="de"` (in German, `ä`
+sorts _before_ `z`) or Swedish set `sort-compare-locale="sv"` (in Swedish, `ä` sorts _after_ `z`)
+
+**Example 2:** To compare numbers that are strings numerically, and to ignore case and accents:
+
+```html
+
+```
+
+**Notes:**
+
+- Refer to
+ [MDN `String.prototype.localeCompare()` documentation](https://developer.mozilla.org/enUS/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)
+ for details on the options object property values.
+- Refer to
+ [MDN locales documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument)
+ for details on locale values.
+- Not all browsers (or Node.js) support the `locale` and `options` with
+ `String.prototype.localeCompare()`. Refer to [Can I Use](https://caniuse.com/#feat=localecompare)
+ for browser support. For Node.js, you may need to add in
+ [Intl support](https://nodejs.org/api/intl.html) for handling locales, other than the default, to
+ prevent [SSR hydration mismatch errors](https://ssr.vuejs.org/guide/hydration.html).
+
+### Custom sort-compare routine
+
+You can provide your own custom sort compare routine by passing a function reference to the prop
+`sort-compare`. The `sort-compare` routine is passed seven (7) arguments:
- the first two arguments (`a` and `b`) are the _record objects_ for the rows being compared
- the third argument is the field `key` being sorted on (`sortBy`)
@@ -1529,7 +1552,8 @@ The `sort-compare` routine is passed seven (7) arguments:
for descending, `false` for ascending)
- the fifth argument is a reference to the field's [formatter function](#formatter-callback) (or
`undefined` if no field formatter). You will need to call this method to get the formatted field
- value: `val = formatter(a[key], key, a)`
+ value: `valA = formatter(a[key], key, a)` and `valB = formatter(b[key], key, b)`, if you need to
+ sort by the formatted value.
- the sixth argument is the value of the `sort-compare-options` prop (default is
`{ numeric: true }`)
- the seventh argument is the value of the `sort-compare-locale` prop (default is `undefined`)
@@ -1538,14 +1562,19 @@ The sixth and seventh arguments can be used if you are using the
[`String.prototype.localeCompare()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)
method to compare strings.
-The routine should always return either `-1` for `a[key] < b[key]` , `0` for `a[key] === b[key]`, or
-`1` for `a[key] > b[key]` (the fourth argument, sorting direction, should not normally be used, as
-`b-table` will handle the direction, and is typically only needed when special handling of how
-`null` values are sorted). Your custom sort-compare routine can also return `null` or `false` to
-fall back to the _built-in sort-compare routine_ for the particular `key`. You can use this feature
-(i.e. by returning `null`) to have your custom sort-compare routine handle only certain fields
-(keys) such as the special case of virtual (scoped slot) columns, and have the internal sort-compare
-handle all other fields.
+In most typical situations, you only need to use the first three arguments. The fourth argument -
+sorting direction - should not normally be used, as `b-table` will handle the direction, and this
+value is typically only needed when special handling of how `null` and/or `undefined` values are
+sorted.
+
+The routine should return either `-1` (or a negative value) for `a[key] < b[key]` , `0` for
+`a[key] === b[key]`, or `1` (or a positive value) for `a[key] > b[key]`.
+
+Your custom sort-compare routine can also return `null` or `false`, to fall back to the _built-in
+sort-compare routine_ for the particular `key`. You can use this feature (i.e. by returning `null`)
+to have your custom sort-compare routine handle _only_ certain fields (keys) such as the special
+case of virtual (scoped slot) columns, and have the internal (built in) sort-compare handle all
+other fields.
The default sort-compare routine works similar to the following. Note the fourth argument (sorting
direction) is **not** used in the sort comparison:
@@ -1554,13 +1583,13 @@ direction) is **not** used in the sort comparison:
```js
function sortCompare(aRow, bRow, key) {
- const a = aRow[key] // or use Lodash _.get()
+ const a = aRow[key] // or use Lodash `_.get()`
const b = bRow[key]
if (
(typeof a === 'number' && typeof b === 'number') ||
(a instanceof Date && b instanceof Date)
) {
- // If both compared fields are native numbers or both are dates
+ // If both compared fields are native numbers or both are native dates
return a < b ? -1 : a > b ? 1 : 0
} else {
// Otherwise stringify the field data and use String.prototype.localeCompare
@@ -1599,6 +1628,8 @@ with a single argument containing the context object of ``. See the
[Detection of sorting change](#detection-of-sorting-change) section below for details about the
sort-changed event and the context object.
+When `no-local-sorting` is true, the `sort-compare` prop has no effect.
+
### Change initial sort direction
Control the order in which ascending and descending sorting is applied when a sortable column header
@@ -1617,7 +1648,7 @@ unsorted to sorted), specify the property `sortDirection` in `fields`. See the
## Filtering
Filtering, when used, is applied to the **original items** array data, and hence it is not currently
-possible to filter data based on custom rendering of virtual columns.
+possible to filter data based on custom rendering or formatting of virtual columns.
### Built in filtering
@@ -1771,8 +1802,8 @@ table#table-transition-example .flip-list-move {
## Using items provider functions
-As mentioned under the [Items](#items-record-data) prop section, it is possible to use a
-function to provide the row data (items), by specifying a function reference via the `items` prop.
+As mentioned under the [Items](#items-record-data) prop section, it is possible to use a function to
+provide the row data (items), by specifying a function reference via the `items` prop.
The provider function is called with the following signature:
@@ -1995,8 +2026,7 @@ export default {
```
You can also obtain the current sortBy and sortDesc values by using the `:sort-by.sync` and
-`:sort-desc.sync` two-way props respectively (see section [Sorting](#sorting) above for
-details).
+`:sort-desc.sync` two-way props respectively (see section [Sorting](#sorting) above for details).
```html
diff --git a/src/components/table/helpers/mixin-sorting.js b/src/components/table/helpers/mixin-sorting.js
index 18db1be863e..06113faec02 100644
--- a/src/components/table/helpers/mixin-sorting.js
+++ b/src/components/table/helpers/mixin-sorting.js
@@ -37,7 +37,9 @@ export default {
}
},
sortCompareLocale: {
- type: String
+ // String: locale code
+ // Array: array of Locale strings
+ type: [String, Array]
// default: undefined
},
noSortReset: {
@@ -93,7 +95,9 @@ export default {
const sortOptions = { ...this.sortCompareOptions, usage: 'sort' }
const sortLocale = this.sortCompareLocale || undefined
if (sortBy && localSorting) {
- const formatter = this.getFieldFormatter(sortBy)
+ const field = this.computedFieldsObj[sortBy]
+ const formatter =
+ field && field.sortByFormatted ? this.getFieldFormatter(sortBy) : undefined
// stableSort returns a new array, and leaves the original array intact
return stableSort(items, (a, b) => {
let result = null
diff --git a/src/components/table/index.d.ts b/src/components/table/index.d.ts
index 8f850dc654c..750423b4258 100644
--- a/src/components/table/index.d.ts
+++ b/src/components/table/index.d.ts
@@ -22,6 +22,8 @@ export declare class BTable extends BvComponent {
sortDesc?: boolean
sortDirection?: BvTableSortDirection
sortCompare?: BvTableSortCompareCallback
+ sortCompareLocale?: string | Array
+ sortCompareOptions?: BvTableLocaleCompareOptions
perPage?: number | string
currentPage?: number | string
filter?: string | Array | RegExp | object | any
@@ -59,7 +61,32 @@ export type BvTableTbodyTrClassCallback = ((item: any, type: string) => any)
export type BvTableFilterCallback = ((item: any, filter: any) => boolean)
-export type BvTableSortCompareCallback = ((a: any, b: any, field: string) => any)
+export type BvTableLocaleCompareOptionLocaleMatcher = 'lookup' | 'best fit'
+
+export type BvTableLocaleCompareOptionSensitivity = 'base' | 'accent' | 'case' | 'variant'
+
+export type BvTableLocaleCompareOptionCaseFirst = 'upper' | 'lower' | 'false'
+
+export type BvTableLocaleCompareOptionUsage = 'sort'
+
+export interface BvTableLocaleCompareOptions {
+ ignorePunctuation?: boolean
+ numeric?: boolean
+ localeMatcher?: BvTableLocaleCompareOptionLocaleMatcher
+ sensitivity?: BvTableLocaleCompareOptionSensitivity
+ caseFirst?: BvTableLocaleCompareOptionCaseFirst
+ usage?: BvTableLocaleCompareOptionUsage
+}
+
+export type BvTableSortCompareCallback = ((
+ a: any,
+ b: any,
+ field: string,
+ sortDesc?: boolean,
+ formatter?: BvTableFormatterCallback | undefined | null,
+ localeOptions?: BvTableLocaleCompareOptions,
+ locale?: string | Array | undefined | null
+) => number | boolean | null | undefined)
export interface BvTableCtxObject {
currentPage: number
@@ -71,8 +98,10 @@ export interface BvTableCtxObject {
[key: string]: any
}
+export type BvTableProviderPromiseResult = Array | null
+
export interface BvTableProviderCallback {
- (ctx: BvTableCtxObject): any
+ (ctx: BvTableCtxObject): Array | Promise | any
(ctx: BvTableCtxObject, callback: () => Array): null
}
@@ -84,7 +113,8 @@ export interface BvTableField {
formatter?: string | BvTableFormatterCallback
sortable?: boolean
sortDirection?: BvTableSortDirection
- tdClass?: string | string[] | BvTableFormatterCallback
+ sortByFormatted?: boolean
+ tdClass?: string | string[] | ((value: any, key: string, item: any) => any)
thClass?: string | string[]
thStyle?: any
variant?: BvTableVariant | string
diff --git a/src/components/table/table-sorting.spec.js b/src/components/table/table-sorting.spec.js
index 549f898f6d1..247347da3eb 100644
--- a/src/components/table/table-sorting.spec.js
+++ b/src/components/table/table-sorting.spec.js
@@ -707,7 +707,8 @@ describe('table > sorting', () => {
sortable: true,
formatter(value, key, item) {
return item.a - item.b
- }
+ },
+ sortByFormatted: true
}
],
// Initialy unsorted
From 4e12069abe08dc82cb9bdc333ec595b9dbf7146f Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Tue, 30 Jul 2019 13:13:34 -0300
Subject: [PATCH 34/78] chore: fix prettier warning in docs/pages/index.vue
---
docs/pages/index.vue | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/pages/index.vue b/docs/pages/index.vue
index 51dcf69606b..77acb886296 100644
--- a/docs/pages/index.vue
+++ b/docs/pages/index.vue
@@ -43,10 +43,10 @@
-->
-
+
-
+
-
+
From bcb132e3eb9c812c4e9e9ea7fdc7fa2e731242e4 Mon Sep 17 00:00:00 2001
From: Troy Morehouse
Date: Tue, 30 Jul 2019 17:29:47 -0300
Subject: [PATCH 35/78] chore(docs): minor updates to the toast, modal and
form-select docs (#3785)
---
CHANGELOG.md | 4 ++--
docs/assets/scss/styles.scss | 2 +-
.../reference/accessibility/README.md | 6 +++---
src/_variables.scss | 8 ++++----
src/components/form-select/README.md | 18 ++++++++++++++++++
src/components/form-textarea/README.md | 7 +++----
src/components/modal/README.md | 19 +++++++++++--------
src/components/modal/package.json | 3 +++
src/components/toast/README.md | 9 +++++----
src/components/toast/_toast.scss | 2 +-
src/components/toast/package.json | 3 +++
11 files changed, 54 insertions(+), 27 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ba791775076..3f6eda6e6ad 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -39,8 +39,8 @@ Released: 2019-07-21
options (addresses [#3712](https://github.com/bootstrap-vue/bootstrap-vue/issues/3712))
([#3715](https://github.com/bootstrap-vue/bootstrap-vue/issues/3715))
([1ce8c6d](https://github.com/bootstrap-vue/bootstrap-vue/commit/1ce8c6d))
-- **b-tabs:** new named slot `tabs-start` for prepending tab buttons, deprecates `tabs` slot in favour
- of `tabs-end` (closes [#3678](https://github.com/bootstrap-vue/bootstrap-vue/issues/3678))
+- **b-tabs:** new named slot `tabs-start` for prepending tab buttons, deprecates `tabs` slot in
+ favour of `tabs-end` (closes [#3678](https://github.com/bootstrap-vue/bootstrap-vue/issues/3678))
([#3679](https://github.com/bootstrap-vue/bootstrap-vue/issues/3679))
([0b5f552](https://github.com/bootstrap-vue/bootstrap-vue/commit/0b5f552))
- minor code improvements ([#3682](https://github.com/bootstrap-vue/bootstrap-vue/issues/3682))
diff --git a/docs/assets/scss/styles.scss b/docs/assets/scss/styles.scss
index 371d0d5fd3d..cf75a0b08ff 100644
--- a/docs/assets/scss/styles.scss
+++ b/docs/assets/scss/styles.scss
@@ -63,7 +63,7 @@
}
.bd-navbar {
- box-shadow: 0 0.25rem 0.25rem rgba(0,0,0,.25), inset 0 -1px 5px rgba(0,0,0,.25);
+ box-shadow: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.25), inset 0 -1px 5px rgba(0, 0, 0, 0.25);
}
.bd-toc {
diff --git a/docs/markdown/reference/accessibility/README.md b/docs/markdown/reference/accessibility/README.md
index e7e58711b5e..9c25e407d33 100644
--- a/docs/markdown/reference/accessibility/README.md
+++ b/docs/markdown/reference/accessibility/README.md
@@ -11,9 +11,9 @@ depends in large part on the author's markup, additional styling, and scripting
However, provided that these have been implemented correctly, it should be perfectly possible to
create websites and applications with BootstrapVue that fulfill
- WCAG 2.0
-(A/AA/AAA), Section 508
-and similar accessibility standards and requirements.
+WCAG 2.0 (A/AA/AAA),
+Section 508 and similar
+accessibility standards and requirements.
## Structural markup
diff --git a/src/_variables.scss b/src/_variables.scss
index d4b671ce25f..436ae2ab282 100644
--- a/src/_variables.scss
+++ b/src/_variables.scss
@@ -51,7 +51,7 @@ $b-tooltip-bg-level: 0 !default;
// Deprecated
$bv-tooltip-bg-level: null !default;
@if $bv-tooltip-bg-level {
- @warn("Variable '\$bv-tooltip-bg-level' has been deprecated. Use '\$b-tooltip-bg-level' instead.");
+ @warn ("Variable '\$bv-tooltip-bg-level' has been deprecated. Use '\$b-tooltip-bg-level' instead.");
$b-tooltip-bg-level: $bv-tooltip-bg-level;
}
@@ -67,16 +67,16 @@ $b-popover-color-level: $alert-color-level !default;
// Deprecated
$bv-popover-bg-level: null !default;
@if $bv-popover-bg-level {
- @warn("Variable '\$bv-popover-bg-level' has been deprecated. Use '\$b-popover-bg-level' instead.");
+ @warn ("Variable '\$bv-popover-bg-level' has been deprecated. Use '\$b-popover-bg-level' instead.");
$b-popover-bg-level: $bv-popover-bg-level;
}
$bv-popover-border-level: null !default;
@if $bv-popover-border-level {
- @warn("Variable '\$bv-popover-border-level' has been deprecated. Use '\$b-popover-border-level' instead.");
+ @warn ("Variable '\$bv-popover-border-level' has been deprecated. Use '\$b-popover-border-level' instead.");
$b-popover-border-level: $bv-popover-border-level;
}
$bv-popover-color-level: null !default;
@if $bv-popover-color-level {
- @warn("Variable '\$bv-popover-color-level' has been deprecated. Use '\$b-popover-color-level' instead.");
+ @warn ("Variable '\$bv-popover-color-level' has been deprecated. Use '\$b-popover-color-level' instead.");
$b-popover-color-level: $bv-popover-color-level;
}
diff --git a/src/components/form-select/README.md b/src/components/form-select/README.md
index da05be88c38..f204fce7c01 100644
--- a/src/components/form-select/README.md
+++ b/src/components/form-select/README.md
@@ -226,6 +226,24 @@ const options = [
**Note:** When using the [Object](#object) format, the order of the final array is **not**
guaranteed. For this reason, it is recommended to use the above array formats.
+### Option notes
+
+If the initial value of your `v-model` expression does not match any of the options, the
+`` component (which is a native HTML5 `