@gitlab/ui 32.20.1 → 32.20.2

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/accordion/accordion_item.js +2 -2
  3. package/dist/components/base/daterange_picker/daterange_picker.js +2 -2
  4. package/dist/components/base/filtered_search/filtered_search.js +2 -2
  5. package/dist/components/base/path/path.js +1 -1
  6. package/dist/components/base/search_box_by_click/search_box_by_click.js +2 -2
  7. package/dist/components/base/sorting/sorting.js +2 -2
  8. package/dist/components/base/tabs/tabs/scrollable_tabs.js +1 -1
  9. package/dist/components/base/toggle/toggle.js +5 -1
  10. package/dist/components/charts/heatmap/heatmap.js +2 -2
  11. package/dist/components/charts/sparkline/sparkline.js +2 -2
  12. package/dist/components/shared_components/clear_icon_button/clear_icon_button.js +2 -2
  13. package/dist/directives/collapse_toggle.js +1 -2
  14. package/dist/directives/modal.js +1 -2
  15. package/dist/directives/resize_observer/resize_observer.js +2 -2
  16. package/dist/directives/tooltip.js +1 -2
  17. package/dist/index.js +4 -4
  18. package/index.js +4 -4
  19. package/package.json +1 -1
  20. package/src/components/base/accordion/accordion_item.spec.js +1 -1
  21. package/src/components/base/accordion/accordion_item.vue +2 -2
  22. package/src/components/base/avatar/avatar.stories.js +1 -1
  23. package/src/components/base/avatar_labeled/avatar_labeled.stories.js +1 -1
  24. package/src/components/base/daterange_picker/daterange_picker.vue +2 -2
  25. package/src/components/base/filtered_search/filtered_search.vue +2 -2
  26. package/src/components/base/path/path.vue +1 -1
  27. package/src/components/base/search_box_by_click/search_box_by_click.vue +2 -2
  28. package/src/components/base/sorting/sorting.vue +2 -2
  29. package/src/components/base/tabs/tabs/scrollable_tabs.vue +1 -1
  30. package/src/components/base/toggle/toggle.spec.js +1 -1
  31. package/src/components/base/toggle/toggle.vue +4 -1
  32. package/src/components/charts/heatmap/heatmap.vue +2 -2
  33. package/src/components/charts/sparkline/sparkline.spec.js +4 -2
  34. package/src/components/charts/sparkline/sparkline.vue +2 -2
  35. package/src/components/shared_components/clear_icon_button/clear_icon_button.vue +2 -2
  36. package/src/directives/collapse_toggle.js +1 -3
  37. package/src/directives/modal.js +1 -3
  38. package/src/directives/resize_observer/resize_observer.js +1 -3
  39. package/src/directives/resize_observer/resize_observer.spec.js +3 -3
  40. package/src/directives/tooltip.js +1 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [32.20.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.20.1...v32.20.2) (2021-10-19)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **Toggle:** Always keep aria checked whether true or false ([84a240e](https://gitlab.com/gitlab-org/gitlab-ui/commit/84a240ea14fb7f5827b014f89551f692899f3df4))
7
+
1
8
  ## [32.20.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v32.20.0...v32.20.1) (2021-10-19)
2
9
 
3
10
 
@@ -1,6 +1,6 @@
1
1
  import _uniqueId from 'lodash/uniqueId';
2
2
  import { BCollapse } from 'bootstrap-vue/esm/index.js';
3
- import GlCollapseToggle from '../../../directives/collapse_toggle';
3
+ import { GlCollapseToggleDirective } from '../../../directives/collapse_toggle';
4
4
  import GlButton from '../button/button';
5
5
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
6
6
 
@@ -11,7 +11,7 @@ var script = {
11
11
  GlButton
12
12
  },
13
13
  directives: {
14
- GlCollapseToggle
14
+ GlCollapseToggle: GlCollapseToggleDirective
15
15
  },
16
16
  inject: ['accordionSetId', 'defaultHeaderLevel'],
17
17
  inheritAttrs: false,
@@ -1,4 +1,4 @@
1
- import GlTooltip from '../../../directives/tooltip';
1
+ import { GlTooltipDirective } from '../../../directives/tooltip';
2
2
  import { getDateInPast, getDateInFuture, getDayDifference } from '../../../utils/datetime_utility';
3
3
  import GlDatepicker from '../datepicker/datepicker';
4
4
  import GlIcon from '../icon/icon';
@@ -10,7 +10,7 @@ var script = {
10
10
  GlIcon
11
11
  },
12
12
  directives: {
13
- GlTooltip
13
+ GlTooltip: GlTooltipDirective
14
14
  },
15
15
  props: {
16
16
  fromLabel: {
@@ -1,7 +1,7 @@
1
1
  import _cloneDeep from 'lodash/cloneDeep';
2
2
  import PortalVue from 'portal-vue';
3
3
  import Vue from 'vue';
4
- import GlTooltip from '../../../directives/tooltip';
4
+ import { GlTooltipDirective } from '../../../directives/tooltip';
5
5
  import GlIcon from '../icon/icon';
6
6
  import GlSearchBoxByClick from '../search_box_by_click/search_box_by_click';
7
7
  import GlFilteredSearchTerm from './filtered_search_term';
@@ -30,7 +30,7 @@ var script = {
30
30
  GlIcon
31
31
  },
32
32
  directives: {
33
- GlTooltip
33
+ GlTooltip: GlTooltipDirective
34
34
  },
35
35
 
36
36
  provide() {
@@ -1,7 +1,7 @@
1
1
  import _findLast from 'lodash/findLast';
2
2
  import _uniqueId from 'lodash/uniqueId';
3
3
  import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
4
- import GlResizeObserverDirective from '../../../directives/resize_observer/resize_observer';
4
+ import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
5
5
  import { glThemes } from '../../../utils/constants';
6
6
  import GlIcon from '../icon/icon';
7
7
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
@@ -1,4 +1,4 @@
1
- import GlTooltip from '../../../directives/tooltip';
1
+ import { GlTooltipDirective } from '../../../directives/tooltip';
2
2
  import GlClearIconButton from '../../shared_components/clear_icon_button/clear_icon_button';
3
3
  import GlButton from '../button/button';
4
4
  import GlDropdown from '../dropdown/dropdown';
@@ -23,7 +23,7 @@ var script = {
23
23
  GlFormInputGroup
24
24
  },
25
25
  directives: {
26
- GlTooltip
26
+ GlTooltip: GlTooltipDirective
27
27
  },
28
28
  props: {
29
29
  value: {
@@ -1,4 +1,4 @@
1
- import GlTooltip from '../../../directives/tooltip';
1
+ import { GlTooltipDirective } from '../../../directives/tooltip';
2
2
  import GlButton from '../button/button';
3
3
  import GlButtonGroup from '../button_group/button_group';
4
4
  import GlDropdown from '../dropdown/dropdown';
@@ -12,7 +12,7 @@ var script = {
12
12
  GlDropdown
13
13
  },
14
14
  directives: {
15
- GlTooltip
15
+ GlTooltip: GlTooltipDirective
16
16
  },
17
17
  props: {
18
18
  /**
@@ -1,6 +1,6 @@
1
1
  import _isArray from 'lodash/isArray';
2
2
  import _debounce from 'lodash/debounce';
3
- import GlResizeObserverDirective from '../../../../directives/resize_observer/resize_observer';
3
+ import { GlResizeObserverDirective } from '../../../../directives/resize_observer/resize_observer';
4
4
  import GlIcon from '../../icon/icon';
5
5
  import GlTabs from './tabs';
6
6
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
@@ -90,6 +90,10 @@ var script = {
90
90
 
91
91
  helpId() {
92
92
  return this.help ? `toggle-help-${this.uuid}` : undefined;
93
+ },
94
+
95
+ isChecked() {
96
+ return this.value ? 'true' : 'false';
93
97
  }
94
98
 
95
99
  },
@@ -123,7 +127,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
123
127
  'gl-toggle': true,
124
128
  'is-checked': _vm.value,
125
129
  'is-disabled': _vm.disabled,
126
- },attrs:{"role":"switch","aria-checked":_vm.value,"aria-label":_vm.label,"aria-describedby":_vm.helpId,"type":"button"},on:{"click":function($event){$event.preventDefault();return _vm.toggleFeature($event)}}},[(_vm.isLoading)?_c('gl-loading-icon',{staticClass:"toggle-loading",attrs:{"color":"light"}}):_c('span',{class:{ 'toggle-icon': true, disabled: _vm.disabled }},[_c('gl-icon',{attrs:{"name":_vm.icon,"size":16}})],1)],1)]),_vm._v(" "),(_vm.help)?_c('span',{staticClass:"gl-help-label",attrs:{"id":_vm.helpId,"data-testid":"toggle-help"}},[_vm._t("help",[_vm._v(_vm._s(_vm.help))])],2):_vm._e()])};
130
+ },attrs:{"role":"switch","aria-checked":_vm.isChecked,"aria-label":_vm.label,"aria-describedby":_vm.helpId,"type":"button"},on:{"click":function($event){$event.preventDefault();return _vm.toggleFeature($event)}}},[(_vm.isLoading)?_c('gl-loading-icon',{staticClass:"toggle-loading",attrs:{"color":"light"}}):_c('span',{class:{ 'toggle-icon': true, disabled: _vm.disabled }},[_c('gl-icon',{attrs:{"name":_vm.icon,"size":16}})],1)],1)]),_vm._v(" "),(_vm.help)?_c('span',{staticClass:"gl-help-label",attrs:{"id":_vm.helpId,"data-testid":"toggle-help"}},[_vm._t("help",[_vm._v(_vm._s(_vm.help))])],2):_vm._e()])};
127
131
  var __vue_staticRenderFns__ = [];
128
132
 
129
133
  /* style */
@@ -1,5 +1,5 @@
1
1
  import merge from 'lodash/merge';
2
- import resizeObserver from '../../../directives/resize_observer/resize_observer';
2
+ import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
3
3
  import { getDefaultTooltipContent } from '../../../utils/charts/config';
4
4
  import { TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
5
5
  import { heatmapHues } from '../../../utils/charts/theme';
@@ -52,7 +52,7 @@ var script = {
52
52
  TooltipDefaultFormat
53
53
  },
54
54
  directives: {
55
- resizeObserver
55
+ resizeObserver: GlResizeObserverDirective
56
56
  },
57
57
  mixins: [ToolboxMixin],
58
58
  props: {
@@ -1,5 +1,5 @@
1
1
  import merge from 'lodash/merge';
2
- import resizeObserver from '../../../directives/resize_observer/resize_observer';
2
+ import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
3
3
  import defaultChartOptions, { mergeSeriesToOptions, symbolSize } from '../../../utils/charts/config';
4
4
  import Chart from '../chart/chart';
5
5
  import ChartTooltip from '../tooltip/tooltip';
@@ -12,7 +12,7 @@ var script = {
12
12
  ChartTooltip
13
13
  },
14
14
  directives: {
15
- resizeObserver
15
+ resizeObserver: GlResizeObserverDirective
16
16
  },
17
17
  props: {
18
18
  /**
@@ -1,4 +1,4 @@
1
- import GlTooltip from '../../../directives/tooltip';
1
+ import { GlTooltipDirective } from '../../../directives/tooltip';
2
2
  import GlButton from '../../base/button/button';
3
3
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
4
4
 
@@ -7,7 +7,7 @@ var script = {
7
7
  GlButton
8
8
  },
9
9
  directives: {
10
- GlTooltip
10
+ GlTooltip: GlTooltipDirective
11
11
  },
12
12
  props: {
13
13
  title: {
@@ -1,2 +1 @@
1
- import { VBToggle } from 'bootstrap-vue/esm/index.js';
2
- export { VBToggle as default } from 'bootstrap-vue/esm/index.js';
1
+ export { VBToggle as GlCollapseToggleDirective } from 'bootstrap-vue/esm/index.js';
@@ -1,2 +1 @@
1
- import { VBModal } from 'bootstrap-vue/esm/index.js';
2
- export { VBModal as default } from 'bootstrap-vue/esm/index.js';
1
+ export { VBModal as GlModalDirective } from 'bootstrap-vue/esm/index.js';
@@ -1,7 +1,7 @@
1
1
  import isFunction from 'lodash/isFunction';
2
2
 
3
3
  let observer = null;
4
- const ResizeObserverDirective = {
4
+ const GlResizeObserverDirective = {
5
5
  bind(el, {
6
6
  value: resizeHandler
7
7
  }) {
@@ -34,4 +34,4 @@ const ResizeObserverDirective = {
34
34
 
35
35
  };
36
36
 
37
- export default ResizeObserverDirective;
37
+ export { GlResizeObserverDirective };
@@ -1,2 +1 @@
1
- import { VBTooltip } from 'bootstrap-vue/esm/index.js';
2
- export { VBTooltip as default } from 'bootstrap-vue/esm/index.js';
1
+ export { VBTooltip as GlTooltipDirective } from 'bootstrap-vue/esm/index.js';
package/dist/index.js CHANGED
@@ -87,10 +87,10 @@ export { default as GlFriendlyWrap } from './components/utilities/friendly_wrap/
87
87
  export { default as GlIntersperse } from './components/utilities/intersperse/intersperse';
88
88
  export { default as GlSprintf } from './components/utilities/sprintf/sprintf';
89
89
  export { default as GlTruncate } from './components/utilities/truncate/truncate';
90
- export { default as GlModalDirective } from './directives/modal';
91
- export { default as GlTooltipDirective } from './directives/tooltip';
92
- export { default as GlResizeObserverDirective } from './directives/resize_observer/resize_observer';
93
- export { default as GlCollapseToggleDirective } from './directives/collapse_toggle';
90
+ export { GlModalDirective } from './directives/modal';
91
+ export { GlTooltipDirective } from './directives/tooltip';
92
+ export { GlResizeObserverDirective } from './directives/resize_observer/resize_observer';
93
+ export { GlCollapseToggleDirective } from './directives/collapse_toggle';
94
94
  export { SafeLinkDirective as GlSafeLinkDirective } from './directives/safe_link/safe_link';
95
95
  export { SafeHtmlDirective as GlSafeHtmlDirective } from './directives/safe_html/safe_html';
96
96
  export { OutsideDirective as GlOutsideDirective } from './directives/outside/outside';
package/index.js CHANGED
@@ -101,10 +101,10 @@ export { default as GlSprintf } from './src/components/utilities/sprintf/sprintf
101
101
  export { default as GlTruncate } from './src/components/utilities/truncate/truncate.vue';
102
102
 
103
103
  // Directives
104
- export { default as GlModalDirective } from './src/directives/modal';
105
- export { default as GlTooltipDirective } from './src/directives/tooltip';
106
- export { default as GlResizeObserverDirective } from './src/directives/resize_observer/resize_observer';
107
- export { default as GlCollapseToggleDirective } from './src/directives/collapse_toggle';
104
+ export { GlModalDirective } from './src/directives/modal';
105
+ export { GlTooltipDirective } from './src/directives/tooltip';
106
+ export { GlResizeObserverDirective } from './src/directives/resize_observer/resize_observer';
107
+ export { GlCollapseToggleDirective } from './src/directives/collapse_toggle';
108
108
  export { SafeLinkDirective as GlSafeLinkDirective } from './src/directives/safe_link/safe_link';
109
109
  export { SafeHtmlDirective as GlSafeHtmlDirective } from './src/directives/safe_html/safe_html';
110
110
  export { OutsideDirective as GlOutsideDirective } from './src/directives/outside/outside';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "32.20.1",
3
+ "version": "32.20.2",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -1,6 +1,6 @@
1
1
  import { mount } from '@vue/test-utils';
2
2
  import { BCollapse } from 'bootstrap-vue';
3
- import GlCollapseToggleDirective from '../../../directives/collapse_toggle';
3
+ import { GlCollapseToggleDirective } from '../../../directives/collapse_toggle';
4
4
  import { waitForAnimationFrame } from '../../../utils/test_utils';
5
5
  import GlButton from '../button/button.vue';
6
6
  import GlAccordionItem from './accordion_item.vue';
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import { BCollapse } from 'bootstrap-vue';
3
3
  import { uniqueId } from 'lodash';
4
- import GlCollapseToggle from '../../../directives/collapse_toggle';
4
+ import { GlCollapseToggleDirective } from '../../../directives/collapse_toggle';
5
5
  import GlButton from '../button/button.vue';
6
6
 
7
7
  export default {
@@ -11,7 +11,7 @@ export default {
11
11
  GlButton,
12
12
  },
13
13
  directives: {
14
- GlCollapseToggle,
14
+ GlCollapseToggle: GlCollapseToggleDirective,
15
15
  },
16
16
  inject: ['accordionSetId', 'defaultHeaderLevel'],
17
17
  inheritAttrs: false,
@@ -1,7 +1,7 @@
1
1
  import { select, text, number, withKnobs } from '@storybook/addon-knobs';
2
2
  import Vue from 'vue';
3
3
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
4
- import GlTooltipDirective from '../../../directives/tooltip';
4
+ import { GlTooltipDirective } from '../../../directives/tooltip';
5
5
  import { avatarSizeOptions, avatarShapeOptions, tooltipPlacements } from '../../../utils/constants';
6
6
  import readme from './avatar.md';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { text, withKnobs, select } from '@storybook/addon-knobs';
2
2
  import Vue from 'vue';
3
3
  import { documentedStoriesOf } from '../../../../documentation/documented_stories';
4
- import GlTooltipDirective from '../../../directives/tooltip';
4
+ import { GlTooltipDirective } from '../../../directives/tooltip';
5
5
  import { avatarSizeOptions, avatarShapeOptions, tooltipPlacements } from '../../../utils/constants';
6
6
  import readme from './avatar_labeled.md';
7
7
 
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import GlTooltip from '../../../directives/tooltip';
2
+ import { GlTooltipDirective } from '../../../directives/tooltip';
3
3
  import { getDayDifference, getDateInPast, getDateInFuture } from '../../../utils/datetime_utility';
4
4
  import GlDatepicker from '../datepicker/datepicker.vue';
5
5
  import GlIcon from '../icon/icon.vue';
@@ -10,7 +10,7 @@ export default {
10
10
  GlIcon,
11
11
  },
12
12
  directives: {
13
- GlTooltip,
13
+ GlTooltip: GlTooltipDirective,
14
14
  },
15
15
  props: {
16
16
  fromLabel: {
@@ -2,7 +2,7 @@
2
2
  import { cloneDeep } from 'lodash';
3
3
  import PortalVue from 'portal-vue';
4
4
  import Vue from 'vue';
5
- import GlTooltip from '../../../directives/tooltip';
5
+ import { GlTooltipDirective } from '../../../directives/tooltip';
6
6
  import GlIcon from '../icon/icon.vue';
7
7
  import GlSearchBoxByClick from '../search_box_by_click/search_box_by_click.vue';
8
8
  import GlFilteredSearchTerm from './filtered_search_term.vue';
@@ -34,7 +34,7 @@ export default {
34
34
  GlSearchBoxByClick,
35
35
  GlIcon,
36
36
  },
37
- directives: { GlTooltip },
37
+ directives: { GlTooltip: GlTooltipDirective },
38
38
  provide() {
39
39
  portalUuid += 1;
40
40
  this.portalName = `filters_portal_${portalUuid}`;
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import iconSpriteInfo from '@gitlab/svgs/dist/icons.json';
3
3
  import { uniqueId, findLast } from 'lodash';
4
- import GlResizeObserverDirective from '../../../directives/resize_observer/resize_observer';
4
+ import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
5
5
  import { glThemes } from '../../../utils/constants';
6
6
  import GlIcon from '../icon/icon.vue';
7
7
 
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import GlTooltip from '../../../directives/tooltip';
2
+ import { GlTooltipDirective } from '../../../directives/tooltip';
3
3
  import GlClearIconButton from '../../shared_components/clear_icon_button/clear_icon_button.vue';
4
4
  import GlButton from '../button/button.vue';
5
5
  import GlDropdown from '../dropdown/dropdown.vue';
@@ -23,7 +23,7 @@ export default {
23
23
  GlFormInputGroup,
24
24
  },
25
25
  directives: {
26
- GlTooltip,
26
+ GlTooltip: GlTooltipDirective,
27
27
  },
28
28
  props: {
29
29
  value: {
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import GlTooltip from '../../../directives/tooltip';
2
+ import { GlTooltipDirective } from '../../../directives/tooltip';
3
3
  import GlButton from '../button/button.vue';
4
4
  import GlButtonGroup from '../button_group/button_group.vue';
5
5
  import GlDropdown from '../dropdown/dropdown.vue';
@@ -12,7 +12,7 @@ export default {
12
12
  GlDropdown,
13
13
  },
14
14
  directives: {
15
- GlTooltip,
15
+ GlTooltip: GlTooltipDirective,
16
16
  },
17
17
  props: {
18
18
  /**
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { debounce, isArray } from 'lodash';
3
- import GlResizeObserverDirective from '../../../../directives/resize_observer/resize_observer';
3
+ import { GlResizeObserverDirective } from '../../../../directives/resize_observer/resize_observer';
4
4
  import GlIcon from '../../icon/icon.vue';
5
5
  import GlTabs from './tabs.vue';
6
6
 
@@ -36,7 +36,7 @@ describe('toggle', () => {
36
36
  describe.each`
37
37
  state | value | ariaCheckedExpected | checkedClassExpected
38
38
  ${'on'} | ${true} | ${'true'} | ${true}
39
- ${'off'} | ${false} | ${undefined} | ${false}
39
+ ${'off'} | ${false} | ${'false'} | ${false}
40
40
  `('when $state', ({ value, ariaCheckedExpected, checkedClassExpected }) => {
41
41
  beforeEach(() => {
42
42
  createWrapper({ value });
@@ -83,6 +83,9 @@ export default {
83
83
  helpId() {
84
84
  return this.help ? `toggle-help-${this.uuid}` : undefined;
85
85
  },
86
+ isChecked() {
87
+ return this.value ? 'true' : 'false';
88
+ },
86
89
  },
87
90
 
88
91
  beforeCreate() {
@@ -119,7 +122,7 @@ export default {
119
122
  <input v-if="name" :name="name" :value="value" type="hidden" />
120
123
  <button
121
124
  role="switch"
122
- :aria-checked="value"
125
+ :aria-checked="isChecked"
123
126
  :aria-label="label"
124
127
  :aria-describedby="helpId"
125
128
  :class="{
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import merge from 'lodash/merge';
3
3
  import { white, gray100 } from '../../../../scss_to_js/scss_variables';
4
- import resizeObserver from '../../../directives/resize_observer/resize_observer';
4
+ import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
5
5
  import { getDefaultTooltipContent } from '../../../utils/charts/config';
6
6
  import { TOOLTIP_LEFT_OFFSET } from '../../../utils/charts/constants';
7
7
  import { heatmapHues } from '../../../utils/charts/theme';
@@ -50,7 +50,7 @@ export default {
50
50
  TooltipDefaultFormat,
51
51
  },
52
52
  directives: {
53
- resizeObserver,
53
+ resizeObserver: GlResizeObserverDirective,
54
54
  },
55
55
  mixins: [ToolboxMixin],
56
56
  props: {
@@ -26,8 +26,10 @@ jest.mock('~/utils/charts/theme', () => ({
26
26
 
27
27
  let triggerResize = () => {};
28
28
  jest.mock('~/directives/resize_observer/resize_observer', () => ({
29
- bind(el, { value: resizeHandler }) {
30
- triggerResize = () => resizeHandler();
29
+ GlResizeObserverDirective: {
30
+ bind(el, { value: resizeHandler }) {
31
+ triggerResize = () => resizeHandler();
32
+ },
31
33
  },
32
34
  }));
33
35
 
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import merge from 'lodash/merge';
3
- import resizeObserver from '../../../directives/resize_observer/resize_observer';
3
+ import { GlResizeObserverDirective } from '../../../directives/resize_observer/resize_observer';
4
4
  import defaultChartOptions, {
5
5
  mergeSeriesToOptions,
6
6
  symbolSize,
@@ -14,7 +14,7 @@ const gridPadding = symbolSize / 2;
14
14
  export default {
15
15
  components: { Chart, ChartTooltip },
16
16
  directives: {
17
- resizeObserver,
17
+ resizeObserver: GlResizeObserverDirective,
18
18
  },
19
19
  props: {
20
20
  /**
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import GlTooltip from '../../../directives/tooltip';
2
+ import { GlTooltipDirective } from '../../../directives/tooltip';
3
3
  import GlButton from '../../base/button/button.vue';
4
4
 
5
5
  export default {
@@ -7,7 +7,7 @@ export default {
7
7
  GlButton,
8
8
  },
9
9
  directives: {
10
- GlTooltip,
10
+ GlTooltip: GlTooltipDirective,
11
11
  },
12
12
  props: {
13
13
  title: {
@@ -1,3 +1 @@
1
- import { VBToggle } from 'bootstrap-vue';
2
-
3
- export default VBToggle;
1
+ export { VBToggle as GlCollapseToggleDirective } from 'bootstrap-vue';
@@ -1,3 +1 @@
1
- import { VBModal } from 'bootstrap-vue';
2
-
3
- export default VBModal;
1
+ export { VBModal as GlModalDirective } from 'bootstrap-vue';
@@ -2,7 +2,7 @@ import isFunction from 'lodash/isFunction';
2
2
 
3
3
  let observer = null;
4
4
 
5
- const ResizeObserverDirective = {
5
+ export const GlResizeObserverDirective = {
6
6
  bind(el, { value: resizeHandler }) {
7
7
  if (!isFunction(resizeHandler)) {
8
8
  throw TypeError('directive value must be a function');
@@ -28,5 +28,3 @@ const ResizeObserverDirective = {
28
28
  }
29
29
  },
30
30
  };
31
-
32
- export default ResizeObserverDirective;
@@ -1,5 +1,5 @@
1
1
  import { shallowMount, createLocalVue } from '@vue/test-utils';
2
- import resizeObserver from './resize_observer';
2
+ import { GlResizeObserverDirective } from './resize_observer';
3
3
  import { useMockResizeObserver } from '~helpers/mock_dom_observer';
4
4
 
5
5
  describe('resize observer directive', () => {
@@ -15,7 +15,7 @@ describe('resize observer directive', () => {
15
15
 
16
16
  const component = {
17
17
  directives: {
18
- resizeObserver,
18
+ resizeObserver: GlResizeObserverDirective,
19
19
  },
20
20
  methods: {
21
21
  handleResize: mockHandleResize,
@@ -84,7 +84,7 @@ describe('resize observer directive', () => {
84
84
  (directiveValue) => {
85
85
  const testComponentWithoutHandler = {
86
86
  directives: {
87
- resizeObserver,
87
+ resizeObserver: GlResizeObserverDirective,
88
88
  },
89
89
  data() {
90
90
  return {
@@ -1,3 +1 @@
1
- import { VBTooltip } from 'bootstrap-vue';
2
-
3
- export default VBTooltip;
1
+ export { VBTooltip as GlTooltipDirective } from 'bootstrap-vue';