@gitlab/ui 32.43.2 → 32.45.1
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 +29 -0
- package/README.md +6 -1
- package/config.js +15 -3
- package/dist/components/base/avatar/avatar.documentation.js +2 -5
- package/dist/components/base/avatar_link/avatar_link.documentation.js +2 -5
- package/dist/components/base/form/form_input/form_input.documentation.js +2 -27
- package/dist/components/base/form/form_input/form_input.js +23 -6
- package/dist/components/base/form/form_text/form_text.documentation.js +1 -4
- package/dist/components/base/form/form_textarea/form_textarea.documentation.js +1 -20
- package/dist/components/base/form/form_textarea/form_textarea.js +8 -0
- package/dist/components/base/label/label.documentation.js +2 -9
- package/dist/components/base/label/label.js +23 -1
- package/dist/components/base/pagination/pagination.documentation.js +2 -85
- package/dist/components/base/pagination/pagination.js +76 -0
- package/dist/components/base/segmented_control/segmented_control.documentation.js +2 -14
- package/dist/components/base/segmented_control/segmented_control.js +6 -0
- package/dist/components/base/skeleton_loader/skeleton_loader.documentation.js +2 -28
- package/dist/components/base/skeleton_loader/skeleton_loader.js +30 -0
- package/dist/components/charts/chart/chart.js +17 -4
- package/dist/components/charts/heatmap/heatmap.js +1 -9
- package/dist/components/charts/sparkline/sparkline.js +1 -1
- package/dist/config.js +15 -3
- package/dist/utility_classes.css +1 -1
- package/dist/utility_classes.css.map +1 -1
- package/documentation/documented_stories.js +8 -0
- package/package.json +13 -12
- package/src/components/base/alert/alert.spec.js +2 -2
- package/src/components/base/avatar/avatar.documentation.js +0 -2
- package/src/components/base/avatar/avatar.md +0 -2
- package/src/components/base/avatar/avatar.spec.js +1 -2
- package/src/components/base/avatar/avatar.stories.js +88 -101
- package/src/components/base/avatar_link/avatar_link.documentation.js +0 -2
- package/src/components/base/avatar_link/avatar_link.md +4 -7
- package/src/components/base/avatar_link/avatar_link.stories.js +66 -54
- package/src/components/base/filtered_search/filtered_search.spec.js +35 -35
- package/src/components/base/filtered_search/filtered_search_term.spec.js +1 -1
- package/src/components/base/form/form_input/form_input.documentation.js +0 -31
- package/src/components/base/form/form_input/form_input.md +0 -2
- package/src/components/base/form/form_input/form_input.stories.js +50 -42
- package/src/components/base/form/form_input/form_input.vue +23 -6
- package/src/components/base/form/form_input_group/form_input_group.spec.js +1 -3
- package/src/components/base/form/form_text/form_text.documentation.js +0 -2
- package/src/components/base/form/form_text/form_text.md +1 -3
- package/src/components/base/form/form_text/form_text.stories.js +20 -8
- package/src/components/base/form/form_textarea/form_textarea.documentation.js +0 -25
- package/src/components/base/form/form_textarea/form_textarea.stories.js +31 -30
- package/src/components/base/form/form_textarea/form_textarea.vue +8 -0
- package/src/components/base/icon/icon.spec.js +1 -4
- package/src/components/base/infinite_scroll/infinite_scroll.spec.js +1 -4
- package/src/components/base/label/label.documentation.js +2 -12
- package/src/components/base/label/label.md +2 -7
- package/src/components/base/label/label.stories.js +66 -92
- package/src/components/base/label/label.vue +22 -2
- package/src/components/base/modal/modal.spec.js +19 -23
- package/src/components/base/paginated_list/__snapshots__/paginated_list.spec.js.snap +10 -10
- package/src/components/base/pagination/pagination.documentation.js +0 -100
- package/src/components/base/pagination/pagination.md +5 -9
- package/src/components/base/pagination/pagination.spec.js +1 -4
- package/src/components/base/pagination/pagination.stories.js +109 -117
- package/src/components/base/pagination/pagination.vue +85 -0
- package/src/components/base/search_box_by_click/search_box_by_click.spec.js +1 -5
- package/src/components/base/segmented_control/segmented_control.documentation.js +0 -15
- package/src/components/base/segmented_control/segmented_control.md +0 -2
- package/src/components/base/segmented_control/segmented_control.stories.js +46 -36
- package/src/components/base/segmented_control/segmented_control.vue +5 -0
- package/src/components/base/skeleton_loader/skeleton_loader.documentation.js +0 -27
- package/src/components/base/skeleton_loader/skeleton_loader.md +0 -2
- package/src/components/base/skeleton_loader/skeleton_loader.stories.js +23 -9
- package/src/components/base/skeleton_loader/skeleton_loader.vue +24 -0
- package/src/components/base/sorting/sorting.spec.js +1 -4
- package/src/components/base/toast/toast.spec.js +4 -6
- package/src/components/base/token/token.spec.js +1 -4
- package/src/components/base/token_selector/token_container.spec.js +2 -3
- package/src/components/charts/chart/chart.spec.js +33 -4
- package/src/components/charts/chart/chart.vue +16 -4
- package/src/components/charts/gauge/gauge.spec.js +7 -7
- package/src/components/charts/heatmap/heatmap.vue +2 -9
- package/src/components/charts/sparkline/sparkline.spec.js +1 -4
- package/src/components/charts/sparkline/sparkline.vue +7 -1
- package/src/components/utilities/friendly_wrap/friendly_wrap.spec.js +1 -4
- package/src/components/utilities/intersperse/intersperse.spec.js +1 -4
- package/src/directives/hover_load/hover_load.spec.js +2 -13
- package/src/directives/outside/outside.spec.js +1 -6
- package/src/directives/resize_observer/resize_observer.spec.js +4 -10
- package/src/scss/storybook.scss +8 -0
- package/src/scss/utilities.scss +8 -0
- package/src/scss/utility-mixins/transform.scss +4 -0
- package/dist/components/base/avatar/examples/avatar.fallback.example.js +0 -38
- package/dist/components/base/avatar/examples/avatar.image.example.js +0 -38
- package/dist/components/base/avatar/examples/avatar.rect.example.js +0 -38
- package/dist/components/base/avatar/examples/avatar.tooltip.example.js +0 -38
- package/dist/components/base/avatar/examples/index.js +0 -31
- package/dist/components/base/avatar_link/examples/avatar.link.example.js +0 -38
- package/dist/components/base/avatar_link/examples/index.js +0 -13
- package/dist/components/base/form/form_input/examples/form_input/form_input.text.example.js +0 -38
- package/dist/components/base/form/form_input/examples/form_input/form_input.text_disabled.example.js +0 -38
- package/dist/components/base/form/form_input/examples/form_input/form_input.text_reactive.example.js +0 -57
- package/dist/components/base/form/form_input/examples/form_input/index.js +0 -22
- package/dist/components/base/form/form_text/examples/form_text.basic.example.js +0 -38
- package/dist/components/base/form/form_text/examples/index.js +0 -13
- package/dist/components/base/form/form_textarea/examples/form_textarea.basic.example.js +0 -47
- package/dist/components/base/form/form_textarea/examples/form_textarea.invalid.example.js +0 -47
- package/dist/components/base/form/form_textarea/examples/form_textarea.plaintext.example.js +0 -47
- package/dist/components/base/form/form_textarea/examples/form_textarea.readonly.example.js +0 -45
- package/dist/components/base/form/form_textarea/examples/form_textarea.submit.example.js +0 -47
- package/dist/components/base/form/form_textarea/examples/index.js +0 -37
- package/dist/components/base/label/examples/index.js +0 -19
- package/dist/components/base/label/examples/label.basic.example.js +0 -38
- package/dist/components/base/label/examples/label.scoped.example.js +0 -38
- package/dist/components/base/pagination/examples/index.js +0 -37
- package/dist/components/base/pagination/examples/pagination.basic.example.js +0 -45
- package/dist/components/base/pagination/examples/pagination.compact.example.js +0 -58
- package/dist/components/base/pagination/examples/pagination.double_truncation.example.js +0 -45
- package/dist/components/base/pagination/examples/pagination.event.example.js +0 -51
- package/dist/components/base/pagination/examples/pagination.links.example.js +0 -45
- package/dist/components/base/segmented_control/examples/index.js +0 -19
- package/dist/components/base/segmented_control/examples/segmented_control.basic.example.js +0 -65
- package/dist/components/base/segmented_control/examples/segmented_control.whitespace.example.js +0 -55
- package/dist/components/base/skeleton_loader/examples/ci_header_skeleton.basic.example.js +0 -38
- package/dist/components/base/skeleton_loader/examples/default_skeleton.basic.example.js +0 -38
- package/dist/components/base/skeleton_loader/examples/default_skeleton_custom_props.basic.example.js +0 -38
- package/dist/components/base/skeleton_loader/examples/index.js +0 -37
- package/dist/components/base/skeleton_loader/examples/issue_card_skeleton.basic.example.js +0 -38
- package/dist/components/base/skeleton_loader/examples/job_log_skeleton.basic.example.js +0 -38
- package/src/components/base/avatar/examples/avatar.fallback.example.vue +0 -3
- package/src/components/base/avatar/examples/avatar.image.example.vue +0 -3
- package/src/components/base/avatar/examples/avatar.rect.example.vue +0 -6
- package/src/components/base/avatar/examples/avatar.tooltip.example.vue +0 -3
- package/src/components/base/avatar/examples/index.js +0 -36
- package/src/components/base/avatar_link/examples/avatar.link.example.vue +0 -5
- package/src/components/base/avatar_link/examples/index.js +0 -15
- package/src/components/base/form/form_input/examples/form_input/form_input.text.example.vue +0 -3
- package/src/components/base/form/form_input/examples/form_input/form_input.text_disabled.example.vue +0 -3
- package/src/components/base/form/form_input/examples/form_input/form_input.text_reactive.example.vue +0 -24
- package/src/components/base/form/form_input/examples/form_input/index.js +0 -26
- package/src/components/base/form/form_text/examples/form_text.basic.example.vue +0 -5
- package/src/components/base/form/form_text/examples/index.js +0 -15
- package/src/components/base/form/form_textarea/examples/form_textarea.basic.example.vue +0 -11
- package/src/components/base/form/form_textarea/examples/form_textarea.invalid.example.vue +0 -11
- package/src/components/base/form/form_textarea/examples/form_textarea.plaintext.example.vue +0 -13
- package/src/components/base/form/form_textarea/examples/form_textarea.readonly.example.vue +0 -9
- package/src/components/base/form/form_textarea/examples/form_textarea.submit.example.vue +0 -11
- package/src/components/base/form/form_textarea/examples/index.js +0 -43
- package/src/components/base/label/examples/index.js +0 -22
- package/src/components/base/label/examples/label.basic.example.vue +0 -3
- package/src/components/base/label/examples/label.scoped.example.vue +0 -3
- package/src/components/base/pagination/examples/index.js +0 -43
- package/src/components/base/pagination/examples/pagination.basic.example.vue +0 -17
- package/src/components/base/pagination/examples/pagination.compact.example.vue +0 -33
- package/src/components/base/pagination/examples/pagination.double_truncation.example.vue +0 -11
- package/src/components/base/pagination/examples/pagination.event.example.vue +0 -26
- package/src/components/base/pagination/examples/pagination.links.example.vue +0 -18
- package/src/components/base/segmented_control/examples/index.js +0 -22
- package/src/components/base/segmented_control/examples/segmented_control.basic.example.vue +0 -19
- package/src/components/base/segmented_control/examples/segmented_control.whitespace.example.vue +0 -18
- package/src/components/base/skeleton_loader/examples/ci_header_skeleton.basic.example.vue +0 -10
- package/src/components/base/skeleton_loader/examples/default_skeleton.basic.example.vue +0 -3
- package/src/components/base/skeleton_loader/examples/default_skeleton_custom_props.basic.example.vue +0 -9
- package/src/components/base/skeleton_loader/examples/index.js +0 -44
- package/src/components/base/skeleton_loader/examples/issue_card_skeleton.basic.example.vue +0 -26
- package/src/components/base/skeleton_loader/examples/job_log_skeleton.basic.example.vue +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
## [32.45.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.45.0...v32.45.1) (2021-12-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Guard against nonexistent localStorage ([248f7b7](https://gitlab.com/gitlab-org/gitlab-ui/commit/248f7b7c662a8011c27c05dc14a6aaca4d752e33))
|
|
7
|
+
|
|
8
|
+
# [32.45.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.44.0...v32.45.0) (2021-12-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **css:** add negative translate x axis util ([987ad52](https://gitlab.com/gitlab-org/gitlab-ui/commit/987ad521f0990ed5311075c76496d4d29d89c2f7))
|
|
14
|
+
* **GlChart:** Addition of GlResizeObserverDirective for charts ([7a57fed](https://gitlab.com/gitlab-org/gitlab-ui/commit/7a57fed4e5d48ec209891f0a11fc133f4bcc1ded))
|
|
15
|
+
|
|
16
|
+
# [32.44.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.43.3...v32.44.0) (2021-12-09)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **GlFormText:** Migrate storybook story ([b64bc62](https://gitlab.com/gitlab-org/gitlab-ui/commit/b64bc6239ed5421b2c2023149e6fc59da936256e))
|
|
22
|
+
|
|
23
|
+
## [32.43.3](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.43.2...v32.43.3) (2021-12-08)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Bug Fixes
|
|
27
|
+
|
|
28
|
+
* **deps:** update dependency dompurify to ^2.3.4 ([6798e4f](https://gitlab.com/gitlab-org/gitlab-ui/commit/6798e4f3e4fdd2b12b1b6e4cf8e0ac3d575cf43f))
|
|
29
|
+
|
|
1
30
|
## [32.43.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.43.1...v32.43.2) (2021-12-07)
|
|
2
31
|
|
|
3
32
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# GitLab UI
|
|
2
2
|
|
|
3
|
-
GitLab UI is a UI component library
|
|
3
|
+
GitLab UI is a UI component library that implements [Pajamas](https://design.gitlab.com/), our
|
|
4
|
+
design system. GitLab UI is written in [Vue.js](https://vuejs.org) and its objectives are to:
|
|
5
|
+
|
|
6
|
+
- Create reusable UI components to accelerate frontend development.
|
|
7
|
+
- Create UI consistency for all components within GitLab.
|
|
8
|
+
|
|
4
9
|
See <https://gitlab-org.gitlab.io/gitlab-ui/> for documentation.
|
|
5
10
|
|
|
6
11
|
## Usage
|
package/config.js
CHANGED
|
@@ -11,10 +11,22 @@ const tooltipGlobalConfig = {
|
|
|
11
11
|
delay: tooltipDelay,
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Guard against nonexistent localStorage,
|
|
16
|
+
* or corrupted localStorage
|
|
17
|
+
*
|
|
18
|
+
* localStorage access is not possible in certain environments like
|
|
19
|
+
* - in iframe usage in Chrome if embedded on another domain
|
|
20
|
+
* - tests / node
|
|
21
|
+
*/
|
|
22
|
+
try {
|
|
23
|
+
const glTooltipDelay = localStorage.getItem('gl-tooltip-delay');
|
|
15
24
|
|
|
16
|
-
if (glTooltipDelay) {
|
|
17
|
-
|
|
25
|
+
if (glTooltipDelay) {
|
|
26
|
+
tooltipGlobalConfig.delay = JSON.parse(glTooltipDelay);
|
|
27
|
+
}
|
|
28
|
+
} catch (e) {
|
|
29
|
+
// localStorage doesn't exist (or the value is not properly formatted)
|
|
18
30
|
}
|
|
19
31
|
|
|
20
32
|
const setConfigs = () => {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "## Usage\n\nAvatars are used to represent a unique entity, be it a person, a group, or a project.\n";
|
|
1
|
+
var description = "Avatars are used to represent a unique entity, be it a person, a group, or a project.\n";
|
|
4
2
|
|
|
5
3
|
var avatar_documentation = {
|
|
6
4
|
followsDesignSystem: true,
|
|
7
|
-
description
|
|
8
|
-
examples
|
|
5
|
+
description
|
|
9
6
|
};
|
|
10
7
|
|
|
11
8
|
export default avatar_documentation;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "## Avatar link\n\n`<gl-avatar-link>` decorates `<gl-avatar>` with hyperlink functionality. It accepts the same\nproperties as the `<gl-link>` component and it works in the same way too. The main purpose of this\ncomponent is to apply visual enhancements that makes evident that the user can interact with the\navatar.\n\n## Using the component\n\nWhen wrapping an `<gl-avatar>` component, `<gl-avatar-link>` darkens\nthe border that surrounds the avatar image or fallback text when hovering over it.\n\n~~~vue\n<gl-avatar-link target=\"blank\" href=\"https://gitlab.com/gitlab-org/gitlab\">\n <gl-avatar\n :size=\"32\"\n :src=\"avatarUrl\"\n />\n</gl-avatar-link>\n~~~\n\nWhen wrapping an `<avatar-labeled>` component, `<avatar-link>` underlines\nthe label and sub-label text when hovering over the avatar. It also applies the\nsame effects described in the first example.\n\n~~~vue\n<gl-avatar-link target=\"blank\" href=\"https://gitlab.com/gitlab-org/gitlab\">\n <gl-avatar-labeled\n :size=\"32\"\n entity-name=\"GitLab\"\n label=\"GitLab User\"\n sub-label=\"@gitlab\"\n />\n</gl-avatar-link>\n\n~~~\n";
|
|
1
|
+
var description = "`<gl-avatar-link>` decorates `<gl-avatar>` with hyperlink functionality. It accepts the same\nproperties as the `<gl-link>` component and it works in the same way too. The main purpose of this\ncomponent is to apply visual enhancements that makes evident that the user can interact with the\navatar.\n\n## Using the component\n\nWhen wrapping an `<gl-avatar>` component, `<gl-avatar-link>` darkens\nthe border that surrounds the avatar image or fallback text when hovering over it.\n\n```vue\n<gl-avatar-link target=\"blank\" href=\"https://gitlab.com/gitlab-org/gitlab\">\n <gl-avatar\n :size=\"32\"\n :src=\"avatarUrl\"\n />\n</gl-avatar-link>\n```\n\nWhen wrapping an `<avatar-labeled>` component, `<avatar-link>` underlines\nthe label and sub-label text when hovering over the avatar. It also applies the\nsame effects described in the first example.\n\n```vue\n<gl-avatar-link target=\"blank\" href=\"https://gitlab.com/gitlab-org/gitlab\">\n <gl-avatar-labeled\n :size=\"32\"\n entity-name=\"GitLab\"\n label=\"GitLab User\"\n sub-label=\"@gitlab\"\n />\n</gl-avatar-link>\n```\n";
|
|
4
2
|
|
|
5
3
|
var avatar_link_documentation = {
|
|
6
4
|
followsDesignSystem: true,
|
|
7
|
-
description
|
|
8
|
-
examples
|
|
5
|
+
description
|
|
9
6
|
};
|
|
10
7
|
|
|
11
8
|
export default avatar_link_documentation;
|
|
@@ -1,33 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Form Input\n\nGeneral user input to be used in forms.\n";
|
|
1
|
+
var description = "General user input to be used in forms.\n";
|
|
4
2
|
|
|
5
3
|
var form_input_documentation = {
|
|
6
4
|
description,
|
|
7
|
-
|
|
8
|
-
bootstrapComponent: 'b-form-input',
|
|
9
|
-
followsDesignSystem: true,
|
|
10
|
-
propsInfo: {
|
|
11
|
-
size: {
|
|
12
|
-
additionalInfo: 'Maximum width of the input',
|
|
13
|
-
enum: 'formInputSizes'
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
events: [{
|
|
17
|
-
event: 'input',
|
|
18
|
-
args: [{
|
|
19
|
-
arg: 'value',
|
|
20
|
-
description: '(String)'
|
|
21
|
-
}],
|
|
22
|
-
description: 'Emitted to update the v-model'
|
|
23
|
-
}, {
|
|
24
|
-
event: 'update',
|
|
25
|
-
args: [{
|
|
26
|
-
arg: 'value',
|
|
27
|
-
description: '(String)'
|
|
28
|
-
}],
|
|
29
|
-
description: `Triggered by user interaction. Emitted after any formatting (not including 'trim' or 'number' props). Useful for getting the currently entered value when the 'debounce' or 'lazy' props are set.`
|
|
30
|
-
}]
|
|
5
|
+
followsDesignSystem: true
|
|
31
6
|
};
|
|
32
7
|
|
|
33
8
|
export default form_input_documentation;
|
|
@@ -2,17 +2,21 @@ import { BFormInput } from 'bootstrap-vue/esm/index.js';
|
|
|
2
2
|
import { formInputSizes } from '../../../../utils/constants';
|
|
3
3
|
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
event: 'input'
|
|
8
|
-
};
|
|
5
|
+
const MODEL_PROP = 'value';
|
|
6
|
+
const MODEL_EVENT = 'input';
|
|
9
7
|
var script = {
|
|
10
8
|
components: {
|
|
11
9
|
BFormInput
|
|
12
10
|
},
|
|
13
11
|
inheritAttrs: false,
|
|
14
|
-
model
|
|
12
|
+
model: {
|
|
13
|
+
prop: MODEL_PROP,
|
|
14
|
+
event: MODEL_EVENT
|
|
15
|
+
},
|
|
15
16
|
props: {
|
|
17
|
+
/**
|
|
18
|
+
* Maximum width of the input
|
|
19
|
+
*/
|
|
16
20
|
size: {
|
|
17
21
|
type: String,
|
|
18
22
|
required: false,
|
|
@@ -32,10 +36,23 @@ var script = {
|
|
|
32
36
|
// Swap purpose of input and update events from underlying BFormInput.
|
|
33
37
|
// See https://gitlab.com/gitlab-org/gitlab-ui/-/issues/631.
|
|
34
38
|
input: (...args) => {
|
|
39
|
+
/**
|
|
40
|
+
* Emitted to update the v-model
|
|
41
|
+
*
|
|
42
|
+
* @event update
|
|
43
|
+
* @property {string} value new value
|
|
44
|
+
*/
|
|
35
45
|
this.$emit('update', ...args);
|
|
36
46
|
},
|
|
37
47
|
update: (...args) => {
|
|
38
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Triggered by user interaction. Emitted after any formatting (not including 'trim' or 'number' props).
|
|
50
|
+
* Useful for getting the currently entered value when the 'debounce' or 'lazy' props are set.
|
|
51
|
+
*
|
|
52
|
+
* @event input
|
|
53
|
+
* @property {string} value new value
|
|
54
|
+
*/
|
|
55
|
+
this.$emit(MODEL_EVENT, ...args);
|
|
39
56
|
}
|
|
40
57
|
};
|
|
41
58
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var form_text = "# FormText\n\n<!-- STORY -->\n\nThe component used to render form group descriptions. Useful for when you need\nto add additional form text elements to a form group.\n";
|
|
1
|
+
var form_text = "# Usage\n\nThe component used to render form group descriptions. Useful for when you need\nto add additional form text elements to a form group.\n";
|
|
4
2
|
|
|
5
3
|
var description = /*#__PURE__*/Object.freeze({
|
|
6
4
|
__proto__: null,
|
|
@@ -9,7 +7,6 @@ var description = /*#__PURE__*/Object.freeze({
|
|
|
9
7
|
|
|
10
8
|
var form_text_documentation = {
|
|
11
9
|
description,
|
|
12
|
-
examples,
|
|
13
10
|
bootstrapComponent: 'b-form-text',
|
|
14
11
|
propsInfo: {}
|
|
15
12
|
};
|
|
@@ -1,26 +1,7 @@
|
|
|
1
|
-
import examples from './examples';
|
|
2
|
-
|
|
3
1
|
var description = "**Note:** This needs a `v-model` property to work correctly.\nSee [this issue](https://github.com/bootstrap-vue/bootstrap-vue/issues/1915) on Bootstrap Vue for\nmore information.\n";
|
|
4
2
|
|
|
5
3
|
var form_textarea_documentation = {
|
|
6
|
-
description
|
|
7
|
-
examples,
|
|
8
|
-
bootstrapComponent: 'b-form-textarea',
|
|
9
|
-
events: [{
|
|
10
|
-
event: 'input',
|
|
11
|
-
args: [{
|
|
12
|
-
arg: 'value',
|
|
13
|
-
description: '(String)'
|
|
14
|
-
}],
|
|
15
|
-
description: 'Emitted to update the v-model'
|
|
16
|
-
}, {
|
|
17
|
-
event: 'update',
|
|
18
|
-
args: [{
|
|
19
|
-
arg: 'value',
|
|
20
|
-
description: '(String)'
|
|
21
|
-
}],
|
|
22
|
-
description: `Triggered by user interaction. Emitted after any formatting (not including 'trim' or 'number' props). Useful for getting the currently entered value when the 'debounce' or 'lazy' props are set.`
|
|
23
|
-
}]
|
|
4
|
+
description
|
|
24
5
|
};
|
|
25
6
|
|
|
26
7
|
export default form_textarea_documentation;
|
|
@@ -36,9 +36,17 @@ var script = {
|
|
|
36
36
|
// Swap purpose of input and update events from underlying BFormTextarea.
|
|
37
37
|
// See https://gitlab.com/gitlab-org/gitlab-ui/-/issues/631.
|
|
38
38
|
input: (...args) => {
|
|
39
|
+
/**
|
|
40
|
+
* Emitted to update the v-model
|
|
41
|
+
*/
|
|
39
42
|
this.$emit('update', ...args);
|
|
40
43
|
},
|
|
41
44
|
update: (...args) => {
|
|
45
|
+
/**
|
|
46
|
+
* Triggered by user interaction.
|
|
47
|
+
* Emitted after any formatting (not including 'trim' or 'number' props).
|
|
48
|
+
* Useful for getting the currently entered value when the 'debounce' or 'lazy' props are set.
|
|
49
|
+
*/
|
|
42
50
|
this.$emit(model.event, ...args);
|
|
43
51
|
}
|
|
44
52
|
};
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import description from './label';
|
|
2
2
|
|
|
3
3
|
var label_documentation = {
|
|
4
4
|
followsDesignSystem: true,
|
|
5
|
-
|
|
6
|
-
events: [{
|
|
7
|
-
event: 'click',
|
|
8
|
-
description: 'Emitted when label is clicked'
|
|
9
|
-
}, {
|
|
10
|
-
event: 'close',
|
|
11
|
-
description: 'Emitted when x is clicked'
|
|
12
|
-
}]
|
|
5
|
+
description
|
|
13
6
|
};
|
|
14
7
|
|
|
15
8
|
export default label_documentation;
|
|
@@ -101,6 +101,28 @@ var script = {
|
|
|
101
101
|
this.splitScopedLabelIndex = this.title.lastIndexOf('::');
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
},
|
|
105
|
+
methods: {
|
|
106
|
+
onClick(e) {
|
|
107
|
+
/**
|
|
108
|
+
* Emitted when label is clicked
|
|
109
|
+
*
|
|
110
|
+
* @event click
|
|
111
|
+
* @type {object}
|
|
112
|
+
*/
|
|
113
|
+
this.$emit('click', e);
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
onClose(e) {
|
|
117
|
+
/**
|
|
118
|
+
* Emitted when x is clicked
|
|
119
|
+
*
|
|
120
|
+
* @event close
|
|
121
|
+
* @type {object}
|
|
122
|
+
*/
|
|
123
|
+
this.$emit('close', e);
|
|
124
|
+
}
|
|
125
|
+
|
|
104
126
|
}
|
|
105
127
|
};
|
|
106
128
|
|
|
@@ -108,7 +130,7 @@ var script = {
|
|
|
108
130
|
const __vue_script__ = script;
|
|
109
131
|
|
|
110
132
|
/* template */
|
|
111
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._b({ref:"labelTitle",staticClass:"gl-label",class:_vm.cssClasses,style:(_vm.cssVariables),on:{"click":
|
|
133
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',_vm._b({ref:"labelTitle",staticClass:"gl-label",class:_vm.cssClasses,style:(_vm.cssVariables),on:{"click":_vm.onClick}},'span',_vm.$attrs,false),[_c('gl-link',{staticClass:"gl-label-link",attrs:{"href":_vm.target}},[_c('span',{staticClass:"gl-label-text"},[_vm._v("\n "+_vm._s(_vm.scopedKey)+"\n ")]),_vm._v(" "),(_vm.scoped && _vm.scopedValue)?_c('span',{staticClass:"gl-label-text-scoped"},[_vm._v("\n "+_vm._s(_vm.scopedValue)+"\n ")]):_vm._e()]),_vm._v(" "),(_vm.showCloseButton)?_c('close-button',{staticClass:"gl-label-close gl-p-0!",attrs:{"label":"Remove label","variant":"reset","disabled":_vm.disabled},on:{"click":_vm.onClose}}):_vm._e(),_vm._v(" "),(_vm.description)?_c('gl-tooltip',{attrs:{"target":function () { return _vm.$refs.labelTitle; },"placement":_vm.tooltipPlacement,"boundary":"viewport"}},[(_vm.scoped)?_c('span',{staticClass:"gl-label-tooltip-title"},[_vm._v("Scoped label")]):_vm._e(),_vm._v("\n "+_vm._s(_vm.description)+"\n ")]):_vm._e()],1)};
|
|
112
134
|
var __vue_staticRenderFns__ = [];
|
|
113
135
|
|
|
114
136
|
/* style */
|
|
@@ -1,91 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Pagination\n\n<!-- STORY -->\n\n## Current page\n\nThe current page's value should be bound using `v-model`, e.g.:\n\n```html\n<script>\nexport default {\n data: () => ({\n page: 2,\n }),\n};\n</script>\n\n<template>\n <gl-pagination v-model=\"page\" :per-page=\"10\" :total-items=\"100\" />\n</template>\n```\n\n## Compact pagination\n\nIn some cases, you might not be able to provide the total items count because your API doesn't\nsupport it or because of performance concerns. For such cases, the pagination component supports a\ncompact mode, where only the previous and next buttons are displayed.\n\nTo enable the compact mode, you'll need to provide the previous and/or next page numbers via the\n`prev-page` and `next-page` props respectively.\n\n> NOTE: If one of the props is omitted, the corresponding button will be disabled. If both\n> properties are omitted the pagination won't render at all.\n\n```html\n<template>\n <gl-pagination :value=\"2\" :prev-page=\"1\" :next-page=\"3\" />\n</template>\n```\n\n## Limits\n\nThe `limits` prop is used to define pagination link limits based on Bootstrap's breakpoint sizes.\nIt is strongly recommended you provide a 'default' property, even if you have accounted for all\nbreakpoint sizes. While unlikely, it is possible breakpoints could change, thus, a default property\nensures a graceful fallback.\n\nHere is `limits` default value:\n\n```js\n{\n xs: 0,\n sm: 3,\n md: 9,\n default: 9,\n}\n```\n\n> Note: The component will not render any UI if the total items available for display is less than\n> the max items per page.\n\n## Internet Explorer 11\n\nThis component makes use of the\n[`Number.isInteger` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger),\nwhich is not supported in IE11, make sure it's being polyfilled when using the component.\n[`core-js`](https://github.com/zloirock/core-js) incudes the appropriate polyfill for this.\n";
|
|
1
|
+
var description = "## Current page\n\nThe current page's value should be bound using `v-model`, e.g.:\n\n```html\n<script>\n export default {\n data: () => ({\n page: 2,\n }),\n };\n</script>\n\n<template>\n <gl-pagination v-model=\"page\" :per-page=\"10\" :total-items=\"100\" />\n</template>\n```\n\n## Compact pagination\n\nIn some cases, you might not be able to provide the total items count because your API doesn't\nsupport it or because of performance concerns. For such cases, the pagination component supports a\ncompact mode, where only the previous and next buttons are displayed.\n\nTo enable the compact mode, you'll need to provide the previous and/or next page numbers via the\n`prev-page` and `next-page` props respectively.\n\n> NOTE: If one of the props is omitted, the corresponding button will be disabled. If both\n> properties are omitted the pagination won't render at all.\n\n```html\n<template>\n <gl-pagination :value=\"2\" :prev-page=\"1\" :next-page=\"3\" />\n</template>\n```\n\n## Limits\n\nThe `limits` prop is used to define pagination link limits based on Bootstrap's breakpoint sizes.\nIt is strongly recommended you provide a 'default' property, even if you have accounted for all\nbreakpoint sizes. While unlikely, it is possible breakpoints could change, thus, a default property\nensures a graceful fallback.\n\nHere is `limits` default value:\n\n```js\n{\n xs: 0,\n sm: 3,\n md: 9,\n default: 9,\n}\n```\n\n> Note: The component will not render any UI if the total items available for display is less than\n> the max items per page.\n\n## Internet Explorer 11\n\nThis component makes use of the\n[`Number.isInteger` method](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger),\nwhich is not supported in IE11, make sure it's being polyfilled when using the component.\n[`core-js`](https://github.com/zloirock/core-js) incudes the appropriate polyfill for this.\n";
|
|
4
2
|
|
|
5
3
|
var pagination_documentation = {
|
|
6
4
|
followsDesignSystem: true,
|
|
7
|
-
description
|
|
8
|
-
examples,
|
|
9
|
-
propsInfo: {
|
|
10
|
-
perPage: {
|
|
11
|
-
additionalInfo: 'Number of items per page'
|
|
12
|
-
},
|
|
13
|
-
totalItems: {
|
|
14
|
-
additionalInfo: 'Total number of items'
|
|
15
|
-
},
|
|
16
|
-
limits: {
|
|
17
|
-
additionalInfo: 'The object must contain the xs, sm, md and default keys'
|
|
18
|
-
},
|
|
19
|
-
linkGen: {
|
|
20
|
-
additionalInfo: 'A function that receives the page number and that returns a string representing the page URL'
|
|
21
|
-
},
|
|
22
|
-
prevPage: {
|
|
23
|
-
additionalInfo: 'When using the compact pagination, use this prop to pass the previous page number'
|
|
24
|
-
},
|
|
25
|
-
prevText: {
|
|
26
|
-
additionalInfo: 'Text for the previous button (overridden by "previous" slot)'
|
|
27
|
-
},
|
|
28
|
-
nextPage: {
|
|
29
|
-
additionalInfo: 'When using the compact pagination, use this prop to pass the next page number'
|
|
30
|
-
},
|
|
31
|
-
nextText: {
|
|
32
|
-
additionalInfo: 'Text for the next button (overridden by "next" slot)'
|
|
33
|
-
},
|
|
34
|
-
ellipsisText: {
|
|
35
|
-
additionalInfo: 'Text for the ellipsis (overridden by "ellipsis-left" and "ellipsis-right" slots)'
|
|
36
|
-
},
|
|
37
|
-
labelFirstPage: {
|
|
38
|
-
additionalInfo: 'aria-label for the first page item'
|
|
39
|
-
},
|
|
40
|
-
labelPrevPage: {
|
|
41
|
-
additionalInfo: 'aria-label for the previous page item'
|
|
42
|
-
},
|
|
43
|
-
labelNextPage: {
|
|
44
|
-
additionalInfo: 'aria-label for the next page item'
|
|
45
|
-
},
|
|
46
|
-
labelLastPage: {
|
|
47
|
-
additionalInfo: 'aria-label for the last page item'
|
|
48
|
-
},
|
|
49
|
-
labelPage: {
|
|
50
|
-
additionalInfo: 'aria-label getter for numbered page items, defaults to "Go to page <page_number>"'
|
|
51
|
-
},
|
|
52
|
-
align: {
|
|
53
|
-
additionalInfo: 'Controls the component\'s horizontal alignment, value should be one of "left", "center", "right" or "fill"'
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
events: [{
|
|
57
|
-
event: 'input',
|
|
58
|
-
description: 'Emitted when the page changes',
|
|
59
|
-
args: [{
|
|
60
|
-
arg: 'value',
|
|
61
|
-
description: 'The page that just got loaded'
|
|
62
|
-
}]
|
|
63
|
-
}, {
|
|
64
|
-
event: 'next',
|
|
65
|
-
description: 'Emitted when the "next" button is clicked'
|
|
66
|
-
}, {
|
|
67
|
-
event: 'previous',
|
|
68
|
-
description: 'Emitted when the "previous" button is clicked'
|
|
69
|
-
}],
|
|
70
|
-
slots: [{
|
|
71
|
-
name: 'previous',
|
|
72
|
-
description: `Content for the "previous" button. Overrides the "prevText" prop.`,
|
|
73
|
-
scopedProps: `{ active: boolean, disabled: boolean, page: number }`
|
|
74
|
-
}, {
|
|
75
|
-
name: 'next',
|
|
76
|
-
description: `Content for the "next" button. Overrides the "nextText" prop.`,
|
|
77
|
-
scopedProps: `{ active: boolean, disabled: boolean, page: number }`
|
|
78
|
-
}, {
|
|
79
|
-
name: 'page-number',
|
|
80
|
-
description: `Content for page number buttons.`,
|
|
81
|
-
scopedProps: `{ active: boolean, disabled: boolean, page: number }`
|
|
82
|
-
}, {
|
|
83
|
-
name: 'ellipsis-left',
|
|
84
|
-
description: `Content for the left ellipsis. Overrides the "ellipsisText" prop.`
|
|
85
|
-
}, {
|
|
86
|
-
name: 'ellipsis-right',
|
|
87
|
-
description: `Content for the right ellipsis. Overrides the "ellipsisText" prop.`
|
|
88
|
-
}]
|
|
5
|
+
description
|
|
89
6
|
};
|
|
90
7
|
|
|
91
8
|
export default pagination_documentation;
|
|
@@ -26,17 +26,29 @@ var script = {
|
|
|
26
26
|
default: 1,
|
|
27
27
|
validator: x => x > 0
|
|
28
28
|
},
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Number of items per page
|
|
32
|
+
*/
|
|
29
33
|
perPage: {
|
|
30
34
|
type: Number,
|
|
31
35
|
required: false,
|
|
32
36
|
default: 20,
|
|
33
37
|
validator: x => x > 0
|
|
34
38
|
},
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Total number of items
|
|
42
|
+
*/
|
|
35
43
|
totalItems: {
|
|
36
44
|
type: Number,
|
|
37
45
|
required: false,
|
|
38
46
|
default: 0
|
|
39
47
|
},
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The object must contain the xs, sm, md and default keys
|
|
51
|
+
*/
|
|
40
52
|
limits: {
|
|
41
53
|
type: Object,
|
|
42
54
|
required: false,
|
|
@@ -51,61 +63,109 @@ var script = {
|
|
|
51
63
|
return missingSizes === 0 ? true : value.default;
|
|
52
64
|
}
|
|
53
65
|
},
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A function that receives the page number and that returns a string representing the page URL
|
|
69
|
+
*/
|
|
54
70
|
linkGen: {
|
|
55
71
|
type: Function,
|
|
56
72
|
required: false,
|
|
57
73
|
default: null
|
|
58
74
|
},
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* When using the compact pagination, use this prop to pass the previous page number
|
|
78
|
+
*/
|
|
59
79
|
prevPage: {
|
|
60
80
|
type: Number,
|
|
61
81
|
required: false,
|
|
62
82
|
default: null
|
|
63
83
|
},
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Text for the previous button (overridden by "previous" slot)
|
|
87
|
+
*/
|
|
64
88
|
prevText: {
|
|
65
89
|
type: String,
|
|
66
90
|
required: false,
|
|
67
91
|
default: 'Prev'
|
|
68
92
|
},
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* When using the compact pagination, use this prop to pass the next page number
|
|
96
|
+
*/
|
|
69
97
|
nextPage: {
|
|
70
98
|
type: Number,
|
|
71
99
|
required: false,
|
|
72
100
|
default: null
|
|
73
101
|
},
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Text for the next button (overridden by "next" slot)
|
|
105
|
+
*/
|
|
74
106
|
nextText: {
|
|
75
107
|
type: String,
|
|
76
108
|
required: false,
|
|
77
109
|
default: 'Next'
|
|
78
110
|
},
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Text for the ellipsis (overridden by "ellipsis-left" and "ellipsis-right" slots)
|
|
114
|
+
*/
|
|
79
115
|
ellipsisText: {
|
|
80
116
|
type: String,
|
|
81
117
|
required: false,
|
|
82
118
|
default: '…'
|
|
83
119
|
},
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* aria-label for the first page item
|
|
123
|
+
*/
|
|
84
124
|
labelFirstPage: {
|
|
85
125
|
type: String,
|
|
86
126
|
required: false,
|
|
87
127
|
default: 'Go to first page'
|
|
88
128
|
},
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* aria-label for the previous page item
|
|
132
|
+
*/
|
|
89
133
|
labelPrevPage: {
|
|
90
134
|
type: String,
|
|
91
135
|
required: false,
|
|
92
136
|
default: 'Go to previous page'
|
|
93
137
|
},
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* aria-label for the next page item
|
|
141
|
+
*/
|
|
94
142
|
labelNextPage: {
|
|
95
143
|
type: String,
|
|
96
144
|
required: false,
|
|
97
145
|
default: 'Go to next page'
|
|
98
146
|
},
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* aria-label for the last page item
|
|
150
|
+
*/
|
|
99
151
|
labelLastPage: {
|
|
100
152
|
type: String,
|
|
101
153
|
required: false,
|
|
102
154
|
default: 'Go to last page'
|
|
103
155
|
},
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* aria-label getter for numbered page items, defaults to "Go to page <page_number>"
|
|
159
|
+
*/
|
|
104
160
|
labelPage: {
|
|
105
161
|
type: Function,
|
|
106
162
|
required: false,
|
|
107
163
|
default: page => `Go to page ${page}`
|
|
108
164
|
},
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Controls the component\'s horizontal alignment, value should be one of "left", "center", "right" or "fill"
|
|
168
|
+
*/
|
|
109
169
|
align: {
|
|
110
170
|
type: String,
|
|
111
171
|
required: false,
|
|
@@ -290,17 +350,33 @@ var script = {
|
|
|
290
350
|
handleClick(event, value) {
|
|
291
351
|
if (!this.isLinkBased) {
|
|
292
352
|
event.preventDefault();
|
|
353
|
+
/**
|
|
354
|
+
* Emitted when the page changes
|
|
355
|
+
* @event input
|
|
356
|
+
* @arg {number} value The page that just got loaded
|
|
357
|
+
*/
|
|
358
|
+
|
|
293
359
|
this.$emit('input', value);
|
|
294
360
|
}
|
|
295
361
|
},
|
|
296
362
|
|
|
297
363
|
handlePrevious(event, value) {
|
|
298
364
|
this.handleClick(event, value);
|
|
365
|
+
/**
|
|
366
|
+
* Emitted when the "previous" button is clicked
|
|
367
|
+
* @event previous
|
|
368
|
+
*/
|
|
369
|
+
|
|
299
370
|
this.$emit('previous');
|
|
300
371
|
},
|
|
301
372
|
|
|
302
373
|
handleNext(event, value) {
|
|
303
374
|
this.handleClick(event, value);
|
|
375
|
+
/**
|
|
376
|
+
* Emitted when the "next" button is clicked
|
|
377
|
+
* @event next
|
|
378
|
+
*/
|
|
379
|
+
|
|
304
380
|
this.$emit('next');
|
|
305
381
|
}
|
|
306
382
|
|
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var description = "# Segmented control\n\nButton group of equal options where only one can be selected and active.\n";
|
|
1
|
+
var description = "Button group of equal options where only one can be selected and active.\n";
|
|
4
2
|
|
|
5
3
|
var segmented_control_documentation = {
|
|
6
4
|
followsDesignSystem: false,
|
|
7
|
-
description
|
|
8
|
-
examples,
|
|
9
|
-
bootstrapComponent: 'b-form-radio-group',
|
|
10
|
-
events: [{
|
|
11
|
-
event: 'input',
|
|
12
|
-
description: 'Emitted when the selection changes',
|
|
13
|
-
args: [{
|
|
14
|
-
arg: 'checked',
|
|
15
|
-
description: 'The selected option'
|
|
16
|
-
}]
|
|
17
|
-
}]
|
|
5
|
+
description
|
|
18
6
|
};
|
|
19
7
|
|
|
20
8
|
export default segmented_control_documentation;
|
|
@@ -54,6 +54,12 @@ var script = {
|
|
|
54
54
|
|
|
55
55
|
if (this.enabledOptions.length) {
|
|
56
56
|
const suggestion = oldValue && this.isValidValue(oldValue) ? oldValue : this.enabledOptions[0].value;
|
|
57
|
+
/**
|
|
58
|
+
* Emitted when the selection changes
|
|
59
|
+
* @event input
|
|
60
|
+
* @argument checked The selected option
|
|
61
|
+
*/
|
|
62
|
+
|
|
57
63
|
this.$emit('input', suggestion);
|
|
58
64
|
}
|
|
59
65
|
}
|