@gitlab/ui 96.3.0 → 97.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/components/base/alert/alert.js +1 -1
- package/dist/components/base/avatar/avatar.js +4 -4
- package/dist/components/base/datepicker/datepicker.js +1 -1
- package/dist/components/base/drawer/drawer.js +1 -1
- package/dist/components/base/form/form_input/form_input.js +3 -3
- package/dist/components/base/form/form_select/form_select.js +3 -3
- package/dist/components/base/progress_bar/progress_bar.js +47 -5
- package/dist/components/base/toast/toast.js +1 -1
- package/dist/components/base/token/token.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/utils/number_utils.js +9 -1
- package/dist/vendor/bootstrap-vue/src/constants/components.js +1 -3
- package/dist/vendor/bootstrap-vue/src/index.js +0 -2
- package/package.json +7 -7
- package/src/components/base/alert/alert.vue +1 -1
- package/src/components/base/avatar/avatar.vue +4 -4
- package/src/components/base/datepicker/datepicker.vue +1 -1
- package/src/components/base/drawer/drawer.vue +1 -1
- package/src/components/base/form/form_input/form_input.vue +3 -3
- package/src/components/base/form/form_select/form_select.vue +3 -3
- package/src/components/base/modal/modal.scss +1 -2
- package/src/components/base/progress_bar/progress_bar.md +25 -0
- package/src/components/base/progress_bar/progress_bar.scss +11 -0
- package/src/components/base/progress_bar/progress_bar.vue +54 -5
- package/src/components/base/toast/toast.js +1 -1
- package/src/components/base/token/token.vue +1 -1
- package/src/utils/number_utils.js +7 -0
- package/src/vendor/bootstrap-vue/package.json +3 -42
- package/src/vendor/bootstrap-vue/src/components/badge/README.md +2 -2
- package/src/vendor/bootstrap-vue/src/components/breadcrumb/README.md +2 -2
- package/src/vendor/bootstrap-vue/src/components/button/README.md +7 -9
- package/src/vendor/bootstrap-vue/src/components/button-group/README.md +0 -5
- package/src/vendor/bootstrap-vue/src/components/collapse/README.md +2 -2
- package/src/vendor/bootstrap-vue/src/components/dropdown/README.md +5 -5
- package/src/vendor/bootstrap-vue/src/components/form/README.md +21 -26
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/README.md +6 -6
- package/src/vendor/bootstrap-vue/src/components/form-group/README.md +6 -4
- package/src/vendor/bootstrap-vue/src/components/form-input/README.md +4 -4
- package/src/vendor/bootstrap-vue/src/components/form-radio/README.md +1 -1
- package/src/vendor/bootstrap-vue/src/components/index.d.ts +0 -1
- package/src/vendor/bootstrap-vue/src/components/input-group/README.md +4 -9
- package/src/vendor/bootstrap-vue/src/components/layout/README.md +3 -3
- package/src/vendor/bootstrap-vue/src/components/link/README.md +1 -1
- package/src/vendor/bootstrap-vue/src/components/modal/README.md +2 -2
- package/src/vendor/bootstrap-vue/src/components/nav/README.md +13 -14
- package/src/vendor/bootstrap-vue/src/components/navbar/README.md +5 -6
- package/src/vendor/bootstrap-vue/src/components/popover/README.md +4 -4
- package/src/vendor/bootstrap-vue/src/components/table/README.md +5 -5
- package/src/vendor/bootstrap-vue/src/components/tabs/README.md +2 -2
- package/src/vendor/bootstrap-vue/src/components/toast/README.md +5 -5
- package/src/vendor/bootstrap-vue/src/components/tooltip/README.md +4 -4
- package/src/vendor/bootstrap-vue/src/constants/components.js +0 -2
- package/src/vendor/bootstrap-vue/src/directives/toggle/README.md +5 -6
- package/src/vendor/bootstrap-vue/src/directives/tooltip/README.md +2 -2
- package/src/vendor/bootstrap-vue/src/index.js +0 -4
- package/dist/vendor/bootstrap-vue/src/components/progress/index.js +0 -2
- package/dist/vendor/bootstrap-vue/src/components/progress/progress-bar.js +0 -128
- package/dist/vendor/bootstrap-vue/src/components/progress/progress.js +0 -56
- package/src/vendor/bootstrap-vue/nuxt/index.js +0 -164
- package/src/vendor/bootstrap-vue/nuxt/plugin.template.js +0 -29
- package/src/vendor/bootstrap-vue/src/components/progress/MODIFICATIONS.md +0 -23
- package/src/vendor/bootstrap-vue/src/components/progress/README.md +0 -363
- package/src/vendor/bootstrap-vue/src/components/progress/index.d.ts +0 -10
- package/src/vendor/bootstrap-vue/src/components/progress/index.js +0 -4
- package/src/vendor/bootstrap-vue/src/components/progress/package.json +0 -109
- package/src/vendor/bootstrap-vue/src/components/progress/progress-bar.js +0 -133
- package/src/vendor/bootstrap-vue/src/components/progress/progress-bar.spec.js +0 -270
- package/src/vendor/bootstrap-vue/src/components/progress/progress.js +0 -57
- package/src/vendor/bootstrap-vue/src/components/progress/progress.spec.js +0 -71
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { extend } from '../../vue';
|
|
2
|
-
import { NAME_PROGRESS } from '../../constants/components';
|
|
3
|
-
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING, PROP_TYPE_NUMBER_STRING } from '../../constants/props';
|
|
4
|
-
import { omit, sortKeys } from '../../utils/object';
|
|
5
|
-
import { makePropsConfigurable, makeProp, pluckProps } from '../../utils/props';
|
|
6
|
-
import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
7
|
-
import { props as props$1, BProgressBar } from './progress-bar';
|
|
8
|
-
|
|
9
|
-
// --- Props ---
|
|
10
|
-
|
|
11
|
-
const progressBarProps = omit(props$1, ['label', 'labelHtml']);
|
|
12
|
-
const props = makePropsConfigurable(sortKeys({
|
|
13
|
-
...progressBarProps,
|
|
14
|
-
animated: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
15
|
-
height: makeProp(PROP_TYPE_STRING),
|
|
16
|
-
max: makeProp(PROP_TYPE_NUMBER_STRING, 100),
|
|
17
|
-
precision: makeProp(PROP_TYPE_NUMBER_STRING, 0),
|
|
18
|
-
showProgress: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
19
|
-
showValue: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
20
|
-
striped: makeProp(PROP_TYPE_BOOLEAN, false)
|
|
21
|
-
}), NAME_PROGRESS);
|
|
22
|
-
|
|
23
|
-
// --- Main component ---
|
|
24
|
-
|
|
25
|
-
// @vue/component
|
|
26
|
-
const BProgress = /*#__PURE__*/extend({
|
|
27
|
-
name: NAME_PROGRESS,
|
|
28
|
-
mixins: [normalizeSlotMixin],
|
|
29
|
-
provide() {
|
|
30
|
-
return {
|
|
31
|
-
getBvProgress: () => this
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
props,
|
|
35
|
-
computed: {
|
|
36
|
-
progressHeight() {
|
|
37
|
-
return {
|
|
38
|
-
height: this.height || null
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
render(h) {
|
|
43
|
-
let $childNodes = this.normalizeSlot();
|
|
44
|
-
if (!$childNodes) {
|
|
45
|
-
$childNodes = h(BProgressBar, {
|
|
46
|
-
props: pluckProps(progressBarProps, this.$props)
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return h('div', {
|
|
50
|
-
staticClass: 'progress',
|
|
51
|
-
style: this.progressHeight
|
|
52
|
-
}, [$childNodes]);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
export { BProgress, props };
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
const { resolve } = require('path')
|
|
2
|
-
|
|
3
|
-
// --- Constants ---
|
|
4
|
-
|
|
5
|
-
const RX_UN_KEBAB = /-(\w)/g
|
|
6
|
-
const RX_HYPHENATE = /\B([A-Z])/g
|
|
7
|
-
|
|
8
|
-
// Path to index file when using bootstrap-vue source code
|
|
9
|
-
const srcIndex = 'bootstrap-vue/src/index.js'
|
|
10
|
-
|
|
11
|
-
// --- Utility methods ---
|
|
12
|
-
|
|
13
|
-
// Converts PascalCase or camelCase to kebab-case
|
|
14
|
-
const kebabCase = str => {
|
|
15
|
-
return str.replace(RX_HYPHENATE, '-$1').toLowerCase()
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// Converts a kebab-case or camelCase string to PascalCase
|
|
19
|
-
const pascalCase = str => {
|
|
20
|
-
str = kebabCase(str).replace(RX_UN_KEBAB, (_, c) => (c ? c.toUpperCase() : ''))
|
|
21
|
-
return str.charAt(0).toUpperCase() + str.slice(1)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const pickFirst = (...args) => {
|
|
25
|
-
for (const arg of args) {
|
|
26
|
-
if (arg !== undefined) {
|
|
27
|
-
return arg
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// --- Main Nuxt.js module ---
|
|
33
|
-
module.exports = function nuxtBootstrapVue(moduleOptions = {}) {
|
|
34
|
-
this.nuxt.hook('build:before', () => {
|
|
35
|
-
// Merge moduleOptions with default
|
|
36
|
-
const options = {
|
|
37
|
-
...this.options.bootstrapVue,
|
|
38
|
-
...moduleOptions
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Ensure we have arrays
|
|
42
|
-
this.options.css = [].concat(this.options.css || [])
|
|
43
|
-
this.options.build.transpile = [].concat(this.options.build.transpile || [])
|
|
44
|
-
|
|
45
|
-
const bootstrapVueCSS = pickFirst(
|
|
46
|
-
options.bootstrapVueCSS,
|
|
47
|
-
options.bootstrapVueCss,
|
|
48
|
-
options.bvCSS,
|
|
49
|
-
// Defaults to `true` if no other options provided
|
|
50
|
-
true
|
|
51
|
-
)
|
|
52
|
-
if (bootstrapVueCSS) {
|
|
53
|
-
// Add BootstrapVue CSS
|
|
54
|
-
this.options.css.unshift('bootstrap-vue/dist/bootstrap-vue.css')
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const bootstrapCSS = pickFirst(
|
|
58
|
-
options.bootstrapCSS,
|
|
59
|
-
options.bootstrapCss,
|
|
60
|
-
options.css,
|
|
61
|
-
// Defaults to `true` if no other options provided
|
|
62
|
-
true
|
|
63
|
-
)
|
|
64
|
-
if (bootstrapCSS) {
|
|
65
|
-
// Add Bootstrap CSS
|
|
66
|
-
this.options.css.unshift('bootstrap/dist/css/bootstrap.css')
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// Component src prop resolving
|
|
70
|
-
this.options.build.loaders.vue.transformAssetUrls = {
|
|
71
|
-
// Nuxt default is missing `poster` for video
|
|
72
|
-
video: ['src', 'poster'],
|
|
73
|
-
// Nuxt default is missing image
|
|
74
|
-
image: 'xlink:href',
|
|
75
|
-
// Ensure super supplied values/overrides are not lost
|
|
76
|
-
...this.options.build.loaders.vue.transformAssetUrls
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Enable transpilation of `src/` directory
|
|
80
|
-
this.options.build.transpile.push('bootstrap-vue/src')
|
|
81
|
-
|
|
82
|
-
// Use pre-transpiled or `src/`
|
|
83
|
-
const usePretranspiled = pickFirst(options.usePretranspiled, this.options.dev, false)
|
|
84
|
-
if (!usePretranspiled) {
|
|
85
|
-
// Use bootstrap-vue source code for smaller prod builds
|
|
86
|
-
// by aliasing 'bootstrap-vue' to the source files
|
|
87
|
-
this.extendBuild(config => {
|
|
88
|
-
if (!config.resolve.alias) {
|
|
89
|
-
config.resolve.alias = {}
|
|
90
|
-
}
|
|
91
|
-
const index = require.resolve(srcIndex)
|
|
92
|
-
const srcDir = index.replace(/index\.js$/, '')
|
|
93
|
-
// We prepend a $ to ensure that it is only used for
|
|
94
|
-
// `import from 'bootstrap-vue'` not `import from 'bootstrap-vue/*'`
|
|
95
|
-
config.resolve.alias['bootstrap-vue$'] = index
|
|
96
|
-
// If users are still cherry-picking modules from esm/ or es/ (legacy),
|
|
97
|
-
// alias them to src/ to prevent duplicate code imports
|
|
98
|
-
config.resolve.alias['bootstrap-vue/esm/'] = srcDir
|
|
99
|
-
config.resolve.alias['bootstrap-vue/es/'] = srcDir
|
|
100
|
-
})
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Base options available to template
|
|
104
|
-
const templateOptions = {
|
|
105
|
-
// Flag if we are tree shaking
|
|
106
|
-
treeShake: false
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// Specific component and/or directive plugins
|
|
110
|
-
for (const type of ['componentPlugins', 'directivePlugins']) {
|
|
111
|
-
const bvPlugins = Array.isArray(options[type]) ? options[type] : []
|
|
112
|
-
|
|
113
|
-
templateOptions[type] = bvPlugins
|
|
114
|
-
// Normalize plugin name to `${Name}Plugin` (component) or `VB${Name}Plugin` (directive)
|
|
115
|
-
// Required for backwards compatibility with old plugin import names
|
|
116
|
-
.map(plugin => {
|
|
117
|
-
// Ensure PascalCase name
|
|
118
|
-
plugin = pascalCase(plugin)
|
|
119
|
-
// Ensure new naming convention for directive plugins prefixed with `VB`
|
|
120
|
-
plugin = type === 'directivePlugins' && !/^VB/.test(plugin) ? `VB${plugin}` : plugin
|
|
121
|
-
// Ensure prefixed with `Plugin`
|
|
122
|
-
plugin = /Plugin$/.test(plugin) ? plugin : `${plugin}Plugin`
|
|
123
|
-
return plugin
|
|
124
|
-
})
|
|
125
|
-
// Remove duplicate items
|
|
126
|
-
.filter((plugin, i, arr) => arr.indexOf(plugin) === i)
|
|
127
|
-
|
|
128
|
-
if (templateOptions[type].length > 0) {
|
|
129
|
-
templateOptions.treeShake = true
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Specific components and/or directives
|
|
134
|
-
for (const type of ['components', 'directives']) {
|
|
135
|
-
const ComponentsOrDirectives = Array.isArray(options[type]) ? options[type] : []
|
|
136
|
-
|
|
137
|
-
templateOptions[type] = ComponentsOrDirectives
|
|
138
|
-
// Ensure PascalCase name
|
|
139
|
-
.map(item => pascalCase(item))
|
|
140
|
-
// Ensure prefixed with `V`
|
|
141
|
-
.map(item => (type === 'directives' && !/^V/.test(item) ? `V${item}` : item))
|
|
142
|
-
// Remove duplicate items
|
|
143
|
-
.filter((item, i, arr) => arr.indexOf(item) === i)
|
|
144
|
-
|
|
145
|
-
if (templateOptions[type].length > 0) {
|
|
146
|
-
templateOptions.treeShake = true
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Add BootstrapVue configuration if present
|
|
151
|
-
if (options.config && Object.prototype.toString.call(options.config) === '[object Object]') {
|
|
152
|
-
templateOptions.config = { ...options.config }
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// Register plugin, passing options to plugin template
|
|
156
|
-
this.addPlugin({
|
|
157
|
-
src: resolve(__dirname, 'plugin.template.js'),
|
|
158
|
-
fileName: 'bootstrap-vue.js',
|
|
159
|
-
options: templateOptions
|
|
160
|
-
})
|
|
161
|
-
})
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
module.exports.meta = require('../package.json')
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import Vue from 'vue';
|
|
2
|
-
|
|
3
|
-
<% if (!options.treeShake) { %>
|
|
4
|
-
import { BootstrapVue } from 'bootstrap-vue';
|
|
5
|
-
|
|
6
|
-
Vue.use(BootstrapVue, <%= JSON.stringify(options.config || {}, undefined, 2) %>);
|
|
7
|
-
<% } %>
|
|
8
|
-
<% } %>
|
|
9
|
-
|
|
10
|
-
<% if (options.treeShake) { %>
|
|
11
|
-
import {
|
|
12
|
-
<%= [].concat(
|
|
13
|
-
options.config ? 'BVConfigPlugin' : null,
|
|
14
|
-
options.componentPlugins,
|
|
15
|
-
options.directivePlugins,
|
|
16
|
-
options.components,
|
|
17
|
-
options.directives
|
|
18
|
-
).filter(Boolean).join(',\n ') %>
|
|
19
|
-
} from 'bootstrap-vue';
|
|
20
|
-
|
|
21
|
-
<% if (options.config) { %>
|
|
22
|
-
Vue.use(BVConfigPlugin, <%= JSON.stringify(options.config, undefined, 2) %>);
|
|
23
|
-
<% } %>
|
|
24
|
-
|
|
25
|
-
<%= options.componentPlugins.reduce((acc, plugin) => (acc += `Vue.use(${plugin});\n` ), '') %>
|
|
26
|
-
<%= options.directivePlugins.reduce((acc, plugin) => (acc += `Vue.use(${plugin});\n` ), '') %>
|
|
27
|
-
<%= options.components.reduce((acc, c) => (acc += `Vue.component('${c}', ${c});\n` ), '') %>
|
|
28
|
-
<%= options.directives.reduce((acc, d) => (acc += `Vue.directive('${d.replace(/^VB/, 'B')}', ${d});\n` ), '') %>
|
|
29
|
-
<% } %>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Modifications to Vendored Code
|
|
2
|
-
|
|
3
|
-
**Library**: BootstrapVue
|
|
4
|
-
**Version**: 2.23.1
|
|
5
|
-
|
|
6
|
-
This file documents modifications made to the original BootstrapVue component files.
|
|
7
|
-
|
|
8
|
-
## Removed variants
|
|
9
|
-
|
|
10
|
-
The following files have been modified from the original:
|
|
11
|
-
|
|
12
|
-
- `README.md`: Removed variants.
|
|
13
|
-
|
|
14
|
-
The following variants of the property `variant` have been removed as they are no longer supported
|
|
15
|
-
in our implementation:
|
|
16
|
-
|
|
17
|
-
- `secondary`
|
|
18
|
-
- `info`
|
|
19
|
-
- `light`
|
|
20
|
-
- `dark`
|
|
21
|
-
|
|
22
|
-
It was not necessary to adapt `.js` files for this change, as the propery `variant` accepts any
|
|
23
|
-
string. It would still be technically possible to pass down one of the removed variants.
|
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
# Progress
|
|
2
|
-
|
|
3
|
-
> Use our custom progress component for displaying simple or complex progress bars, featuring
|
|
4
|
-
> support for horizontally stacked bars, animated backgrounds, and text labels.
|
|
5
|
-
|
|
6
|
-
```html
|
|
7
|
-
<template>
|
|
8
|
-
<div>
|
|
9
|
-
<b-progress :value="value" :max="max" show-progress animated></b-progress>
|
|
10
|
-
<b-progress class="mt-2" :max="max" show-value>
|
|
11
|
-
<b-progress-bar :value="value * (6 / 10)" variant="success"></b-progress-bar>
|
|
12
|
-
<b-progress-bar :value="value * (2.5 / 10)" variant="warning"></b-progress-bar>
|
|
13
|
-
<b-progress-bar :value="value * (1.5 / 10)" variant="danger"></b-progress-bar>
|
|
14
|
-
</b-progress>
|
|
15
|
-
|
|
16
|
-
<b-button class="mt-3" @click="randomValue">Click me</b-button>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
export default {
|
|
22
|
-
data() {
|
|
23
|
-
return {
|
|
24
|
-
value: 45,
|
|
25
|
-
max: 100
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
methods: {
|
|
29
|
-
randomValue() {
|
|
30
|
-
this.value = Math.random() * this.max
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
<!-- b-progress.vue -->
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Value
|
|
40
|
-
|
|
41
|
-
Set the maximum value with the `max` prop (default is `100`), and the current value via the `value`
|
|
42
|
-
prop (default `0`).
|
|
43
|
-
|
|
44
|
-
When creating multiple bars in a single process, place the value prop on the individual
|
|
45
|
-
`<b-progress-bar>` sub components (see the **Multiple Bars** section below for more details)
|
|
46
|
-
|
|
47
|
-
## Labels
|
|
48
|
-
|
|
49
|
-
Add labels to your progress bars by either enabling `show-progress` (percentage of max) or
|
|
50
|
-
`show-value`for the current absolute value. You may also set the precision (number of digits after
|
|
51
|
-
the decimal) via the `precision` prop (default is `0`digits after the decimal).
|
|
52
|
-
|
|
53
|
-
```html
|
|
54
|
-
<template>
|
|
55
|
-
<div>
|
|
56
|
-
<h5>No label</h5>
|
|
57
|
-
<b-progress :value="value" :max="max" class="mb-3"></b-progress>
|
|
58
|
-
|
|
59
|
-
<h5>Value label</h5>
|
|
60
|
-
<b-progress :value="value" :max="max" show-value class="mb-3"></b-progress>
|
|
61
|
-
|
|
62
|
-
<h5>Progress label</h5>
|
|
63
|
-
<b-progress :value="value" :max="max" show-progress class="mb-3"></b-progress>
|
|
64
|
-
|
|
65
|
-
<h5>Value label with precision</h5>
|
|
66
|
-
<b-progress :value="value" :max="max" :precision="2" show-value class="mb-3"></b-progress>
|
|
67
|
-
|
|
68
|
-
<h5>Progress label with precision</h5>
|
|
69
|
-
<b-progress :value="value" :max="max" :precision="2" show-progress class="mb-3"></b-progress>
|
|
70
|
-
</div>
|
|
71
|
-
</template>
|
|
72
|
-
|
|
73
|
-
<script>
|
|
74
|
-
export default {
|
|
75
|
-
data() {
|
|
76
|
-
return {
|
|
77
|
-
value: 33.333333333,
|
|
78
|
-
max: 50
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
</script>
|
|
83
|
-
|
|
84
|
-
<!-- b-progress-labels.vue -->
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Custom progress label
|
|
88
|
-
|
|
89
|
-
Need more control over the label? Provide your own label by using the default slot within a
|
|
90
|
-
`<b-progress-bar>` sub-component, or by using the `label` or `label-html` property on
|
|
91
|
-
`<b-progress-bar>`:
|
|
92
|
-
|
|
93
|
-
```html
|
|
94
|
-
<template>
|
|
95
|
-
<div>
|
|
96
|
-
<h5>Custom label via default slot</h5>
|
|
97
|
-
<b-progress :max="max" height="2rem">
|
|
98
|
-
<b-progress-bar :value="value">
|
|
99
|
-
<span>Progress: <strong>{{ value.toFixed(2) }} / {{ max }}</strong></span>
|
|
100
|
-
</b-progress-bar>
|
|
101
|
-
</b-progress>
|
|
102
|
-
|
|
103
|
-
<h5 class="mt-3">Custom label via property</h5>
|
|
104
|
-
<b-progress :max="max">
|
|
105
|
-
<b-progress-bar :value="value" :label="`${((value / max) * 100).toFixed(2)}%`"></b-progress-bar>
|
|
106
|
-
</b-progress>
|
|
107
|
-
|
|
108
|
-
<h5 class="mt-3">Custom label via property (HTML support)</h5>
|
|
109
|
-
<b-progress :max="max">
|
|
110
|
-
<b-progress-bar :value="value" :label-html="`<del>${value}</del>`"></b-progress-bar>
|
|
111
|
-
</b-progress>
|
|
112
|
-
</div>
|
|
113
|
-
</template>
|
|
114
|
-
|
|
115
|
-
<script>
|
|
116
|
-
export default {
|
|
117
|
-
data() {
|
|
118
|
-
return {
|
|
119
|
-
value: 33.333333333,
|
|
120
|
-
max: 50
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
</script>
|
|
125
|
-
|
|
126
|
-
<!-- b-progress-custom-labels.vue -->
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Precedence order for label methods (top-most has precedence):
|
|
130
|
-
|
|
131
|
-
- default slot of `<b-progress-bar>`
|
|
132
|
-
- `label` prop of `<b-progress-bar>`
|
|
133
|
-
- `show-progress` prop of `<b-progress-bar>`
|
|
134
|
-
- `show-value` prop of `<b-progress-bar>`
|
|
135
|
-
- `show-progress` prop of `<b-progress>`
|
|
136
|
-
- `show-value` prop of `<b-progress>`
|
|
137
|
-
- no label
|
|
138
|
-
|
|
139
|
-
## Width and height
|
|
140
|
-
|
|
141
|
-
`<b-progress>` will always expand to the maximum with of its parent container. To change the width,
|
|
142
|
-
place `<b-progress>` in a standard Bootstrap column or apply one of the standard Bootstrap width
|
|
143
|
-
classes.
|
|
144
|
-
|
|
145
|
-
```html
|
|
146
|
-
<template>
|
|
147
|
-
<div>
|
|
148
|
-
<h5>Default width</h5>
|
|
149
|
-
<b-progress :value="value" class="mb-3"></b-progress>
|
|
150
|
-
|
|
151
|
-
<h5>Custom widths</h5>
|
|
152
|
-
<b-progress :value="value" class="w-75 mb-2"></b-progress>
|
|
153
|
-
<b-progress :value="value" class="w-50 mb-2"></b-progress>
|
|
154
|
-
<b-progress :value="value" class="w-25"></b-progress>
|
|
155
|
-
</div>
|
|
156
|
-
</template>
|
|
157
|
-
|
|
158
|
-
<script>
|
|
159
|
-
export default {
|
|
160
|
-
data() {
|
|
161
|
-
return {
|
|
162
|
-
value: 75
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
</script>
|
|
167
|
-
|
|
168
|
-
<!-- b-progress-width.vue -->
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
The height of the progress bar can be controlled with the `height` prop. The height value should be
|
|
172
|
-
a standard CSS dimension (`px`, `rem`, `em`, etc.). The default height is `1rem`.
|
|
173
|
-
|
|
174
|
-
```html
|
|
175
|
-
<template>
|
|
176
|
-
<div>
|
|
177
|
-
<h5>Default height</h5>
|
|
178
|
-
<b-progress :value="value" show-progress class="mb-3"></b-progress>
|
|
179
|
-
|
|
180
|
-
<h5>Custom heights</h5>
|
|
181
|
-
<b-progress height="2rem" :value="value" show-progress class="mb-2"></b-progress>
|
|
182
|
-
<b-progress height="20px" :value="value" show-progress class="mb-2"></b-progress>
|
|
183
|
-
<b-progress height="2px" :value="value"></b-progress>
|
|
184
|
-
</div>
|
|
185
|
-
</template>
|
|
186
|
-
|
|
187
|
-
<script>
|
|
188
|
-
export default {
|
|
189
|
-
data() {
|
|
190
|
-
return {
|
|
191
|
-
value: 75
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
</script>
|
|
196
|
-
|
|
197
|
-
<!-- b-progress-height.vue -->
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
## Backgrounds
|
|
201
|
-
|
|
202
|
-
Use background variants to change the appearance of individual progress bars. The default variant is
|
|
203
|
-
`primary`.
|
|
204
|
-
|
|
205
|
-
### Solid background variants
|
|
206
|
-
|
|
207
|
-
```html
|
|
208
|
-
<template>
|
|
209
|
-
<div>
|
|
210
|
-
<div v-for="bar in bars" class="row mb-1">
|
|
211
|
-
<div class="col-sm-2">{{ bar.variant }}:</div>
|
|
212
|
-
<div class="col-sm-10 pt-1">
|
|
213
|
-
<b-progress :value="bar.value" :variant="bar.variant" :key="bar.variant"></b-progress>
|
|
214
|
-
</div>
|
|
215
|
-
</div>
|
|
216
|
-
</div>
|
|
217
|
-
</template>
|
|
218
|
-
|
|
219
|
-
<script>
|
|
220
|
-
export default {
|
|
221
|
-
data() {
|
|
222
|
-
return {
|
|
223
|
-
bars: [
|
|
224
|
-
{ variant: 'success', value: 75 },
|
|
225
|
-
{ variant: 'warning', value: 75 },
|
|
226
|
-
{ variant: 'danger', value: 75 },
|
|
227
|
-
{ variant: 'primary', value: 75 },
|
|
228
|
-
],
|
|
229
|
-
timer: null
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
mounted() {
|
|
233
|
-
this.timer = setInterval(() => {
|
|
234
|
-
this.bars.forEach(bar => (bar.value = 25 + Math.random() * 75))
|
|
235
|
-
}, 2000)
|
|
236
|
-
},
|
|
237
|
-
beforeDestroy() {
|
|
238
|
-
clearInterval(this.timer)
|
|
239
|
-
this.timer = null
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
</script>
|
|
243
|
-
|
|
244
|
-
<!-- b-progress-backgrounds.vue -->
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
### Striped backgrounds
|
|
248
|
-
|
|
249
|
-
Set `striped` to apply a stripe via CSS gradient over the progress bar's background variant.
|
|
250
|
-
|
|
251
|
-
```html
|
|
252
|
-
<template>
|
|
253
|
-
<div>
|
|
254
|
-
<b-progress :value="25" variant="success" :striped="striped"></b-progress>
|
|
255
|
-
<b-progress :value="75" variant="warning" :striped="striped" class="mt-2"></b-progress>
|
|
256
|
-
<b-progress :value="100" variant="danger" :striped="striped" class="mt-2"></b-progress>
|
|
257
|
-
</div>
|
|
258
|
-
</template>
|
|
259
|
-
|
|
260
|
-
<script>
|
|
261
|
-
export default {
|
|
262
|
-
data() {
|
|
263
|
-
return {
|
|
264
|
-
striped: true
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
</script>
|
|
269
|
-
|
|
270
|
-
<!-- b-progress-striped.vue -->
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
### Animated backgrounds
|
|
274
|
-
|
|
275
|
-
The striped gradient can also be animated by setting the `animated`prop.
|
|
276
|
-
|
|
277
|
-
```html
|
|
278
|
-
<template>
|
|
279
|
-
<div>
|
|
280
|
-
<b-progress :value="25" variant="success" striped :animated="animate"></b-progress>
|
|
281
|
-
<b-progress :value="75" variant="warning" striped :animated="animate" class="mt-2"></b-progress>
|
|
282
|
-
<b-progress :value="100" variant="danger" :animated="animate" class="mt-3"></b-progress>
|
|
283
|
-
</div>
|
|
284
|
-
</template>
|
|
285
|
-
|
|
286
|
-
<script>
|
|
287
|
-
export default {
|
|
288
|
-
data() {
|
|
289
|
-
return {
|
|
290
|
-
animate: true
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
</script>
|
|
295
|
-
|
|
296
|
-
<!-- b-progress-animated.vue -->
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
Notes:
|
|
300
|
-
|
|
301
|
-
- if `animated` is true, `striped` will automatically be enabled.
|
|
302
|
-
- Animated progress bars don't work in Opera 12 — as they don't support CSS3 animations.
|
|
303
|
-
- The animation effect of this component is dependent on the `prefers-reduced-motion` media query.
|
|
304
|
-
See the [reduced motion section of our accessibility documentation](/docs/reference/accessibility)
|
|
305
|
-
for additional details.
|
|
306
|
-
|
|
307
|
-
## Multiple bars
|
|
308
|
-
|
|
309
|
-
Include multiple `<b-progress-bar>` sub-components in a `<b-progress>` component to build a
|
|
310
|
-
horizontally stacked set of progress bars.
|
|
311
|
-
|
|
312
|
-
```html
|
|
313
|
-
<template>
|
|
314
|
-
<div>
|
|
315
|
-
<b-progress :max="max" class="mb-3">
|
|
316
|
-
<b-progress-bar variant="primary" :value="values[0]"></b-progress-bar>
|
|
317
|
-
<b-progress-bar variant="success" :value="values[1]"></b-progress-bar>
|
|
318
|
-
<b-progress-bar variant="danger" :value="values[2]"></b-progress-bar>
|
|
319
|
-
</b-progress>
|
|
320
|
-
|
|
321
|
-
<b-progress show-progress :max="max" class="mb-3">
|
|
322
|
-
<b-progress-bar variant="primary" :value="values[0]"></b-progress-bar>
|
|
323
|
-
<b-progress-bar variant="success" :value="values[1]"></b-progress-bar>
|
|
324
|
-
<b-progress-bar variant="danger" :value="values[2]"></b-progress-bar>
|
|
325
|
-
</b-progress>
|
|
326
|
-
|
|
327
|
-
<b-progress show-value striped :max="max" class="mb-3">
|
|
328
|
-
<b-progress-bar variant="primary" :value="values[0]"></b-progress-bar>
|
|
329
|
-
<b-progress-bar variant="success" :value="values[1]"></b-progress-bar>
|
|
330
|
-
<b-progress-bar variant="danger" :value="values[2]"></b-progress-bar>
|
|
331
|
-
</b-progress>
|
|
332
|
-
|
|
333
|
-
<b-progress :max="max">
|
|
334
|
-
<b-progress-bar variant="primary" :value="values[0]" show-progress></b-progress-bar>
|
|
335
|
-
<b-progress-bar variant="success" :value="values[1]" animated show-progress></b-progress-bar>
|
|
336
|
-
<b-progress-bar variant="danger" :value="values[2]" striped show-progress></b-progress-bar>
|
|
337
|
-
</b-progress>
|
|
338
|
-
</div>
|
|
339
|
-
</template>
|
|
340
|
-
|
|
341
|
-
<script>
|
|
342
|
-
export default {
|
|
343
|
-
data() {
|
|
344
|
-
return {
|
|
345
|
-
values: [15, 30, 20],
|
|
346
|
-
max: 100
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
</script>
|
|
351
|
-
|
|
352
|
-
<!-- b-progress-multiple.vue -->
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
`<b-progress-bar>` will inherit most of the props from the `<b-progress>` parent component, but you
|
|
356
|
-
can override any of the props by setting them on the `<b-progress-bar>`
|
|
357
|
-
|
|
358
|
-
Notes:
|
|
359
|
-
|
|
360
|
-
- `height`, if specified, should always set on the `<b-progress>` component.
|
|
361
|
-
- `<b-progress-bar>` will not inherit `value` from `<b-progress>`.
|
|
362
|
-
|
|
363
|
-
<!-- Component reference added automatically from component package.json -->
|