@gitlab/ui 54.4.1 → 55.0.1

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,23 @@
1
+ ## [55.0.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v55.0.0...v55.0.1) (2023-02-07)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **GlDisclosureDropdown:** Ensure default ID is unique ([06326e8](https://gitlab.com/gitlab-org/gitlab-ui/commit/06326e89003bb5c9f13e8b0511bee306fac6ffc7))
7
+
8
+ # [55.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v54.4.1...v55.0.0) (2023-02-06)
9
+
10
+
11
+ ### Features
12
+
13
+ * **GlSearchBoxByType:** implemented component wide focusin focusout ([c202cde](https://gitlab.com/gitlab-org/gitlab-ui/commit/c202cde2374542c0b2b6608acc84f52390783e76))
14
+
15
+
16
+ ### BREAKING CHANGES
17
+
18
+ * **GlSearchBoxByType:** removes `clearButtonFocus`, `clearButtonBlur`, and
19
+ `clearButtonRelease` events.
20
+
1
21
  ## [54.4.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v54.4.0...v54.4.1) (2023-02-06)
2
22
 
3
23
 
@@ -99,12 +99,12 @@ var script = {
99
99
  },
100
100
  /**
101
101
  * Custom toggle id.
102
- * Fot instance, it can be referenced by tooltip or popover
102
+ * For instance, it can be referenced by tooltip or popover
103
103
  */
104
104
  toggleId: {
105
105
  type: String,
106
106
  required: false,
107
- default: _uniqueId('dropdown-toggle-btn-')
107
+ default: () => _uniqueId('dropdown-toggle-btn-')
108
108
  },
109
109
  /**
110
110
  * Additional CSS classes to customize toggle appearance
@@ -78,9 +78,9 @@ var script = {
78
78
  inputListeners() {
79
79
  return {
80
80
  ...this.$listeners,
81
- input: value => {
82
- this.$emit('input', value);
83
- }
81
+ input: this.onInput,
82
+ focusin: this.onFocusin,
83
+ focusout: this.onFocusout
84
84
  };
85
85
  },
86
86
  showClearButton() {
@@ -88,21 +88,37 @@ var script = {
88
88
  }
89
89
  },
90
90
  methods: {
91
+ isInputOrClearButton(element) {
92
+ var _this$$refs$input, _this$$refs$clearButt;
93
+ return element === ((_this$$refs$input = this.$refs.input) === null || _this$$refs$input === void 0 ? void 0 : _this$$refs$input.$el) || element === ((_this$$refs$clearButt = this.$refs.clearButton) === null || _this$$refs$clearButt === void 0 ? void 0 : _this$$refs$clearButt.$el);
94
+ },
91
95
  clearInput() {
92
- this.$emit('input', '');
96
+ this.onInput('');
93
97
  this.focusInput();
94
98
  },
95
99
  focusInput() {
96
100
  this.$refs.input.$el.focus();
97
101
  },
98
- onClearButtonFocus() {
99
- this.$emit('clearButtonFocus');
102
+ onInput(value) {
103
+ this.$emit('input', value);
100
104
  },
101
- onClearButtonBlur() {
102
- this.$emit('clearButtonBlur');
105
+ onFocusout(event) {
106
+ const {
107
+ relatedTarget
108
+ } = event;
109
+ if (this.isInputOrClearButton(relatedTarget)) {
110
+ return;
111
+ }
112
+ this.$emit('focusout', event);
103
113
  },
104
- onClearButtonRelease() {
105
- this.$emit('clearButtonRelease');
114
+ onFocusin(event) {
115
+ const {
116
+ relatedTarget
117
+ } = event;
118
+ if (this.isInputOrClearButton(relatedTarget)) {
119
+ return;
120
+ }
121
+ this.$emit('focusin', event);
106
122
  }
107
123
  }
108
124
  };
@@ -114,7 +130,7 @@ const __vue_script__ = script;
114
130
  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",class:{
115
131
  'gl-search-box-by-type-input': !_vm.borderless,
116
132
  'gl-search-box-by-type-input-borderless': _vm.borderless,
117
- },attrs:{"value":_vm.value,"disabled":_vm.disabled}},'gl-form-input',_vm.inputAttributes,false),_vm.inputListeners)),_vm._v(" "),(_vm.isLoading || _vm.showClearButton)?_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):_vm._e()],1)};
133
+ },attrs:{"value":_vm.value,"disabled":_vm.disabled}},'gl-form-input',_vm.inputAttributes,false),_vm.inputListeners)),_vm._v(" "),(_vm.isLoading || _vm.showClearButton)?_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',{ref:"clearButton",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)},"focusin":_vm.onFocusin,"focusout":_vm.onFocusout}}):_vm._e()],1):_vm._e()],1)};
118
134
  var __vue_staticRenderFns__ = [];
119
135
 
120
136
  /* style */