@gitlab/ui 122.1.0 → 122.1.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.
@@ -26,7 +26,7 @@ var script = {
26
26
  id: {
27
27
  type: String,
28
28
  required: false,
29
- default: () => uniqueId()
29
+ default: undefined
30
30
  },
31
31
  /**
32
32
  * The current value of the checkbox(es). Must be an array when there are multiple checkboxes bound to the same v-model.
@@ -112,6 +112,7 @@ var script = {
112
112
  data() {
113
113
  const group = this.getGroup();
114
114
  return {
115
+ internalId: this.id ? this.id : uniqueId('gitlab_ui_checkbox_'),
115
116
  localChecked: group ? group.checked : this.checked
116
117
  };
117
118
  },
@@ -177,7 +178,7 @@ var script = {
177
178
  } = this;
178
179
  return {
179
180
  ...this.$attrs,
180
- id: this.id,
181
+ id: this.internalId,
181
182
  name: this.computedName,
182
183
  disabled,
183
184
  required,
@@ -295,7 +296,7 @@ var script = {
295
296
  const __vue_script__ = script;
296
297
 
297
298
  /* template */
298
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-form-checkbox custom-checkbox custom-control"},[_c('input',_vm._b({key:"input",ref:"input",staticClass:"custom-control-input",class:_vm.stateClass,attrs:{"type":"checkbox"},on:{"change":_vm.handleChange}},'input',_vm.computedAttrs,false)),_vm._v(" "),_c('label',{staticClass:"custom-control-label",attrs:{"for":_vm.id}},[_vm._t("default"),_vm._v(" "),(Boolean(_vm.$scopedSlots.help))?_c('p',{staticClass:"help-text"},[_vm._t("help")],2):_vm._e()],2)])};
299
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-form-checkbox custom-checkbox custom-control"},[_c('input',_vm._b({key:"input",ref:"input",staticClass:"custom-control-input",class:_vm.stateClass,attrs:{"type":"checkbox"},on:{"change":_vm.handleChange}},'input',_vm.computedAttrs,false)),_vm._v(" "),_c('label',{staticClass:"custom-control-label",attrs:{"for":_vm.internalId}},[_vm._t("default"),_vm._v(" "),(Boolean(_vm.$scopedSlots.help))?_c('p',{staticClass:"help-text"},[_vm._t("help")],2):_vm._e()],2)])};
299
300
  var __vue_staticRenderFns__ = [];
300
301
 
301
302
  /* style */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/ui",
3
- "version": "122.1.0",
3
+ "version": "122.1.1",
4
4
  "description": "GitLab UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -26,7 +26,7 @@ export default {
26
26
  id: {
27
27
  type: String,
28
28
  required: false,
29
- default: () => uniqueId(),
29
+ default: undefined,
30
30
  },
31
31
  /**
32
32
  * The current value of the checkbox(es). Must be an array when there are multiple checkboxes bound to the same v-model.
@@ -112,6 +112,7 @@ export default {
112
112
  data() {
113
113
  const group = this.getGroup();
114
114
  return {
115
+ internalId: this.id ? this.id : uniqueId('gitlab_ui_checkbox_'),
115
116
  localChecked: group ? group.checked : this.checked,
116
117
  };
117
118
  },
@@ -172,7 +173,7 @@ export default {
172
173
 
173
174
  return {
174
175
  ...this.$attrs,
175
- id: this.id,
176
+ id: this.internalId,
176
177
  name: this.computedName,
177
178
  disabled,
178
179
  required,
@@ -286,7 +287,7 @@ export default {
286
287
  :class="stateClass"
287
288
  @change="handleChange"
288
289
  />
289
- <label :for="id" class="custom-control-label">
290
+ <label :for="internalId" class="custom-control-label">
290
291
  <slot></slot>
291
292
  <p v-if="Boolean($scopedSlots.help)" class="help-text">
292
293
  <slot name="help"></slot>