@gitlab/ui 32.43.0 → 32.44.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 +28 -0
- package/README.md +6 -1
- 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_group/examples/form_group/form_group.validation.example.js +3 -3
- 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/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/regions/empty_state/empty_state.js +1 -1
- package/documentation/documented_stories.js +6 -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_group/examples/form_group/form_group.validation.example.vue +3 -3
- package/src/components/base/form/form_group/form_group.stories.js +3 -3
- 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/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/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/gauge/gauge.spec.js +7 -7
- package/src/components/charts/sparkline/sparkline.spec.js +1 -4
- package/src/components/regions/empty_state/empty_state.vue +8 -2
- 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/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/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/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/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
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
var script = {
|
|
4
|
-
data() {
|
|
5
|
-
return {
|
|
6
|
-
options: [{
|
|
7
|
-
value: 1,
|
|
8
|
-
text: 'First'
|
|
9
|
-
}, {
|
|
10
|
-
value: 2,
|
|
11
|
-
text: 'Second',
|
|
12
|
-
disabled: true
|
|
13
|
-
}, {
|
|
14
|
-
value: 3,
|
|
15
|
-
text: 'Third'
|
|
16
|
-
}, {
|
|
17
|
-
value: 4,
|
|
18
|
-
text: 'Fourth'
|
|
19
|
-
}, {
|
|
20
|
-
value: 5,
|
|
21
|
-
text: 'Fifth'
|
|
22
|
-
}],
|
|
23
|
-
selected: 1
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/* script */
|
|
30
|
-
const __vue_script__ = script;
|
|
31
|
-
|
|
32
|
-
/* template */
|
|
33
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-segmented-control',{attrs:{"options":_vm.options},model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v;},expression:"selected"}})};
|
|
34
|
-
var __vue_staticRenderFns__ = [];
|
|
35
|
-
|
|
36
|
-
/* style */
|
|
37
|
-
const __vue_inject_styles__ = undefined;
|
|
38
|
-
/* scoped */
|
|
39
|
-
const __vue_scope_id__ = undefined;
|
|
40
|
-
/* module identifier */
|
|
41
|
-
const __vue_module_identifier__ = undefined;
|
|
42
|
-
/* functional template */
|
|
43
|
-
const __vue_is_functional_template__ = false;
|
|
44
|
-
/* style inject */
|
|
45
|
-
|
|
46
|
-
/* style inject SSR */
|
|
47
|
-
|
|
48
|
-
/* style inject shadow dom */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const __vue_component__ = __vue_normalize__(
|
|
53
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
54
|
-
__vue_inject_styles__,
|
|
55
|
-
__vue_script__,
|
|
56
|
-
__vue_scope_id__,
|
|
57
|
-
__vue_is_functional_template__,
|
|
58
|
-
__vue_module_identifier__,
|
|
59
|
-
false,
|
|
60
|
-
undefined,
|
|
61
|
-
undefined,
|
|
62
|
-
undefined
|
|
63
|
-
);
|
|
64
|
-
|
|
65
|
-
export default __vue_component__;
|
package/dist/components/base/segmented_control/examples/segmented_control.whitespace.example.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
2
|
-
|
|
3
|
-
var script = {
|
|
4
|
-
data() {
|
|
5
|
-
return {
|
|
6
|
-
options: [{
|
|
7
|
-
value: true,
|
|
8
|
-
text: 'Show'
|
|
9
|
-
}, {
|
|
10
|
-
value: false,
|
|
11
|
-
text: 'Hide'
|
|
12
|
-
}],
|
|
13
|
-
selected: true
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/* script */
|
|
20
|
-
const __vue_script__ = script;
|
|
21
|
-
|
|
22
|
-
/* template */
|
|
23
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-group',{attrs:{"id":"group-id","label":"Whitespace","label-size":"sm","label-for":"select1"}},[_c('gl-segmented-control',{attrs:{"id":"select1","options":_vm.options},model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v;},expression:"selected"}})],1)};
|
|
24
|
-
var __vue_staticRenderFns__ = [];
|
|
25
|
-
|
|
26
|
-
/* style */
|
|
27
|
-
const __vue_inject_styles__ = undefined;
|
|
28
|
-
/* scoped */
|
|
29
|
-
const __vue_scope_id__ = undefined;
|
|
30
|
-
/* module identifier */
|
|
31
|
-
const __vue_module_identifier__ = undefined;
|
|
32
|
-
/* functional template */
|
|
33
|
-
const __vue_is_functional_template__ = false;
|
|
34
|
-
/* style inject */
|
|
35
|
-
|
|
36
|
-
/* style inject SSR */
|
|
37
|
-
|
|
38
|
-
/* style inject shadow dom */
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const __vue_component__ = __vue_normalize__(
|
|
43
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
44
|
-
__vue_inject_styles__,
|
|
45
|
-
__vue_script__,
|
|
46
|
-
__vue_scope_id__,
|
|
47
|
-
__vue_is_functional_template__,
|
|
48
|
-
__vue_module_identifier__,
|
|
49
|
-
false,
|
|
50
|
-
undefined,
|
|
51
|
-
undefined,
|
|
52
|
-
undefined
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
export default __vue_component__;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import AvatarProjectFallbackExample from './avatar.fallback.example.vue';
|
|
2
|
-
import AvatarImageExample from './avatar.image.example.vue';
|
|
3
|
-
import AvatarRectExample from './avatar.rect.example.vue';
|
|
4
|
-
import AvatarTooltipExample from './avatar.tooltip.example.vue';
|
|
5
|
-
|
|
6
|
-
export default [
|
|
7
|
-
{
|
|
8
|
-
name: 'Basic',
|
|
9
|
-
items: [
|
|
10
|
-
{
|
|
11
|
-
id: 'avatar-image',
|
|
12
|
-
name: 'Default Image',
|
|
13
|
-
description: 'Avatar with an image',
|
|
14
|
-
component: AvatarImageExample,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
id: 'avatar-image-rect',
|
|
18
|
-
name: 'Rectangular Image',
|
|
19
|
-
description: 'Avatar with a rectangular image',
|
|
20
|
-
component: AvatarRectExample,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
id: 'avatar-project-fallback',
|
|
24
|
-
name: 'Project/Group Fallback',
|
|
25
|
-
description: 'A fallback for projects or groups without an image',
|
|
26
|
-
component: AvatarProjectFallbackExample,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
id: 'avatar-with-tooltip',
|
|
30
|
-
name: 'With tooltip',
|
|
31
|
-
description: 'Avatar that displays a tooltip on hover',
|
|
32
|
-
component: AvatarTooltipExample,
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
];
|
package/src/components/base/form/form_input/examples/form_input/form_input.text_reactive.example.vue
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
/**
|
|
3
|
-
* This example ensures that browser native input events lead to updating the component state.
|
|
4
|
-
*/
|
|
5
|
-
export default {
|
|
6
|
-
data() {
|
|
7
|
-
return {
|
|
8
|
-
value: '',
|
|
9
|
-
};
|
|
10
|
-
},
|
|
11
|
-
mounted() {
|
|
12
|
-
const inputElement = this.$refs.input.$el;
|
|
13
|
-
inputElement.value = 'some value';
|
|
14
|
-
inputElement.dispatchEvent(new Event('input'));
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<template>
|
|
20
|
-
<div>
|
|
21
|
-
<gl-form-input ref="input" v-model="value" type="text" />
|
|
22
|
-
<p class="mt-3">The entered value is: {{ value }}</p>
|
|
23
|
-
</div>
|
|
24
|
-
</template>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import FormInputTextExample from './form_input.text.example.vue';
|
|
2
|
-
import FormInputTextDisabledExample from './form_input.text_disabled.example.vue';
|
|
3
|
-
import FormInputTextReactiveExample from './form_input.text_reactive.example.vue';
|
|
4
|
-
|
|
5
|
-
export default [
|
|
6
|
-
{
|
|
7
|
-
name: 'Text Input',
|
|
8
|
-
items: [
|
|
9
|
-
{
|
|
10
|
-
id: 'input-text',
|
|
11
|
-
name: 'default state',
|
|
12
|
-
component: FormInputTextExample,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
id: 'input-text-reactive',
|
|
16
|
-
name: 'with reactive binding',
|
|
17
|
-
component: FormInputTextReactiveExample,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
id: 'input-text-disabled',
|
|
21
|
-
name: 'disabled state',
|
|
22
|
-
component: FormInputTextDisabledExample,
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
// We need this because without a v-model this input will reset on every keystroke
|
|
4
|
-
// https://github.com/bootstrap-vue/bootstrap-vue/issues/1915
|
|
5
|
-
data: () => ({ text: '' }),
|
|
6
|
-
};
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<gl-form-textarea v-model="text" placeholder="Enter something" />
|
|
11
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
// We need this because without a v-model this input will reset on every keystroke
|
|
4
|
-
// https://github.com/bootstrap-vue/bootstrap-vue/issues/1915
|
|
5
|
-
data: () => ({ text: 'This is invalid' }),
|
|
6
|
-
};
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<gl-form-textarea v-model="text" placeholder="Enter something" :state="false" />
|
|
11
|
-
</template>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
// We need this because without a v-model this input will reset on every keystroke
|
|
4
|
-
// https://github.com/bootstrap-vue/bootstrap-vue/issues/1915
|
|
5
|
-
data: () => ({
|
|
6
|
-
text: "This is some plain text.\nIt is read only and doesn't look like an input.",
|
|
7
|
-
}),
|
|
8
|
-
};
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<gl-form-textarea v-model="text" plaintext />
|
|
13
|
-
</template>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
// We need this because without a v-model this input will reset on every keystroke
|
|
4
|
-
// https://github.com/bootstrap-vue/bootstrap-vue/issues/1915
|
|
5
|
-
data: () => ({ text: '' }),
|
|
6
|
-
};
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<gl-form-textarea v-model="text" placeholder="Enter something" submit-on-enter />
|
|
11
|
-
</template>
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import FormTextAreaBasic from './form_textarea.basic.example.vue';
|
|
2
|
-
import FormTextAreaInvalid from './form_textarea.invalid.example.vue';
|
|
3
|
-
import FormTextAreaPlaintext from './form_textarea.plaintext.example.vue';
|
|
4
|
-
import FormTextReadOnlytext from './form_textarea.readonly.example.vue';
|
|
5
|
-
import FormTextSubmitOnEnter from './form_textarea.submit.example.vue';
|
|
6
|
-
|
|
7
|
-
export default [
|
|
8
|
-
{
|
|
9
|
-
name: 'Basic',
|
|
10
|
-
items: [
|
|
11
|
-
{
|
|
12
|
-
id: 'form-textarea-basic',
|
|
13
|
-
name: 'Basic',
|
|
14
|
-
description: 'Basic Form Textarea',
|
|
15
|
-
component: FormTextAreaBasic,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
id: 'form-textarea-invalid',
|
|
19
|
-
name: 'Invalid',
|
|
20
|
-
description: 'Invalid Form Textarea',
|
|
21
|
-
component: FormTextAreaInvalid,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: 'form-textarea-plaintext',
|
|
25
|
-
name: 'Plaintext',
|
|
26
|
-
description: 'Plaintext Form Textarea',
|
|
27
|
-
component: FormTextAreaPlaintext,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: 'form-textarea-readonly',
|
|
31
|
-
name: 'Read Only',
|
|
32
|
-
description: 'Read Only Form Textarea',
|
|
33
|
-
component: FormTextReadOnlytext,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: 'form-textarea-submit-on-enter',
|
|
37
|
-
name: 'Submit On Enter',
|
|
38
|
-
description: 'Submit On Enter Form Textarea',
|
|
39
|
-
component: FormTextSubmitOnEnter,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
];
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import PaginationBasicExample from './pagination.basic.example.vue';
|
|
2
|
-
import PaginationCompactExample from './pagination.compact.example.vue';
|
|
3
|
-
import PaginationDoubleTruncation from './pagination.double_truncation.example.vue';
|
|
4
|
-
import PaginationEventExample from './pagination.event.example.vue';
|
|
5
|
-
import PaginationLinksExample from './pagination.links.example.vue';
|
|
6
|
-
|
|
7
|
-
export default [
|
|
8
|
-
{
|
|
9
|
-
name: 'Basic',
|
|
10
|
-
items: [
|
|
11
|
-
{
|
|
12
|
-
id: 'pagination-basic',
|
|
13
|
-
name: 'Basic',
|
|
14
|
-
description: 'Basic Pagination',
|
|
15
|
-
component: PaginationBasicExample,
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
id: 'pagination-double-truncation',
|
|
19
|
-
name: 'Double truncation',
|
|
20
|
-
description: 'Double truncation',
|
|
21
|
-
component: PaginationDoubleTruncation,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: 'pagination-compact',
|
|
25
|
-
name: 'Compact',
|
|
26
|
-
description: 'Compact Pagination',
|
|
27
|
-
component: PaginationCompactExample,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: 'pagination-links',
|
|
31
|
-
name: 'Link based pagination',
|
|
32
|
-
description: 'Link based pagination',
|
|
33
|
-
component: PaginationLinksExample,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: 'pagination-event',
|
|
37
|
-
name: 'Page change event',
|
|
38
|
-
description: 'Page change event',
|
|
39
|
-
component: PaginationEventExample,
|
|
40
|
-
},
|
|
41
|
-
],
|
|
42
|
-
},
|
|
43
|
-
];
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
const LAST_PAGE = 3;
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
lastPage: LAST_PAGE,
|
|
6
|
-
data: () => ({
|
|
7
|
-
page: 1,
|
|
8
|
-
}),
|
|
9
|
-
computed: {
|
|
10
|
-
prevPage() {
|
|
11
|
-
return Math.max(this.page - 1, 0);
|
|
12
|
-
},
|
|
13
|
-
nextPage() {
|
|
14
|
-
const nextPage = this.page + 1;
|
|
15
|
-
return nextPage > LAST_PAGE ? 0 : nextPage;
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<template>
|
|
22
|
-
<div class="text-center">
|
|
23
|
-
<gl-pagination
|
|
24
|
-
v-model="page"
|
|
25
|
-
:prev-page="prevPage"
|
|
26
|
-
:next-page="nextPage"
|
|
27
|
-
prev-text="Prev"
|
|
28
|
-
next-text="Next"
|
|
29
|
-
align="center"
|
|
30
|
-
/>
|
|
31
|
-
Page {{ page }} of {{ $options.lastPage }}
|
|
32
|
-
</div>
|
|
33
|
-
</template>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
data: () => ({
|
|
4
|
-
page: 2,
|
|
5
|
-
}),
|
|
6
|
-
methods: {
|
|
7
|
-
logEvent(page) {
|
|
8
|
-
console.log(`page changed to ${page}`); // eslint-disable-line
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<div>
|
|
16
|
-
<p>Change events are logged to the console</p>
|
|
17
|
-
<gl-pagination
|
|
18
|
-
v-model="page"
|
|
19
|
-
:per-page="10"
|
|
20
|
-
:total-items="100"
|
|
21
|
-
prev-text="Prev"
|
|
22
|
-
next-text="Next"
|
|
23
|
-
@input="logEvent"
|
|
24
|
-
/>
|
|
25
|
-
</div>
|
|
26
|
-
</template>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
data: () => ({
|
|
4
|
-
page: 2,
|
|
5
|
-
}),
|
|
6
|
-
};
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<template>
|
|
10
|
-
<gl-pagination
|
|
11
|
-
v-model="page"
|
|
12
|
-
:per-page="10"
|
|
13
|
-
:total-items="100"
|
|
14
|
-
:link-gen="(page) => `#page${page}`"
|
|
15
|
-
prev-text="Prev"
|
|
16
|
-
next-text="Next"
|
|
17
|
-
/>
|
|
18
|
-
</template>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import SegmentedControlBasicExample from './segmented_control.basic.example.vue';
|
|
2
|
-
import SegmentedControlWhitespaceExample from './segmented_control.whitespace.example.vue';
|
|
3
|
-
|
|
4
|
-
export default [
|
|
5
|
-
{
|
|
6
|
-
name: 'Basic',
|
|
7
|
-
items: [
|
|
8
|
-
{
|
|
9
|
-
id: 'segmented-control-basic',
|
|
10
|
-
name: 'Basic',
|
|
11
|
-
description: 'Basic Segmented Control',
|
|
12
|
-
component: SegmentedControlBasicExample,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
id: 'segmented-control-whitespace',
|
|
16
|
-
name: 'Whitespace',
|
|
17
|
-
description: 'Whitespace Segmented control',
|
|
18
|
-
component: SegmentedControlWhitespaceExample,
|
|
19
|
-
},
|
|
20
|
-
],
|
|
21
|
-
},
|
|
22
|
-
];
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
data() {
|
|
4
|
-
return {
|
|
5
|
-
options: [
|
|
6
|
-
{ value: 1, text: 'First' },
|
|
7
|
-
{ value: 2, text: 'Second', disabled: true },
|
|
8
|
-
{ value: 3, text: 'Third' },
|
|
9
|
-
{ value: 4, text: 'Fourth' },
|
|
10
|
-
{ value: 5, text: 'Fifth' },
|
|
11
|
-
],
|
|
12
|
-
selected: 1,
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
</script>
|
|
17
|
-
<template>
|
|
18
|
-
<gl-segmented-control v-model="selected" :options="options" />
|
|
19
|
-
</template>
|
package/src/components/base/segmented_control/examples/segmented_control.whitespace.example.vue
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export default {
|
|
3
|
-
data() {
|
|
4
|
-
return {
|
|
5
|
-
options: [
|
|
6
|
-
{ value: true, text: 'Show' },
|
|
7
|
-
{ value: false, text: 'Hide' },
|
|
8
|
-
],
|
|
9
|
-
selected: true,
|
|
10
|
-
};
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
</script>
|
|
14
|
-
<template>
|
|
15
|
-
<gl-form-group id="group-id" label="Whitespace" label-size="sm" label-for="select1">
|
|
16
|
-
<gl-segmented-control id="select1" v-model="selected" :options="options" />
|
|
17
|
-
</gl-form-group>
|
|
18
|
-
</template>
|