@carbon/vue 2.24.0 → 2.24.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,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.24.1
4
+
5
+ ## Fix
6
+
7
+ Dropdown value presentation
8
+
3
9
  ## 2.24.0
4
10
 
5
11
  ## Feat
@@ -23365,8 +23365,8 @@ var component = Object(componentNormalizer["a" /* default */])(
23365
23365
  // ESM COMPAT FLAG
23366
23366
  __webpack_require__.r(__webpack_exports__);
23367
23367
 
23368
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4767fa4f-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/cv-dropdown/cv-dropdown.vue?vue&type=template&id=0ad427d1&
23369
- var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{ 'bx--form-item': _vm.formItem }},[_c('div',{staticClass:"bx--dropdown__wrapper",class:{ 'bx--dropdown__wrapper--inline': _vm.inline, 'cv-dropdown': !_vm.formItem },style:(_vm.wrapperStyleOverride)},[(_vm.label)?_c('span',{staticClass:"bx--label",class:{ 'bx--label--disabled': _vm.disabled },attrs:{"id":(_vm.uid + "-label")}},[_vm._v(_vm._s(_vm.label))]):_vm._e(),(!_vm.inline && _vm.isHelper)?_c('div',{staticClass:"bx--form__helper-text",class:{ 'bx--form__helper-text--disabled': _vm.disabled },attrs:{"aria-disabled":_vm.disabled}},[_vm._t("helper-text",[_vm._v(_vm._s(_vm.helperText))])],2):_vm._e(),_c('div',_vm._b({staticClass:"bx--dropdown",class:{
23368
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4767fa4f-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/cv-dropdown/cv-dropdown.vue?vue&type=template&id=2c47caf7&
23369
+ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:{ 'bx--form-item': _vm.formItem }},[_c('div',{staticClass:"bx--dropdown__wrapper",class:{ 'bx--dropdown__wrapper--inline': _vm.inline, 'cv-dropdown': !_vm.formItem },style:(_vm.wrapperStyleOverride)},[(_vm.label)?_c('span',{staticClass:"bx--label",class:{ 'bx--label--disabled': _vm.disabled },attrs:{"id":(_vm.uid + "-label")}},[_vm._v("\n "+_vm._s(_vm.label)+"\n ")]):_vm._e(),(!_vm.inline && _vm.isHelper)?_c('div',{staticClass:"bx--form__helper-text",class:{ 'bx--form__helper-text--disabled': _vm.disabled },attrs:{"aria-disabled":_vm.disabled}},[_vm._t("helper-text",[_vm._v(_vm._s(_vm.helperText))])],2):_vm._e(),_c('div',_vm._b({staticClass:"bx--dropdown",class:{
23370
23370
  'bx--dropdown--light': _vm.theme === 'light',
23371
23371
  'bx--dropdown--up': _vm.up,
23372
23372
  'bx--dropdown--open': _vm.open,
@@ -23374,11 +23374,11 @@ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._sel
23374
23374
  'bx--dropdown--disabled': _vm.disabled,
23375
23375
  'bx--dropdown--inline': _vm.inline,
23376
23376
  'bx--dropdown--show-selected': !_vm.hideSelected,
23377
- },attrs:{"data-dropdown":"","data-value":_vm.internalValue,"data-invalid":_vm.isInvalid},on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }$event.preventDefault();return _vm.onDown($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }$event.preventDefault();return _vm.onUp($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }$event.preventDefault();return _vm.onClick($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.preventDefault();return _vm.onEsc($event)}],"click":_vm.onClick}},'div',_vm.$attrs,false),[_c('button',{staticClass:"bx--dropdown-text",attrs:{"aria-haspopup":"true","aria-expanded":_vm.open,"aria-controls":(_vm.uid + "-menu"),"aria-labelledby":(_vm.uid + "-label " + _vm.uid + "-value"),"type":"button"}},[(_vm.isInvalid && _vm.inline)?_c('WarningFilled16',{staticClass:"bx--dropdown__invalid-icon"}):_vm._e(),_c('span',{staticClass:"bx--dropdown-text__inner",attrs:{"id":(_vm.uid + "-value")}},[_vm._v(_vm._s(_vm.internalCaption))]),_c('span',{staticClass:"bx--dropdown__arrow-container"},[_c('span',{staticClass:"bx--dropdown__arrow",style:(_vm.chevronStyleOveride)},[_c('chevron-down-glyph')],1)])],1),_c('ul',{staticClass:"bx--dropdown-list",attrs:{"id":(_vm.uid + "-menu"),"role":"menu","aria-hidden":!_vm.open,"wh-menu-anchor":"left","aria-labelledby":(_vm.uid + "-label")}},[_vm._t("default")],2)]),(_vm.isInvalid && _vm.inline)?_c('div',{staticClass:"bx--form-requirement"},[_vm._t("invalid-message",[_vm._v(_vm._s(_vm.invalidMessage))])],2):_vm._e()]),(_vm.isInvalid && !_vm.inline)?_c('div',{staticClass:"bx--form-requirement"},[_vm._t("invalid-message",[_vm._v(_vm._s(_vm.invalidMessage))])],2):_vm._e()])}
23377
+ },attrs:{"data-dropdown":"","data-value":_vm.internalValue,"data-invalid":_vm.isInvalid},on:{"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }$event.preventDefault();return _vm.onDown($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }$event.preventDefault();return _vm.onUp($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }$event.preventDefault();return _vm.onClick($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.preventDefault();return _vm.onEsc($event)}],"click":_vm.onClick}},'div',_vm.$attrs,false),[_c('button',{staticClass:"bx--dropdown-text",attrs:{"aria-haspopup":"true","aria-expanded":_vm.open,"aria-controls":(_vm.uid + "-menu"),"aria-labelledby":(_vm.uid + "-label " + _vm.uid + "-value"),"type":"button"}},[(_vm.isInvalid && _vm.inline)?_c('WarningFilled16',{staticClass:"bx--dropdown__invalid-icon"}):_vm._e(),_c('span',{staticClass:"bx--dropdown-text__inner",attrs:{"id":(_vm.uid + "-value"),"data-test":"internalCaption"},domProps:{"innerHTML":_vm._s(_vm.internalCaption)}}),_c('span',{staticClass:"bx--dropdown__arrow-container"},[_c('span',{staticClass:"bx--dropdown__arrow",style:(_vm.chevronStyleOveride)},[_c('chevron-down-glyph')],1)])],1),_c('ul',{ref:"droplist",staticClass:"bx--dropdown-list",attrs:{"id":(_vm.uid + "-menu"),"role":"menu","aria-hidden":!_vm.open,"wh-menu-anchor":"left","aria-labelledby":(_vm.uid + "-label")}},[_vm._t("default")],2)]),(_vm.isInvalid && _vm.inline)?_c('div',{staticClass:"bx--form-requirement"},[_vm._t("invalid-message",[_vm._v(_vm._s(_vm.invalidMessage))])],2):_vm._e()]),(_vm.isInvalid && !_vm.inline)?_c('div',{staticClass:"bx--form-requirement"},[_vm._t("invalid-message",[_vm._v(_vm._s(_vm.invalidMessage))])],2):_vm._e()])}
23378
23378
  var staticRenderFns = []
23379
23379
 
23380
23380
 
23381
- // CONCATENATED MODULE: ./src/components/cv-dropdown/cv-dropdown.vue?vue&type=template&id=0ad427d1&
23381
+ // CONCATENATED MODULE: ./src/components/cv-dropdown/cv-dropdown.vue?vue&type=template&id=2c47caf7&
23382
23382
 
23383
23383
  // EXTERNAL MODULE: ./src/mixins/theme-mixin.js
23384
23384
  var theme_mixin = __webpack_require__("d43c");
@@ -23488,6 +23488,12 @@ var chevron_down = __webpack_require__("fa89");
23488
23488
  //
23489
23489
  //
23490
23490
  //
23491
+ //
23492
+ //
23493
+ //
23494
+ //
23495
+ //
23496
+ //
23491
23497
 
23492
23498
 
23493
23499
 
@@ -23676,8 +23682,13 @@ var chevron_down = __webpack_require__("fa89");
23676
23682
  this.$el.focus();
23677
23683
  }
23678
23684
 
23679
- if (ev.target.classList.contains('bx--dropdown-link')) {
23680
- const targetItemEl = ev.target.parentNode;
23685
+ let target = ev.target;
23686
+ while (!target.classList.contains('bx--dropdown-link') && this.$refs.droplist.contains(target)) {
23687
+ target = target.parentNode; // try next one up
23688
+ }
23689
+
23690
+ if (target.classList.contains('bx--dropdown-link')) {
23691
+ const targetItemEl = target.parentNode;
23681
23692
  const newValue = targetItemEl.getAttribute('data-value');
23682
23693
 
23683
23694
  this.internalValue = newValue;