@gitlab/ui 128.15.0 → 128.16.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.
@@ -86,6 +86,20 @@ var script = {
86
86
  required: false,
87
87
  default: false
88
88
  },
89
+ /**
90
+ * The header level used in the alert (h1/h2/h3/h4/h5/h6).
91
+ *
92
+ * This overrides the value provided by GlAlert. For accessibility this should be set to an
93
+ * appropriate value in the context where the alert is used.
94
+ */
95
+ headerLevel: {
96
+ type: Number,
97
+ required: false,
98
+ default: 2,
99
+ validator(value) {
100
+ return [1, 2, 3, 4, 5, 6].includes(value);
101
+ }
102
+ },
89
103
  /**
90
104
  * Set the aria-live attribute on the alert.
91
105
  *
@@ -103,6 +117,9 @@ var script = {
103
117
  }
104
118
  },
105
119
  computed: {
120
+ headingComponent() {
121
+ return `h${this.headerLevel}`;
122
+ },
106
123
  role() {
107
124
  if ([alertVariantOptions.danger, alertVariantOptions.warning, alertVariantOptions.success].includes(this.variant)) {
108
125
  return 'alert';
@@ -197,7 +214,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
197
214
  { 'gl-alert-sticky': _vm.sticky },
198
215
  { 'gl-alert-not-dismissible': !_vm.dismissible },
199
216
  { 'gl-alert-has-title': !!_vm.title },
200
- _vm.variantClass ],attrs:{"role":_vm.role,"aria-live":_vm.politeness}},[_c('div',{staticClass:"gl-alert-icon-container"},[_c('gl-icon',{staticClass:"gl-alert-icon",attrs:{"name":_vm.iconName}})],1),_vm._v(" "),_c('div',{staticClass:"gl-alert-content"},[(_vm.title)?_c('h2',{staticClass:"gl-alert-title"},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-alert-body"},[_vm._t("default")],2),_vm._v(" "),(_vm.shouldRenderActions)?_c('div',{staticClass:"gl-alert-actions"},[_vm._t("actions",function(){return _vm._l((_vm.actionButtons),function(actionButton,index){return _c('gl-button',_vm._g(_vm._b({key:index,staticClass:"gl-alert-action"},'gl-button',actionButton.attrs,false),actionButton.listeners),[_vm._v("\n "+_vm._s(actionButton.text)+"\n ")])})})],2):_vm._e()]),_vm._v(" "),(_vm.dismissible)?_c('close-button',{ref:"dismiss",staticClass:"gl-dismiss-btn",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.onDismiss}}):_vm._e()],1)};
217
+ _vm.variantClass ],attrs:{"role":_vm.role,"aria-live":_vm.politeness}},[_c('div',{staticClass:"gl-alert-icon-container"},[_c('gl-icon',{staticClass:"gl-alert-icon",attrs:{"name":_vm.iconName}})],1),_vm._v(" "),_c('div',{staticClass:"gl-alert-content"},[(_vm.title)?_c(_vm.headingComponent,{tag:"component",staticClass:"gl-alert-title"},[_vm._v(_vm._s(_vm.title))]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"gl-alert-body"},[_vm._t("default")],2),_vm._v(" "),(_vm.shouldRenderActions)?_c('div',{staticClass:"gl-alert-actions"},[_vm._t("actions",function(){return _vm._l((_vm.actionButtons),function(actionButton,index){return _c('gl-button',_vm._g(_vm._b({key:index,staticClass:"gl-alert-action"},'gl-button',actionButton.attrs,false),actionButton.listeners),[_vm._v("\n "+_vm._s(actionButton.text)+"\n ")])})})],2):_vm._e()],1),_vm._v(" "),(_vm.dismissible)?_c('close-button',{ref:"dismiss",staticClass:"gl-dismiss-btn",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.onDismiss}}):_vm._e()],1)};
201
218
  var __vue_staticRenderFns__ = [];
202
219
 
203
220
  /* style */
@@ -213,6 +213,11 @@ var script = {
213
213
  },
214
214
  computedLocalCheckedWatcher(newValue, oldValue) {
215
215
  if (!looseEqual(newValue, oldValue)) {
216
+ /**
217
+ * Emitted when checked state is changed.
218
+ *
219
+ * @event input
220
+ */
216
221
  this.$emit('input', newValue);
217
222
  const {
218
223
  input
@@ -252,11 +257,20 @@ var script = {
252
257
 
253
258
  // Fire events in a `$nextTick()` to ensure the `v-model` is updated
254
259
  this.$nextTick(() => {
255
- // Change is only emitted on user interaction
260
+ /**
261
+ * Emitted when selected value(s) is changed due to user interaction.
262
+ *
263
+ * @event change
264
+ */
256
265
  this.$emit('change', localChecked);
257
266
 
258
267
  // If this is a child of a group, we emit a change event on it as well
259
268
  if (this.isGroup) {
269
+ /**
270
+ * Emitted when selected value(s) is changed due to user interaction.
271
+ *
272
+ * @event change
273
+ */
260
274
  this.group.$emit('change', localChecked);
261
275
  }
262
276
  this.$emit('indeterminate', indeterminate);
@@ -144,6 +144,11 @@ var script = {
144
144
  },
145
145
  localChecked(newValue, oldValue) {
146
146
  if (!looseEqual(newValue, oldValue)) {
147
+ /**
148
+ * Emitted when the checked value is changed.
149
+ *
150
+ * @event input
151
+ */
147
152
  this.$emit('input', newValue);
148
153
  }
149
154
  }