@gitlab/ui 36.6.0 → 36.7.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/base/form/form_radio_group/form_radio_group.documentation.js +2 -48
  3. package/dist/components/base/form/form_radio_group/form_radio_group.js +22 -2
  4. package/dist/components/base/pagination/pagination.js +1 -1
  5. package/dist/components/charts/heatmap/heatmap.documentation.js +0 -3
  6. package/dist/components/charts/series_label/series_label.documentation.js +2 -5
  7. package/documentation/documented_stories.js +3 -0
  8. package/package.json +3 -3
  9. package/src/components/base/form/form_radio_group/form_radio_group.documentation.js +0 -48
  10. package/src/components/base/form/form_radio_group/form_radio_group.md +0 -2
  11. package/src/components/base/form/form_radio_group/form_radio_group.stories.js +50 -29
  12. package/src/components/base/form/form_radio_group/form_radio_group.vue +22 -2
  13. package/src/components/base/paginated_list/__snapshots__/paginated_list.spec.js.snap +10 -10
  14. package/src/components/base/pagination/pagination.stories.js +5 -1
  15. package/src/components/base/pagination/pagination.vue +1 -1
  16. package/src/components/charts/heatmap/heatmap.documentation.js +0 -2
  17. package/src/components/charts/heatmap/heatmap.stories.js +59 -42
  18. package/src/components/charts/series_label/series_label.documentation.js +0 -2
  19. package/src/components/charts/series_label/series_label.md +0 -2
  20. package/src/components/charts/series_label/series_label.stories.js +62 -59
  21. package/dist/components/base/form/form_radio_group/examples/form_radio_group.options_array.example.js +0 -59
  22. package/dist/components/base/form/form_radio_group/examples/form_radio_group.slots.example.js +0 -48
  23. package/dist/components/base/form/form_radio_group/examples/index.js +0 -17
  24. package/dist/components/charts/heatmap/examples/heatmap.custom_options.example.js +0 -79
  25. package/dist/components/charts/heatmap/examples/heatmap.hourly.example.js +0 -70
  26. package/dist/components/charts/heatmap/examples/heatmap.responsive.example.js +0 -70
  27. package/dist/components/charts/heatmap/examples/heatmap.totals.example.js +0 -62
  28. package/dist/components/charts/heatmap/examples/index.js +0 -31
  29. package/dist/components/charts/series_label/examples/index.js +0 -13
  30. package/dist/components/charts/series_label/examples/series_label.basic.example.js +0 -38
  31. package/src/components/base/form/form_radio_group/examples/form_radio_group.options_array.example.vue +0 -27
  32. package/src/components/base/form/form_radio_group/examples/form_radio_group.slots.example.vue +0 -21
  33. package/src/components/base/form/form_radio_group/examples/index.js +0 -20
  34. package/src/components/charts/heatmap/examples/heatmap.custom_options.example.vue +0 -70
  35. package/src/components/charts/heatmap/examples/heatmap.hourly.example.vue +0 -62
  36. package/src/components/charts/heatmap/examples/heatmap.responsive.example.vue +0 -63
  37. package/src/components/charts/heatmap/examples/heatmap.totals.example.vue +0 -38
  38. package/src/components/charts/heatmap/examples/index.js +0 -36
  39. package/src/components/charts/series_label/examples/index.js +0 -15
  40. package/src/components/charts/series_label/examples/series_label.basic.example.vue +0 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [36.7.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v36.6.0...v36.7.0) (2022-02-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * **pagination:** Remove abbreviation from prev text ([f959077](https://gitlab.com/gitlab-org/gitlab-ui/commit/f959077da8ec3bf2107f2229a25fd09ff6771993))
7
+
1
8
  # [36.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v36.5.1...v36.6.0) (2022-02-14)
2
9
 
3
10
 
@@ -1,54 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "# GlFormRadioGroup\n\nThe `GlFormRadioGroup` component provides an alternative and sometimes more\ncompact way of setting up a group of `GlFormRadio` components.\n\n## Usage\n\n`GlFormRadioGroup` can be used in a few ways to build a group of `GlFormRadio`\ncomponents: implicitly, explicitly, or a mix of both.\n\nBelow is an example which demonstrates all three approaches, written such that\nall of them produce the same visual result.\n\n```html\n<script>\nexport default {\n data() {\n return {\n selected: 'one',\n options: [\n {\n value: 'one',\n text: 'One',\n },\n {\n value: 'two',\n text: 'Two',\n },\n {\n value: 'three',\n text: 'Three',\n },\n ],\n };\n },\n};\n</script>\n\n<template>\n <div>\n <!-- Implicit -->\n <gl-form-radio-group v-model=\"selected\" :options=\"options\" name=\"implicit\" />\n\n <!-- Explicit -->\n <gl-form-radio-group v-model=\"selected\" name=\"explicit\">\n <gl-form-radio value=\"one\">One</gl-form-radio>\n <gl-form-radio value=\"two\">Two</gl-form-radio>\n <gl-form-radio value=\"three\">Three</gl-form-radio>\n </gl-form-radio-group>\n\n <!-- Mixed -->\n <gl-form-radio-group v-model=\"selected\" :options=\"[options[1]]\" name=\"mixed\">\n <template #first>\n <gl-form-radio value=\"one\">One</gl-form-radio>\n </template>\n <gl-form-radio value=\"three\">Three</gl-form-radio>\n </gl-form-radio-group>\n </div>\n</template>\n```\n\n## Stacked\n\nBy default, the GitLab Design guide mandates the `<gl-form-radio-group>` be `stacked` by default and\nis non-changeable at this time.\n";
1
+ var description = "The `GlFormRadioGroup` component provides an alternative and sometimes more\ncompact way of setting up a group of `GlFormRadio` components.\n\n## Usage\n\n`GlFormRadioGroup` can be used in a few ways to build a group of `GlFormRadio`\ncomponents: implicitly, explicitly, or a mix of both.\n\nBelow is an example which demonstrates all three approaches, written such that\nall of them produce the same visual result.\n\n```html\n<script>\nexport default {\n data() {\n return {\n selected: 'one',\n options: [\n {\n value: 'one',\n text: 'One',\n },\n {\n value: 'two',\n text: 'Two',\n },\n {\n value: 'three',\n text: 'Three',\n },\n ],\n };\n },\n};\n</script>\n\n<template>\n <div>\n <!-- Implicit -->\n <gl-form-radio-group v-model=\"selected\" :options=\"options\" name=\"implicit\" />\n\n <!-- Explicit -->\n <gl-form-radio-group v-model=\"selected\" name=\"explicit\">\n <gl-form-radio value=\"one\">One</gl-form-radio>\n <gl-form-radio value=\"two\">Two</gl-form-radio>\n <gl-form-radio value=\"three\">Three</gl-form-radio>\n </gl-form-radio-group>\n\n <!-- Mixed -->\n <gl-form-radio-group v-model=\"selected\" :options=\"[options[1]]\" name=\"mixed\">\n <template #first>\n <gl-form-radio value=\"one\">One</gl-form-radio>\n </template>\n <gl-form-radio value=\"three\">Three</gl-form-radio>\n </gl-form-radio-group>\n </div>\n</template>\n```\n\n## Stacked\n\nBy default, the GitLab Design guide mandates the `<gl-form-radio-group>` be `stacked` by default and\nis non-changeable at this time.\n";
4
2
 
5
3
  var form_radio_group_documentation = {
6
4
  description,
7
- examples,
8
- followsDesignSystem: true,
9
- bootstrapComponent: 'b-form-radio-group',
10
- propsInfo: {
11
- options: {
12
- additionalInfo: 'Array of objects representing the radios to render'
13
- },
14
- valueField: {
15
- additionalInfo: 'Field name in the options prop that should be used for the value'
16
- },
17
- textField: {
18
- additionalInfo: 'Field name in the options prop that should be used for the text label'
19
- },
20
- htmlField: {
21
- additionalInfo: 'Field name in the options prop that should be used for the html label instead of text field. Use with caution.'
22
- },
23
- disabledField: {
24
- additionalInfo: 'Field name in the options prop that should be used for the disabled state'
25
- },
26
- checked: {
27
- additionalInfo: 'The current value of the checked radio in the group'
28
- }
29
- },
30
- events: [{
31
- event: 'input',
32
- args: [{
33
- arg: 'checked',
34
- description: 'current selected value of radio group'
35
- }],
36
- description: 'Emitted when the selected value is changed'
37
- }, {
38
- event: 'change',
39
- args: [{
40
- arg: 'checked',
41
- description: 'current selected value of radio group'
42
- }],
43
- description: 'Emitted when the selected value is changed due to user interaction'
44
- }],
45
- slots: [{
46
- name: 'first',
47
- description: 'Slot for GlFormRadios that will appear before radios generated from options prop'
48
- }, {
49
- name: 'default',
50
- description: 'Slot for GlFormRadios that will appear after radios generated from options prop'
51
- }]
5
+ followsDesignSystem: true
52
6
  };
53
7
 
54
8
  export default form_radio_group_documentation;
@@ -17,14 +17,34 @@ var script = {
17
17
  },
18
18
  mixins: [formOptionsMixin],
19
19
  inheritAttrs: false,
20
- model
20
+ model,
21
+ methods: {
22
+ onInput(e) {
23
+ /**
24
+ * Emitted when the selected value is changed.
25
+ *
26
+ * @event input
27
+ */
28
+ this.$emit('input', e);
29
+ },
30
+
31
+ onChange(e) {
32
+ /**
33
+ * Emitted when the selected value is changed.
34
+ *
35
+ * @event change
36
+ */
37
+ this.$emit('change', e);
38
+ }
39
+
40
+ }
21
41
  };
22
42
 
23
43
  /* script */
24
44
  const __vue_script__ = script;
25
45
 
26
46
  /* template */
27
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-form-radio-group',_vm._g(_vm._b({staticClass:"gl-form-checkbox-group",attrs:{"stacked":""},on:{"input":function($event){return _vm.$emit('input', $event)},"change":function($event){return _vm.$emit('change', $event)}}},'b-form-radio-group',_vm.$attrs,false),_vm.$listeners),[_vm._t("first"),_vm._v(" "),_vm._l((_vm.formOptions),function(option,idx){return _c('gl-form-radio',{key:idx,attrs:{"value":option.value,"disabled":option.disabled}},[(option.html)?_c('span',{directives:[{name:"safe-html",rawName:"v-safe-html",value:(option.html),expression:"option.html"}]}):_c('span',[_vm._v(_vm._s(option.text))])])}),_vm._v(" "),_vm._t("default")],2)};
47
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-form-radio-group',_vm._g(_vm._b({staticClass:"gl-form-checkbox-group",attrs:{"stacked":""},on:{"input":_vm.onInput,"change":_vm.onChange}},'b-form-radio-group',_vm.$attrs,false),_vm.$listeners),[_vm._t("first"),_vm._v(" "),_vm._l((_vm.formOptions),function(option,idx){return _c('gl-form-radio',{key:idx,attrs:{"value":option.value,"disabled":option.disabled}},[(option.html)?_c('span',{directives:[{name:"safe-html",rawName:"v-safe-html",value:(option.html),expression:"option.html"}]}):_c('span',[_vm._v(_vm._s(option.text))])])}),_vm._v(" "),_vm._t("default")],2)};
28
48
  var __vue_staticRenderFns__ = [];
29
49
 
30
50
  /* style */
@@ -88,7 +88,7 @@ var script = {
88
88
  prevText: {
89
89
  type: String,
90
90
  required: false,
91
- default: 'Prev'
91
+ default: 'Previous'
92
92
  },
93
93
 
94
94
  /**
@@ -1,10 +1,7 @@
1
- import examples from './examples';
2
-
3
1
  var description = "## Heatmaps\n\n**Note** This component uses `<gl-legend>`, which should allow a user to click on any data point(s)\nin the legend and make the corresponding data point(s) on the chart rendered disappear.\n_See [area chart](https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/charts-area-chart--default)\nfor an example_ For this particular chart, there is a [known issue](https://gitlab.com/gitlab-org/gitlab-ui/issues/352)\nwith the functionality of the legend, where clicking on it does nothing.\n";
4
2
 
5
3
  var heatmap_documentation = {
6
4
  description,
7
- examples,
8
5
  followsDesignSystem: true
9
6
  };
10
7
 
@@ -1,10 +1,7 @@
1
- import examples from './examples';
2
-
3
- var description = "# Chart Series Label\n\nDisplays chart data series name as a label for chart legend, tooltip, etc.\n";
1
+ var description = "Displays chart data series name as a label for chart legend, tooltip, etc.\n";
4
2
 
5
3
  var series_label_documentation = {
6
- description,
7
- examples
4
+ description
8
5
  };
9
6
 
10
7
  export default series_label_documentation;
@@ -129,6 +129,9 @@ export const setupStorybookReadme = () =>
129
129
  'GlPopover',
130
130
  'GlSingleStat',
131
131
  'GlDrawer',
132
+ 'GlHeatmap',
133
+ 'GlFormRadioGroup',
134
+ 'GlChartSeriesLabel',
132
135
  ],
133
136
  components: {
134
137
  GlComponentDocumentation,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "36.6.0",
3
+ "version": "36.7.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -76,7 +76,8 @@
76
76
  "vue": "^2.6.10"
77
77
  },
78
78
  "resolutions": {
79
- "chokidar": "^3.5.2"
79
+ "chokidar": "^3.5.2",
80
+ "sane": "^5.0.1"
80
81
  },
81
82
  "devDependencies": {
82
83
  "@arkweid/lefthook": "^0.7.6",
@@ -122,7 +123,6 @@
122
123
  "mockdate": "^2.0.5",
123
124
  "node-sass": "^4.14.1",
124
125
  "node-sass-magic-importer": "^5.3.2",
125
- "nodemon": "^1.11.0",
126
126
  "npm-run-all": "^4.1.5",
127
127
  "pikaday": "^1.8.0",
128
128
  "plop": "^2.5.4",
@@ -1,54 +1,6 @@
1
- import examples from './examples';
2
1
  import description from './form_radio_group.md';
3
2
 
4
3
  export default {
5
4
  description,
6
- examples,
7
5
  followsDesignSystem: true,
8
- bootstrapComponent: 'b-form-radio-group',
9
- propsInfo: {
10
- options: {
11
- additionalInfo: 'Array of objects representing the radios to render',
12
- },
13
- valueField: {
14
- additionalInfo: 'Field name in the options prop that should be used for the value',
15
- },
16
- textField: {
17
- additionalInfo: 'Field name in the options prop that should be used for the text label',
18
- },
19
- htmlField: {
20
- additionalInfo:
21
- 'Field name in the options prop that should be used for the html label instead of text field. Use with caution.',
22
- },
23
- disabledField: {
24
- additionalInfo: 'Field name in the options prop that should be used for the disabled state',
25
- },
26
- checked: {
27
- additionalInfo: 'The current value of the checked radio in the group',
28
- },
29
- },
30
- events: [
31
- {
32
- event: 'input',
33
- args: [{ arg: 'checked', description: 'current selected value of radio group' }],
34
- description: 'Emitted when the selected value is changed',
35
- },
36
- {
37
- event: 'change',
38
- args: [{ arg: 'checked', description: 'current selected value of radio group' }],
39
- description: 'Emitted when the selected value is changed due to user interaction',
40
- },
41
- ],
42
- slots: [
43
- {
44
- name: 'first',
45
- description:
46
- 'Slot for GlFormRadios that will appear before radios generated from options prop',
47
- },
48
- {
49
- name: 'default',
50
- description:
51
- 'Slot for GlFormRadios that will appear after radios generated from options prop',
52
- },
53
- ],
54
6
  };
@@ -1,5 +1,3 @@
1
- # GlFormRadioGroup
2
-
3
1
  The `GlFormRadioGroup` component provides an alternative and sometimes more
4
2
  compact way of setting up a group of `GlFormRadio` components.
5
3
 
@@ -1,30 +1,16 @@
1
- import { withKnobs, object, text } from '@storybook/addon-knobs';
2
- import { documentedStoriesOf } from '../../../../../documentation/documented_stories';
3
- import { GlFormRadioGroup, GlFormRadio } from '../../../../index';
1
+ import { GlFormRadioGroup } from '../../../../index';
4
2
  import readme from './form_radio_group.md';
5
3
 
6
- const components = {
7
- GlFormRadioGroup,
8
- GlFormRadio,
9
- };
10
-
11
4
  const defaultOptions = [
12
5
  { value: 'pizza', text: 'Pizza' },
13
6
  { value: 'tacos', text: 'Tacos' },
14
7
  { value: 'burger', text: 'Burger', disabled: true },
15
8
  ];
16
-
17
- function generateProps({ name = 'radio-group-name', options = defaultOptions } = {}) {
18
- return {
19
- name: {
20
- type: String,
21
- default: text('name', name),
22
- },
23
- options: {
24
- default: object('options', options),
25
- },
26
- };
27
- }
9
+ const data = () => ({ selected: 'slot-option' });
10
+ const generateProps = ({ name = 'radio-group-name', options = defaultOptions } = {}) => ({
11
+ name,
12
+ options,
13
+ });
28
14
 
29
15
  const template = `
30
16
  <div>
@@ -45,13 +31,48 @@ const template = `
45
31
  </gl-form-radio-group>
46
32
  </div>`;
47
33
 
48
- const data = () => ({ selected: 'slot-option' });
34
+ const Template = (args, { argTypes }) => ({
35
+ components: {
36
+ GlFormRadioGroup,
37
+ },
38
+ props: Object.keys(argTypes),
39
+ template,
40
+ data,
41
+ });
42
+ export const Default = Template.bind({});
43
+ Default.args = generateProps();
49
44
 
50
- documentedStoriesOf('base/form/form-radio-group', readme)
51
- .addDecorator(withKnobs)
52
- .add('default', () => ({
53
- components,
54
- props: generateProps(),
55
- data,
56
- template,
57
- }));
45
+ export default {
46
+ title: 'base/form/form-radio-group',
47
+ component: GlFormRadioGroup,
48
+ parameters: {
49
+ knobs: { disable: true },
50
+ bootstrapComponent: 'b-form-radio-group',
51
+ docs: {
52
+ description: {
53
+ component: readme,
54
+ },
55
+ },
56
+ },
57
+ argTypes: {
58
+ options: {
59
+ description: 'Array of objects representing the radios to render',
60
+ },
61
+ valueField: {
62
+ description: 'Field name in the options prop that should be used for the value',
63
+ },
64
+ textField: {
65
+ description: 'Field name in the options prop that should be used for the text label',
66
+ },
67
+ htmlField: {
68
+ description:
69
+ 'Field name in the options prop that should be used for the html label instead of text field. Use with caution.',
70
+ },
71
+ disabledField: {
72
+ description: 'Field name in the options prop that should be used for the disabled state',
73
+ },
74
+ checked: {
75
+ description: 'The current value of the checked radio in the group',
76
+ },
77
+ },
78
+ };
@@ -17,6 +17,24 @@ export default {
17
17
  mixins: [formOptionsMixin],
18
18
  inheritAttrs: false,
19
19
  model,
20
+ methods: {
21
+ onInput(e) {
22
+ /**
23
+ * Emitted when the selected value is changed.
24
+ *
25
+ * @event input
26
+ */
27
+ this.$emit('input', e);
28
+ },
29
+ onChange(e) {
30
+ /**
31
+ * Emitted when the selected value is changed.
32
+ *
33
+ * @event change
34
+ */
35
+ this.$emit('change', e);
36
+ },
37
+ },
20
38
  };
21
39
  </script>
22
40
  <template>
@@ -25,9 +43,10 @@ export default {
25
43
  stacked
26
44
  v-bind="$attrs"
27
45
  v-on="$listeners"
28
- @input="$emit('input', $event)"
29
- @change="$emit('change', $event)"
46
+ @input="onInput"
47
+ @change="onChange"
30
48
  >
49
+ <!-- @slot Slot for GlFormRadios that will appear before radios generated from options prop -->
31
50
  <slot name="first"></slot>
32
51
  <gl-form-radio
33
52
  v-for="(option, idx) in formOptions"
@@ -38,6 +57,7 @@ export default {
38
57
  <span v-if="option.html" v-safe-html="option.html"></span>
39
58
  <span v-else>{{ option.text }}</span>
40
59
  </gl-form-radio>
60
+ <!-- @slot Slot for GlFormRadios that will appear after radios generated from options prop -->
41
61
  <slot></slot>
42
62
  </b-form-radio-group>
43
63
  </template>
@@ -42,7 +42,7 @@ exports[`Paginated List Pagination renders 1 item on page 7 with page size of 2
42
42
  limits="[object Object]"
43
43
  nexttext="Next"
44
44
  perpage="2"
45
- prevtext="Prev"
45
+ prevtext="Previous"
46
46
  totalitems="13"
47
47
  value="7"
48
48
  />
@@ -119,7 +119,7 @@ exports[`Paginated List Pagination renders 3 items on page 2 with default page s
119
119
  limits="[object Object]"
120
120
  nexttext="Next"
121
121
  perpage="10"
122
- prevtext="Prev"
122
+ prevtext="Previous"
123
123
  totalitems="13"
124
124
  value="2"
125
125
  />
@@ -222,7 +222,7 @@ exports[`Paginated List Pagination renders 5 items on page 1 for a page size of
222
222
  limits="[object Object]"
223
223
  nexttext="Next"
224
224
  perpage="5"
225
- prevtext="Prev"
225
+ prevtext="Previous"
226
226
  totalitems="13"
227
227
  value="1"
228
228
  />
@@ -390,7 +390,7 @@ exports[`Paginated List Pagination renders 10 items for a default page size of 1
390
390
  limits="[object Object]"
391
391
  nexttext="Next"
392
392
  perpage="10"
393
- prevtext="Prev"
393
+ prevtext="Previous"
394
394
  totalitems="13"
395
395
  value="1"
396
396
  />
@@ -597,7 +597,7 @@ exports[`Paginated List Pagination renders 13 items for a default page size of 2
597
597
  limits="[object Object]"
598
598
  nexttext="Next"
599
599
  perpage="20"
600
- prevtext="Prev"
600
+ prevtext="Previous"
601
601
  totalitems="13"
602
602
  value="1"
603
603
  />
@@ -717,7 +717,7 @@ exports[`Paginated List Search states renders the list filtered by search result
717
717
  limits="[object Object]"
718
718
  nexttext="Next"
719
719
  perpage="10"
720
- prevtext="Prev"
720
+ prevtext="Previous"
721
721
  totalitems="2"
722
722
  value="1"
723
723
  />
@@ -837,7 +837,7 @@ exports[`Paginated List Searchless states renders the list with nested items, wh
837
837
  limits="[object Object]"
838
838
  nexttext="Next"
839
839
  perpage="10"
840
- prevtext="Prev"
840
+ prevtext="Previous"
841
841
  totalitems="2"
842
842
  value="1"
843
843
  />
@@ -888,7 +888,7 @@ exports[`Paginated List props filter filters on default "id" key 1`] = `
888
888
  limits="[object Object]"
889
889
  nexttext="Next"
890
890
  perpage="10"
891
- prevtext="Prev"
891
+ prevtext="Previous"
892
892
  totalitems="1"
893
893
  value="1"
894
894
  />
@@ -939,7 +939,7 @@ exports[`Paginated List props filter filters on provided "myKey" key 1`] = `
939
939
  limits="[object Object]"
940
940
  nexttext="Next"
941
941
  perpage="10"
942
- prevtext="Prev"
942
+ prevtext="Previous"
943
943
  totalitems="1"
944
944
  value="1"
945
945
  />
@@ -990,7 +990,7 @@ exports[`Paginated List props filter filters with provided filter function 1`] =
990
990
  limits="[object Object]"
991
991
  nexttext="Next"
992
992
  perpage="10"
993
- prevtext="Prev"
993
+ prevtext="Previous"
994
994
  totalitems="1"
995
995
  value="1"
996
996
  />
@@ -4,7 +4,11 @@ import GlPagination from './pagination.vue';
4
4
 
5
5
  const components = { GlPagination };
6
6
 
7
- const generateBaseProps = ({ prevText = 'Prev', nextText = 'Next', disabled = false } = {}) => ({
7
+ const generateBaseProps = ({
8
+ prevText = 'Previous',
9
+ nextText = 'Next',
10
+ disabled = false,
11
+ } = {}) => ({
8
12
  prevText,
9
13
  nextText,
10
14
  disabled,
@@ -82,7 +82,7 @@ export default {
82
82
  prevText: {
83
83
  type: String,
84
84
  required: false,
85
- default: 'Prev',
85
+ default: 'Previous',
86
86
  },
87
87
  /**
88
88
  * When using the compact pagination, use this prop to pass the next page number
@@ -1,8 +1,6 @@
1
- import examples from './examples';
2
1
  import description from './heatmap.md';
3
2
 
4
3
  export default {
5
4
  description,
6
- examples,
7
5
  followsDesignSystem: true,
8
6
  };
@@ -1,12 +1,7 @@
1
1
  import { GlHeatmap } from '../../../charts';
2
- import { documentedStoriesOf } from '../../../../documentation/documented_stories';
3
2
  import { toolbox } from '../../../utils/charts/story_config';
4
3
  import readme from '../area/area.md';
5
4
 
6
- const components = {
7
- GlHeatmap,
8
- };
9
-
10
5
  function generateData() {
11
6
  let data = [
12
7
  [5, 0, 5],
@@ -21,46 +16,68 @@ function generateData() {
21
16
  return data;
22
17
  }
23
18
 
24
- documentedStoriesOf('charts/heatmap', readme)
25
- .add('default', () => ({
26
- data() {
27
- return {
28
- data: generateData(),
29
- xAxisLabels: ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'],
30
- yAxisLabels: ['Sat', 'Fri', 'Thu', 'Wed', 'Tue', 'Mon', 'Sun'],
31
- xAxisName: 'Hour',
32
- yAxisName: 'Day',
33
- };
34
- },
35
- components,
36
- template: `<gl-heatmap
19
+ const template = `
20
+ <gl-heatmap
37
21
  :data-series="data"
38
22
  :x-axis-labels="xAxisLabels"
39
23
  :y-axis-labels="yAxisLabels"
40
24
  :x-axis-name="xAxisName"
41
25
  :y-axis-name="yAxisName"
42
- />`,
43
- }))
44
- .add('with toolbox', () => ({
45
- data() {
46
- return {
47
- data: generateData(),
48
- xAxisLabels: ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'],
49
- yAxisLabels: ['Sat', 'Fri', 'Thu', 'Wed', 'Tue', 'Mon', 'Sun'],
50
- xAxisName: 'Hour',
51
- yAxisName: 'Day',
52
- option: {
53
- toolbox,
54
- },
55
- };
26
+ :options="options"
27
+ />
28
+ `;
29
+
30
+ const generateProps = ({
31
+ data = generateData(),
32
+ xAxisLabels = ['12', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11'],
33
+ yAxisLabels = ['Sat', 'Fri', 'Thu', 'Wed', 'Tue', 'Mon', 'Sun'],
34
+ xAxisName = 'Hour',
35
+ yAxisName = 'Day',
36
+ options = {},
37
+ } = {}) => ({
38
+ data,
39
+ xAxisLabels,
40
+ yAxisLabels,
41
+ xAxisName,
42
+ yAxisName,
43
+ options,
44
+ });
45
+
46
+ const Template = (args, { argTypes }) => ({
47
+ components: {
48
+ GlHeatmap,
49
+ },
50
+ props: Object.keys(argTypes),
51
+ template,
52
+ });
53
+
54
+ export const Default = Template.bind({});
55
+ Default.args = generateProps();
56
+
57
+ export const WithToolbox = Template.bind({});
58
+ WithToolbox.args = generateProps({ options: { toolbox } });
59
+
60
+ export default {
61
+ title: 'charts/heatmap',
62
+ component: GlHeatmap,
63
+ parameters: {
64
+ knobs: { disable: true },
65
+ docs: {
66
+ description: {
67
+ component: readme,
68
+ },
56
69
  },
57
- components,
58
- template: `<gl-heatmap
59
- :data-series="data"
60
- :x-axis-labels="xAxisLabels"
61
- :y-axis-labels="yAxisLabels"
62
- :x-axis-name="xAxisName"
63
- :y-axis-name="yAxisName"
64
- :options="option"
65
- />`,
66
- }));
70
+ },
71
+ argTypes: {
72
+ showToolbox: { control: { disable: true } },
73
+ toolboxZoomIconPath: { control: { disable: true } },
74
+ toolboxBackIconPath: { control: { disable: true } },
75
+ toolboxRestoreIconPath: { control: { disable: true } },
76
+ toolboxSaveAsImageIconPath: { control: { disable: true } },
77
+ dataSeries: { control: { disable: true } },
78
+ formatTooltipText: { control: { disable: true } },
79
+ legendAverageText: { control: { disable: true } },
80
+ legendMaxText: { control: { disable: true } },
81
+ responsive: { control: { disable: true } },
82
+ },
83
+ };
@@ -1,7 +1,5 @@
1
- import examples from './examples';
2
1
  import description from './series_label.md';
3
2
 
4
3
  export default {
5
4
  description,
6
- examples,
7
5
  };
@@ -1,3 +1 @@
1
- # Chart Series Label
2
-
3
1
  Displays chart data series name as a label for chart legend, tooltip, etc.