@gitlab/ui 49.0.3 → 49.1.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 CHANGED
@@ -1,3 +1,10 @@
1
+ # [49.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.0.3...v49.1.0) (2022-10-27)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlSearchBoxByType:** Clear button events ([71506b3](https://gitlab.com/gitlab-org/gitlab-ui/commit/71506b3a9ca15f0e233bea4b8ee1fbe7de688059))
7
+
1
8
  ## [49.0.3](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.0.2...v49.0.3) (2022-10-26)
2
9
 
3
10
 
@@ -89,6 +89,15 @@ var script = {
89
89
  },
90
90
  focusInput() {
91
91
  this.$refs.input.$el.focus();
92
+ },
93
+ onClearButtonFocus() {
94
+ this.$emit('clearButtonFocus');
95
+ },
96
+ onClearButtonBlur() {
97
+ this.$emit('clearButtonBlur');
98
+ },
99
+ onClearButtonRelease() {
100
+ this.$emit('clearButtonRelease');
92
101
  }
93
102
  }
94
103
  };
@@ -97,7 +106,7 @@ var script = {
97
106
  const __vue_script__ = script;
98
107
 
99
108
  /* template */
100
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-search-box-by-type"},[_c('gl-icon',{staticClass:"gl-search-box-by-type-search-icon",attrs:{"name":"search"}}),_vm._v(" "),_c('gl-form-input',_vm._g(_vm._b({ref:"input",staticClass:"gl-search-box-by-type-input",attrs:{"value":_vm.value,"disabled":_vm.disabled}},'gl-form-input',_vm.inputAttributes,false),_vm.inputListeners)),_vm._v(" "),_c('div',{staticClass:"gl-search-box-by-type-right-icons"},[(_vm.isLoading)?_c('gl-loading-icon',{staticClass:"gl-search-box-by-type-loading-icon"}):_vm._e(),_vm._v(" "),(_vm.showClearButton)?_c('gl-clear-icon-button',{staticClass:"gl-search-box-by-type-clear gl-clear-icon-button",attrs:{"title":_vm.clearButtonTitle,"tooltip-container":_vm.tooltipContainer},on:{"click":function($event){$event.stopPropagation();return _vm.clearInput.apply(null, arguments)}}}):_vm._e()],1)],1)};
109
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-search-box-by-type"},[_c('gl-icon',{staticClass:"gl-search-box-by-type-search-icon",attrs:{"name":"search"}}),_vm._v(" "),_c('gl-form-input',_vm._g(_vm._b({ref:"input",staticClass:"gl-search-box-by-type-input",attrs:{"value":_vm.value,"disabled":_vm.disabled}},'gl-form-input',_vm.inputAttributes,false),_vm.inputListeners)),_vm._v(" "),_c('div',{staticClass:"gl-search-box-by-type-right-icons"},[(_vm.isLoading)?_c('gl-loading-icon',{staticClass:"gl-search-box-by-type-loading-icon"}):_vm._e(),_vm._v(" "),(_vm.showClearButton)?_c('gl-clear-icon-button',{staticClass:"gl-search-box-by-type-clear gl-clear-icon-button",attrs:{"title":_vm.clearButtonTitle,"tooltip-container":_vm.tooltipContainer},on:{"click":function($event){$event.stopPropagation();return _vm.clearInput.apply(null, arguments)},"focus":_vm.onClearButtonFocus,"blur":_vm.onClearButtonBlur,"release":_vm.onClearButtonRelease}}):_vm._e()],1)],1)};
101
110
  var __vue_staticRenderFns__ = [];
102
111
 
103
112
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "49.0.3",
3
+ "version": "49.1.0",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -42,6 +42,24 @@ describe('search box by type component', () => {
42
42
 
43
43
  expect(wrapper.emitted('input')).toEqual([['']]);
44
44
  });
45
+
46
+ it('emits clearButtonFocus when focused', () => {
47
+ findClearIcon().vm.$emit('focus', { stopPropagation: jest.fn() });
48
+
49
+ expect(wrapper.emitted('clearButtonFocus')).toHaveLength(1);
50
+ });
51
+
52
+ it('emits clearButtonBlur when blur', () => {
53
+ findClearIcon().vm.$emit('blur', { stopPropagation: jest.fn() });
54
+
55
+ expect(wrapper.emitted('clearButtonBlur')).toHaveLength(1);
56
+ });
57
+
58
+ it('emits clearButtonRelease when released', () => {
59
+ findClearIcon().vm.$emit('release', { stopPropagation: jest.fn() });
60
+
61
+ expect(wrapper.emitted('clearButtonRelease')).toHaveLength(1);
62
+ });
45
63
  });
46
64
 
47
65
  describe('v-model', () => {
@@ -93,6 +93,15 @@ export default {
93
93
  focusInput() {
94
94
  this.$refs.input.$el.focus();
95
95
  },
96
+ onClearButtonFocus() {
97
+ this.$emit('clearButtonFocus');
98
+ },
99
+ onClearButtonBlur() {
100
+ this.$emit('clearButtonBlur');
101
+ },
102
+ onClearButtonRelease() {
103
+ this.$emit('clearButtonRelease');
104
+ },
96
105
  },
97
106
  };
98
107
  </script>
@@ -116,6 +125,9 @@ export default {
116
125
  :tooltip-container="tooltipContainer"
117
126
  class="gl-search-box-by-type-clear gl-clear-icon-button"
118
127
  @click.stop="clearInput"
128
+ @focus="onClearButtonFocus"
129
+ @blur="onClearButtonBlur"
130
+ @release="onClearButtonRelease"
119
131
  />
120
132
  </div>
121
133
  </div>