@gitlab/ui 64.18.0 → 64.18.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [64.18.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.18.1...v64.18.2) (2023-07-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * revert block level toggle ([78179da](https://gitlab.com/gitlab-org/gitlab-ui/commit/78179dac12a70fa76180facc88c4426c999d95b3))
7
+
8
+ ## [64.18.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.18.0...v64.18.1) (2023-07-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **listbox:** Allow use of reset button on single select ([cff7777](https://gitlab.com/gitlab-org/gitlab-ui/commit/cff7777e5eff36de54d4f628f818fc44284d1de1))
14
+
1
15
  # [64.18.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v64.17.0...v64.18.0) (2023-07-04)
2
16
 
3
17
 
@@ -387,9 +387,6 @@ var script = {
387
387
  if (!this.resetButtonLabel) {
388
388
  return false;
389
389
  }
390
- if (!this.multiple) {
391
- return false;
392
- }
393
390
 
394
391
  /**
395
392
  * if dropdown has no items
@@ -398,6 +395,13 @@ var script = {
398
395
  if (!this.hasItems) {
399
396
  return false;
400
397
  }
398
+
399
+ /**
400
+ * hide if no selection
401
+ */
402
+ if (this.selected.length === 0) {
403
+ return false;
404
+ }
401
405
  if (this.multiple) {
402
406
  return this.selected.length === this.items.length;
403
407
  }
@@ -88,40 +88,18 @@ var script = {
88
88
  };
89
89
  },
90
90
  computed: {
91
- layoutAllowsDescription() {
92
- return this.isVerticalLayout || this.isBlockLayout;
93
- },
94
91
  shouldRenderDescription() {
95
- return Boolean(this.$scopedSlots.description || this.description) && this.layoutAllowsDescription;
96
- },
97
- labelIsSrOnly() {
98
- return this.labelPosition === 'hidden';
99
- },
100
- layoutAllowsHelp() {
101
- return this.isVerticalLayout || this.isBlockLayout;
92
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
93
+ return Boolean(this.$scopedSlots.description || this.description) && this.isVerticalLayout;
102
94
  },
103
95
  shouldRenderHelp() {
104
- return Boolean(this.$scopedSlots.help || this.help) && this.layoutAllowsHelp;
96
+ // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
97
+ return Boolean(this.$slots.help || this.help) && this.isVerticalLayout;
105
98
  },
106
- labelContainerClasses() {
107
- return {
108
- 'gl-mb-3': this.isVerticalLayout && !this.labelIsSrOnly
109
- };
110
- },
111
- labelClasses() {
112
- if (this.labelIsSrOnly) return 'gl-sr-only';
113
- return {
114
- 'gl-mb-2': this.shouldRenderDescription,
115
- 'gl-mb-3': !this.shouldRenderDescription && !this.isVerticalLayout
116
- };
117
- },
118
- wrapperClasses() {
119
- return {
120
- 'gl-flex-direction-column': this.isVerticalLayout,
121
- 'gl-toggle-label-inline': !this.isVerticalLayout,
122
- 'is-disabled': this.disabled,
123
- 'gl-toggle-label-position-block': this.isBlockLayout
124
- };
99
+ toggleClasses() {
100
+ return [{
101
+ 'gl-sr-only': this.labelPosition === 'hidden'
102
+ }, this.shouldRenderDescription ? 'gl-mb-2' : 'gl-mb-3'];
125
103
  },
126
104
  icon() {
127
105
  return this.value ? 'mobile-issue-close' : 'close';
@@ -134,9 +112,6 @@ var script = {
134
112
  },
135
113
  isVerticalLayout() {
136
114
  return this.labelPosition === 'top' || this.labelPosition === 'hidden';
137
- },
138
- isBlockLayout() {
139
- return this.labelPosition === 'block';
140
115
  }
141
116
  },
142
117
  beforeCreate() {
@@ -162,11 +137,15 @@ var script = {
162
137
  const __vue_script__ = script;
163
138
 
164
139
  /* template */
165
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-toggle-wrapper gl-display-flex gl-mb-0",class:_vm.wrapperClasses,attrs:{"data-testid":"toggle-wrapper"}},[_c('span',{staticClass:"gl-toggle-label-container",class:_vm.labelContainerClasses},[_c('span',{staticClass:"gl-toggle-label",class:_vm.labelClasses,attrs:{"id":_vm.labelId,"data-testid":"toggle-label"}},[_vm._t("label",function(){return [_vm._v(_vm._s(_vm.label))]})],2),_vm._v(" "),(_vm.shouldRenderDescription)?_c('span',{staticClass:"gl-description-label",attrs:{"data-testid":"toggle-description"}},[_vm._t("description",function(){return [_vm._v(_vm._s(_vm.description))]})],2):_vm._e()]),_vm._v(" "),_c('span',{staticClass:"gl-toggle-switch-container"},[(_vm.name)?_c('input',{attrs:{"name":_vm.name,"type":"hidden"},domProps:{"value":_vm.value}}):_vm._e(),_vm._v(" "),_c('button',{staticClass:"gl-flex-shrink-0",class:{
166
- 'gl-toggle': true,
167
- 'is-checked': _vm.value,
168
- 'is-disabled': _vm.disabled,
169
- },attrs:{"role":"switch","aria-checked":_vm.isChecked,"aria-labelledby":_vm.labelId,"aria-describedby":_vm.helpId,"aria-disabled":_vm.disabled,"type":"button"},on:{"click":function($event){$event.preventDefault();return _vm.toggleFeature.apply(null, arguments)}}},[(_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.shouldRenderHelp)?_c('span',{staticClass:"gl-help-label",attrs:{"id":_vm.helpId,"data-testid":"toggle-help"}},[_vm._t("help",function(){return [_vm._v(_vm._s(_vm.help))]})],2):_vm._e()])])};
140
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-toggle-wrapper gl-display-flex gl-mb-0",class:{
141
+ 'gl-flex-direction-column': _vm.isVerticalLayout,
142
+ 'gl-toggle-label-inline': !_vm.isVerticalLayout,
143
+ 'is-disabled': _vm.disabled,
144
+ },attrs:{"data-testid":"toggle-wrapper"}},[_c('span',{staticClass:"gl-toggle-label gl-flex-shrink-0",class:_vm.toggleClasses,attrs:{"id":_vm.labelId,"data-testid":"toggle-label"}},[_vm._t("label",function(){return [_vm._v(_vm._s(_vm.label))]})],2),_vm._v(" "),(_vm.shouldRenderDescription)?_c('span',{staticClass:"gl-description-label gl-mb-3",attrs:{"data-testid":"toggle-description"}},[_vm._t("description",function(){return [_vm._v(_vm._s(_vm.description))]})],2):_vm._e(),_vm._v(" "),(_vm.name)?_c('input',{attrs:{"name":_vm.name,"type":"hidden"},domProps:{"value":_vm.value}}):_vm._e(),_vm._v(" "),_c('button',{staticClass:"gl-flex-shrink-0",class:{
145
+ 'gl-toggle': true,
146
+ 'is-checked': _vm.value,
147
+ 'is-disabled': _vm.disabled,
148
+ },attrs:{"role":"switch","aria-checked":_vm.isChecked,"aria-labelledby":_vm.labelId,"aria-describedby":_vm.helpId,"aria-disabled":_vm.disabled,"type":"button"},on:{"click":function($event){$event.preventDefault();return _vm.toggleFeature.apply(null, arguments)}}},[(_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.shouldRenderHelp)?_c('span',{staticClass:"gl-help-label",attrs:{"id":_vm.helpId,"data-testid":"toggle-help"}},[_vm._t("help",function(){return [_vm._v(_vm._s(_vm.help))]})],2):_vm._e()])};
170
149
  var __vue_staticRenderFns__ = [];
171
150
 
172
151
  /* style */