@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
|
@@ -121,4 +121,12 @@ const formatNumberToLocale = function (value) {
|
|
|
121
121
|
return new Intl.NumberFormat(locales, options).format(value);
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
// Converts a value (string, number, etc.) to a number
|
|
125
|
+
// Taken from bootstrap-vue
|
|
126
|
+
const toFloat = function (value) {
|
|
127
|
+
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;
|
|
128
|
+
const float = parseFloat(value);
|
|
129
|
+
return Number.isNaN(float) ? defaultValue : float;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export { addition, average, engineeringNotation, formatNumberToLocale, modulo, sum, toFloat };
|
|
@@ -44,8 +44,6 @@ const NAME_NAVBAR_BRAND = 'BNavbarBrand';
|
|
|
44
44
|
const NAME_NAV_ITEM = 'BNavItem';
|
|
45
45
|
const NAME_NAV_ITEM_DROPDOWN = 'BNavItemDropdown';
|
|
46
46
|
const NAME_POPOVER = 'BPopover';
|
|
47
|
-
const NAME_PROGRESS = 'BProgress';
|
|
48
|
-
const NAME_PROGRESS_BAR = 'BProgressBar';
|
|
49
47
|
const NAME_TAB = 'BTab';
|
|
50
48
|
const NAME_TABLE = 'BTable';
|
|
51
49
|
const NAME_TABLE_CELL = 'BTableCell';
|
|
@@ -76,4 +74,4 @@ const NAME_TRANSITION = 'BVTransition';
|
|
|
76
74
|
const NAME_TRANSPORTER = 'BVTransporter';
|
|
77
75
|
const NAME_TRANSPORTER_TARGET = 'BVTransporterTarget';
|
|
78
76
|
|
|
79
|
-
export { NAME_BADGE, NAME_BREADCRUMB, NAME_BREADCRUMB_ITEM, NAME_BREADCRUMB_LINK, NAME_BUTTON, NAME_BUTTON_CLOSE, NAME_BUTTON_GROUP, NAME_COL, NAME_COLLAPSE, NAME_COLLAPSE_HELPER, NAME_DROPDOWN, NAME_DROPDOWN_DIVIDER, NAME_DROPDOWN_FORM, NAME_DROPDOWN_GROUP, NAME_DROPDOWN_HEADER, NAME_DROPDOWN_ITEM, NAME_DROPDOWN_ITEM_BUTTON, NAME_DROPDOWN_TEXT, NAME_FORM, NAME_FORM_BUTTON_LABEL_CONTROL, NAME_FORM_CHECKBOX, NAME_FORM_CHECKBOX_GROUP, NAME_FORM_GROUP, NAME_FORM_INPUT, NAME_FORM_INVALID_FEEDBACK, NAME_FORM_RADIO, NAME_FORM_RADIO_GROUP, NAME_FORM_RATING_STAR, NAME_FORM_ROW, NAME_FORM_SELECT, NAME_FORM_SELECT_OPTION, NAME_FORM_SELECT_OPTION_GROUP, NAME_FORM_TEXT, NAME_FORM_TEXTAREA, NAME_FORM_VALID_FEEDBACK, NAME_INPUT_GROUP, NAME_INPUT_GROUP_ADDON, NAME_INPUT_GROUP_APPEND, NAME_INPUT_GROUP_PREPEND, NAME_INPUT_GROUP_TEXT, NAME_LINK, NAME_MODAL, NAME_NAV, NAME_NAVBAR, NAME_NAVBAR_BRAND, NAME_NAV_ITEM, NAME_NAV_ITEM_DROPDOWN, NAME_POPOVER, NAME_POPOVER_HELPER, NAME_POPOVER_TEMPLATE, NAME_POPPER,
|
|
77
|
+
export { NAME_BADGE, NAME_BREADCRUMB, NAME_BREADCRUMB_ITEM, NAME_BREADCRUMB_LINK, NAME_BUTTON, NAME_BUTTON_CLOSE, NAME_BUTTON_GROUP, NAME_COL, NAME_COLLAPSE, NAME_COLLAPSE_HELPER, NAME_DROPDOWN, NAME_DROPDOWN_DIVIDER, NAME_DROPDOWN_FORM, NAME_DROPDOWN_GROUP, NAME_DROPDOWN_HEADER, NAME_DROPDOWN_ITEM, NAME_DROPDOWN_ITEM_BUTTON, NAME_DROPDOWN_TEXT, NAME_FORM, NAME_FORM_BUTTON_LABEL_CONTROL, NAME_FORM_CHECKBOX, NAME_FORM_CHECKBOX_GROUP, NAME_FORM_GROUP, NAME_FORM_INPUT, NAME_FORM_INVALID_FEEDBACK, NAME_FORM_RADIO, NAME_FORM_RADIO_GROUP, NAME_FORM_RATING_STAR, NAME_FORM_ROW, NAME_FORM_SELECT, NAME_FORM_SELECT_OPTION, NAME_FORM_SELECT_OPTION_GROUP, NAME_FORM_TEXT, NAME_FORM_TEXTAREA, NAME_FORM_VALID_FEEDBACK, NAME_INPUT_GROUP, NAME_INPUT_GROUP_ADDON, NAME_INPUT_GROUP_APPEND, NAME_INPUT_GROUP_PREPEND, NAME_INPUT_GROUP_TEXT, NAME_LINK, NAME_MODAL, NAME_NAV, NAME_NAVBAR, NAME_NAVBAR_BRAND, NAME_NAV_ITEM, NAME_NAV_ITEM_DROPDOWN, NAME_POPOVER, NAME_POPOVER_HELPER, NAME_POPOVER_TEMPLATE, NAME_POPPER, NAME_TAB, NAME_TABLE, NAME_TABLE_CELL, NAME_TABLE_LITE, NAME_TABLE_SIMPLE, NAME_TABS, NAME_TAB_BUTTON_HELPER, NAME_TBODY, NAME_TFOOT, NAME_TH, NAME_THEAD, NAME_TOAST, NAME_TOASTER, NAME_TOAST_POP, NAME_TOOLTIP, NAME_TOOLTIP_HELPER, NAME_TOOLTIP_TEMPLATE, NAME_TR, NAME_TRANSITION, NAME_TRANSPORTER, NAME_TRANSPORTER_TARGET };
|
|
@@ -46,8 +46,6 @@ export { BNavItemDropdown } from './components/nav/nav-item-dropdown';
|
|
|
46
46
|
export { BNavbar } from './components/navbar/navbar';
|
|
47
47
|
export { BNavbarBrand } from './components/navbar/navbar-brand';
|
|
48
48
|
export { BPopover } from './components/popover/popover';
|
|
49
|
-
export { BProgress } from './components/progress/progress';
|
|
50
|
-
export { BProgressBar } from './components/progress/progress-bar';
|
|
51
49
|
export { BTable } from './components/table/table';
|
|
52
50
|
export { BTableLite } from './components/table/table-lite';
|
|
53
51
|
export { BTableSimple } from './components/table/table-simple';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "97.0.0",
|
|
4
4
|
"description": "GitLab UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -107,13 +107,13 @@
|
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@arkweid/lefthook": "0.7.7",
|
|
110
|
-
"@babel/core": "^7.25.
|
|
110
|
+
"@babel/core": "^7.25.8",
|
|
111
111
|
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
|
|
112
112
|
"@babel/plugin-proposal-optional-chaining": "^7.21.0",
|
|
113
|
-
"@babel/preset-env": "^7.25.
|
|
113
|
+
"@babel/preset-env": "^7.25.8",
|
|
114
114
|
"@babel/preset-react": "^7.25.7",
|
|
115
115
|
"@cypress/grep": "^4.0.1",
|
|
116
|
-
"@gitlab/eslint-plugin": "20.
|
|
116
|
+
"@gitlab/eslint-plugin": "20.4.1",
|
|
117
117
|
"@gitlab/fonts": "^1.3.0",
|
|
118
118
|
"@gitlab/stylelint-config": "6.2.2",
|
|
119
119
|
"@gitlab/svgs": "3.117.0",
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
"esbuild": "^0.18.0",
|
|
158
158
|
"eslint": "8.57.1",
|
|
159
159
|
"eslint-import-resolver-jest": "3.0.2",
|
|
160
|
-
"eslint-plugin-cypress": "3.
|
|
160
|
+
"eslint-plugin-cypress": "3.6.0",
|
|
161
161
|
"eslint-plugin-storybook": "0.9.0",
|
|
162
162
|
"gitlab-api-async-iterator": "^1.3.1",
|
|
163
163
|
"glob": "10.3.3",
|
|
@@ -174,8 +174,8 @@
|
|
|
174
174
|
"module-alias": "^2.2.2",
|
|
175
175
|
"npm-run-all": "^4.1.5",
|
|
176
176
|
"pikaday": "^1.8.0",
|
|
177
|
-
"playwright": "^1.
|
|
178
|
-
"playwright-core": "^1.
|
|
177
|
+
"playwright": "^1.48.0",
|
|
178
|
+
"playwright-core": "^1.48.0",
|
|
179
179
|
"plop": "^2.5.4",
|
|
180
180
|
"postcss": "8.4.28",
|
|
181
181
|
"postcss-loader": "^7.0.2",
|
|
@@ -156,7 +156,7 @@ export default {
|
|
|
156
156
|
}, []);
|
|
157
157
|
},
|
|
158
158
|
variantClass() {
|
|
159
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
159
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
160
160
|
return `gl-alert-${this.variant}`;
|
|
161
161
|
},
|
|
162
162
|
},
|
|
@@ -72,17 +72,17 @@ export default {
|
|
|
72
72
|
computed: {
|
|
73
73
|
sizeClasses() {
|
|
74
74
|
if (isNumber(this.size)) {
|
|
75
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
75
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
76
76
|
return `gl-avatar-s${this.size}`;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
const { default: defaultSize, ...nonDefaultSizes } = this.size;
|
|
80
80
|
|
|
81
81
|
return [
|
|
82
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
82
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
83
83
|
`gl-avatar-s${defaultSize || avatarSizeOptions[1]}`,
|
|
84
84
|
...Object.entries(nonDefaultSizes).map(
|
|
85
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
85
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
86
86
|
([breakpoint, size]) => `gl-${breakpoint}-avatar-s${size}`
|
|
87
87
|
),
|
|
88
88
|
];
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
* Gets the remainder after dividing the 'entityId' by the number of available backgrounds.
|
|
97
97
|
*/
|
|
98
98
|
const type = (this.entityId % IDENTICON_BG_COUNT) + 1;
|
|
99
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
99
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
100
100
|
return `gl-avatar-identicon-bg${type}`;
|
|
101
101
|
},
|
|
102
102
|
identiconText() {
|
|
@@ -245,7 +245,7 @@ export default {
|
|
|
245
245
|
'gl-datepicker',
|
|
246
246
|
'd-inline-block',
|
|
247
247
|
'gl-w-full',
|
|
248
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
248
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
249
249
|
`gl-form-input-${this.computedWidth}`,
|
|
250
250
|
];
|
|
251
251
|
},
|
|
@@ -62,7 +62,7 @@ export default {
|
|
|
62
62
|
return Boolean(this.$slots.footer);
|
|
63
63
|
},
|
|
64
64
|
variantClass() {
|
|
65
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
65
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
66
66
|
return `gl-drawer-${this.variant}`;
|
|
67
67
|
},
|
|
68
68
|
},
|
|
@@ -42,16 +42,16 @@ export default {
|
|
|
42
42
|
const { default: defaultWidth, ...nonDefaultWidths } = this.width;
|
|
43
43
|
|
|
44
44
|
return [
|
|
45
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
45
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
46
46
|
...(defaultWidth ? [`gl-form-input-${defaultWidth}`] : []),
|
|
47
47
|
...Object.entries(nonDefaultWidths).map(
|
|
48
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
48
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
49
49
|
([breakpoint, width]) => `gl-${breakpoint}-form-input-${width}`
|
|
50
50
|
),
|
|
51
51
|
];
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
54
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
55
55
|
return [`gl-form-input-${this.width}`];
|
|
56
56
|
},
|
|
57
57
|
listeners() {
|
|
@@ -34,16 +34,16 @@ export default {
|
|
|
34
34
|
const { default: defaultWidth, ...nonDefaultWidths } = this.width;
|
|
35
35
|
|
|
36
36
|
return [
|
|
37
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
37
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
38
38
|
...(defaultWidth ? [`gl-form-select-${defaultWidth}`] : []),
|
|
39
39
|
...Object.entries(nonDefaultWidths).map(
|
|
40
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
40
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
41
41
|
([breakpoint, width]) => `gl-${breakpoint}-form-select-${width}`
|
|
42
42
|
),
|
|
43
43
|
];
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
46
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
47
47
|
return [`gl-form-select-${this.width}`];
|
|
48
48
|
},
|
|
49
49
|
},
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// variables
|
|
2
2
|
$modal-body-height: 80px;
|
|
3
3
|
$modal-body-line-height: 1.5;
|
|
4
|
-
$modal-box-shadow: 0 4px 16px $t-gray-a-24;
|
|
5
4
|
|
|
6
5
|
// mixins
|
|
7
6
|
@mixin gl-tmp-modal-btn-group-ml {
|
|
@@ -38,7 +37,7 @@ body.modal-open {
|
|
|
38
37
|
.modal-content {
|
|
39
38
|
@apply gl-rounded-base;
|
|
40
39
|
@apply gl-border-0;
|
|
41
|
-
|
|
40
|
+
@apply gl-shadow-lg;
|
|
42
41
|
background-color: var(--gl-background-color-overlap);
|
|
43
42
|
color: var(--gl-text-color-default);
|
|
44
43
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
The progress bar component can be used to show an amount of progress.
|
|
2
|
+
It comes in 4 variants and supports setting a custom maximum and height.
|
|
3
|
+
|
|
4
|
+
## Value
|
|
5
|
+
|
|
6
|
+
The `value` prop can be a Number or String. If not given, it will default to `0`.
|
|
7
|
+
|
|
8
|
+
## Variants
|
|
9
|
+
|
|
10
|
+
The following variants are available:
|
|
11
|
+
|
|
12
|
+
1. 'primary' (default)
|
|
13
|
+
2. 'success'
|
|
14
|
+
3. 'warning'
|
|
15
|
+
4. 'danger'
|
|
16
|
+
|
|
17
|
+
## Maximum
|
|
18
|
+
|
|
19
|
+
A custom maximum can be set with the `max` prop. If not given, it will default to `100`.
|
|
20
|
+
|
|
21
|
+
## Width and Height
|
|
22
|
+
|
|
23
|
+
The `GlProgressBar` will always expand to the maximum width of its parent container.
|
|
24
|
+
The height can be controlled with the `height` prop. The value should be a standard
|
|
25
|
+
CSS dimension (`px`, `rem`, `em`, etc.) and given as a String, e.g. `'20px'`.
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
.gl-progress-bar {
|
|
2
2
|
background-color: var(--gl-progress-bar-track-color);
|
|
3
|
+
|
|
4
|
+
.gl-progress {
|
|
5
|
+
@apply gl-flex-col;
|
|
6
|
+
@apply gl-justify-center;
|
|
7
|
+
@apply gl-w-full;
|
|
8
|
+
@apply gl-overflow-hidden;
|
|
9
|
+
@apply gl-text-center;
|
|
10
|
+
@apply gl-whitespace-nowrap;
|
|
11
|
+
transition: transform 0.6s $gl-easing-out-cubic;
|
|
12
|
+
transform-origin: left;
|
|
13
|
+
}
|
|
3
14
|
|
|
4
15
|
.bg-primary {
|
|
5
16
|
background-color: var(--gl-progress-bar-indicator-color-default) !important;
|
|
@@ -1,15 +1,64 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import {
|
|
2
|
+
import { progressBarVariantOptions } from '../../../utils/constants';
|
|
3
|
+
import { toFloat } from '../../../utils/number_utils';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
name: 'GlProgressBar',
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
props: {
|
|
8
|
+
value: {
|
|
9
|
+
type: [Number, String],
|
|
10
|
+
required: false,
|
|
11
|
+
default: 0,
|
|
12
|
+
},
|
|
13
|
+
variant: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: false,
|
|
16
|
+
default: 'primary',
|
|
17
|
+
validator: (value) => Object.keys(progressBarVariantOptions).includes(value),
|
|
18
|
+
},
|
|
19
|
+
max: {
|
|
20
|
+
type: [Number, String],
|
|
21
|
+
required: false,
|
|
22
|
+
default: 100,
|
|
23
|
+
},
|
|
24
|
+
height: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: false,
|
|
27
|
+
default: null,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
computed: {
|
|
31
|
+
progressHeight() {
|
|
32
|
+
return { height: this.height };
|
|
33
|
+
},
|
|
34
|
+
computedValue() {
|
|
35
|
+
return toFloat(this.value, 0);
|
|
36
|
+
},
|
|
37
|
+
computedMax() {
|
|
38
|
+
const max = toFloat(this.max, 100);
|
|
39
|
+
return max > 0 ? max : 100;
|
|
40
|
+
},
|
|
41
|
+
progressBarStyles() {
|
|
42
|
+
return {
|
|
43
|
+
transform: `scaleX(${this.computedValue / this.computedMax})`,
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
classes() {
|
|
47
|
+
return ['gl-progress', `bg-${this.variant}`];
|
|
48
|
+
},
|
|
8
49
|
},
|
|
9
|
-
inheritAttrs: false,
|
|
10
50
|
};
|
|
11
51
|
</script>
|
|
12
52
|
|
|
13
53
|
<template>
|
|
14
|
-
<
|
|
54
|
+
<div class="gl-progress-bar progress" :style="progressHeight">
|
|
55
|
+
<div
|
|
56
|
+
:class="classes"
|
|
57
|
+
:style="progressBarStyles"
|
|
58
|
+
role="progressbar"
|
|
59
|
+
aria-valuemin="0"
|
|
60
|
+
:aria-valuemax="String(computedMax)"
|
|
61
|
+
:aria-valuenow="computedValue"
|
|
62
|
+
></div>
|
|
63
|
+
</div>
|
|
15
64
|
</template>
|
|
@@ -44,7 +44,7 @@ function renderTitle(h, toast, options) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function showToast(message, options = {}) {
|
|
47
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
47
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
48
48
|
const id = `gl-toast-${toastsCount}`;
|
|
49
49
|
toastsCount += 1;
|
|
50
50
|
const hide = () => {
|
|
@@ -35,7 +35,7 @@ export default {
|
|
|
35
35
|
},
|
|
36
36
|
computed: {
|
|
37
37
|
variantClass() {
|
|
38
|
-
// eslint-disable-next-line @gitlab/tailwind -- Not a CSS utility
|
|
38
|
+
// eslint-disable-next-line @gitlab/tailwind-no-interpolation -- Not a CSS utility
|
|
39
39
|
return `gl-token-${this.variant}-variant`;
|
|
40
40
|
},
|
|
41
41
|
viewOnlyClass() {
|
|
@@ -118,3 +118,10 @@ export const formatNumberToLocale = (value, options = {}, locales = undefined) =
|
|
|
118
118
|
|
|
119
119
|
return new Intl.NumberFormat(locales, options).format(value);
|
|
120
120
|
};
|
|
121
|
+
|
|
122
|
+
// Converts a value (string, number, etc.) to a number
|
|
123
|
+
// Taken from bootstrap-vue
|
|
124
|
+
export const toFloat = (value, defaultValue = NaN) => {
|
|
125
|
+
const float = parseFloat(value);
|
|
126
|
+
return Number.isNaN(float) ? defaultValue : float;
|
|
127
|
+
};
|
|
@@ -47,29 +47,22 @@
|
|
|
47
47
|
"files": [
|
|
48
48
|
"dist",
|
|
49
49
|
"esm",
|
|
50
|
-
"nuxt",
|
|
51
50
|
"src"
|
|
52
51
|
],
|
|
53
52
|
"sideEffects": [
|
|
54
53
|
"**/*.css",
|
|
55
54
|
"**/*.scss",
|
|
56
55
|
"**/*.vue",
|
|
57
|
-
"./docs",
|
|
58
56
|
"./types"
|
|
59
57
|
],
|
|
60
58
|
"scripts": {
|
|
61
59
|
"audit": "improved-yarn-audit --ignore-dev-deps --min-severity moderate -e 1488",
|
|
62
|
-
"build": "scripts/build.sh",
|
|
63
|
-
"docs-build": "cross-env NODE_ENV=docs nuxt build -c docs/nuxt.config.js",
|
|
64
|
-
"docs-dev": "cross-env NODE_ENV=docs nuxt dev -c docs/nuxt.config.js",
|
|
65
|
-
"docs-gen": "cross-env NODE_ENV=docs nuxt generate -c docs/nuxt.config.js",
|
|
66
60
|
"lint": "eslint --ext .js,.md,.vue ./",
|
|
67
|
-
"prepare": "yarn run build",
|
|
68
61
|
"prettify": "prettier --write '**/*.{js,json,md,scss,ts,vue}'",
|
|
69
|
-
"test": "yarn run test:lint && yarn run test:unit",
|
|
62
|
+
"test": "yarn run test:meta && yarn run test:lint && yarn run test:unit",
|
|
70
63
|
"test:lint": "yarn run lint",
|
|
71
|
-
"test:
|
|
72
|
-
"
|
|
64
|
+
"test:meta": "scripts/check-meta.sh",
|
|
65
|
+
"test:unit": "jest"
|
|
73
66
|
},
|
|
74
67
|
"dependencies": {
|
|
75
68
|
"bootstrap": "^4.6.1",
|
|
@@ -78,32 +71,15 @@
|
|
|
78
71
|
"vue-functional-data-merge": "^3.1.0"
|
|
79
72
|
},
|
|
80
73
|
"devDependencies": {
|
|
81
|
-
"@babel/cli": "^7.19.3",
|
|
82
74
|
"@babel/core": "^7.16.5",
|
|
83
|
-
"@babel/plugin-transform-modules-commonjs": "^7.14.0",
|
|
84
|
-
"@babel/plugin-transform-runtime": "^7.16.5",
|
|
85
75
|
"@babel/preset-env": "^7.14.2",
|
|
86
|
-
"@babel/standalone": "^7.16.6",
|
|
87
|
-
"@nuxt/content": "^1.14.0",
|
|
88
|
-
"@nuxtjs/google-analytics": "^2.4.0",
|
|
89
|
-
"@nuxtjs/pwa": "^3.3.5",
|
|
90
|
-
"@nuxtjs/robots": "^2.5.0",
|
|
91
|
-
"@nuxtjs/sitemap": "^2.4.0",
|
|
92
76
|
"@testing-library/jest-dom": "^5.12.0",
|
|
93
77
|
"@vue/compat": "^3.2.40",
|
|
94
78
|
"@vue/compiler-dom": "^3.2.40",
|
|
95
79
|
"@vue/test-utils": "^1.3.0",
|
|
96
80
|
"@vue/test-utils-vue3": "npm:@vue/test-utils@2.2.0",
|
|
97
|
-
"autoprefixer": "^10.4.0",
|
|
98
|
-
"babel-core": "^7.0.0-bridge.0",
|
|
99
|
-
"babel-eslint": "^10.1.0",
|
|
100
81
|
"babel-jest": "^26.6.3",
|
|
101
|
-
"babel-plugin-istanbul": "^6.0.0",
|
|
102
|
-
"clean-css-cli": "^4.3.0",
|
|
103
|
-
"codemirror": "^5.61.0",
|
|
104
|
-
"codesandbox": "^2.2.3",
|
|
105
82
|
"core-js": "^3.12.1",
|
|
106
|
-
"cross-env": "^7.0.3",
|
|
107
83
|
"eslint": "^7.26.0",
|
|
108
84
|
"eslint-config-prettier": "^8.3.0",
|
|
109
85
|
"eslint-config-standard": "^16.0.2",
|
|
@@ -115,25 +91,10 @@
|
|
|
115
91
|
"eslint-plugin-prettier": "^3.4.1",
|
|
116
92
|
"eslint-plugin-promise": "^5.1.0",
|
|
117
93
|
"eslint-plugin-vue": "^7.9.0",
|
|
118
|
-
"highlight.js": "^10.7.2",
|
|
119
|
-
"html-loader": "^1.3.2",
|
|
120
94
|
"improved-yarn-audit": "^3.0.0",
|
|
121
95
|
"jest": "^26.6.3",
|
|
122
|
-
"loader-utils": "^2.0.0",
|
|
123
96
|
"lodash": "^4.17.21",
|
|
124
|
-
"marked": "^2.0.3",
|
|
125
|
-
"nuxt": "^2.15.8",
|
|
126
|
-
"postcss": "^8.2.15",
|
|
127
|
-
"postcss-cli": "^8.3.1",
|
|
128
97
|
"prettier": "1.14.3",
|
|
129
|
-
"require-context": "^1.1.0",
|
|
130
|
-
"rollup": "^2.47.0",
|
|
131
|
-
"rollup-plugin-babel": "^4.4.0",
|
|
132
|
-
"rollup-plugin-commonjs": "^10.1.0",
|
|
133
|
-
"rollup-plugin-node-resolve": "^5.2.0",
|
|
134
|
-
"sass": "^1.45.0",
|
|
135
|
-
"sass-loader": "^10.1.1",
|
|
136
|
-
"terser": "^5.15.0",
|
|
137
98
|
"vue": "^2.6.12",
|
|
138
99
|
"vue-router": "^3.5.1",
|
|
139
100
|
"vue-server-renderer": "^2.6.12",
|
|
@@ -120,7 +120,7 @@ Quickly provide actionable badges with hover and focus states by specifying eith
|
|
|
120
120
|
<!-- b-badge-action.vue -->
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
Refer to the [Router support](/docs
|
|
124
|
-
props.
|
|
123
|
+
Refer to the [Router support](?path=/docs/base-link--docs#router-link-support) reference page for
|
|
124
|
+
router-link specific props.
|
|
125
125
|
|
|
126
126
|
<!-- Component reference added automatically from component package.json -->
|
|
@@ -62,8 +62,8 @@ const items = [
|
|
|
62
62
|
]
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
-
Refer to the [Router support](/docs
|
|
66
|
-
props.
|
|
65
|
+
Refer to the [Router support](?path=/docs/base-link--docs#router-link-support) reference page for
|
|
66
|
+
router-link specific props.
|
|
67
67
|
|
|
68
68
|
## Manually placed items
|
|
69
69
|
|
|
@@ -252,13 +252,13 @@ modifier (available in Vue 2.3+) on the `pressed` property
|
|
|
252
252
|
```
|
|
253
253
|
|
|
254
254
|
If using toggle button style for a radio or checkbox style interface, it is best to use the built-in
|
|
255
|
-
`button` style support of [`<b-form-radio-group>`](
|
|
256
|
-
[`<b-form-checkbox-group>`](
|
|
255
|
+
`button` style support of [`<b-form-radio-group>`](?path=/docs/base-form-form-radio--docs) and
|
|
256
|
+
[`<b-form-checkbox-group>`](?path=/docs/base-form-form-checkbox--docs).
|
|
257
257
|
|
|
258
258
|
## Router link support
|
|
259
259
|
|
|
260
|
-
Refer to the [`Router support`](/docs
|
|
261
|
-
supported `<router-link>` related props.
|
|
260
|
+
Refer to the [`Router support`](?path=/docs/base-link--docs#router-link-support) reference docs for
|
|
261
|
+
the various supported `<router-link>` related props.
|
|
262
262
|
|
|
263
263
|
## Accessibility
|
|
264
264
|
|
|
@@ -272,10 +272,8 @@ added, nor will the keyboard event listeners be enabled.
|
|
|
272
272
|
|
|
273
273
|
## See also
|
|
274
274
|
|
|
275
|
-
- [
|
|
276
|
-
- [
|
|
277
|
-
- [
|
|
278
|
-
- [Router Link Support](/docs/reference/router-links)
|
|
279
|
-
- [Color Variants](/docs/reference/color-variants)
|
|
275
|
+
- [button-group](?path=/docs/base-button-group--docs)
|
|
276
|
+
- [link](?path=/docs/base-link--docs)
|
|
277
|
+
- [Router Link Support](?path=/docs/base-link--docs#router-link-support)
|
|
280
278
|
|
|
281
279
|
<!-- Component reference added automatically from component package.json -->
|
|
@@ -104,9 +104,4 @@ that split dropdown menus are not supported when prop `vertical` is set.
|
|
|
104
104
|
<!-- b-button-group-menu.vue -->
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
## See also
|
|
108
|
-
|
|
109
|
-
Also check out the [`<b-button-toolbar>`](/docs/components/button-toolbar) component for generating
|
|
110
|
-
toolbars containing button groups and input groups.
|
|
111
|
-
|
|
112
107
|
<!-- Component reference added automatically from component package.json -->
|
|
@@ -311,8 +311,8 @@ apply those roles for you automatically, as it depends on your final document ma
|
|
|
311
311
|
|
|
312
312
|
**Note:** The animation effect of this component is dependent on the `prefers-reduced-motion` media
|
|
313
313
|
query. See the
|
|
314
|
-
[reduced motion section of our accessibility documentation](/docs
|
|
315
|
-
additional details.
|
|
314
|
+
[reduced motion section of our accessibility documentation](?path=/docs/base-tooltip--docs#accessibility)
|
|
315
|
+
for additional details.
|
|
316
316
|
|
|
317
317
|
## See also
|
|
318
318
|
|
|
@@ -508,8 +508,8 @@ the `tag` prop to any valid HTML5 tag on the `<b-dropdown-text>` sub-component.
|
|
|
508
508
|
|
|
509
509
|
Dropdowns support basic forms. Put a `<b-dropdown-form>` within a dropdown menu and place form
|
|
510
510
|
controls within the `<b-dropdown-form>`. The `<b-dropdown-form>` is based on the
|
|
511
|
-
[`<
|
|
512
|
-
regular form.
|
|
511
|
+
[`<gl-form>`](?path=/docs/base-form-form--docs) component, and supports the same props and
|
|
512
|
+
attributes as a regular form.
|
|
513
513
|
|
|
514
514
|
```html
|
|
515
515
|
<template>
|
|
@@ -722,9 +722,9 @@ the dropdown menu, ensure they are wrapped with a plain `<li>`.
|
|
|
722
722
|
|
|
723
723
|
## See also
|
|
724
724
|
|
|
725
|
-
- [`<b-nav-item-dropdown>`](
|
|
725
|
+
- [`<b-nav-item-dropdown>`](?path=/docs/base-nav--docs#dropdown-support) for dropdown support inside
|
|
726
726
|
`<b-nav>` and `<n-navbar>`
|
|
727
|
-
- [Router Link Support](/docs
|
|
728
|
-
specific props available on `<b-dropdown-item>`
|
|
727
|
+
- [Router Link Support](?path=/docs/base-link--docs#router-link-support) reference for information
|
|
728
|
+
about router-link specific props available on `<b-dropdown-item>`
|
|
729
729
|
|
|
730
730
|
<!-- Component reference added automatically from component package.json -->
|
|
@@ -186,23 +186,19 @@ technologies may resort to using the `placeholder` attribute, if present, but no
|
|
|
186
186
|
|
|
187
187
|
See also:
|
|
188
188
|
|
|
189
|
-
- [
|
|
190
|
-
- [
|
|
191
|
-
- [
|
|
192
|
-
- [
|
|
193
|
-
- [
|
|
194
|
-
- [
|
|
195
|
-
- [
|
|
196
|
-
- [
|
|
197
|
-
|
|
198
|
-
- [
|
|
199
|
-
- [
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
support labels, help text and feedback
|
|
203
|
-
- [`<b-input-group>`](/docs/components/input-group) Form Inputs with add-ons
|
|
204
|
-
- [`<b-form-row>`](/docs/components/layout) Create grid rows and columns with tighter margins
|
|
205
|
-
(available via the [Layout and grid components](/docs/components/layout))
|
|
189
|
+
- [form-input](?path=/docs/base-form-form-input--docs) Textual and text-like inputs
|
|
190
|
+
- [form-textarea](?path=/docs/base-form-form-textarea--docs) Text area inputs
|
|
191
|
+
- [form-select](?path=/docs/base-form-form-select--docs) Select input
|
|
192
|
+
- [form-radio](?path=/docs/base-form-form-radio--docs) Radio Inputs
|
|
193
|
+
- [form-checkbox](?path=/docs/base-form-form-checkbox--docs) Checkbox Inputs
|
|
194
|
+
- [form-date](?path=/docs/base-form-form-date--docs) Date input
|
|
195
|
+
- [button](?path=/docs/base-button--docs) Buttons
|
|
196
|
+
- [form-group](/?path=/docs/base-form-form-group--docs) Form Input wrapper to generate form-groups
|
|
197
|
+
that support labels, help text and feedback
|
|
198
|
+
- [form-input-group](/?path=/docs/base-form-form-input-group--docs) Form Inputs with add-ons
|
|
199
|
+
- [form-row](?path=/docs/base-form-form-group--docs#rows-b-row-and-b-form-row) Create grid rows and
|
|
200
|
+
columns with tighter margins (available via the
|
|
201
|
+
[Layout and grid components](?path=/docs/base-form-form-group--docs#layout-and-grid-system))
|
|
206
202
|
|
|
207
203
|
## Form helper components
|
|
208
204
|
|
|
@@ -253,12 +249,11 @@ class). Note that tooltip style feedback may, since its positioning is static, o
|
|
|
253
249
|
labels, etc.
|
|
254
250
|
|
|
255
251
|
**Note:** Some form controls, such as
|
|
256
|
-
[`<
|
|
257
|
-
[`<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
or the `force-show` prop to display the feedback.
|
|
252
|
+
[`<gl-form-radio>`](?path=/docs/base-form-form-radio--docs#contextual-states) and
|
|
253
|
+
[`<gl-form-checkbox>`](?path=/docs/base-form-form-checkbox--docs#contextual-states) have wrapper
|
|
254
|
+
elements which will prevent the feedback text from automatically showing (as the feedback component
|
|
255
|
+
is not a direct sibling of the form control's input). Use the feedback component's `state` prop
|
|
256
|
+
(bound to the state of the form control) or the `force-show` prop to display the feedback.
|
|
262
257
|
|
|
263
258
|
```html
|
|
264
259
|
<template>
|
|
@@ -330,9 +325,9 @@ export default {
|
|
|
330
325
|
|
|
331
326
|
See also:
|
|
332
327
|
|
|
333
|
-
- [
|
|
334
|
-
- [
|
|
335
|
-
on the formats and helper props associated with `options`.
|
|
328
|
+
- [form-input datalist](?path=/docs/base-form-form-input--docs#datalist-support) for datalist usage.
|
|
329
|
+
- [form-select `options` prop](?path=/docs/base-form-form-select--docs#options-property) docs for
|
|
330
|
+
details on the formats and helper props associated with `options`.
|
|
336
331
|
|
|
337
332
|
## Validation
|
|
338
333
|
|