@gitlab/ui 37.3.0 → 37.4.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 (57) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/components/base/form/form_group/form_group.documentation.js +2 -6
  3. package/dist/components/base/search_box_by_click/search_box_by_click.documentation.js +2 -80
  4. package/dist/components/base/search_box_by_click/search_box_by_click.js +60 -1
  5. package/dist/components/base/search_box_by_type/search_box_by_type.documentation.js +2 -20
  6. package/dist/components/base/search_box_by_type/search_box_by_type.js +19 -5
  7. package/dist/directives/hover_load/hover_load.documentation.js +1 -1
  8. package/dist/directives/resize_observer/resize_observer.documentation.js +2 -5
  9. package/dist/index.css +1 -1
  10. package/dist/index.css.map +1 -1
  11. package/documentation/documented_stories.js +5 -0
  12. package/package.json +1 -1
  13. package/src/components/base/button/button.scss +5 -9
  14. package/src/components/base/form/form_group/form_group.documentation.js +0 -3
  15. package/src/components/base/form/form_group/form_group.md +0 -2
  16. package/src/components/base/form/form_group/form_group.stories.js +106 -145
  17. package/src/components/base/search_box_by_click/search_box_by_click.documentation.js +0 -90
  18. package/src/components/base/search_box_by_click/search_box_by_click.md +0 -2
  19. package/src/components/base/search_box_by_click/search_box_by_click.stories.js +91 -48
  20. package/src/components/base/search_box_by_click/search_box_by_click.vue +50 -1
  21. package/src/components/base/search_box_by_type/search_box_by_type.documentation.js +0 -18
  22. package/src/components/base/search_box_by_type/search_box_by_type.md +0 -2
  23. package/src/components/base/search_box_by_type/search_box_by_type.stories.js +49 -43
  24. package/src/components/base/search_box_by_type/search_box_by_type.vue +16 -6
  25. package/src/directives/hover_load/hover_load.md +0 -2
  26. package/src/directives/hover_load/hover_load.stories.js +39 -34
  27. package/src/directives/resize_observer/resize_observer.documentation.js +0 -2
  28. package/src/directives/resize_observer/resize_observer.md +0 -6
  29. package/src/directives/resize_observer/resize_observer.stories.js +70 -51
  30. package/dist/components/base/form/form_group/examples/form_group/form_group.basic.example.js +0 -38
  31. package/dist/components/base/form/form_group/examples/form_group/form_group.disabled.example.js +0 -48
  32. package/dist/components/base/form/form_group/examples/form_group/form_group.textarea.example.js +0 -48
  33. package/dist/components/base/form/form_group/examples/form_group/form_group.validation.example.js +0 -66
  34. package/dist/components/base/form/form_group/examples/form_group/index.js +0 -27
  35. package/dist/components/base/search_box_by_click/examples/index.js +0 -22
  36. package/dist/components/base/search_box_by_click/examples/search_box_by_click.default.example.js +0 -48
  37. package/dist/components/base/search_box_by_click/examples/search_box_by_click.history.example.js +0 -51
  38. package/dist/components/base/search_box_by_click/examples/search_box_by_click.v_model.example.js +0 -54
  39. package/dist/components/base/search_box_by_type/examples/index.js +0 -17
  40. package/dist/components/base/search_box_by_type/examples/search_box_by_type.default.example.js +0 -48
  41. package/dist/components/base/search_box_by_type/examples/search_box_by_type.loading.example.js +0 -65
  42. package/dist/directives/resize_observer/examples/index.js +0 -12
  43. package/dist/directives/resize_observer/examples/resize_observer.basic.example.js +0 -62
  44. package/src/components/base/form/form_group/examples/form_group/form_group.basic.example.vue +0 -11
  45. package/src/components/base/form/form_group/examples/form_group/form_group.disabled.example.vue +0 -21
  46. package/src/components/base/form/form_group/examples/form_group/form_group.textarea.example.vue +0 -15
  47. package/src/components/base/form/form_group/examples/form_group/form_group.validation.example.vue +0 -36
  48. package/src/components/base/form/form_group/examples/form_group/index.js +0 -32
  49. package/src/components/base/search_box_by_click/examples/index.js +0 -26
  50. package/src/components/base/search_box_by_click/examples/search_box_by_click.default.example.vue +0 -14
  51. package/src/components/base/search_box_by_click/examples/search_box_by_click.history.example.vue +0 -23
  52. package/src/components/base/search_box_by_click/examples/search_box_by_click.v_model.example.vue +0 -23
  53. package/src/components/base/search_box_by_type/examples/index.js +0 -20
  54. package/src/components/base/search_box_by_type/examples/search_box_by_type.default.example.vue +0 -14
  55. package/src/components/base/search_box_by_type/examples/search_box_by_type.loading.example.vue +0 -34
  56. package/src/directives/resize_observer/examples/index.js +0 -14
  57. package/src/directives/resize_observer/examples/resize_observer.basic.example.vue +0 -21
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [37.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.3.0...v37.4.0) (2022-03-07)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlButton:** Update selected state background ([b9e3116](https://gitlab.com/gitlab-org/gitlab-ui/commit/b9e31166ee8a43c2ea09c2f4a9cafd9e71e222d8))
7
+ * **GlButton:** Update selected state design ([a5ebf70](https://gitlab.com/gitlab-org/gitlab-ui/commit/a5ebf701e38fd32ff965af33c30319e4c7f2edc5))
8
+
1
9
  # [37.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.2.0...v37.3.0) (2022-03-03)
2
10
 
3
11
 
@@ -1,11 +1,7 @@
1
- import examples from './examples/form_group';
2
-
3
- var description = "# Form Group\n\nForm group adds structure to forms.\n";
1
+ var description = "Form group adds structure to forms.\n";
4
2
 
5
3
  var form_group_documentation = {
6
- description,
7
- examples,
8
- bootstrapComponent: 'b-form-group'
4
+ description
9
5
  };
10
6
 
11
7
  export default form_group_documentation;
@@ -1,86 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "# Search Box By Click\n\nProvides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).\n";
1
+ var description = "Provides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).\n";
4
2
 
5
3
  var search_box_by_click_documentation = {
6
4
  followsDesignSystem: true,
7
- description,
8
- examples,
9
- propsInfo: {
10
- value: {
11
- additionalInfo: 'If provided, used as value of search input'
12
- },
13
- historyItems: {
14
- type: Array,
15
- required: false,
16
- additionalInfo: 'If provided, used as history items for this component'
17
- },
18
- placeholder: {
19
- type: String,
20
- required: false,
21
- additionalInfo: 'If provided, used as history items for this component'
22
- },
23
- disabled: {
24
- type: Boolean,
25
- required: false,
26
- additionalInfo: 'If provided and true, disables the input and controls'
27
- },
28
- recentSearchesHeader: {
29
- type: String,
30
- required: false,
31
- default: 'Recent searches',
32
- additionalInfo: 'i18n for recent searches title within history dropdown'
33
- },
34
- clearButtonTitle: {
35
- type: String,
36
- required: false,
37
- default: 'Clear',
38
- additionalInfo: 'i18n for clear button title'
39
- },
40
- closeButtonTitle: {
41
- type: String,
42
- required: false,
43
- default: 'Close',
44
- additionalInfo: 'i18n for close button title within history dropdown'
45
- },
46
- clearRecentSearchesText: {
47
- type: String,
48
- required: false,
49
- default: 'Clear recent searches',
50
- additionalInfo: 'i18n for recent searches clear text'
51
- },
52
- tooltipContainer: {
53
- additionalInfo: 'Container for tooltip. Valid values: DOM node, selector string or `false` for default'
54
- },
55
- searchButtonAttributes: {
56
- additionalInfo: 'HTML attributes to add to the search button'
57
- }
58
- },
59
- events: [{
60
- event: 'clear',
61
- description: 'Emitted when search is cleared'
62
- }, {
63
- event: 'submit',
64
- args: [{
65
- arg: 'value',
66
- description: 'Search value'
67
- }],
68
- description: 'Emitted when search is submitted'
69
- }, {
70
- event: 'history-item-selected',
71
- args: [{
72
- arg: 'value',
73
- description: 'History item'
74
- }],
75
- description: 'Emitted when item from history is selected'
76
- }, {
77
- event: 'clear-history',
78
- description: 'Emitted when clear history button is clicked'
79
- }],
80
- slots: [{
81
- name: 'history-item',
82
- description: 'Slot to customize history item in history dropdown. Used only with history-items prop'
83
- }]
5
+ description
84
6
  };
85
7
 
86
8
  export default search_box_by_click_documentation;
@@ -26,6 +26,9 @@ var script = {
26
26
  GlTooltip: GlTooltipDirective
27
27
  },
28
28
  props: {
29
+ /**
30
+ * If provided, used as value of search input
31
+ */
29
32
  value: {
30
33
  required: false,
31
34
  default: '',
@@ -33,11 +36,19 @@ var script = {
33
36
  // so we should not force any specific type for value here
34
37
  validator: () => true
35
38
  },
39
+
40
+ /**
41
+ * If provided, used as history items for this component
42
+ */
36
43
  historyItems: {
37
44
  type: Array,
38
45
  required: false,
39
46
  default: null
40
47
  },
48
+
49
+ /**
50
+ * If provided, used as a placeholder for this component
51
+ */
41
52
  placeholder: {
42
53
  type: String,
43
54
  required: false,
@@ -48,26 +59,46 @@ var script = {
48
59
  required: false,
49
60
  default: true
50
61
  },
62
+
63
+ /**
64
+ * If provided and true, disables the input and controls
65
+ */
51
66
  disabled: {
52
67
  type: Boolean,
53
68
  required: false,
54
69
  default: false
55
70
  },
71
+
72
+ /**
73
+ * i18n for recent searches title within history dropdown
74
+ */
56
75
  recentSearchesHeader: {
57
76
  type: String,
58
77
  required: false,
59
78
  default: 'Recent searches'
60
79
  },
80
+
81
+ /**
82
+ * i18n for clear button title
83
+ */
61
84
  clearButtonTitle: {
62
85
  type: String,
63
86
  required: false,
64
87
  default: 'Clear'
65
88
  },
89
+
90
+ /**
91
+ * i18n for close button title within history dropdown
92
+ */
66
93
  closeButtonTitle: {
67
94
  type: String,
68
95
  required: false,
69
96
  default: 'Close'
70
97
  },
98
+
99
+ /**
100
+ * i18n for recent searches clear text
101
+ */
71
102
  clearRecentSearchesText: {
72
103
  type: String,
73
104
  required: false,
@@ -78,11 +109,19 @@ var script = {
78
109
  required: false,
79
110
  default: "You don't have any recent searches"
80
111
  },
112
+
113
+ /**
114
+ * Container for tooltip. Valid values: DOM node, selector string or `false` for default
115
+ */
81
116
  tooltipContainer: {
82
117
  required: false,
83
118
  default: false,
84
119
  validator: value => value === false || typeof value === 'string' || value instanceof HTMLElement
85
120
  },
121
+
122
+ /**
123
+ * HTML attributes to add to the search button
124
+ */
86
125
  searchButtonAttributes: {
87
126
  type: Object,
88
127
  required: false,
@@ -137,11 +176,20 @@ var script = {
137
176
  },
138
177
 
139
178
  search(value) {
179
+ /**
180
+ * Emitted when search is submitted
181
+ * @property {*} value Search value
182
+ */
140
183
  this.$emit('submit', value);
141
184
  },
142
185
 
143
186
  selectHistoryItem(item) {
144
187
  this.currentValue = item;
188
+ /**
189
+ * Emitted when item from history is selected
190
+ * @property {*} item History item
191
+ */
192
+
145
193
  this.$emit('history-item-selected', item);
146
194
  setTimeout(() => {
147
195
  document.activeElement.blur();
@@ -150,11 +198,22 @@ var script = {
150
198
 
151
199
  clearInput() {
152
200
  this.currentValue = '';
201
+ /**
202
+ * Emitted when search is cleared
203
+ */
204
+
153
205
  this.$emit('clear');
154
206
 
155
207
  if (this.$refs.input) {
156
208
  this.$refs.input.$el.focus();
157
209
  }
210
+ },
211
+
212
+ emitClearHistory() {
213
+ /**
214
+ * Emitted when clear history button is clicked
215
+ */
216
+ this.$emit('clear-history');
158
217
  }
159
218
 
160
219
  }
@@ -164,7 +223,7 @@ var script = {
164
223
  const __vue_script__ = script;
165
224
 
166
225
  /* template */
167
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-input-group',{staticClass:"gl-search-box-by-click",scopedSlots:_vm._u([(_vm.historyItems)?{key:"prepend",fn:function(){return [_c('gl-dropdown',{ref:"historyDropdown",staticClass:"gl-search-box-by-click-history",attrs:{"menu-class":"gl-search-box-by-click-menu","category":"secondary","disabled":_vm.disabled},scopedSlots:_vm._u([{key:"button-content",fn:function(){return [_c('gl-icon',{staticClass:"gl-search-box-by-click-history-icon",attrs:{"name":"history"}}),_vm._v(" "),_c('gl-icon',{staticClass:"gl-search-box-by-click-history-icon-chevron",attrs:{"name":"chevron-down"}}),_vm._v(" "),_c('span',{staticClass:"gl-sr-only"},[_vm._v("Toggle history")])]},proxy:true}],null,false,2220989388)},[_vm._v(" "),_c('gl-dropdown-text',{staticClass:"gl-search-box-by-click-history-header"},[_vm._v("\n "+_vm._s(_vm.recentSearchesHeader)+"\n "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip.hover",value:({ container: _vm.tooltipContainer }),expression:"{ container: tooltipContainer }",modifiers:{"hover":true}}],ref:"closeHistory",staticClass:"gl-search-box-by-click-close-history-button",attrs:{"title":_vm.closeButtonTitle,"aria-label":_vm.closeButtonTitle,"category":"tertiary","name":"close","icon":"close"},on:{"click":_vm.closeHistoryDropdown}})],1),_vm._v(" "),_c('gl-dropdown-divider'),_vm._v(" "),(_vm.historyItems.length)?[_vm._l((_vm.historyItems),function(item,idx){return _c('gl-dropdown-item',{key:idx,staticClass:"gl-search-box-by-click-history-item",on:{"click":function($event){return _vm.selectHistoryItem(item)}}},[_vm._t("history-item",[_vm._v(_vm._s(item))],{"historyItem":item})],2)}),_vm._v(" "),_c('gl-dropdown-divider'),_vm._v(" "),_c('gl-dropdown-item',{ref:"clearHistory",on:{"click":function($event){return _vm.$emit('clear-history')}}},[_vm._v(_vm._s(_vm.clearRecentSearchesText))])]:_c('gl-dropdown-text',{staticClass:"gl-search-box-by-click-history-no-searches"},[_vm._v(_vm._s(_vm.noRecentSearchesText))])],2)]},proxy:true}:null,{key:"append",fn:function(){return [_c('gl-button',_vm._b({ref:"searchButton",staticClass:"gl-search-box-by-click-search-button",attrs:{"icon":"search","disabled":_vm.disabled,"aria-label":"Search","data-testid":"search-button"},on:{"click":function($event){return _vm.search(_vm.currentValue)}}},'gl-button',_vm.searchButtonAttributes,false))]},proxy:true}],null,true)},[_vm._v(" "),_vm._t("input",[_c('gl-form-input',_vm._b({ref:"input",staticClass:"gl-search-box-by-click-input",attrs:{"disabled":_vm.disabled},on:{"focus":function($event){_vm.isFocused = true;},"blur":function($event){_vm.isFocused = false;},"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.search(_vm.currentValue)}},model:{value:(_vm.currentValue),callback:function ($$v) {_vm.currentValue=$$v;},expression:"currentValue"}},'gl-form-input',_vm.inputAttributes,false))]),_vm._v(" "),(_vm.clearable && _vm.hasValue && !_vm.disabled)?_c('gl-clear-icon-button',{staticClass:"gl-search-box-by-click-icon-button gl-search-box-by-click-clear-button gl-clear-icon-button",attrs:{"title":_vm.clearButtonTitle,"tooltip-container":_vm.tooltipContainer,"data-testid":"filtered-search-clear-button"},on:{"click":_vm.clearInput}}):_vm._e()],2)};
226
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-form-input-group',{staticClass:"gl-search-box-by-click",scopedSlots:_vm._u([(_vm.historyItems)?{key:"prepend",fn:function(){return [_c('gl-dropdown',{ref:"historyDropdown",staticClass:"gl-search-box-by-click-history",attrs:{"menu-class":"gl-search-box-by-click-menu","category":"secondary","disabled":_vm.disabled},scopedSlots:_vm._u([{key:"button-content",fn:function(){return [_c('gl-icon',{staticClass:"gl-search-box-by-click-history-icon",attrs:{"name":"history"}}),_vm._v(" "),_c('gl-icon',{staticClass:"gl-search-box-by-click-history-icon-chevron",attrs:{"name":"chevron-down"}}),_vm._v(" "),_c('span',{staticClass:"gl-sr-only"},[_vm._v("Toggle history")])]},proxy:true}],null,false,2220989388)},[_vm._v(" "),_c('gl-dropdown-text',{staticClass:"gl-search-box-by-click-history-header"},[_vm._v("\n "+_vm._s(_vm.recentSearchesHeader)+"\n "),_c('gl-button',{directives:[{name:"gl-tooltip",rawName:"v-gl-tooltip.hover",value:({ container: _vm.tooltipContainer }),expression:"{ container: tooltipContainer }",modifiers:{"hover":true}}],ref:"closeHistory",staticClass:"gl-search-box-by-click-close-history-button",attrs:{"title":_vm.closeButtonTitle,"aria-label":_vm.closeButtonTitle,"category":"tertiary","name":"close","icon":"close"},on:{"click":_vm.closeHistoryDropdown}})],1),_vm._v(" "),_c('gl-dropdown-divider'),_vm._v(" "),(_vm.historyItems.length)?[_vm._l((_vm.historyItems),function(item,idx){return _c('gl-dropdown-item',{key:idx,staticClass:"gl-search-box-by-click-history-item",on:{"click":function($event){return _vm.selectHistoryItem(item)}}},[_vm._t("history-item",[_vm._v(_vm._s(item))],{"historyItem":item})],2)}),_vm._v(" "),_c('gl-dropdown-divider'),_vm._v(" "),_c('gl-dropdown-item',{ref:"clearHistory",on:{"click":_vm.emitClearHistory}},[_vm._v(_vm._s(_vm.clearRecentSearchesText))])]:_c('gl-dropdown-text',{staticClass:"gl-search-box-by-click-history-no-searches"},[_vm._v(_vm._s(_vm.noRecentSearchesText))])],2)]},proxy:true}:null,{key:"append",fn:function(){return [_c('gl-button',_vm._b({ref:"searchButton",staticClass:"gl-search-box-by-click-search-button",attrs:{"icon":"search","disabled":_vm.disabled,"aria-label":"Search","data-testid":"search-button"},on:{"click":function($event){return _vm.search(_vm.currentValue)}}},'gl-button',_vm.searchButtonAttributes,false))]},proxy:true}],null,true)},[_vm._v(" "),_vm._t("input",[_c('gl-form-input',_vm._b({ref:"input",staticClass:"gl-search-box-by-click-input",attrs:{"disabled":_vm.disabled},on:{"focus":function($event){_vm.isFocused = true;},"blur":function($event){_vm.isFocused = false;},"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.search(_vm.currentValue)}},model:{value:(_vm.currentValue),callback:function ($$v) {_vm.currentValue=$$v;},expression:"currentValue"}},'gl-form-input',_vm.inputAttributes,false))]),_vm._v(" "),(_vm.clearable && _vm.hasValue && !_vm.disabled)?_c('gl-clear-icon-button',{staticClass:"gl-search-box-by-click-icon-button gl-search-box-by-click-clear-button gl-clear-icon-button",attrs:{"title":_vm.clearButtonTitle,"tooltip-container":_vm.tooltipContainer,"data-testid":"filtered-search-clear-button"},on:{"click":_vm.clearInput}}):_vm._e()],2)};
168
227
  var __vue_staticRenderFns__ = [];
169
228
 
170
229
  /* style */
@@ -1,26 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "# Search Box By Type\n\nProvides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).\n";
1
+ var description = "Provides a clearable text input with loading state to be used for [search](https://design.gitlab.com/components/search).\n";
4
2
 
5
3
  var search_box_by_type_documentation = {
6
4
  followsDesignSystem: true,
7
- description,
8
- propsInfo: {
9
- value: {
10
- additionalInfo: 'If provided, used as value of search input'
11
- },
12
- disabled: {
13
- additionalInfo: 'If provided and true, disables the input and controls'
14
- },
15
- isLoading: {
16
- additionalInfo: 'Puts search box into loading state, rendering spinner'
17
- },
18
- tooltipContainer: {
19
- additionalInfo: 'Container for tooltip. Valid values: DOM node, selector string or `false` for default'
20
- }
21
- },
22
- examples,
23
- bootstrapComponent: 'b-form-input'
5
+ description
24
6
  };
25
7
 
26
8
  export default search_box_by_type_documentation;
@@ -4,10 +4,6 @@ import GlIcon from '../icon/icon';
4
4
  import GlLoadingIcon from '../loading_icon/loading_icon';
5
5
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
6
6
 
7
- const model = {
8
- prop: 'value',
9
- event: 'input'
10
- };
11
7
  var script = {
12
8
  components: {
13
9
  GlClearIconButton,
@@ -16,8 +12,14 @@ var script = {
16
12
  GlLoadingIcon
17
13
  },
18
14
  inheritAttrs: false,
19
- model,
15
+ model: {
16
+ prop: 'value',
17
+ event: 'input'
18
+ },
20
19
  props: {
20
+ /**
21
+ * If provided, used as value of search input
22
+ */
21
23
  value: {
22
24
  type: String,
23
25
  required: false,
@@ -28,16 +30,28 @@ var script = {
28
30
  required: false,
29
31
  default: 'Clear'
30
32
  },
33
+
34
+ /**
35
+ * If provided and true, disables the input and controls
36
+ */
31
37
  disabled: {
32
38
  type: Boolean,
33
39
  required: false,
34
40
  default: false
35
41
  },
42
+
43
+ /**
44
+ * Puts search box into loading state, rendering spinner
45
+ */
36
46
  isLoading: {
37
47
  type: Boolean,
38
48
  required: false,
39
49
  default: false
40
50
  },
51
+
52
+ /**
53
+ * Container for tooltip. Valid values: DOM node, selector string or `false` for default
54
+ */
41
55
  tooltipContainer: {
42
56
  required: false,
43
57
  default: false,
@@ -1,4 +1,4 @@
1
- var hover_load = "# Hover Load\n\nA Vue Directive to help with preloading resources when hovering over an element.\n\n## Usage\n\n```html\n<script>\nimport { GlHoverLoadDirective } from '@gitlab/ui';\n\nexport default {\n directives: { GlHoverLoadDirective },\n methods: {\n handlePreload() {\n fetch('some/endpoint');\n },\n },\n};\n</script>\n\n<template>\n <div v-gl-hover-load=\"handlePreload\">Hover me to preload</div>\n</template>\n```\n";
1
+ var hover_load = "A Vue Directive to help with preloading resources when hovering over an element.\n\n## Usage\n\n```html\n<script>\nimport { GlHoverLoadDirective } from '@gitlab/ui';\n\nexport default {\n directives: { GlHoverLoadDirective },\n methods: {\n handlePreload() {\n fetch('some/endpoint');\n },\n },\n};\n</script>\n\n<template>\n <div v-gl-hover-load=\"handlePreload\">Hover me to preload</div>\n</template>\n```\n";
2
2
 
3
3
  var description = /*#__PURE__*/Object.freeze({
4
4
  __proto__: null,
@@ -1,11 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "# Resize Observer\n\n<!-- STORY -->\n\n## Usage\n\nThis directive can be used to get notified whenever a given element's size (width or height) changes\nand to retrieve the updated dimensions.\n\nUnder the hood, it leverages the [Resize Observer API](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).\nIf you use GitLab UI in an older browser which doesn't support the Resize Observer API,\nyou can use a [polyfill](https://github.com/que-etc/resize-observer-polyfill).\n\nThe directive accepts a callback as a value and passes on the received\n[contentRect](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentRect)\nand the target element whenever a resize event gets triggered.\n\n```html\n<script>\nexport default {\n data() {\n return {\n width: 0,\n height: 0,\n };\n },\n methods: {\n handleResize({ contentRect: { width, height } }) {\n this.width = width;\n this.height = height;\n },\n },\n};\n</script>\n<template>\n <div v-gl-resize-observer-directive=\"handleResize\">\n <p>{{ width }} x {{ height }}</p>\n </div>\n</template>\n```\n\nThe observer can be toggled on or off by passing a boolean argument to the directive:\n\n```html\n<script>\nexport default {\n data() {\n return {\n shouldObserve: true,\n };\n },\n methods: {\n handleResize() {},\n },\n};\n</script>\n<template>\n <div v-gl-resize-observer-directive[shouldObserve]=\"handleResize\"></div>\n</template>\n```\n";
1
+ var description = "This directive can be used to get notified whenever a given element's size (width or height) changes\nand to retrieve the updated dimensions.\n\nUnder the hood, it leverages the [Resize Observer API](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver).\nIf you use GitLab UI in an older browser which doesn't support the Resize Observer API,\nyou can use a [polyfill](https://github.com/que-etc/resize-observer-polyfill).\n\nThe directive accepts a callback as a value and passes on the received\n[contentRect](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry/contentRect)\nand the target element whenever a resize event gets triggered.\n\n```html\n<script>\nexport default {\n data() {\n return {\n width: 0,\n height: 0,\n };\n },\n methods: {\n handleResize({ contentRect: { width, height } }) {\n this.width = width;\n this.height = height;\n },\n },\n};\n</script>\n<template>\n <div v-gl-resize-observer-directive=\"handleResize\">\n <p>{{ width }} x {{ height }}</p>\n </div>\n</template>\n```\n\nThe observer can be toggled on or off by passing a boolean argument to the directive:\n\n```html\n<script>\nexport default {\n data() {\n return {\n shouldObserve: true,\n };\n },\n methods: {\n handleResize() {},\n },\n};\n</script>\n<template>\n <div v-gl-resize-observer-directive[shouldObserve]=\"handleResize\"></div>\n</template>\n```\n";
4
2
 
5
3
  var resize_observer_documentation = {
6
4
  followsDesignSystem: false,
7
- description,
8
- examples
5
+ description
9
6
  };
10
7
 
11
8
  export default resize_observer_documentation;