@gitlab/ui 36.7.1 → 37.2.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 +32 -0
- package/dist/components/base/alert/alert.js +1 -11
- package/dist/components/base/card/card.js +1 -1
- package/dist/components/base/drawer/drawer.documentation.js +1 -1
- package/dist/components/base/form/form_input_group/form_input_group.documentation.js +2 -26
- package/dist/components/base/form/form_input_group/form_input_group.js +7 -0
- package/dist/components/base/loading_icon/loading_icon.js +1 -1
- package/dist/components/base/pagination/pagination.js +23 -2
- package/dist/components/base/path/data.js +2 -1
- package/dist/components/base/path/path.js +14 -7
- package/dist/components/base/tabs/tab/tab.js +4 -0
- package/dist/components/base/tabs/tabs/tabs.documentation.js +2 -14
- package/dist/components/base/tabs/tabs/tabs.js +8 -0
- package/dist/components/charts/area/area.documentation.js +1 -7
- package/dist/components/charts/legend/legend.js +12 -0
- package/dist/components/charts/line/line.documentation.js +2 -5
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/utils/stories_utils.js +13 -1
- package/documentation/components_documentation.js +0 -2
- package/documentation/documented_stories.js +6 -0
- package/package.json +2 -2
- package/src/components/base/accordion/accordion.stories.js +2 -1
- package/src/components/base/alert/alert.scss +0 -38
- package/src/components/base/alert/alert.spec.js +0 -1
- package/src/components/base/alert/alert.stories.js +0 -8
- package/src/components/base/alert/alert.vue +30 -41
- package/src/components/base/badge/badge.stories.js +4 -24
- package/src/components/base/card/card.vue +2 -2
- package/src/components/base/daterange_picker/daterange_picker.stories.js +10 -35
- package/src/components/base/drawer/drawer.documentation.js +1 -1
- package/src/components/base/form/form_input_group/form_input_group.documentation.js +0 -28
- package/src/components/base/form/form_input_group/form_input_group.md +0 -4
- package/src/components/base/form/form_input_group/form_input_group.stories.js +84 -62
- package/src/components/base/form/form_input_group/form_input_group.vue +9 -0
- package/src/components/base/icon/icon.stories.js +2 -5
- package/src/components/base/loading_icon/loading_icon.vue +1 -1
- package/src/components/base/pagination/pagination.spec.js +12 -2
- package/src/components/base/pagination/pagination.vue +23 -6
- package/src/components/base/path/__snapshots__/path.spec.js.snap +6 -0
- package/src/components/base/path/data.js +1 -0
- package/src/components/base/path/path.scss +6 -1
- package/src/components/base/path/path.spec.js +20 -0
- package/src/components/base/path/path.vue +18 -7
- package/src/components/base/tabs/tab/tab.vue +4 -0
- package/src/components/base/tabs/tabs/tabs.documentation.js +0 -12
- package/src/components/base/tabs/tabs/tabs.md +2 -7
- package/src/components/base/tabs/tabs/tabs.stories.js +219 -161
- package/src/components/base/tabs/tabs/tabs.vue +6 -0
- package/src/components/base/toggle/toggle.stories.js +2 -3
- package/src/components/charts/area/area.documentation.js +0 -5
- package/src/components/charts/area/area.stories.js +127 -127
- package/src/components/charts/bar/bar.stories.js +8 -5
- package/src/components/charts/heatmap/heatmap.stories.js +13 -16
- package/src/components/charts/legend/legend.stories.js +22 -15
- package/src/components/charts/legend/legend.vue +9 -0
- package/src/components/charts/line/line.documentation.js +0 -2
- package/src/components/charts/line/line.md +0 -2
- package/src/components/charts/line/line.stories.js +124 -113
- package/src/utils/stories_utils.js +6 -0
- package/src/utils/stories_utils.spec.js +18 -0
- package/dist/components/base/form/form_input_group/examples/form_input_group.basic.example.js +0 -38
- package/dist/components/base/form/form_input_group/examples/form_input_group.predefined_options.example.js +0 -54
- package/dist/components/base/form/form_input_group/examples/form_input_group.predefined_reactive.example.js +0 -55
- package/dist/components/base/form/form_input_group/examples/form_input_group.reactive.example.js +0 -48
- package/dist/components/base/form/form_input_group/examples/index.js +0 -27
- package/dist/components/base/tabs/tab/examples/index.js +0 -13
- package/dist/components/base/tabs/tab/examples/tab.basic.example.js +0 -38
- package/dist/components/base/tabs/tab/tab.documentation.js +0 -18
- package/dist/components/base/tabs/tabs/examples/index.js +0 -60
- package/dist/components/base/tabs/tabs/examples/tabs.basic.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.contentless_tab.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.counterbadges.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.custom_title.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.disabled.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.justified.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.no_tabs.example.js +0 -38
- package/dist/components/base/tabs/tabs/examples/tabs.scrollable.example.js +0 -47
- package/dist/components/base/tabs/tabs/examples/tabs.styles_only.example.js +0 -38
- package/dist/components/charts/area/examples/area.basic.example.js +0 -45
- package/dist/components/charts/area/examples/area.basic_plus.example.js +0 -53
- package/dist/components/charts/area/examples/index.js +0 -19
- package/dist/components/charts/legend/examples/index.js +0 -22
- package/dist/components/charts/legend/examples/legend.basic.example.js +0 -93
- package/dist/components/charts/legend/examples/legend.toggled.example.js +0 -100
- package/dist/components/charts/legend/legend.documentation.js +0 -21
- package/dist/components/charts/line/examples/index.js +0 -19
- package/dist/components/charts/line/examples/line.basic.example.js +0 -45
- package/dist/components/charts/line/examples/line.series.example.js +0 -53
- package/src/components/base/form/form_input_group/examples/form_input_group.basic.example.vue +0 -10
- package/src/components/base/form/form_input_group/examples/form_input_group.predefined_options.example.vue +0 -25
- package/src/components/base/form/form_input_group/examples/form_input_group.predefined_reactive.example.vue +0 -32
- package/src/components/base/form/form_input_group/examples/form_input_group.reactive.example.vue +0 -25
- package/src/components/base/form/form_input_group/examples/index.js +0 -32
- package/src/components/base/tabs/tab/examples/index.js +0 -15
- package/src/components/base/tabs/tab/examples/tab.basic.example.vue +0 -5
- package/src/components/base/tabs/tab/tab.documentation.js +0 -16
- package/src/components/base/tabs/tab/tab.md +0 -3
- package/src/components/base/tabs/tab/tab.stories.js +0 -12
- package/src/components/base/tabs/tabs/examples/index.js +0 -72
- package/src/components/base/tabs/tabs/examples/tabs.basic.example.vue +0 -6
- package/src/components/base/tabs/tabs/examples/tabs.contentless_tab.example.vue +0 -17
- package/src/components/base/tabs/tabs/examples/tabs.counterbadges.example.vue +0 -28
- package/src/components/base/tabs/tabs/examples/tabs.custom_title.example.vue +0 -9
- package/src/components/base/tabs/tabs/examples/tabs.disabled.example.vue +0 -7
- package/src/components/base/tabs/tabs/examples/tabs.justified.example.vue +0 -6
- package/src/components/base/tabs/tabs/examples/tabs.no_tabs.example.vue +0 -8
- package/src/components/base/tabs/tabs/examples/tabs.scrollable.example.vue +0 -20
- package/src/components/base/tabs/tabs/examples/tabs.styles_only.example.vue +0 -22
- package/src/components/charts/area/area.md +0 -1
- package/src/components/charts/area/examples/area.basic.example.vue +0 -14
- package/src/components/charts/area/examples/area.basic_plus.example.vue +0 -25
- package/src/components/charts/area/examples/index.js +0 -22
- package/src/components/charts/legend/examples/index.js +0 -27
- package/src/components/charts/legend/examples/legend.basic.example.vue +0 -55
- package/src/components/charts/legend/examples/legend.toggled.example.vue +0 -60
- package/src/components/charts/legend/legend.documentation.js +0 -19
- package/src/components/charts/legend/legend.md +0 -0
- package/src/components/charts/line/examples/index.js +0 -22
- package/src/components/charts/line/examples/line.basic.example.vue +0 -14
- package/src/components/charts/line/examples/line.series.example.vue +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
# [37.2.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.1.0...v37.2.0) (2022-03-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlPath:** allow changing selected index programmatically ([d711441](https://gitlab.com/gitlab-org/gitlab-ui/commit/d71144162363ae62ff4d1aeb3ee3dc956bd04108))
|
|
7
|
+
|
|
8
|
+
# [37.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.0.0...v37.1.0) (2022-02-28)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **GlPagination:** Add aria-current="page" on active page ([58b8993](https://gitlab.com/gitlab-org/gitlab-ui/commit/58b89935c32845406d85ce5898c501908e25d8ff))
|
|
14
|
+
|
|
15
|
+
# [37.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v36.7.1...v37.0.0) (2022-02-22)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **GlAlert:** drop contained behavior ([a2ae17e](https://gitlab.com/gitlab-org/gitlab-ui/commit/a2ae17eeb80eb9ea399b9f93047fc71764a3e1cb))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### BREAKING CHANGES
|
|
24
|
+
|
|
25
|
+
* **GlAlert:** This drops GlAlert's contained behavior.
|
|
26
|
+
|
|
27
|
+
Alerts content width cannot be constrainted with the `contained` prop
|
|
28
|
+
anymore. Existing alerts' content will exapnd to the take up the alert's
|
|
29
|
+
full width.
|
|
30
|
+
You should consider removing all `contained` usages from your code.
|
|
31
|
+
`
|
|
32
|
+
|
|
1
33
|
## [36.7.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v36.7.0...v36.7.1) (2022-02-18)
|
|
2
34
|
|
|
3
35
|
|
|
@@ -76,15 +76,6 @@ var script = {
|
|
|
76
76
|
required: false,
|
|
77
77
|
default: ''
|
|
78
78
|
},
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Contained alerts have their content's width limited.
|
|
82
|
-
*/
|
|
83
|
-
contained: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
required: false,
|
|
86
|
-
default: false
|
|
87
|
-
},
|
|
88
79
|
sticky: {
|
|
89
80
|
type: Boolean,
|
|
90
81
|
required: false,
|
|
@@ -182,10 +173,9 @@ const __vue_script__ = script;
|
|
|
182
173
|
/* template */
|
|
183
174
|
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:[
|
|
184
175
|
'gl-alert',
|
|
185
|
-
{ 'gl-alert-max-content gl-alert-layout-limited': _vm.contained },
|
|
186
176
|
{ 'gl-alert-sticky': _vm.sticky },
|
|
187
177
|
{ 'gl-alert-not-dismissible': !_vm.dismissible },
|
|
188
|
-
_vm.variantClass ]},[_c('
|
|
178
|
+
_vm.variantClass ]},[_c('gl-icon',{class:{ 'gl-alert-icon': true, 'gl-alert-icon-no-title': !_vm.title },attrs:{"name":_vm.iconName}}),_vm._v(" "),(_vm.dismissible)?_c('close-button',{ref:"dismiss",staticClass:"gl-dismiss-btn",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.onDismiss}}):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-alert-content",attrs:{"role":"alert"}},[(_vm.title)?_c('h4',{staticClass:"gl-alert-title"},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-alert-body"},[_vm._t("default")],2),_vm._v(" "),(_vm.shouldRenderActions)?_c('div',{staticClass:"gl-alert-actions"},[_vm._t("actions",_vm._l((_vm.actionButtons),function(actionButton,index){return _c('gl-button',_vm._g(_vm._b({key:index,staticClass:"gl-alert-action"},'gl-button',actionButton.attrs,false),actionButton.listeners),[_vm._v("\n "+_vm._s(actionButton.text)+"\n ")])}))],2):_vm._e()])],1)};
|
|
189
179
|
var __vue_staticRenderFns__ = [];
|
|
190
180
|
|
|
191
181
|
/* style */
|
|
@@ -35,7 +35,7 @@ var script = {
|
|
|
35
35
|
const __vue_script__ = script;
|
|
36
36
|
|
|
37
37
|
/* template */
|
|
38
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-card"},[(
|
|
38
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-card"},[(_vm.$slots.header)?_c('div',{staticClass:"gl-card-header",class:_vm.headerClass},[_vm._t("header")],2):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-card-body",class:_vm.bodyClass},[_vm._t("default")],2),_vm._v(" "),(_vm.$slots.footer)?_c('div',{staticClass:"gl-card-footer",class:_vm.footerClass},[_vm._t("footer")],2):_vm._e()])};
|
|
39
39
|
var __vue_staticRenderFns__ = [];
|
|
40
40
|
|
|
41
41
|
/* style */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var description = "The drawer is used to show more information about a certain resource in the UI and potentially\nhandle actions on the information.\n\n### By default\n\n```html\n<gl-drawer :open=\"open\" @close=\"close\">\n <template #header>Your Title</template>\n <template>\n ...children\n </template>\n</gl-drawer>\n```\n\n- `v-bind:open` will be a boolean you will pass to `gl-drawer` and `@close` is a listener that will\nbe a function that will toggle open to `false`.\n";
|
|
2
2
|
|
|
3
3
|
var drawer_documentation = {
|
|
4
|
-
followsDesignSystem:
|
|
4
|
+
followsDesignSystem: true,
|
|
5
5
|
description
|
|
6
6
|
};
|
|
7
7
|
|
|
@@ -1,32 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Form Group Input\n\n<!-- STORY -->\n\nThe `GlFormInputGroup` component allows one to build more advanced text\ninput fields than generic `GlFormInput` when one needs that flexibility.\nBasic usage of the component:\n\n```html\n<div>\n <gl-form-input-group>\n <template #prepend>\n <!-- Content to prepend your text input field -->\n </template>\n <template #append>\n <!-- Content to append your text input field -->\n </template>\n </gl-form-input-group>\n</div>\n```\n\nOne can use any other component (custom or `<gl-*>`) in both slots or\nnot to use the slots at all. In the latter, the component will fallback\nto simple `GlFormInput`.\n\n## Predefined options\n\nSometimes custom text input from the user isn't desired. Instead, the\nuser should pick one of the predefined options that will automatically\npopulate the input field. Typically, such cases will also include an\nactionable button (like **Copy**) put into the `append` slot.\n\nTo achieve this effect, the `GlFormInputGroup` component accepts an\narray of options in the form of `predefinedOptions` param. For example:\n\n```javascript\nconst optionValues = [\n { name: 'Option #1', value: 'Option #1 is selected!' },\n { name: 'Option #2', value: 'Option #2 is selected!' },\n];\n...\n<gl-form-input-group :predefined-options=\"optionValues\" />\n```\n\nThis will tell `GlFormInputGroup` to render a dropdown in the `prepend`\nslot with all of the supplied options' `name`s. When one of the options\nis selected, the input field is automatically populated with the\noption's `value`. Check the \"Examples\" section below for \"With\npredefined options\" example.\n\n### Pro tips\n\nRead some useful tips below about specific usage of the component.\n\n### Readonly input\n\nOften you want to make sure user doesn't mess up the predefined content\npasted into the input field. In this case, you can set `readonly`\nparam to `true`. You can play with `Readonly` knob on the right.\n\n### Preselect the text to copy\n\nIf you set the `readonly` param on the `GlFormInputGroup` component,\nusers will still be able to manually select the text and copy it.\nHowever, it's more user-friendly to preselect the text for the users if\nthey click anywhere in the input field. This can be achieved by setting\nthe `select-on-click` param to `true`. You can play with\n`Select text on click` knob on the right. Even better, try enabling\n`Readonly`, `Select text on click`, and `Switch to predefined input`\naltogether. And, probably, remove `Prepend text`. Or leave it. It's your\ncall. :)\n";
|
|
1
|
+
var description = "The `GlFormInputGroup` component allows one to build more advanced text\ninput fields than generic `GlFormInput` when one needs that flexibility.\nBasic usage of the component:\n\n```html\n<div>\n <gl-form-input-group>\n <template #prepend>\n <!-- Content to prepend your text input field -->\n </template>\n <template #append>\n <!-- Content to append your text input field -->\n </template>\n </gl-form-input-group>\n</div>\n```\n\nOne can use any other component (custom or `<gl-*>`) in both slots or\nnot to use the slots at all. In the latter, the component will fallback\nto simple `GlFormInput`.\n\n## Predefined options\n\nSometimes custom text input from the user isn't desired. Instead, the\nuser should pick one of the predefined options that will automatically\npopulate the input field. Typically, such cases will also include an\nactionable button (like **Copy**) put into the `append` slot.\n\nTo achieve this effect, the `GlFormInputGroup` component accepts an\narray of options in the form of `predefinedOptions` param. For example:\n\n```javascript\nconst optionValues = [\n { name: 'Option #1', value: 'Option #1 is selected!' },\n { name: 'Option #2', value: 'Option #2 is selected!' },\n];\n...\n<gl-form-input-group :predefined-options=\"optionValues\" />\n```\n\nThis will tell `GlFormInputGroup` to render a dropdown in the `prepend`\nslot with all of the supplied options' `name`s. When one of the options\nis selected, the input field is automatically populated with the\noption's `value`. Check the \"Examples\" section below for \"With\npredefined options\" example.\n\n### Pro tips\n\nRead some useful tips below about specific usage of the component.\n\n### Readonly input\n\nOften you want to make sure user doesn't mess up the predefined content\npasted into the input field. In this case, you can set `readonly`\nparam to `true`. You can play with `Readonly` knob on the right.\n\n### Preselect the text to copy\n\nIf you set the `readonly` param on the `GlFormInputGroup` component,\nusers will still be able to manually select the text and copy it.\nHowever, it's more user-friendly to preselect the text for the users if\nthey click anywhere in the input field. This can be achieved by setting\nthe `select-on-click` param to `true`. You can play with\n`Select text on click` knob on the right. Even better, try enabling\n`Readonly`, `Select text on click`, and `Switch to predefined input`\naltogether. And, probably, remove `Prepend text`. Or leave it. It's your\ncall. :)\n";
|
|
4
2
|
|
|
5
3
|
var form_input_group_documentation = {
|
|
6
4
|
followsDesignSystem: false,
|
|
7
|
-
description
|
|
8
|
-
examples,
|
|
9
|
-
bootstrapComponent: 'b-form-input',
|
|
10
|
-
propsInfo: {
|
|
11
|
-
'select-on-click': {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
additionalInfo: 'Automatically selects the content of the input field on click'
|
|
14
|
-
},
|
|
15
|
-
'predefined-options': {
|
|
16
|
-
type: Array,
|
|
17
|
-
additionalInfo: 'Array of options. Each option should have `name` and `value` information: {name: "Foo", value: "Bar"})'
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
slots: [{
|
|
21
|
-
name: 'default',
|
|
22
|
-
description: 'Allows replacement of default input field.'
|
|
23
|
-
}, {
|
|
24
|
-
name: 'prepend',
|
|
25
|
-
description: 'Is rendered in front of the input field.'
|
|
26
|
-
}, {
|
|
27
|
-
name: 'append',
|
|
28
|
-
description: 'Is rendered after the input field.'
|
|
29
|
-
}]
|
|
5
|
+
description
|
|
30
6
|
};
|
|
31
7
|
|
|
32
8
|
export default form_input_group_documentation;
|
|
@@ -16,11 +16,18 @@ var script = {
|
|
|
16
16
|
},
|
|
17
17
|
mixins: [InputGroupMixin],
|
|
18
18
|
props: {
|
|
19
|
+
/**
|
|
20
|
+
* Automatically selects the content of the input field on click.
|
|
21
|
+
*/
|
|
19
22
|
selectOnClick: {
|
|
20
23
|
type: Boolean,
|
|
21
24
|
required: false,
|
|
22
25
|
default: false
|
|
23
26
|
},
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Array of options. Each option should have `name` and `value` information: {name: "Foo", value: "Bar"})
|
|
30
|
+
*/
|
|
24
31
|
predefinedOptions: {
|
|
25
32
|
type: Array,
|
|
26
33
|
required: false,
|
|
@@ -67,7 +67,7 @@ var script = {
|
|
|
67
67
|
const __vue_script__ = script;
|
|
68
68
|
|
|
69
69
|
/* template */
|
|
70
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.rootElementType,{tag:"component",staticClass:"gl-spinner-container",attrs:{"role":"status"}},[_c('span',{staticClass:"align-text-bottom",class:_vm.cssClasses,attrs:{"aria-label":_vm.label}})])};
|
|
70
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.rootElementType,{tag:"component",staticClass:"gl-spinner-container",attrs:{"role":"status"}},[_c('span',{staticClass:"gl-vertical-align-text-bottom!",class:_vm.cssClasses,attrs:{"aria-label":_vm.label}})])};
|
|
71
71
|
var __vue_staticRenderFns__ = [];
|
|
72
72
|
|
|
73
73
|
/* style */
|
|
@@ -277,6 +277,26 @@ var script = {
|
|
|
277
277
|
|
|
278
278
|
nextPageIsDisabled() {
|
|
279
279
|
return this.pageIsDisabled(this.value + 1);
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
prevPageAriaLabel() {
|
|
283
|
+
return this.prevPageIsDisabled ? false : this.labelPrevPage || this.labelPage(this.value - 1);
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
nextPageAriaLabel() {
|
|
287
|
+
return this.nextPageIsDisabled ? false : this.labelNextPage || this.labelPage(this.value + 1);
|
|
288
|
+
},
|
|
289
|
+
|
|
290
|
+
prevPageHref() {
|
|
291
|
+
if (this.prevPageIsDisabled) return false;
|
|
292
|
+
if (this.isLinkBased) return this.linkGen(this.value - 1);
|
|
293
|
+
return '#';
|
|
294
|
+
},
|
|
295
|
+
|
|
296
|
+
nextPageHref() {
|
|
297
|
+
if (this.nextPageIsDisabled) return false;
|
|
298
|
+
if (this.isLinkBased) return this.linkGen(this.value + 1);
|
|
299
|
+
return '#';
|
|
280
300
|
}
|
|
281
301
|
|
|
282
302
|
},
|
|
@@ -313,6 +333,7 @@ var script = {
|
|
|
313
333
|
|
|
314
334
|
if (isActivePage) {
|
|
315
335
|
attrs.class.push('active');
|
|
336
|
+
attrs['aria-current'] = 'page';
|
|
316
337
|
} // Disable previous and/or next buttons if needed
|
|
317
338
|
|
|
318
339
|
|
|
@@ -391,13 +412,13 @@ const __vue_script__ = script;
|
|
|
391
412
|
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isVisible)?_c('ul',{staticClass:"pagination gl-pagination text-nowrap",class:_vm.wrapperClasses,attrs:{"role":"navigation","aria-label":"Pagination"}},[_c('li',{staticClass:"page-item",class:{
|
|
392
413
|
disabled: _vm.prevPageIsDisabled,
|
|
393
414
|
'flex-fill': _vm.isFillAlign,
|
|
394
|
-
}},[_c(_vm.prevPageIsDisabled ? 'span' : 'a',{tag:"component",staticClass:"gl-link page-link prev-page-item gl-display-flex",attrs:{"aria-
|
|
415
|
+
},attrs:{"aria-hidden":_vm.prevPageIsDisabled}},[_c(_vm.prevPageIsDisabled ? 'span' : 'a',{tag:"component",staticClass:"gl-link page-link prev-page-item gl-display-flex",attrs:{"aria-label":_vm.prevPageAriaLabel,"href":_vm.prevPageHref},on:{"click":function($event){return _vm.handlePrevious($event, _vm.value - 1)}}},[_vm._t("previous",[_c('gl-icon',{attrs:{"name":"chevron-left"}}),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.prevText))])],null,{ page: _vm.value - 1, disabled: _vm.prevPageIsDisabled })],2)],1),_vm._v(" "),_vm._l((_vm.visibleItems),function(item){return _c('li',{key:item.key,staticClass:"page-item",class:{
|
|
395
416
|
disabled: item.disabled,
|
|
396
417
|
'flex-fill': _vm.isFillAlign,
|
|
397
418
|
}},[_c(item.component,_vm._g(_vm._b({tag:"component",staticClass:"page-link",attrs:{"size":"md","aria-disabled":item.disabled}},'component',item.attrs,false),item.listeners),[_vm._t(item.slot,[_vm._v(_vm._s(item.content))],null,item.slotData)],2)],1)}),_vm._v(" "),_c('li',{staticClass:"page-item",class:{
|
|
398
419
|
disabled: _vm.nextPageIsDisabled,
|
|
399
420
|
'flex-fill': _vm.isFillAlign,
|
|
400
|
-
}},[_c(_vm.nextPageIsDisabled ? 'span' : 'a',{tag:"component",staticClass:"gl-link page-link next-page-item gl-display-flex",attrs:{"aria-
|
|
421
|
+
},attrs:{"aria-hidden":_vm.nextPageIsDisabled}},[_c(_vm.nextPageIsDisabled ? 'span' : 'a',{tag:"component",staticClass:"gl-link page-link next-page-item gl-display-flex",attrs:{"aria-label":_vm.nextPageAriaLabel,"href":_vm.nextPageHref},on:{"click":function($event){return _vm.handleNext($event, _vm.value + 1)}}},[_vm._t("next",[_c('span',[_vm._v(_vm._s(_vm.nextText))]),_vm._v(" "),_c('gl-icon',{attrs:{"name":"chevron-right"}})],null,{ page: _vm.value + 1, disabled: _vm.nextPageIsDisabled })],2)],1)],2):_vm._e()};
|
|
401
422
|
var __vue_staticRenderFns__ = [];
|
|
402
423
|
|
|
403
424
|
/* style */
|
|
@@ -21,9 +21,10 @@ var script = {
|
|
|
21
21
|
* A list of path items in the form:
|
|
22
22
|
* ```
|
|
23
23
|
* {
|
|
24
|
-
* title:
|
|
25
|
-
* metric:
|
|
26
|
-
* icon:
|
|
24
|
+
* title: String, required
|
|
25
|
+
* metric: Any, optional
|
|
26
|
+
* icon: String, optional
|
|
27
|
+
* disabled: Boolean, optional
|
|
27
28
|
* }
|
|
28
29
|
* ```
|
|
29
30
|
*/
|
|
@@ -88,10 +89,16 @@ var script = {
|
|
|
88
89
|
}
|
|
89
90
|
|
|
90
91
|
},
|
|
92
|
+
watch: {
|
|
93
|
+
items: {
|
|
94
|
+
immediate: true,
|
|
95
|
+
|
|
96
|
+
handler(items) {
|
|
97
|
+
const selectedIndex = items.findIndex(item => item.selected);
|
|
98
|
+
this.selectedIndex = selectedIndex > 0 ? selectedIndex : 0;
|
|
99
|
+
}
|
|
91
100
|
|
|
92
|
-
|
|
93
|
-
const selectedIndex = this.items.findIndex(item => item.selected);
|
|
94
|
-
this.selectedIndex = selectedIndex > 0 ? selectedIndex : 0;
|
|
101
|
+
}
|
|
95
102
|
},
|
|
96
103
|
|
|
97
104
|
beforeCreate() {
|
|
@@ -174,7 +181,7 @@ var script = {
|
|
|
174
181
|
const __vue_script__ = script;
|
|
175
182
|
|
|
176
183
|
/* template */
|
|
177
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"gl-resize-observer-directive",rawName:"v-gl-resize-observer-directive",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-path-nav",style:({ '--path-bg-color': _vm.backgroundColor }),attrs:{"data-testid":"gl-path-nav"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollLeft),expression:"displayScrollLeft"}],staticClass:"gl-path-fade gl-path-fade-left"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll left"},on:{"click":_vm.scrollPathLeft}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-left"}})],1)]),_vm._v(" "),_c('ul',{ref:"pathNavList",staticClass:"gl-path-nav-list"},_vm._l((_vm.items),function(item,index){return _c('li',{key:index,ref:"pathListItems",refInFor:true,staticClass:"gl-path-nav-list-item",attrs:{"id":_vm.pathId(index)}},[_c('button',{class:_vm.pathItemClass(index),on:{"click":function($event){return _vm.onItemClicked(index)}}},[(_vm.shouldDisplayIcon(item.icon))?_c('gl-icon',{staticClass:"gl-mr-2",attrs:{"name":item.icon,"data-testid":"gl-path-item-icon"}}):_vm._e(),_vm._v("\n "+_vm._s(item.title)),(item.metric)?_c('span',{staticClass:"gl-font-weight-normal gl-pl-2"},[_vm._v(_vm._s(item.metric))]):_vm._e()],1),_vm._v(" "),_vm._t("default",null,{"pathItem":item,"pathId":_vm.pathId(index)})],2)}),0),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollRight),expression:"displayScrollRight"}],staticClass:"gl-path-fade gl-path-fade-right"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll right"},on:{"click":_vm.scrollPathRight}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-right"}})],1)])])};
|
|
184
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"gl-resize-observer-directive",rawName:"v-gl-resize-observer-directive",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-path-nav",style:({ '--path-bg-color': _vm.backgroundColor }),attrs:{"data-testid":"gl-path-nav"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollLeft),expression:"displayScrollLeft"}],staticClass:"gl-path-fade gl-path-fade-left"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll left"},on:{"click":_vm.scrollPathLeft}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-left"}})],1)]),_vm._v(" "),_c('ul',{ref:"pathNavList",staticClass:"gl-path-nav-list"},_vm._l((_vm.items),function(item,index){return _c('li',{key:index,ref:"pathListItems",refInFor:true,staticClass:"gl-path-nav-list-item",attrs:{"id":_vm.pathId(index)}},[_c('button',{class:_vm.pathItemClass(index),attrs:{"category":item.disabled ? 'tertiary' : undefined,"disabled":item.disabled},on:{"click":function($event){return _vm.onItemClicked(index)}}},[(_vm.shouldDisplayIcon(item.icon))?_c('gl-icon',{staticClass:"gl-mr-2",attrs:{"name":item.icon,"data-testid":"gl-path-item-icon"}}):_vm._e(),_vm._v("\n "+_vm._s(item.title)),(item.metric)?_c('span',{staticClass:"gl-font-weight-normal gl-pl-2"},[_vm._v(_vm._s(item.metric))]):_vm._e()],1),_vm._v(" "),_vm._t("default",null,{"pathItem":item,"pathId":_vm.pathId(index)})],2)}),0),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollRight),expression:"displayScrollRight"}],staticClass:"gl-path-fade gl-path-fade-right"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll right"},on:{"click":_vm.scrollPathRight}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-right"}})],1)])])};
|
|
178
185
|
var __vue_staticRenderFns__ = [];
|
|
179
186
|
|
|
180
187
|
/* style */
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Tabs\n\n<!-- STORY -->\n## Usage\n\nTabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one\nspecific view at a time while maintaining sight of all the relevant content options available. Each\ntab, when active, will reveal it’s own unique content.\n\n## Using the component Vue\n\n~~~js\n<gl-tabs>\n <gl-tab title=\"Tab 1\">\n Tab panel 1\n </gl-tab>\n <gl-tab title=\"Tab 2\">\n Tab panel 2\n </gl-tab>\n</gl-tabs>\n~~~\n\n## Using the component HTML\n\n~~~js\n<div class=\"tabs gl-tabs\">\n <ul role=\"tablist\" class=\"nav gl-tabs-nav\">\n <li role=\"presentation\" class=\"nav-item\">\n <a\n role=\"tab\"\n target=\"_self\"\n href=\"#\"\n class=\"nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo\"\n >Tab 1</a>\n </li>\n <li role=\"presentation\" class=\"nav-item\">\n <a role=\"tab\" target=\"_self\" href=\"#\" class=\"nav-link gl-tab-nav-item\">Tab 2</a>\n </li>\n </ul>\n <div class=\"tab-content gl-tab-content\">\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content active\">Tab panel 1</div>\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content\">Tab panel 2</div>\n </div>\n</div>\n~~~\n\n## Adding Action Buttons to the Tabs\n\nTabs start and end slot can be populated via props: `action-primary`, `action-secondary` and\n`action-tertiary`. These props allow you to handle how a primary, secondary and tertiary button will\nbehave and look. The props receive an object as such:\n\n~~~js\n{\n text: 'Save Changes',\n attributes: [\n { variant: 'info' },\n { disabled: this.someState },\n { class: 'some-class' },\n ...\n ]\n}\n~~~\n\n## Scrollable tab buttons\n\nBy default, `GlTab` will wrap tab buttons when they overflow the container. To\nenable horizontally scrolling for the tab buttons, use the `GlScrollableTabs`\ncomponent. This is a separate Vue component because of some limitations:\n\n- The action props (e.g., `action-primary`) are not respected in `GlScrollableTabs`. At the\n moment, BootstrapVue does not provide a reliable way for us to achieve this desired combination.\n\n`GlScrollableTabs` composes `GlTabs` and passes through every listener, slot, or prop (with the above\nexceptions).\n\n~~~html\n<gl-scrollable-tabs>\n <gl-tab v-for=\"tab in tabs\" :key=\"tab.key\" :title=\"tab.title\"> {{ tab.content }} </gl-tab>\n</gl-scrollable-tabs>\n~~~\n";
|
|
1
|
+
var description = "Tabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one\nspecific view at a time while maintaining sight of all the relevant content options available. Each\ntab, when active, will reveal it’s own unique content.\n\n## Using the component Vue\n\n~~~html\n<gl-tabs>\n <gl-tab title=\"Tab 1\">\n Tab panel 1\n </gl-tab>\n <gl-tab title=\"Tab 2\">\n Tab panel 2\n </gl-tab>\n</gl-tabs>\n~~~\n\n## Using the component HTML\n\n~~~html\n<div class=\"tabs gl-tabs\">\n <ul role=\"tablist\" class=\"nav gl-tabs-nav\">\n <li role=\"presentation\" class=\"nav-item\">\n <a\n role=\"tab\"\n target=\"_self\"\n href=\"#\"\n class=\"nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo\"\n >Tab 1</a>\n </li>\n <li role=\"presentation\" class=\"nav-item\">\n <a role=\"tab\" target=\"_self\" href=\"#\" class=\"nav-link gl-tab-nav-item\">Tab 2</a>\n </li>\n </ul>\n <div class=\"tab-content gl-tab-content\">\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content active\">Tab panel 1</div>\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content\">Tab panel 2</div>\n </div>\n</div>\n~~~\n\n## Adding Action Buttons to the Tabs\n\nTabs start and end slot can be populated via props: `action-primary`, `action-secondary` and\n`action-tertiary`. These props allow you to handle how a primary, secondary and tertiary button will\nbehave and look. The props receive an object as such:\n\n~~~js\n{\n text: 'Save Changes',\n attributes: [\n { variant: 'info' },\n { disabled: this.someState },\n { class: 'some-class' },\n ...\n ]\n}\n~~~\n\n## Scrollable tab buttons\n\nBy default, `GlTab` will wrap tab buttons when they overflow the container. To\nenable horizontally scrolling for the tab buttons, use the `GlScrollableTabs`\ncomponent. This is a separate Vue component because of some limitations:\n\n- The action props (e.g., `action-primary`) are not respected in `GlScrollableTabs`. At the\n moment, BootstrapVue does not provide a reliable way for us to achieve this desired combination.\n\n`GlScrollableTabs` composes `GlTabs` and passes through every listener, slot, or prop (with the above\nexceptions).\n\n~~~html\n<gl-scrollable-tabs>\n <gl-tab v-for=\"tab in tabs\" :key=\"tab.key\" :title=\"tab.title\"> {{ tab.content }} </gl-tab>\n</gl-scrollable-tabs>\n~~~\n";
|
|
4
2
|
|
|
5
3
|
var tabs_documentation = {
|
|
6
4
|
description,
|
|
7
|
-
|
|
8
|
-
bootstrapComponent: 'b-tabs',
|
|
9
|
-
followsDesignSystem: true,
|
|
10
|
-
propsInfo: {
|
|
11
|
-
syncActiveTabWithQueryParams: {
|
|
12
|
-
additionalInfo: 'Sync active tab with query string parameters. Allows for deep linking into specific tabs.'
|
|
13
|
-
},
|
|
14
|
-
queryParamName: {
|
|
15
|
-
additionalInfo: 'Name to use for query string parameter.'
|
|
16
|
-
}
|
|
17
|
-
}
|
|
5
|
+
followsDesignSystem: true
|
|
18
6
|
};
|
|
19
7
|
|
|
20
8
|
export default tabs_documentation;
|
|
@@ -45,11 +45,19 @@ var script = {
|
|
|
45
45
|
required: false,
|
|
46
46
|
default: false
|
|
47
47
|
},
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Sync active tab with query string parameters. Allows for deep linking into specific tabs.
|
|
51
|
+
*/
|
|
48
52
|
syncActiveTabWithQueryParams: {
|
|
49
53
|
type: Boolean,
|
|
50
54
|
required: false,
|
|
51
55
|
default: false
|
|
52
56
|
},
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Name to use for query string parameter.
|
|
60
|
+
*/
|
|
53
61
|
queryParamName: {
|
|
54
62
|
type: String,
|
|
55
63
|
required: false,
|
|
@@ -37,6 +37,10 @@ var script = {
|
|
|
37
37
|
required: false,
|
|
38
38
|
default: () => ({})
|
|
39
39
|
},
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Text for data average (overridden by prop if needed for internationalization)
|
|
43
|
+
*/
|
|
40
44
|
averageText: {
|
|
41
45
|
type: String,
|
|
42
46
|
required: false,
|
|
@@ -52,11 +56,19 @@ var script = {
|
|
|
52
56
|
required: false,
|
|
53
57
|
default: LEGEND_MIN_TEXT
|
|
54
58
|
},
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Text for max amount (overridden by prop if needed for internationalization)
|
|
62
|
+
*/
|
|
55
63
|
maxText: {
|
|
56
64
|
type: String,
|
|
57
65
|
required: false,
|
|
58
66
|
default: LEGEND_MAX_TEXT
|
|
59
67
|
},
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Sets the display layout
|
|
71
|
+
*/
|
|
60
72
|
layout: {
|
|
61
73
|
type: String,
|
|
62
74
|
required: false,
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "### Line Chart\n\nThis is a basic line chart.\n\n### Implementation Details\n\nThis component wraps the Gitlab UI `chart` component, which in turn wraps the ECharts component.\n\nSee the [chart](./?path=/story/charts-chart--default) component for more info.\n";
|
|
1
|
+
var description = "This is a basic line chart.\n\n### Implementation Details\n\nThis component wraps the Gitlab UI `chart` component, which in turn wraps the ECharts component.\n\nSee the [chart](./?path=/story/charts-chart--default) component for more info.\n";
|
|
4
2
|
|
|
5
3
|
var line_documentation = {
|
|
6
4
|
followsDesignSystem: false,
|
|
7
|
-
description
|
|
8
|
-
examples
|
|
5
|
+
description
|
|
9
6
|
};
|
|
10
7
|
|
|
11
8
|
export default line_documentation;
|