@dialpad/dialtone-vue 2.11.0 → 2.12.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.
|
@@ -3375,6 +3375,7 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3375
3375
|
* the root element of the component.
|
|
3376
3376
|
*/
|
|
3377
3377
|
|
|
3378
|
+
const ERROR_INVALID_LIST_ELEMENT = 'listElementKey is required or the referenced ' + 'element doesn\'t exist. Received listElement: ';
|
|
3378
3379
|
/* harmony default export */ const keyboard_list_navigation = (function () {
|
|
3379
3380
|
let {
|
|
3380
3381
|
// Role of the list items in the component. This is used to identify the list items
|
|
@@ -3398,7 +3399,7 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3398
3399
|
endOfListMethod = null,
|
|
3399
3400
|
// Scroll the active element into view when highlighted by a keyboard event.
|
|
3400
3401
|
scrollToOnHighlight = true,
|
|
3401
|
-
// Focus the active element on keyboard navigation
|
|
3402
|
+
// Focus the active element on keyboard navigation.
|
|
3402
3403
|
focusOnKeyboardNavigation = false
|
|
3403
3404
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3404
3405
|
return {
|
|
@@ -3408,8 +3409,8 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3408
3409
|
return {
|
|
3409
3410
|
[indexKey]: -1,
|
|
3410
3411
|
[idKey]: '',
|
|
3411
|
-
scrollToOnHighlight
|
|
3412
|
-
focusOnKeyboardNavigation
|
|
3412
|
+
scrollToOnHighlight,
|
|
3413
|
+
focusOnKeyboardNavigation
|
|
3413
3414
|
};
|
|
3414
3415
|
},
|
|
3415
3416
|
|
|
@@ -3432,14 +3433,25 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3432
3433
|
// Gets the length of all the items in the list, uses the listItemRole param to determine
|
|
3433
3434
|
// whether an element is a list item.
|
|
3434
3435
|
_itemsLength() {
|
|
3436
|
+
const listItems = this._getListItemNodes();
|
|
3437
|
+
|
|
3438
|
+
if (listItems === null) {
|
|
3439
|
+
return 0;
|
|
3440
|
+
}
|
|
3441
|
+
|
|
3442
|
+
return listItems.length;
|
|
3443
|
+
},
|
|
3444
|
+
|
|
3445
|
+
// Gets all the list item nodes within the list element
|
|
3446
|
+
_getListItemNodes() {
|
|
3435
3447
|
const listElement = this._getListElement();
|
|
3436
3448
|
|
|
3437
3449
|
if (!listElement) {
|
|
3438
|
-
console.error(
|
|
3439
|
-
return
|
|
3450
|
+
console.error(ERROR_INVALID_LIST_ELEMENT, listElement);
|
|
3451
|
+
return null;
|
|
3440
3452
|
}
|
|
3441
3453
|
|
|
3442
|
-
return listElement.querySelectorAll("[role=\"".concat(listItemRole, "\"]"))
|
|
3454
|
+
return Array.from(listElement.querySelectorAll("[role=\"".concat(listItemRole, "\"]")));
|
|
3443
3455
|
},
|
|
3444
3456
|
|
|
3445
3457
|
onUpKey() {
|
|
@@ -3484,6 +3496,31 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3484
3496
|
this.focusActiveItemIfNeeded();
|
|
3485
3497
|
},
|
|
3486
3498
|
|
|
3499
|
+
onNavigationKey(key) {
|
|
3500
|
+
const listItems = this._getListItemNodes();
|
|
3501
|
+
|
|
3502
|
+
const matchingItems = listItems.filter(item => {
|
|
3503
|
+
const content = item.textContent.trim().toLowerCase();
|
|
3504
|
+
return content.startsWith(key.toLowerCase());
|
|
3505
|
+
});
|
|
3506
|
+
|
|
3507
|
+
if (matchingItems.length <= 0) {
|
|
3508
|
+
return;
|
|
3509
|
+
}
|
|
3510
|
+
|
|
3511
|
+
const highlightedMatchingItemIndex = matchingItems.findIndex(item => {
|
|
3512
|
+
return this[indexKey] === listItems.indexOf(item);
|
|
3513
|
+
});
|
|
3514
|
+
const nextHighlightedItemIndex = listItems.indexOf(highlightedMatchingItemIndex < matchingItems.length - 1 ? matchingItems[highlightedMatchingItemIndex + 1] : matchingItems[0]);
|
|
3515
|
+
this.setHighlightIndex(nextHighlightedItemIndex);
|
|
3516
|
+
this.scrollActiveItemIntoViewIfNeeded();
|
|
3517
|
+
this.focusActiveItemIfNeeded();
|
|
3518
|
+
},
|
|
3519
|
+
|
|
3520
|
+
isValidCharacter(key) {
|
|
3521
|
+
return key.length === 1;
|
|
3522
|
+
},
|
|
3523
|
+
|
|
3487
3524
|
jumpToBeginning() {
|
|
3488
3525
|
this.setHighlightIndex(0);
|
|
3489
3526
|
},
|
|
@@ -3520,8 +3557,7 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3520
3557
|
}
|
|
3521
3558
|
|
|
3522
3559
|
const listItems = Array.from(listElement.querySelectorAll("[role=\"".concat(listItemRole, "\"]")));
|
|
3523
|
-
|
|
3524
|
-
return index;
|
|
3560
|
+
return listItems.indexOf(listElement.querySelector("#".concat(id)));
|
|
3525
3561
|
},
|
|
3526
3562
|
|
|
3527
3563
|
_getItemId(index) {
|
|
@@ -3830,13 +3866,13 @@ var combobox_component = normalizeComponent(
|
|
|
3830
3866
|
/* harmony default export */ const combobox = (combobox_component.exports);
|
|
3831
3867
|
;// CONCATENATED MODULE: ./components/combobox/index.js
|
|
3832
3868
|
|
|
3833
|
-
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/dropdown/dropdown.vue?vue&type=template&id=
|
|
3834
|
-
var
|
|
3869
|
+
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/dropdown/dropdown.vue?vue&type=template&id=e689f0c4&
|
|
3870
|
+
var dropdownvue_type_template_id_e689f0c4_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('dt-popover',_vm._g({ref:"popover",attrs:{"content-width":_vm.contentWidth,"open":_vm.open,"placement":_vm.placement,"initial-focus-element":"first","fallback-placements":_vm.fallbackPlacements,"padding":"none","role":"menu","modal":_vm.modal,"max-height":_vm.maxHeight,"max-width":_vm.maxWidth,"open-with-arrow-keys":true},on:{"opened":_vm.updateInitialHighlightIndex,"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.onEnterKey.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"space",32,$event.key,[" ","Spacebar"])){ return null; }return _vm.onSpaceKey.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.onKeyValidation($event, 'onUpKeyPress')},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.onKeyValidation($event, 'onDownKeyPress')},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"home",undefined,$event.key,undefined)){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.onKeyValidation($event, 'onHomeKeyPress')},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"end",undefined,$event.key,undefined)){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.onKeyValidation($event, 'onEndKeyPress')},function($event){return _vm.onKeyValidation($event, 'onKeyPress')}]},scopedSlots:_vm._u([{key:"anchor",fn:function(ref){
|
|
3835
3871
|
var attrs = ref.attrs;
|
|
3836
3872
|
return [_vm._t("anchor",null,null,attrs)]}},{key:"content",fn:function(ref){
|
|
3837
3873
|
var close = ref.close;
|
|
3838
3874
|
return [_c('ul',{ref:"listWrapper",class:['d-ps-relative', 'd-px0', _vm.DROPDOWN_PADDING_CLASSES[_vm.padding], _vm.listClass],attrs:{"id":_vm.listId,"data-qa":"dt-dropdown-list-wrapper"},on:{"mouseleave":_vm.clearHighlightIndex,"!mousemove":function($event){return _vm.onMouseHighlight.apply(null, arguments)}}},[_vm._t("list",null,{"close":close})],2)]}}],null,true)},_vm.$listeners))}
|
|
3839
|
-
var
|
|
3875
|
+
var dropdownvue_type_template_id_e689f0c4_staticRenderFns = []
|
|
3840
3876
|
|
|
3841
3877
|
|
|
3842
3878
|
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/popover/popover.vue?vue&type=template&id=97535496&
|
|
@@ -9534,6 +9570,7 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9534
9570
|
//
|
|
9535
9571
|
//
|
|
9536
9572
|
//
|
|
9573
|
+
//
|
|
9537
9574
|
|
|
9538
9575
|
|
|
9539
9576
|
|
|
@@ -9703,6 +9740,10 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9703
9740
|
|
|
9704
9741
|
activeItemEl() {
|
|
9705
9742
|
return this.getListElement().querySelector('#' + this.highlightId);
|
|
9743
|
+
},
|
|
9744
|
+
|
|
9745
|
+
isArrowKeyNav() {
|
|
9746
|
+
return this.navigationType === this.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS;
|
|
9706
9747
|
}
|
|
9707
9748
|
|
|
9708
9749
|
},
|
|
@@ -9762,7 +9803,7 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9762
9803
|
return;
|
|
9763
9804
|
}
|
|
9764
9805
|
|
|
9765
|
-
if (this.
|
|
9806
|
+
if (this.isArrowKeyNav) {
|
|
9766
9807
|
return this.onUpKey();
|
|
9767
9808
|
}
|
|
9768
9809
|
},
|
|
@@ -9773,29 +9814,35 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9773
9814
|
return;
|
|
9774
9815
|
}
|
|
9775
9816
|
|
|
9776
|
-
if (this.
|
|
9817
|
+
if (this.isArrowKeyNav) {
|
|
9777
9818
|
return this.onDownKey();
|
|
9778
9819
|
}
|
|
9779
9820
|
},
|
|
9780
9821
|
|
|
9781
9822
|
onHomeKeyPress() {
|
|
9782
|
-
if (!this.isOpen) {
|
|
9823
|
+
if (!this.isOpen || !this.isArrowKeyNav) {
|
|
9783
9824
|
return;
|
|
9784
9825
|
}
|
|
9785
9826
|
|
|
9786
|
-
|
|
9787
|
-
return this.onHomeKey();
|
|
9788
|
-
}
|
|
9827
|
+
return this.onHomeKey();
|
|
9789
9828
|
},
|
|
9790
9829
|
|
|
9791
9830
|
onEndKeyPress() {
|
|
9792
|
-
if (!this.isOpen) {
|
|
9831
|
+
if (!this.isOpen || !this.isArrowKeyNav) {
|
|
9793
9832
|
return;
|
|
9794
9833
|
}
|
|
9795
9834
|
|
|
9796
|
-
|
|
9797
|
-
|
|
9835
|
+
return this.onEndKey();
|
|
9836
|
+
},
|
|
9837
|
+
|
|
9838
|
+
onKeyPress(e) {
|
|
9839
|
+
if (!this.isOpen || !this.isArrowKeyNav || !this.isValidCharacter(e.key)) {
|
|
9840
|
+
return;
|
|
9798
9841
|
}
|
|
9842
|
+
|
|
9843
|
+
e.stopPropagation();
|
|
9844
|
+
e.preventDefault();
|
|
9845
|
+
return this.onNavigationKey(e.key);
|
|
9799
9846
|
},
|
|
9800
9847
|
|
|
9801
9848
|
onKeyValidation(e, eventHandler) {
|
|
@@ -9820,8 +9867,8 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9820
9867
|
;
|
|
9821
9868
|
var dropdown_component = normalizeComponent(
|
|
9822
9869
|
dropdown_dropdownvue_type_script_lang_js_,
|
|
9823
|
-
|
|
9824
|
-
|
|
9870
|
+
dropdownvue_type_template_id_e689f0c4_render,
|
|
9871
|
+
dropdownvue_type_template_id_e689f0c4_staticRenderFns,
|
|
9825
9872
|
false,
|
|
9826
9873
|
null,
|
|
9827
9874
|
null,
|
|
@@ -14360,15 +14407,20 @@ var checkbox_group_component = normalizeComponent(
|
|
|
14360
14407
|
/* harmony default export */ const checkbox_group = (checkbox_group_component.exports);
|
|
14361
14408
|
;// CONCATENATED MODULE: ./components/checkbox_group/index.js
|
|
14362
14409
|
|
|
14363
|
-
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/chip/chip.vue?vue&type=template&id=
|
|
14364
|
-
var
|
|
14365
|
-
var
|
|
14410
|
+
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/chip/chip.vue?vue&type=template&id=81827eb4&
|
|
14411
|
+
var chipvue_type_template_id_81827eb4_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"d-chip"},[_c(_vm.interactive ? 'button' : 'span',_vm._g({tag:"component",class:_vm.chipClasses(),attrs:{"id":_vm.id,"type":_vm.interactive && 'button',"data-qa":"dt-chip","aria-labelledby":_vm.ariaLabel ? undefined : (_vm.id + "-content"),"aria-label":_vm.ariaLabel}},_vm.chipListeners),[(_vm.$slots.icon)?_c('span',{staticClass:"d-chip__icon",attrs:{"data-qa":"dt-chip-icon"}},[_vm._t("icon")],2):(_vm.$slots.avatar)?_c('span',{attrs:{"data-qa":"dt-chip-avatar"}},[_vm._t("avatar")],2):_vm._e(),(_vm.$slots.default)?_c('span',{class:['d-truncate', 'd-chip__text', _vm.contentClass],attrs:{"id":(_vm.id + "-content"),"data-qa":"dt-chip-label"}},[_vm._t("default")],2):_vm._e()]),(!_vm.hideClose)?_c('dt-button',_vm._b({class:_vm.chipCloseButtonClasses(),attrs:{"data-qa":"dt-chip-close","aria-label":_vm.closeButtonProps.ariaLabel},on:{"click":function($event){return _vm.$emit('close')}},scopedSlots:_vm._u([{key:"icon",fn:function(){return [_c('icon-close')]},proxy:true}],null,false,4267981299)},'dt-button',_vm.closeButtonProps,false)):_vm._e()],1)}
|
|
14412
|
+
var chipvue_type_template_id_81827eb4_staticRenderFns = []
|
|
14366
14413
|
|
|
14367
14414
|
|
|
14368
14415
|
;// CONCATENATED MODULE: ./components/chip/chip_constants.js
|
|
14369
14416
|
const CHIP_SIZE_MODIFIERS = {
|
|
14370
|
-
xs: 'd-
|
|
14371
|
-
sm: 'd-
|
|
14417
|
+
xs: 'd-chip__label--xs',
|
|
14418
|
+
sm: 'd-chip__label--sm',
|
|
14419
|
+
md: ''
|
|
14420
|
+
};
|
|
14421
|
+
const CHIP_CLOSE_BUTTON_SIZE_MODIFIERS = {
|
|
14422
|
+
xs: 'd-chip__close--xs',
|
|
14423
|
+
sm: 'd-chip__close--sm',
|
|
14372
14424
|
md: ''
|
|
14373
14425
|
};
|
|
14374
14426
|
/* harmony default export */ const chip_constants = ({
|
|
@@ -14427,17 +14479,6 @@ const CHIP_SIZE_MODIFIERS = {
|
|
|
14427
14479
|
//
|
|
14428
14480
|
//
|
|
14429
14481
|
//
|
|
14430
|
-
//
|
|
14431
|
-
//
|
|
14432
|
-
//
|
|
14433
|
-
//
|
|
14434
|
-
//
|
|
14435
|
-
//
|
|
14436
|
-
//
|
|
14437
|
-
//
|
|
14438
|
-
//
|
|
14439
|
-
//
|
|
14440
|
-
//
|
|
14441
14482
|
|
|
14442
14483
|
|
|
14443
14484
|
|
|
@@ -14515,7 +14556,7 @@ const CHIP_SIZE_MODIFIERS = {
|
|
|
14515
14556
|
default: ''
|
|
14516
14557
|
}
|
|
14517
14558
|
},
|
|
14518
|
-
emits: ['click', 'close'],
|
|
14559
|
+
emits: ['click', 'close', 'keyup'],
|
|
14519
14560
|
|
|
14520
14561
|
data() {
|
|
14521
14562
|
return {
|
|
@@ -14524,37 +14565,37 @@ const CHIP_SIZE_MODIFIERS = {
|
|
|
14524
14565
|
},
|
|
14525
14566
|
|
|
14526
14567
|
computed: {
|
|
14527
|
-
|
|
14528
|
-
return this
|
|
14568
|
+
chipListeners() {
|
|
14569
|
+
return { ...this.$listeners,
|
|
14570
|
+
click: event => {
|
|
14571
|
+
if (this.interactive) this.$emit('click', event);
|
|
14572
|
+
},
|
|
14573
|
+
keyup: event => {
|
|
14574
|
+
var _event$code;
|
|
14575
|
+
|
|
14576
|
+
if (((_event$code = event.code) === null || _event$code === void 0 ? void 0 : _event$code.toLowerCase()) === 'delete') {
|
|
14577
|
+
this.onClose();
|
|
14578
|
+
} else {
|
|
14579
|
+
this.$emit('keyup', event);
|
|
14580
|
+
}
|
|
14581
|
+
}
|
|
14582
|
+
};
|
|
14529
14583
|
}
|
|
14530
14584
|
|
|
14531
14585
|
},
|
|
14532
14586
|
methods: {
|
|
14533
14587
|
chipClasses() {
|
|
14534
|
-
return ['d-
|
|
14535
|
-
|
|
14536
|
-
|
|
14537
|
-
|
|
14588
|
+
return ['d-chip__label', CHIP_SIZE_MODIFIERS[this.size]];
|
|
14589
|
+
},
|
|
14590
|
+
|
|
14591
|
+
chipCloseButtonClasses() {
|
|
14592
|
+
return ['d-chip__close', CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[this.size]];
|
|
14538
14593
|
},
|
|
14539
14594
|
|
|
14540
14595
|
onClose() {
|
|
14541
14596
|
if (!this.hideClose) {
|
|
14542
14597
|
this.$emit('close');
|
|
14543
14598
|
}
|
|
14544
|
-
},
|
|
14545
|
-
|
|
14546
|
-
onClick(event) {
|
|
14547
|
-
// Clicking on the button should not update value of isActive.
|
|
14548
|
-
if (!this.interactive || this.$refs.closeBtnContainer.contains(event.target)) {
|
|
14549
|
-
return;
|
|
14550
|
-
}
|
|
14551
|
-
|
|
14552
|
-
if (event.type === 'mousedown' || event.type === 'keydown') {
|
|
14553
|
-
this.isActive = true;
|
|
14554
|
-
} else {
|
|
14555
|
-
this.isActive = false;
|
|
14556
|
-
this.$emit('click');
|
|
14557
|
-
}
|
|
14558
14599
|
}
|
|
14559
14600
|
|
|
14560
14601
|
}
|
|
@@ -14571,8 +14612,8 @@ const CHIP_SIZE_MODIFIERS = {
|
|
|
14571
14612
|
;
|
|
14572
14613
|
var chip_component = normalizeComponent(
|
|
14573
14614
|
chip_chipvue_type_script_lang_js_,
|
|
14574
|
-
|
|
14575
|
-
|
|
14615
|
+
chipvue_type_template_id_81827eb4_render,
|
|
14616
|
+
chipvue_type_template_id_81827eb4_staticRenderFns,
|
|
14576
14617
|
false,
|
|
14577
14618
|
null,
|
|
14578
14619
|
null,
|
package/dist/dialtone-vue.umd.js
CHANGED
|
@@ -3393,6 +3393,7 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3393
3393
|
* the root element of the component.
|
|
3394
3394
|
*/
|
|
3395
3395
|
|
|
3396
|
+
const ERROR_INVALID_LIST_ELEMENT = 'listElementKey is required or the referenced ' + 'element doesn\'t exist. Received listElement: ';
|
|
3396
3397
|
/* harmony default export */ const keyboard_list_navigation = (function () {
|
|
3397
3398
|
let {
|
|
3398
3399
|
// Role of the list items in the component. This is used to identify the list items
|
|
@@ -3416,7 +3417,7 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3416
3417
|
endOfListMethod = null,
|
|
3417
3418
|
// Scroll the active element into view when highlighted by a keyboard event.
|
|
3418
3419
|
scrollToOnHighlight = true,
|
|
3419
|
-
// Focus the active element on keyboard navigation
|
|
3420
|
+
// Focus the active element on keyboard navigation.
|
|
3420
3421
|
focusOnKeyboardNavigation = false
|
|
3421
3422
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3422
3423
|
return {
|
|
@@ -3426,8 +3427,8 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3426
3427
|
return {
|
|
3427
3428
|
[indexKey]: -1,
|
|
3428
3429
|
[idKey]: '',
|
|
3429
|
-
scrollToOnHighlight
|
|
3430
|
-
focusOnKeyboardNavigation
|
|
3430
|
+
scrollToOnHighlight,
|
|
3431
|
+
focusOnKeyboardNavigation
|
|
3431
3432
|
};
|
|
3432
3433
|
},
|
|
3433
3434
|
|
|
@@ -3450,14 +3451,25 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3450
3451
|
// Gets the length of all the items in the list, uses the listItemRole param to determine
|
|
3451
3452
|
// whether an element is a list item.
|
|
3452
3453
|
_itemsLength() {
|
|
3454
|
+
const listItems = this._getListItemNodes();
|
|
3455
|
+
|
|
3456
|
+
if (listItems === null) {
|
|
3457
|
+
return 0;
|
|
3458
|
+
}
|
|
3459
|
+
|
|
3460
|
+
return listItems.length;
|
|
3461
|
+
},
|
|
3462
|
+
|
|
3463
|
+
// Gets all the list item nodes within the list element
|
|
3464
|
+
_getListItemNodes() {
|
|
3453
3465
|
const listElement = this._getListElement();
|
|
3454
3466
|
|
|
3455
3467
|
if (!listElement) {
|
|
3456
|
-
console.error(
|
|
3457
|
-
return
|
|
3468
|
+
console.error(ERROR_INVALID_LIST_ELEMENT, listElement);
|
|
3469
|
+
return null;
|
|
3458
3470
|
}
|
|
3459
3471
|
|
|
3460
|
-
return listElement.querySelectorAll("[role=\"".concat(listItemRole, "\"]"))
|
|
3472
|
+
return Array.from(listElement.querySelectorAll("[role=\"".concat(listItemRole, "\"]")));
|
|
3461
3473
|
},
|
|
3462
3474
|
|
|
3463
3475
|
onUpKey() {
|
|
@@ -3502,6 +3514,31 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3502
3514
|
this.focusActiveItemIfNeeded();
|
|
3503
3515
|
},
|
|
3504
3516
|
|
|
3517
|
+
onNavigationKey(key) {
|
|
3518
|
+
const listItems = this._getListItemNodes();
|
|
3519
|
+
|
|
3520
|
+
const matchingItems = listItems.filter(item => {
|
|
3521
|
+
const content = item.textContent.trim().toLowerCase();
|
|
3522
|
+
return content.startsWith(key.toLowerCase());
|
|
3523
|
+
});
|
|
3524
|
+
|
|
3525
|
+
if (matchingItems.length <= 0) {
|
|
3526
|
+
return;
|
|
3527
|
+
}
|
|
3528
|
+
|
|
3529
|
+
const highlightedMatchingItemIndex = matchingItems.findIndex(item => {
|
|
3530
|
+
return this[indexKey] === listItems.indexOf(item);
|
|
3531
|
+
});
|
|
3532
|
+
const nextHighlightedItemIndex = listItems.indexOf(highlightedMatchingItemIndex < matchingItems.length - 1 ? matchingItems[highlightedMatchingItemIndex + 1] : matchingItems[0]);
|
|
3533
|
+
this.setHighlightIndex(nextHighlightedItemIndex);
|
|
3534
|
+
this.scrollActiveItemIntoViewIfNeeded();
|
|
3535
|
+
this.focusActiveItemIfNeeded();
|
|
3536
|
+
},
|
|
3537
|
+
|
|
3538
|
+
isValidCharacter(key) {
|
|
3539
|
+
return key.length === 1;
|
|
3540
|
+
},
|
|
3541
|
+
|
|
3505
3542
|
jumpToBeginning() {
|
|
3506
3543
|
this.setHighlightIndex(0);
|
|
3507
3544
|
},
|
|
@@ -3538,8 +3575,7 @@ var comboboxvue_type_template_id_f944df30_staticRenderFns = []
|
|
|
3538
3575
|
}
|
|
3539
3576
|
|
|
3540
3577
|
const listItems = Array.from(listElement.querySelectorAll("[role=\"".concat(listItemRole, "\"]")));
|
|
3541
|
-
|
|
3542
|
-
return index;
|
|
3578
|
+
return listItems.indexOf(listElement.querySelector("#".concat(id)));
|
|
3543
3579
|
},
|
|
3544
3580
|
|
|
3545
3581
|
_getItemId(index) {
|
|
@@ -3848,13 +3884,13 @@ var combobox_component = normalizeComponent(
|
|
|
3848
3884
|
/* harmony default export */ const combobox = (combobox_component.exports);
|
|
3849
3885
|
;// CONCATENATED MODULE: ./components/combobox/index.js
|
|
3850
3886
|
|
|
3851
|
-
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/dropdown/dropdown.vue?vue&type=template&id=
|
|
3852
|
-
var
|
|
3887
|
+
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/dropdown/dropdown.vue?vue&type=template&id=e689f0c4&
|
|
3888
|
+
var dropdownvue_type_template_id_e689f0c4_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('dt-popover',_vm._g({ref:"popover",attrs:{"content-width":_vm.contentWidth,"open":_vm.open,"placement":_vm.placement,"initial-focus-element":"first","fallback-placements":_vm.fallbackPlacements,"padding":"none","role":"menu","modal":_vm.modal,"max-height":_vm.maxHeight,"max-width":_vm.maxWidth,"open-with-arrow-keys":true},on:{"opened":_vm.updateInitialHighlightIndex,"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.onEnterKey.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"space",32,$event.key,[" ","Spacebar"])){ return null; }return _vm.onSpaceKey.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.onKeyValidation($event, 'onUpKeyPress')},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.onKeyValidation($event, 'onDownKeyPress')},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"home",undefined,$event.key,undefined)){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.onKeyValidation($event, 'onHomeKeyPress')},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"end",undefined,$event.key,undefined)){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.onKeyValidation($event, 'onEndKeyPress')},function($event){return _vm.onKeyValidation($event, 'onKeyPress')}]},scopedSlots:_vm._u([{key:"anchor",fn:function(ref){
|
|
3853
3889
|
var attrs = ref.attrs;
|
|
3854
3890
|
return [_vm._t("anchor",null,null,attrs)]}},{key:"content",fn:function(ref){
|
|
3855
3891
|
var close = ref.close;
|
|
3856
3892
|
return [_c('ul',{ref:"listWrapper",class:['d-ps-relative', 'd-px0', _vm.DROPDOWN_PADDING_CLASSES[_vm.padding], _vm.listClass],attrs:{"id":_vm.listId,"data-qa":"dt-dropdown-list-wrapper"},on:{"mouseleave":_vm.clearHighlightIndex,"!mousemove":function($event){return _vm.onMouseHighlight.apply(null, arguments)}}},[_vm._t("list",null,{"close":close})],2)]}}],null,true)},_vm.$listeners))}
|
|
3857
|
-
var
|
|
3893
|
+
var dropdownvue_type_template_id_e689f0c4_staticRenderFns = []
|
|
3858
3894
|
|
|
3859
3895
|
|
|
3860
3896
|
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/popover/popover.vue?vue&type=template&id=97535496&
|
|
@@ -9552,6 +9588,7 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9552
9588
|
//
|
|
9553
9589
|
//
|
|
9554
9590
|
//
|
|
9591
|
+
//
|
|
9555
9592
|
|
|
9556
9593
|
|
|
9557
9594
|
|
|
@@ -9721,6 +9758,10 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9721
9758
|
|
|
9722
9759
|
activeItemEl() {
|
|
9723
9760
|
return this.getListElement().querySelector('#' + this.highlightId);
|
|
9761
|
+
},
|
|
9762
|
+
|
|
9763
|
+
isArrowKeyNav() {
|
|
9764
|
+
return this.navigationType === this.LIST_ITEM_NAVIGATION_TYPES.ARROW_KEYS;
|
|
9724
9765
|
}
|
|
9725
9766
|
|
|
9726
9767
|
},
|
|
@@ -9780,7 +9821,7 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9780
9821
|
return;
|
|
9781
9822
|
}
|
|
9782
9823
|
|
|
9783
|
-
if (this.
|
|
9824
|
+
if (this.isArrowKeyNav) {
|
|
9784
9825
|
return this.onUpKey();
|
|
9785
9826
|
}
|
|
9786
9827
|
},
|
|
@@ -9791,29 +9832,35 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9791
9832
|
return;
|
|
9792
9833
|
}
|
|
9793
9834
|
|
|
9794
|
-
if (this.
|
|
9835
|
+
if (this.isArrowKeyNav) {
|
|
9795
9836
|
return this.onDownKey();
|
|
9796
9837
|
}
|
|
9797
9838
|
},
|
|
9798
9839
|
|
|
9799
9840
|
onHomeKeyPress() {
|
|
9800
|
-
if (!this.isOpen) {
|
|
9841
|
+
if (!this.isOpen || !this.isArrowKeyNav) {
|
|
9801
9842
|
return;
|
|
9802
9843
|
}
|
|
9803
9844
|
|
|
9804
|
-
|
|
9805
|
-
return this.onHomeKey();
|
|
9806
|
-
}
|
|
9845
|
+
return this.onHomeKey();
|
|
9807
9846
|
},
|
|
9808
9847
|
|
|
9809
9848
|
onEndKeyPress() {
|
|
9810
|
-
if (!this.isOpen) {
|
|
9849
|
+
if (!this.isOpen || !this.isArrowKeyNav) {
|
|
9811
9850
|
return;
|
|
9812
9851
|
}
|
|
9813
9852
|
|
|
9814
|
-
|
|
9815
|
-
|
|
9853
|
+
return this.onEndKey();
|
|
9854
|
+
},
|
|
9855
|
+
|
|
9856
|
+
onKeyPress(e) {
|
|
9857
|
+
if (!this.isOpen || !this.isArrowKeyNav || !this.isValidCharacter(e.key)) {
|
|
9858
|
+
return;
|
|
9816
9859
|
}
|
|
9860
|
+
|
|
9861
|
+
e.stopPropagation();
|
|
9862
|
+
e.preventDefault();
|
|
9863
|
+
return this.onNavigationKey(e.key);
|
|
9817
9864
|
},
|
|
9818
9865
|
|
|
9819
9866
|
onKeyValidation(e, eventHandler) {
|
|
@@ -9838,8 +9885,8 @@ const DROPDOWN_PADDING_CLASSES = {
|
|
|
9838
9885
|
;
|
|
9839
9886
|
var dropdown_component = normalizeComponent(
|
|
9840
9887
|
dropdown_dropdownvue_type_script_lang_js_,
|
|
9841
|
-
|
|
9842
|
-
|
|
9888
|
+
dropdownvue_type_template_id_e689f0c4_render,
|
|
9889
|
+
dropdownvue_type_template_id_e689f0c4_staticRenderFns,
|
|
9843
9890
|
false,
|
|
9844
9891
|
null,
|
|
9845
9892
|
null,
|
|
@@ -14378,15 +14425,20 @@ var checkbox_group_component = normalizeComponent(
|
|
|
14378
14425
|
/* harmony default export */ const checkbox_group = (checkbox_group_component.exports);
|
|
14379
14426
|
;// CONCATENATED MODULE: ./components/checkbox_group/index.js
|
|
14380
14427
|
|
|
14381
|
-
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/chip/chip.vue?vue&type=template&id=
|
|
14382
|
-
var
|
|
14383
|
-
var
|
|
14428
|
+
;// CONCATENATED MODULE: ./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/chip/chip.vue?vue&type=template&id=81827eb4&
|
|
14429
|
+
var chipvue_type_template_id_81827eb4_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"d-chip"},[_c(_vm.interactive ? 'button' : 'span',_vm._g({tag:"component",class:_vm.chipClasses(),attrs:{"id":_vm.id,"type":_vm.interactive && 'button',"data-qa":"dt-chip","aria-labelledby":_vm.ariaLabel ? undefined : (_vm.id + "-content"),"aria-label":_vm.ariaLabel}},_vm.chipListeners),[(_vm.$slots.icon)?_c('span',{staticClass:"d-chip__icon",attrs:{"data-qa":"dt-chip-icon"}},[_vm._t("icon")],2):(_vm.$slots.avatar)?_c('span',{attrs:{"data-qa":"dt-chip-avatar"}},[_vm._t("avatar")],2):_vm._e(),(_vm.$slots.default)?_c('span',{class:['d-truncate', 'd-chip__text', _vm.contentClass],attrs:{"id":(_vm.id + "-content"),"data-qa":"dt-chip-label"}},[_vm._t("default")],2):_vm._e()]),(!_vm.hideClose)?_c('dt-button',_vm._b({class:_vm.chipCloseButtonClasses(),attrs:{"data-qa":"dt-chip-close","aria-label":_vm.closeButtonProps.ariaLabel},on:{"click":function($event){return _vm.$emit('close')}},scopedSlots:_vm._u([{key:"icon",fn:function(){return [_c('icon-close')]},proxy:true}],null,false,4267981299)},'dt-button',_vm.closeButtonProps,false)):_vm._e()],1)}
|
|
14430
|
+
var chipvue_type_template_id_81827eb4_staticRenderFns = []
|
|
14384
14431
|
|
|
14385
14432
|
|
|
14386
14433
|
;// CONCATENATED MODULE: ./components/chip/chip_constants.js
|
|
14387
14434
|
const CHIP_SIZE_MODIFIERS = {
|
|
14388
|
-
xs: 'd-
|
|
14389
|
-
sm: 'd-
|
|
14435
|
+
xs: 'd-chip__label--xs',
|
|
14436
|
+
sm: 'd-chip__label--sm',
|
|
14437
|
+
md: ''
|
|
14438
|
+
};
|
|
14439
|
+
const CHIP_CLOSE_BUTTON_SIZE_MODIFIERS = {
|
|
14440
|
+
xs: 'd-chip__close--xs',
|
|
14441
|
+
sm: 'd-chip__close--sm',
|
|
14390
14442
|
md: ''
|
|
14391
14443
|
};
|
|
14392
14444
|
/* harmony default export */ const chip_constants = ({
|
|
@@ -14445,17 +14497,6 @@ const CHIP_SIZE_MODIFIERS = {
|
|
|
14445
14497
|
//
|
|
14446
14498
|
//
|
|
14447
14499
|
//
|
|
14448
|
-
//
|
|
14449
|
-
//
|
|
14450
|
-
//
|
|
14451
|
-
//
|
|
14452
|
-
//
|
|
14453
|
-
//
|
|
14454
|
-
//
|
|
14455
|
-
//
|
|
14456
|
-
//
|
|
14457
|
-
//
|
|
14458
|
-
//
|
|
14459
14500
|
|
|
14460
14501
|
|
|
14461
14502
|
|
|
@@ -14533,7 +14574,7 @@ const CHIP_SIZE_MODIFIERS = {
|
|
|
14533
14574
|
default: ''
|
|
14534
14575
|
}
|
|
14535
14576
|
},
|
|
14536
|
-
emits: ['click', 'close'],
|
|
14577
|
+
emits: ['click', 'close', 'keyup'],
|
|
14537
14578
|
|
|
14538
14579
|
data() {
|
|
14539
14580
|
return {
|
|
@@ -14542,37 +14583,37 @@ const CHIP_SIZE_MODIFIERS = {
|
|
|
14542
14583
|
},
|
|
14543
14584
|
|
|
14544
14585
|
computed: {
|
|
14545
|
-
|
|
14546
|
-
return this
|
|
14586
|
+
chipListeners() {
|
|
14587
|
+
return { ...this.$listeners,
|
|
14588
|
+
click: event => {
|
|
14589
|
+
if (this.interactive) this.$emit('click', event);
|
|
14590
|
+
},
|
|
14591
|
+
keyup: event => {
|
|
14592
|
+
var _event$code;
|
|
14593
|
+
|
|
14594
|
+
if (((_event$code = event.code) === null || _event$code === void 0 ? void 0 : _event$code.toLowerCase()) === 'delete') {
|
|
14595
|
+
this.onClose();
|
|
14596
|
+
} else {
|
|
14597
|
+
this.$emit('keyup', event);
|
|
14598
|
+
}
|
|
14599
|
+
}
|
|
14600
|
+
};
|
|
14547
14601
|
}
|
|
14548
14602
|
|
|
14549
14603
|
},
|
|
14550
14604
|
methods: {
|
|
14551
14605
|
chipClasses() {
|
|
14552
|
-
return ['d-
|
|
14553
|
-
|
|
14554
|
-
|
|
14555
|
-
|
|
14606
|
+
return ['d-chip__label', CHIP_SIZE_MODIFIERS[this.size]];
|
|
14607
|
+
},
|
|
14608
|
+
|
|
14609
|
+
chipCloseButtonClasses() {
|
|
14610
|
+
return ['d-chip__close', CHIP_CLOSE_BUTTON_SIZE_MODIFIERS[this.size]];
|
|
14556
14611
|
},
|
|
14557
14612
|
|
|
14558
14613
|
onClose() {
|
|
14559
14614
|
if (!this.hideClose) {
|
|
14560
14615
|
this.$emit('close');
|
|
14561
14616
|
}
|
|
14562
|
-
},
|
|
14563
|
-
|
|
14564
|
-
onClick(event) {
|
|
14565
|
-
// Clicking on the button should not update value of isActive.
|
|
14566
|
-
if (!this.interactive || this.$refs.closeBtnContainer.contains(event.target)) {
|
|
14567
|
-
return;
|
|
14568
|
-
}
|
|
14569
|
-
|
|
14570
|
-
if (event.type === 'mousedown' || event.type === 'keydown') {
|
|
14571
|
-
this.isActive = true;
|
|
14572
|
-
} else {
|
|
14573
|
-
this.isActive = false;
|
|
14574
|
-
this.$emit('click');
|
|
14575
|
-
}
|
|
14576
14617
|
}
|
|
14577
14618
|
|
|
14578
14619
|
}
|
|
@@ -14589,8 +14630,8 @@ const CHIP_SIZE_MODIFIERS = {
|
|
|
14589
14630
|
;
|
|
14590
14631
|
var chip_component = normalizeComponent(
|
|
14591
14632
|
chip_chipvue_type_script_lang_js_,
|
|
14592
|
-
|
|
14593
|
-
|
|
14633
|
+
chipvue_type_template_id_81827eb4_render,
|
|
14634
|
+
chipvue_type_template_id_81827eb4_staticRenderFns,
|
|
14594
14635
|
false,
|
|
14595
14636
|
null,
|
|
14596
14637
|
null,
|