q2-tecton-elements 1.25.1 → 1.25.3

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.
Files changed (60) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/q2-badge_2.cjs.entry.js +2 -2
  3. package/dist/cjs/q2-btn_2.cjs.entry.js +5 -3
  4. package/dist/cjs/q2-optgroup_2.cjs.entry.js +1 -1
  5. package/dist/cjs/q2-option-list_2.cjs.entry.js +63 -20
  6. package/dist/cjs/q2-pill.cjs.entry.js +1 -1
  7. package/dist/cjs/q2-select.cjs.entry.js +23 -16
  8. package/dist/cjs/q2-tag.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  10. package/dist/collection/collection-manifest.json +1 -1
  11. package/dist/collection/components/q2-btn/index.js +22 -3
  12. package/dist/collection/components/q2-input/index.js +13 -8
  13. package/dist/collection/components/q2-option/index.js +1 -1
  14. package/dist/collection/components/q2-option-list/index.js +33 -25
  15. package/dist/collection/components/q2-pill/index.js +1 -1
  16. package/dist/collection/components/q2-popover/index.js +55 -16
  17. package/dist/collection/components/q2-popover/styles.css +3 -4
  18. package/dist/collection/components/q2-select/index.js +40 -15
  19. package/dist/collection/components/q2-select/styles.css +41 -3
  20. package/dist/collection/components/q2-tag/index.js +1 -1
  21. package/dist/components/index12.js +1 -1
  22. package/dist/components/index13.js +10 -6
  23. package/dist/components/index14.js +56 -17
  24. package/dist/components/index5.js +6 -3
  25. package/dist/components/index8.js +3 -3
  26. package/dist/components/q2-pill.js +1 -1
  27. package/dist/components/q2-select.js +25 -17
  28. package/dist/components/q2-tag.js +1 -1
  29. package/dist/docs.json +56 -28
  30. package/dist/esm/loader.js +1 -1
  31. package/dist/esm/q2-badge_2.entry.js +2 -2
  32. package/dist/esm/q2-btn_2.entry.js +5 -3
  33. package/dist/esm/q2-optgroup_2.entry.js +1 -1
  34. package/dist/esm/q2-option-list_2.entry.js +64 -21
  35. package/dist/esm/q2-pill.entry.js +1 -1
  36. package/dist/esm/q2-select.entry.js +24 -17
  37. package/dist/esm/q2-tag.entry.js +1 -1
  38. package/dist/esm/q2-tecton-elements.js +1 -1
  39. package/dist/q2-tecton-elements/p-1f16d0f8.entry.js +1 -0
  40. package/dist/q2-tecton-elements/p-2ee8d7ae.entry.js +1 -0
  41. package/dist/q2-tecton-elements/p-30391257.entry.js +1 -0
  42. package/dist/q2-tecton-elements/{p-8b5639a1.entry.js → p-954534b8.entry.js} +1 -1
  43. package/dist/q2-tecton-elements/{p-82fef3f9.entry.js → p-c24aa7d6.entry.js} +1 -1
  44. package/dist/q2-tecton-elements/p-f3dad195.entry.js +1 -0
  45. package/dist/q2-tecton-elements/p-f8423314.entry.js +1 -0
  46. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  47. package/dist/test/helpers.js +7 -0
  48. package/dist/types/components/q2-btn/index.d.ts +2 -0
  49. package/dist/types/components/q2-input/index.d.ts +3 -2
  50. package/dist/types/components/q2-option-list/index.d.ts +5 -1
  51. package/dist/types/components/q2-popover/index.d.ts +5 -1
  52. package/dist/types/components/q2-select/index.d.ts +4 -3
  53. package/dist/types/components.d.ts +17 -4
  54. package/dist/types/workspace/workspace/tecton-production_release_1.25.x/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +2 -1
  55. package/package.json +3 -3
  56. package/dist/q2-tecton-elements/p-3410c675.entry.js +0 -1
  57. package/dist/q2-tecton-elements/p-471e5d58.entry.js +0 -1
  58. package/dist/q2-tecton-elements/p-aafb9537.entry.js +0 -1
  59. package/dist/q2-tecton-elements/p-f573fe5a.entry.js +0 -1
  60. package/dist/q2-tecton-elements/p-fa8cb091.entry.js +0 -1
@@ -5,12 +5,10 @@ export class Q2Select {
5
5
  constructor() {
6
6
  var _a;
7
7
  this.scheduledAfterRender = [];
8
- this.showSelectedOptions = (event) => {
9
- event.stopPropagation();
8
+ this.showSelectedOptions = () => {
10
9
  this.showSelected = true;
11
10
  };
12
- this.showAllOptions = (event) => {
13
- event === null || event === void 0 ? void 0 : event.stopPropagation();
11
+ this.showAllOptions = () => {
14
12
  this.showSelected = false;
15
13
  };
16
14
  this.onMutationObserved = () => {
@@ -60,17 +58,20 @@ export class Q2Select {
60
58
  return;
61
59
  if (this.shouldClearSearchText(event))
62
60
  this.clearSearchText();
61
+ // Prevent click event from firing when spacebar is pressed
62
+ if (event.key === ' ')
63
+ event.preventDefault();
63
64
  this.optionList.handleExternalKeydown(event);
64
65
  };
65
66
  this.visibilityToggleKeyDown = (event) => {
66
- const keysForOptionListToHandle = ['ArrowDown', 'ArrowUp'];
67
- const keysThatTriggerClick = ['Enter', ' '];
68
67
  const key = event.key;
69
- if (keysForOptionListToHandle.includes(key)) {
70
- this.optionList.handleExternalKeydown(event);
71
- }
72
- else if (keysThatTriggerClick.includes(key)) {
73
- event.target.dispatchEvent(new MouseEvent('click'));
68
+ const isShiftTab = key === 'Tab' && event.shiftKey;
69
+ const isRadioControlKey = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(key);
70
+ if (isRadioControlKey)
71
+ event.stopPropagation();
72
+ if (isShiftTab) {
73
+ event.stopPropagation();
74
+ this.optionList.setDefaultActiveElement();
74
75
  }
75
76
  };
76
77
  this.inputClickHandler = async (event) => {
@@ -126,6 +127,7 @@ export class Q2Select {
126
127
  this.disabled = false;
127
128
  this.readonly = false;
128
129
  this.invalid = undefined;
130
+ this.listLabel = loc('tecton.element.select.listLabel');
129
131
  this.errors = undefined;
130
132
  this.multiple = false;
131
133
  this.minRows = 3;
@@ -187,7 +189,10 @@ export class Q2Select {
187
189
  get popoverMinHeight() {
188
190
  const { minRows } = this;
189
191
  const firstOption = this.hostElement.querySelector('q2-option:not([hidden])');
190
- const minHeight = firstOption ? window.getComputedStyle(firstOption).minHeight : '44px';
192
+ let minHeight = firstOption && window.getComputedStyle(firstOption).minHeight;
193
+ // Safari doesn't return a min-height for non-visible items
194
+ if (!minHeight || minHeight === '0px')
195
+ minHeight = '44px';
191
196
  return minRows * parseInt(minHeight);
192
197
  }
193
198
  get selectedDisplay() {
@@ -451,16 +456,18 @@ export class Q2Select {
451
456
  this.errors.length > 0 &&
452
457
  this.errors.map(error => loc(error))) ||
453
458
  (this.invalid && ['tecton.element.select.invalid']) ||
454
- [], disabled: this.disabled, optional: this.optional, readonly: this.readonly, placeholder: this.placeholder || undefined, hideLabel: this.hideLabel, ariaExpanded: `${!!this.open}`, ariaOwns: "option-list", ariaHaspopup: "listbox", role: this.searchable ? 'combobox' : null, pseudo: showAsPseudo, "test-id": "toggleDropdown", "hide-messages": true, iconRight: "chevron-down", onClick: this.inputClickHandler, onInput: this.inputInputHandler, onKeyDown: this.inputKeydownHandler, onFocus: this.inputFocusHandler, onBlur: this.inputBlurHandler, onChange: this.inputChangeHandler, badgeValue: this.badgeValue, badgeTheme: this.inputFocused ? 'primary' : undefined }, this.renderCustomDisplay()), h("div", { class: "custom-display-content", hidden: !this.hasCustomDisplay || !!this.searchText, onClick: this.onCustomDisplayClick }, h("slot", { name: "q2-select-display" })), this.optionsDropdown()));
459
+ [], disabled: this.disabled, optional: this.optional, readonly: this.readonly, placeholder: this.placeholder || undefined, hideLabel: this.hideLabel, ariaExpanded: `${this.open}`, ariaControls: "option-list", ariaHaspopup: "listbox", role: "combobox", pseudo: showAsPseudo, "test-id": "toggleDropdown", "hide-messages": true, iconRight: "chevron-down", onClick: this.inputClickHandler, onInput: this.inputInputHandler, onKeyDown: this.inputKeydownHandler, onFocus: this.inputFocusHandler, onBlur: this.inputBlurHandler, onChange: this.inputChangeHandler, badgeValue: this.badgeValue, badgeTheme: this.inputFocused ? 'primary' : undefined }, this.renderCustomDisplay()), h("div", { class: "custom-display-content", hidden: !this.hasCustomDisplay || !!this.searchText, onClick: this.onCustomDisplayClick }, h("slot", { name: "q2-select-display" })), this.optionsDropdown()));
455
460
  }
456
461
  optionsDropdown() {
457
- return (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.innerInputField, open: this.open, minHeight: this.popoverMinHeight, direction: this.popDirection, onPopoverStateChanged: this.popoverStateChanged, block: true }, this.multiple ? this.visibilityToggle() : '', h("q2-option-list", { ref: el => (this.optionList = el), id: "option-list", "show-selected": this.showSelected, multiple: this.multiple, selectedOptions: this.structuredSelectedOptions, onChange: this.onOptionListChange }, h("slot", null))));
462
+ return (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.innerInputField, open: this.open, minHeight: this.popoverMinHeight, direction: this.popDirection, onPopoverStateChanged: this.popoverStateChanged, block: true }, h("div", { class: "popover-content", tabindex: "-1" }, h("q2-option-list", { ref: el => (this.optionList = el), type: "listbox", id: "option-list", "show-selected": this.showSelected, "aria-label": this.listLabel, multiple: this.multiple, selectedOptions: this.structuredSelectedOptions, onChange: this.onOptionListChange }, h("slot", null)), this.multiple && this.visibilityToggle())));
458
463
  }
459
464
  visibilityToggle() {
460
465
  var _a, _b;
461
466
  const selectedOptionsCount = (_b = (_a = this.selectedOptions) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
462
467
  const { showSelected } = this;
463
- return (h("div", { class: "multi-select-header", ref: el => (this.multiSelectHeader = el) }, h("span", null, loc('tecton.element.select.multiHeader.showing')), h("q2-btn", { class: showSelected ? '' : 'selected', badge: true, "aria-selected": !showSelected || undefined, "test-id": "allOptionsButton", onClick: this.showAllOptions, onKeyDown: this.visibilityToggleKeyDown, label: loc('tecton.element.select.multiHeader.allAriaLabel'), "hide-label": true }, loc('tecton.element.select.multiHeader.all')), h("q2-btn", { class: showSelected ? 'selected' : '', "aria-selected": showSelected || undefined, disabled: selectedOptionsCount === 0, badge: true, "test-id": "selectedOptionsButton", onClick: this.showSelectedOptions, onKeyDown: this.visibilityToggleKeyDown, label: loc('tecton.element.select.multiHeader.selectedAriaLabel', [selectedOptionsCount]), "hide-label": true }, loc('tecton.element.select.multiHeader.selected', [selectedOptionsCount]))));
468
+ return (h("div", { class: "multi-select-header", ref: el => (this.multiSelectHeader = el) }, h("fieldset", null, h("legend", { "aria-label": loc('tecton.element.select.multiHeader.showing') }, loc('tecton.element.select.multiHeader.showing')), h("div", null, h("input", { class: "sr", type: "radio", id: "all", name: "viewDisplay", value: "all", checked: !showSelected, "aria-label": loc('tecton.element.select.multiHeader.allAriaLabel'), "test-id": "allOptionsButton", onClick: this.showAllOptions, onKeyDown: this.visibilityToggleKeyDown }), h("label", { htmlFor: "all" }, loc('tecton.element.select.multiHeader.all'))), h("div", null, h("input", { class: "sr", type: "radio", id: "selected", disabled: selectedOptionsCount === 0, name: "viewDisplay", value: "selected", "aria-label": loc('tecton.element.select.multiHeader.selectedAriaLabel', [
469
+ selectedOptionsCount,
470
+ ]), checked: showSelected, "test-id": "selectedOptionsButton", onClick: this.showSelectedOptions, onKeyDown: this.visibilityToggleKeyDown }), h("label", { htmlFor: "selected" }, loc('tecton.element.select.multiHeader.selected', [selectedOptionsCount]))))));
464
471
  }
465
472
  static get is() { return "q2-select"; }
466
473
  static get encapsulation() { return "shadow"; }
@@ -613,6 +620,24 @@ export class Q2Select {
613
620
  "attribute": "invalid",
614
621
  "reflect": true
615
622
  },
623
+ "listLabel": {
624
+ "type": "string",
625
+ "mutable": false,
626
+ "complexType": {
627
+ "original": "string",
628
+ "resolved": "string",
629
+ "references": {}
630
+ },
631
+ "required": false,
632
+ "optional": false,
633
+ "docs": {
634
+ "tags": [],
635
+ "text": ""
636
+ },
637
+ "attribute": "list-label",
638
+ "reflect": false,
639
+ "defaultValue": "loc('tecton.element.select.listLabel')"
640
+ },
616
641
  "errors": {
617
642
  "type": "unknown",
618
643
  "mutable": false,
@@ -171,14 +171,52 @@ button {
171
171
  width: calc(100% - 68px - var(--tct-scale-3, var(--app-scale-3x, 15px)));
172
172
  }
173
173
 
174
+ .popover-content {
175
+ display: flex;
176
+ flex-direction: column-reverse;
177
+ }
178
+
174
179
  .multi-select-header {
175
- padding: var(--tct-scale-1, var(--app-scale-1x, 5px)) var(--tct-scale-2, var(--app-scale-2x, 10px));
180
+ padding: var(--tct-scale-2, var(--app-scale-2x, 10px)) var(--tct-scale-2, var(--app-scale-2x, 10px));
176
181
  position: sticky;
177
182
  top: 0;
178
183
  z-index: 5;
179
184
  background: var(--app-white);
180
- display: inline-grid;
181
- grid-template-columns: repeat(3, auto);
185
+ display: flex;
182
186
  gap: var(--app-scale-2x, 10px);
183
187
  align-items: center;
188
+ }
189
+ .multi-select-header fieldset {
190
+ margin: 0;
191
+ padding: 0;
192
+ border: 0;
193
+ display: flex;
194
+ gap: var(--app-scale-2x, 10px);
195
+ }
196
+ .multi-select-header legend {
197
+ padding: 0;
198
+ float: left;
199
+ }
200
+ .multi-select-header label {
201
+ cursor: pointer;
202
+ padding: var(--tct-select-multi-select-option-padding, var(--t-select-multi-select-option-padding, var(--tct-btn-badge-padding, var(--t-btn-badge-padding, 2px 5px))));
203
+ font-size: var(--tct-select-multi-select-option-font-size, var(--t-select-multi-select-option-font-size, var(--tct-btn-badge-font-size, var(--t-btn-badge-font-size, inherit))));
204
+ border-radius: var(--tct-select-multi-select-option-radius, var(--t-select-multi-select-option-radius, var(--tct-btn-badge-border-radius, var(--t-btn-badge-border-radius, var(--app-border-radius-1, 3px)))));
205
+ background-color: var(--tct-select-multi-select-option-bg, var(--t-select-multi-select-option-bg, var(--tct-btn-badge-bg, var(--t-btn-badge-bg, transparent))));
206
+ color: var(--tct-select-multi-select-option-color, var(--t-select-multi-select-option-color, var(--tct-btn-badge-font-color, var(--t-btn-badge-font-color, inherit))));
207
+ }
208
+ .multi-select-header label:hover {
209
+ background-color: var(--tct-select-multi-select-option-hover-background-color, var(--t-select-multi-select-option-hover-background-color, var(--tct-btn-badge-hover-bg, var(--t-btn-badge-hover-bg, var(--tct-gray-14, var(--t-gray-14, var(--app-gray-l3, #f2f2f2)))))));
210
+ color: var(--tct-select-multi-select-option-color, var(--t-select-multi-select-option-color, var(--tct-btn-badge-hover-font-color, var(--t-btn-badge-hover-font-color, var(--tct-gray-5, var(--t-gray-5, var(--app-gray-d2, #404040)))))));
211
+ }
212
+ .multi-select-header input:checked + label, .multi-select-header input:checked + label:enabled:hover {
213
+ background-color: var(--tct-select-multi-select-option-active-background-color, var(--t-select-multi-select-option-active-background-color, var(--tct-btn-primary-bg, var(--t-btn-primary-bg, #2e2e2e))));
214
+ color: var(--tct-select-multi-select-option-active-color, var(--t-select-multi-select-option-active-color, var(--tct-btn-primary-font-color, var(--t-btn-primary-font-color, var(--app-white, #ffffff)))));
215
+ }
216
+ .multi-select-header input:disabled + label {
217
+ opacity: var(--tct-select-multi-select-option-active-color, var(--t-select-multi-select-option-active-color, var(--tct-btn-disabled-opacity, var(--t-btn-disabled-opacity, var(--app-disabled-opacity, 0.4)))));
218
+ cursor: not-allowed;
219
+ }
220
+ .multi-select-header input:focus + label {
221
+ box-shadow: var(--const-double-focus-ring);
184
222
  }
@@ -99,7 +99,7 @@ export class Q2Tag {
99
99
  const wrapperClassNames = ['tag-wrapper'];
100
100
  if (hasOptions)
101
101
  wrapperClassNames.push('has-options');
102
- return (h(Host, { role: "listitem" }, h("click-elsewhere", { onChange: this.onClickElsewhere }, h("div", { class: wrapperClassNames.join(' '), onClick: e => e.stopPropagation() }, h("div", { class: "tag" }, this.label), this.hasOptions && (h("div", { class: "btn-wrapper", onClick: this.handleWrapperClick }, h("button", { ref: el => (this.dropdownBtn = el), "test-id": "btn-control", onClick: this.handleClick, onKeyDown: this.handleKeydown, onFocusout: this.handleButtonFocusout, "aria-controls": "option-list", "aria-haspopup": "true", "aria-expanded": open ? 'true' : 'false', "aria-label": loc('tecton.element.tag.viewOptions') }, h("q2-icon", { type: "options" }))))), this.hasOptions && (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.dropdownBtn, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: "right" }, h("q2-option-list", { id: "option-list", role: "menu", ref: el => (this.optionList = el), onChange: this.handleChange, align: "right", type: "menu", "no-select": true }, h("slot", null)))))));
102
+ return (h(Host, { role: "listitem" }, h("click-elsewhere", { onChange: this.onClickElsewhere }, h("div", { class: wrapperClassNames.join(' '), onClick: e => e.stopPropagation() }, h("div", { class: "tag" }, this.label), this.hasOptions && (h("div", { class: "btn-wrapper", onClick: this.handleWrapperClick }, h("button", { ref: el => (this.dropdownBtn = el), "test-id": "btn-control", type: "button", role: "combobox", onClick: this.handleClick, onKeyDown: this.handleKeydown, onFocusout: this.handleButtonFocusout, "aria-controls": "option-list", "aria-haspopup": "true", "aria-expanded": open ? 'true' : 'false', "aria-label": loc('tecton.element.tag.viewOptions') }, h("q2-icon", { type: "options" }))))), this.hasOptions && (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.dropdownBtn, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: "right" }, h("q2-option-list", { id: "option-list", ref: el => (this.optionList = el), onChange: this.handleChange, type: "menu", align: "right", "no-select": true }, h("slot", null)))))));
103
103
  }
104
104
  static get is() { return "q2-tag"; }
105
105
  static get encapsulation() { return "shadow"; }
@@ -30,7 +30,7 @@ const Q2Option = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
30
30
  render() {
31
31
  const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
32
32
  const isDisabled = disabled || disabledGroup;
33
- return (h(Host, { tabindex: "-1", "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && h("q2-icon", { type: "checkmark" }), h("div", { class: "content" }, h("slot", null))));
33
+ return (h(Host, { tabindex: "-1", "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": `${!!selected}`, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && h("q2-icon", { type: "checkmark" }), h("div", { class: "content" }, h("slot", null))));
34
34
  }
35
35
  get hostElement() { return this; }
36
36
  static get watchers() { return {
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { o as overrideFocus, w as waitForNextPaint, n as nextPaint, a as isEventFromElement } from './index15.js';
2
+ import { n as nextPaint, l as loc, o as overrideFocus, w as waitForNextPaint, a as isEventFromElement } from './index15.js';
3
3
 
4
4
  const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{position:relative;width:100%;display:block;line-height:var(--tct-option-list-line-height, var(--t-option-list-line-height, var(--app-line-height, 1.428571429em)))}.content{text-align:start}:host([is-sizeable]) .content{display:block;height:auto}";
5
5
 
@@ -27,21 +27,23 @@ const Q2OptionList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
27
27
  this.searchOptions(key, true);
28
28
  break;
29
29
  }
30
- else if (this.role === 'menu') {
30
+ else if (this.type === 'menu') {
31
31
  this.activeIndex = 0;
32
32
  this.openDropdownWithActiveElement(0);
33
33
  }
34
34
  else {
35
35
  this.setDefaultActiveElement();
36
+ nextPaint(() => this.popoverState.emit({ open: true, action: 'open' }));
36
37
  }
37
38
  break;
38
39
  case 'Enter':
39
- if (this.role === 'menu') {
40
+ if (this.type === 'menu') {
40
41
  this.activeIndex = 0;
41
42
  this.openDropdownWithActiveElement(0);
42
43
  }
43
44
  else {
44
45
  this.setDefaultActiveElement();
46
+ nextPaint(() => this.popoverState.emit({ open: true, action: 'open' }));
45
47
  }
46
48
  break;
47
49
  case 'ArrowUp':
@@ -171,6 +173,8 @@ const Q2OptionList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
171
173
  case 'Tab':
172
174
  if (shiftKey)
173
175
  break;
176
+ if (this.multiple && this.type === 'listbox')
177
+ break;
174
178
  newOption = allOptions.find(element => element.active);
175
179
  if (!newOption || newOption.disabled)
176
180
  return;
@@ -205,7 +209,6 @@ const Q2OptionList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
205
209
  const option = target.closest('q2-option');
206
210
  this.selectOption(option);
207
211
  };
208
- this.role = 'listbox';
209
212
  this.customSearch = undefined;
210
213
  this.noSelect = undefined;
211
214
  this.align = undefined;
@@ -213,7 +216,8 @@ const Q2OptionList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
213
216
  this.multiple = undefined;
214
217
  this.disabled = undefined;
215
218
  this.showSelected = undefined;
216
- this.type = undefined;
219
+ this.type = 'listbox';
220
+ this.label = loc('tecton.element.optionList.label');
217
221
  this.hasOptions = undefined;
218
222
  }
219
223
  /// LifeCycle Hooks ///
@@ -495,7 +499,6 @@ const Q2OptionList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
495
499
  }; }
496
500
  static get style() { return stylesCss; }
497
501
  }, [1, "q2-option-list", {
498
- "role": [513],
499
502
  "customSearch": [516, "custom-search"],
500
503
  "noSelect": [516, "no-select"],
501
504
  "align": [513],
@@ -504,6 +507,7 @@ const Q2OptionList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
504
507
  "disabled": [516],
505
508
  "showSelected": [1540, "show-selected"],
506
509
  "type": [1],
510
+ "label": [1],
507
511
  "hasOptions": [32],
508
512
  "setDefaultActiveElement": [64],
509
513
  "setActiveElement": [64],
@@ -1,7 +1,7 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
2
  import { r as resizeIframe, w as waitForNextPaint } from './index15.js';
3
3
 
4
- const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block;width:100%}:host([align=right]){display:block;position:absolute;right:0;text-align:end;left:unset}.container{display:none;overflow:hidden;opacity:0;height:0;position:absolute;top:var(--tct-popover-top, var(--t-popover-top, initial));visibility:hidden;background-color:var(--tct-popover-background-color, var(--t-popover-background-color, var(--app-white, #ffffff)));color:var(--tct-popover-text-color, var(--t-popover-text-color, var(--t-text, #4d4d4d)));z-index:var(--tct-popover-z-index, var(--t-popover-z-index, 100));width:max-content;min-width:var(--tct-popover-min-width, var(--t-popover-min-width, 135px));box-shadow:var(--tct-popover-box-shadow, var(--t-popover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))));text-align:start;left:0;transition:opacity var(--app-tween-1, 0.2s ease);border-radius:var(--tct-popover-border-radius, var(--t-popover-border-radius, 0));max-height:var(--comp-pop-max-height);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}.container::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.container::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.container::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}:host([block]) .container{left:unset;right:unset;width:100%;min-width:unset}:host([align=right]) .container{right:0;text-align:end;left:unset}.container :host([open]){display:block}:host([open]) .container.show{height:auto;overflow:auto;opacity:1;visibility:visible}.container.up{bottom:var(--comp-pop-offset)}click-elsewhere{position:relative;display:block}.content{height:auto}";
4
+ const stylesCss = "*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{display:block;width:100%}:host([align=right]){display:block;position:absolute;right:0;text-align:end;left:unset}.container{display:none;overflow:hidden;opacity:0;height:0;position:absolute;top:var(--tct-popover-top, var(--t-popover-top, initial));visibility:hidden;background-color:var(--tct-popover-background-color, var(--t-popover-background-color, var(--app-white, #ffffff)));color:var(--tct-popover-text-color, var(--t-popover-text-color, var(--t-text, #4d4d4d)));z-index:var(--tct-popover-z-index, var(--t-popover-z-index, 100));width:max-content;min-width:var(--tct-popover-min-width, var(--t-popover-min-width, 135px));box-shadow:var(--tct-popover-box-shadow, var(--t-popover-box-shadow, var(--app-shadow-1, 0 2px 4px rgba(0, 0, 0, 0.3))));text-align:start;left:0;transition:opacity var(--app-tween-1, 0.2s ease), max-height var(--app-tween-1, 0.2s ease);border-radius:var(--tct-popover-border-radius, var(--t-popover-border-radius, 0));max-height:var(--comp-pop-max-height);--comp-scrollbar-size:var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));--comp-scrollbar-border-radius:var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));--comp-scrollbar-color:var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));scrollbar-width:thin;scrollbar-color:var(--comp-scrollbar-color) transparent}.container::-webkit-scrollbar{width:var(--comp-scrollbar-size);height:var(--comp-scrollbar-size);margin:5px}.container::-webkit-scrollbar-thumb{background:var(--comp-scrollbar-color);border-radius:var(--comp-scrollbar-border-radius)}.container::-webkit-scrollbar-track{background:transparent;border-radius:var(--comp-scrollbar-border-radius)}:host([block]) .container{left:unset;right:unset;width:100%;min-width:unset}:host([align=right]) .container{right:0;text-align:end;left:unset}:host([open]) .container{visibility:visible}:host([open]) .container.show{height:auto;overflow:auto;opacity:1}.container.up{bottom:var(--comp-pop-offset)}click-elsewhere{position:relative;display:block}.content{height:auto}";
5
5
 
6
6
  const Q2Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
7
7
  constructor() {
@@ -10,13 +10,19 @@ const Q2Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
10
  this.__attachShadow();
11
11
  this.popoverStateChanged = createEvent(this, "popoverStateChanged", 7);
12
12
  this.scheduledAfterRender = [];
13
+ /// Helpers ///
14
+ this.viewPortChanged = () => {
15
+ if (!this.open)
16
+ return;
17
+ this.determinePopDirection();
18
+ };
13
19
  this.direction = undefined;
14
20
  this.align = undefined;
15
21
  this.open = undefined;
16
22
  this.block = undefined;
17
23
  this.minHeight = undefined;
18
24
  this.controlElement = undefined;
19
- this.privateDirection = 'down';
25
+ this.currentDirection = undefined;
20
26
  this.show = false;
21
27
  }
22
28
  /// Lifecycle hooks ///
@@ -30,6 +36,9 @@ const Q2Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
30
36
  this.scheduledAfterRender = [];
31
37
  }, 25);
32
38
  }
39
+ disconnectedCallback() {
40
+ this.removeViewportListeners();
41
+ }
33
42
  /// Methods ///
34
43
  async toggle() {
35
44
  this.open = !this.open;
@@ -39,9 +48,18 @@ const Q2Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
39
48
  this.popoverStateChanged.emit({ open });
40
49
  this.scheduledAfterRender.push(resizeIframe);
41
50
  if (open) {
51
+ this.addViewportListeners();
42
52
  this.determinePopDirection();
43
53
  }
44
54
  else {
55
+ this.removeViewportListeners();
56
+ // Reset currentDirection after close transition completes
57
+ this.containerElement.addEventListener('transitionend', () => {
58
+ if (this.open)
59
+ return;
60
+ this.currentDirection = undefined;
61
+ this.containerElement.style.removeProperty('--comp-pop-max-height');
62
+ }, { once: true });
45
63
  this.show = false;
46
64
  }
47
65
  }
@@ -53,17 +71,24 @@ const Q2Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
53
71
  this.open = open;
54
72
  event.stopPropagation();
55
73
  }
74
+ addViewportListeners() {
75
+ // window.visualViewport.addEventListener('scroll', this.viewPortChanged);
76
+ window.visualViewport.addEventListener('resize', this.viewPortChanged);
77
+ }
78
+ removeViewportListeners() {
79
+ // window.visualViewport.removeEventListener('scroll', this.viewPortChanged);
80
+ window.visualViewport.removeEventListener('resize', this.viewPortChanged);
81
+ }
56
82
  async setDirectionAndShow(direction) {
57
83
  if (direction === 'up') {
58
84
  this.determinePopOffset();
59
85
  }
60
- this.privateDirection = direction;
86
+ this.currentDirection = direction;
61
87
  this.show = true;
62
88
  }
63
- /// Helpers ///
64
89
  async determinePopDirection() {
65
- var _a, _b, _c, _d, _e;
66
- const { containerElement, contentElement, direction, controlElement } = this;
90
+ var _a, _b, _c, _d, _e, _f, _g;
91
+ const { containerElement, contentElement, direction, controlElement, currentDirection } = this;
67
92
  if (containerElement)
68
93
  containerElement.style.maxHeight = null;
69
94
  // If direction defined, use it
@@ -78,32 +103,46 @@ const Q2Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
78
103
  height: 0,
79
104
  };
80
105
  const contentHeight = contentElement.clientHeight;
81
- const scrollY = ((_c = (_b = window.Tecton) === null || _b === void 0 ? void 0 : _b.platformDimensions) === null || _c === void 0 ? void 0 : _c.scrollY) || 0;
82
- const innerHeight = ((_e = (_d = window.Tecton) === null || _d === void 0 ? void 0 : _d.platformDimensions) === null || _e === void 0 ? void 0 : _e.innerHeight) || window.innerHeight;
106
+ const scrollY = ((_c = (_b = window.Tecton) === null || _b === void 0 ? void 0 : _b.platformDimensions) === null || _c === void 0 ? void 0 : _c.scrollY) ||
107
+ ((_d = window.visualViewport) === null || _d === void 0 ? void 0 : _d.offsetTop) || // Only Android Chrome provides this which we need when scrolled
108
+ 0;
109
+ const innerHeight = ((_f = (_e = window.Tecton) === null || _e === void 0 ? void 0 : _e.platformDimensions) === null || _f === void 0 ? void 0 : _f.innerHeight) || ((_g = window.visualViewport) === null || _g === void 0 ? void 0 : _g.height) || window.innerHeight;
83
110
  const bottomOffset = scrollY + innerHeight - topOffset - height;
84
111
  const canShowFullSizeBelow = bottomOffset > contentHeight;
85
- const canShowFullSizeAbove = contentHeight <= topOffset || !this.minHeight;
112
+ const canShowFullSizeAbove = contentHeight <= topOffset;
86
113
  let determinedDirection;
87
114
  // Show the full-size popover below or above if it will fit
88
- if (canShowFullSizeBelow)
115
+ if (currentDirection === 'down' && canShowFullSizeBelow)
116
+ return this.setDirectionAndShow('down');
117
+ else if (currentDirection === 'up' && canShowFullSizeAbove)
118
+ return this.setDirectionAndShow('up');
119
+ else if (currentDirection === undefined && canShowFullSizeBelow)
89
120
  determinedDirection = 'down';
90
- else if (canShowFullSizeAbove)
121
+ else if (currentDirection === undefined && canShowFullSizeAbove)
91
122
  determinedDirection = 'up';
92
123
  if (determinedDirection)
93
124
  return this.setDirectionAndShow(determinedDirection);
94
- // If full size will not fit and minHeight is set, then make as tall as possible
125
+ // If full size will not fit then make it as tall as possible
95
126
  const { minHeight = 150 } = this;
96
127
  const displayBuffer = 5;
97
- const canShowSmallBelow = bottomOffset >= minHeight + displayBuffer;
128
+ const canShowMinHeightBelow = bottomOffset >= minHeight + displayBuffer;
98
129
  let maxHeight;
99
- if (canShowSmallBelow) {
130
+ if (currentDirection === 'down') {
100
131
  maxHeight = Math.max(bottomOffset - displayBuffer, minHeight);
101
132
  determinedDirection = 'down';
102
133
  }
103
- else {
134
+ else if (currentDirection === 'up') {
104
135
  maxHeight = Math.max(topOffset - displayBuffer, minHeight);
105
136
  determinedDirection = 'up';
106
137
  }
138
+ else if (canShowMinHeightBelow) {
139
+ maxHeight = Math.max(bottomOffset - displayBuffer, minHeight);
140
+ determinedDirection = 'down';
141
+ }
142
+ else {
143
+ maxHeight = Math.max(topOffset - scrollY - displayBuffer, minHeight);
144
+ determinedDirection = 'up';
145
+ }
107
146
  containerElement.style.setProperty('--comp-pop-max-height', `${maxHeight}px`);
108
147
  return this.setDirectionAndShow(determinedDirection);
109
148
  }
@@ -115,7 +154,7 @@ const Q2Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
115
154
  }
116
155
  /// DOM ///
117
156
  render() {
118
- const containerClasses = ['container', this.privateDirection];
157
+ const containerClasses = ['container', this.currentDirection];
119
158
  if (this.show)
120
159
  containerClasses.push('show');
121
160
  return (h("div", { ref: el => (this.containerElement = el), class: containerClasses.join(' '), role: "menu" }, h("div", { ref: el => (this.contentElement = el), class: "content" }, h("slot", null))));
@@ -132,7 +171,7 @@ const Q2Popover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
132
171
  "block": [516],
133
172
  "minHeight": [2, "min-height"],
134
173
  "controlElement": [16],
135
- "privateDirection": [32],
174
+ "currentDirection": [32],
136
175
  "show": [32],
137
176
  "toggle": [64]
138
177
  }, [[0, "popoverState", "popoverStateHandler"]]]);
@@ -16,6 +16,7 @@ const Q2Btn = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
16
16
  this.ariaHasPopup = undefined;
17
17
  this.ariaControls = undefined;
18
18
  this.ariaSelected = undefined;
19
+ this.ariaPressed = undefined;
19
20
  this.label = undefined;
20
21
  this.hideLabel = undefined;
21
22
  this.ariaLabel = undefined;
@@ -80,19 +81,20 @@ const Q2Btn = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
80
81
  this.iconPosition = iconPosition;
81
82
  }
82
83
  render() {
83
- const { ariaExpanded, ariaHasPopup, ariaSelected, disabled, type, tabindex } = this.buttonAttributes;
84
+ const { ariaExpanded, ariaHasPopup, ariaSelected, ariaPressed, disabled, type, tabindex } = this.buttonAttributes;
84
85
  const { iconPosition, loading, badge, label, hideLabel } = this;
85
86
  const renderLoadingSpinner = iconPosition || loading;
86
87
  const isLoadingSpinnerInline = !iconPosition || badge;
87
- return (h("button", { "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, "aria-label": hideLabel && loc(label), "aria-selected": ariaSelected, disabled: disabled, type: type, tabindex: tabindex, "test-id": "q2BtnInnerButton", class: iconPosition ? `icon-${iconPosition}` : '' }, h("div", null, renderLoadingSpinner && (h("q2-loading", { hidden: !loading, modifiers: isLoadingSpinnerInline ? 'inline' : undefined })), !hideLabel && label ? loc(label) : h("slot", { onSlotchange: this.handleSlotChange }))));
88
+ return (h("button", { "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, "aria-label": hideLabel && loc(label), "aria-selected": ariaSelected, "aria-pressed": ariaPressed, disabled: disabled, type: type, tabindex: tabindex, "test-id": "q2BtnInnerButton", class: iconPosition ? `icon-${iconPosition}` : '' }, h("div", null, renderLoadingSpinner && (h("q2-loading", { hidden: !loading, modifiers: isLoadingSpinnerInline ? 'inline' : undefined })), !hideLabel && label ? loc(label) : h("slot", { onSlotchange: this.handleSlotChange }))));
88
89
  }
89
90
  get buttonAttributes() {
90
- var _a, _b, _c;
91
+ var _a, _b, _c, _d;
91
92
  return {
92
93
  ariaExpanded: this.ariaExpanded !== undefined ? `${((_a = this.ariaExpanded) === null || _a === void 0 ? void 0 : _a.toString()) === 'true'}` : undefined,
93
94
  ariaHasPopup: this.ariaHasPopup !== undefined ? `${((_b = this.ariaHasPopup) === null || _b === void 0 ? void 0 : _b.toString()) === 'true'}` : undefined,
94
95
  ariaLabel: this.label && this.hideLabel ? loc(this.label) : undefined,
95
96
  ariaSelected: this.ariaSelected !== undefined ? `${((_c = this.ariaSelected) === null || _c === void 0 ? void 0 : _c.toString()) === 'true'}` : undefined,
97
+ ariaPressed: this.ariaPressed !== undefined ? `${((_d = this.ariaPressed) === null || _d === void 0 ? void 0 : _d.toString()) === 'true'}` : undefined,
96
98
  disabled: this.disabled || false,
97
99
  type: this.type || 'button',
98
100
  tabindex: this.tabIndex || undefined,
@@ -108,6 +110,7 @@ const Q2Btn = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
108
110
  "ariaHasPopup": [1, "aria-has-popup"],
109
111
  "ariaControls": [1, "aria-controls"],
110
112
  "ariaSelected": [1, "aria-selected"],
113
+ "ariaPressed": [1, "aria-pressed"],
111
114
  "label": [1537],
112
115
  "hideLabel": [1540, "hide-label"],
113
116
  "ariaLabel": [1537, "aria-label"],
@@ -2967,8 +2967,8 @@ const Q2Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
2967
2967
  this.textHidden = undefined;
2968
2968
  this.badgeValue = undefined;
2969
2969
  this.badgeTheme = undefined;
2970
- this.ariaControls = undefined;
2971
2970
  this.role = undefined;
2971
+ this.ariaControls = undefined;
2972
2972
  this.ariaOwns = undefined;
2973
2973
  this.ariaLabel = undefined;
2974
2974
  this.ariaHaspopup = undefined;
@@ -3232,7 +3232,7 @@ const Q2Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
3232
3232
  }
3233
3233
  /* tslint:disable:cyclomatic-complexity */
3234
3234
  inputContainerDOM() {
3235
- return (h("div", { class: "input-container" }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("span", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft })), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("q2-icon", { type: "error", class: "icon-error" }))), this.pseudo ? this.pseudoInputDOM() : this.standardInputDOM(), h("div", { class: "input-icons-container-right" }, this.canClear && (h("q2-btn", { class: "btn-clear", ariaLabel: loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput }, h("q2-icon", { type: "close", class: "icon-clear" }))), ['password', 'text', 'ssn'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.iconRight && !this.formattedValueObject.suffix && (h("q2-icon", { type: this.iconRight, class: "icon-right" })), this.hasError && this.type !== 'currency' && (h("q2-icon", { type: "error", class: "icon-error" })))));
3235
+ return (h("div", { class: "input-container", tabindex: -1 }, h("div", { class: "input-icons-container-left" }, this.formattedValueObject.prefix && (h("span", { class: "input-prefix" }, this.formattedValueObject.prefix)), this.computedIconLeft && (h("q2-icon", { type: this.computedIconLeft, class: this.computedClassForIconLeft })), this.showIconSeparator && h("div", { class: "vertical-separator" }), this.hasError && this.type === 'currency' && (h("q2-icon", { type: "error", class: "icon-error" }))), this.pseudo ? this.pseudoInputDOM() : this.standardInputDOM(), h("div", { class: "input-icons-container-right" }, this.canClear && (h("q2-btn", { class: "btn-clear", ariaLabel: loc('tecton.element.input.clear', [this.label]), "test-id": "clearButton", onClick: this.onClearInput }, h("q2-icon", { type: "close", class: "icon-clear" }))), ['password', 'text', 'ssn'].includes(this.type) && this.showVisibilityToggle && (h("q2-btn", { class: "btn-visibility-toggle", "test-id": "toggleVisibilityButton", onClick: this.onToggleVisibility }, this.visibilityToggleText)), this.formattedValueObject.suffix && (h("span", { class: "input-suffix" }, this.formattedValueObject.suffix)), this.badgeValue && (h("q2-badge", { size: "large", theme: this.badgeTheme }, this.badgeValue)), this.iconRight && !this.formattedValueObject.suffix && (h("q2-icon", { type: this.iconRight, class: "icon-right" })), this.hasError && this.type !== 'currency' && (h("q2-icon", { type: "error", class: "icon-error" })))));
3236
3236
  }
3237
3237
  /* tslint:enable:cyclomatic-complexity */
3238
3238
  /* tslint:disable:cyclomatic-complexity */
@@ -3334,8 +3334,8 @@ const Q2Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
3334
3334
  "textHidden": [1540, "text-hidden"],
3335
3335
  "badgeValue": [513, "badge-value"],
3336
3336
  "badgeTheme": [513, "badge-theme"],
3337
- "ariaControls": [1, "aria-controls"],
3338
3337
  "role": [1],
3338
+ "ariaControls": [1, "aria-controls"],
3339
3339
  "ariaOwns": [1, "aria-owns"],
3340
3340
  "ariaLabel": [1537, "aria-label"],
3341
3341
  "ariaHaspopup": [1, "aria-haspopup"],
@@ -187,7 +187,7 @@ const Q2Pill$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
187
187
  wrapperClassNames.push('has-icon');
188
188
  if (hasOptions)
189
189
  wrapperClassNames.push('has-options');
190
- return (h("click-elsewhere", { onChange: this.onClickElsewhere }, h("div", { class: wrapperClassNames.join(' ') }, h("div", { class: "btn-height-wrapper", ref: el => (this.primaryBtnWrapper = el), onClick: this.handleWrapperClick, tabIndex: -1 }, h("button", { class: "btn-primary", "test-id": "btn-control", type: "button", ref: el => (this.primaryBtn = el), onClick: this.handleClick, onKeyDown: this.handleKeydown, disabled: this.disabled, "aria-selected": !hasOptions && active ? 'true' : 'false', "aria-roledescription": !hasOptions && 'filter', "aria-controls": hasOptions && 'option-list', "aria-haspopup": hasOptions && 'true', "aria-expanded": (hasOptions && `${!!open}`) || undefined, "aria-label": this.maxLength && this.buttonContent }, this.truncatedButtonContent, !hasOptions && active && h("span", { class: "sr" }, "(", loc('tecton.element.pill.active'), ")"))), this.generateIcon()), this.hasOptions && (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.primaryBtn, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: "right" }, h("q2-option-list", { role: "menu", ref: el => (this.optionList = el), id: "option-list", onChange: this.handleChange, multiple: this.multiple, selectedOptions: this.selectedOptions, onReady: () => this.updateSelectedOptionElements() }, h("slot", null))))));
190
+ return (h("click-elsewhere", { onChange: this.onClickElsewhere }, h("div", { class: wrapperClassNames.join(' ') }, h("div", { class: "btn-height-wrapper", ref: el => (this.primaryBtnWrapper = el), onClick: this.handleWrapperClick, tabIndex: -1 }, h("button", { class: "btn-primary", "test-id": "btn-control", type: "button", role: "combobox", ref: el => (this.primaryBtn = el), onClick: this.handleClick, onKeyDown: this.handleKeydown, disabled: this.disabled, "aria-selected": !hasOptions && active ? 'true' : 'false', "aria-roledescription": !hasOptions && 'filter', "aria-controls": hasOptions && 'option-list', "aria-haspopup": hasOptions && 'true', "aria-expanded": (hasOptions && `${!!open}`) || undefined, "aria-label": this.maxLength && this.buttonContent }, this.truncatedButtonContent, !hasOptions && active && h("span", { class: "sr" }, "(", loc('tecton.element.pill.active'), ")"))), this.generateIcon()), this.hasOptions && (h("q2-popover", { ref: el => (this.popoverElement = el), controlElement: this.primaryBtn, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: "right" }, h("q2-option-list", { type: "listbox", ref: el => (this.optionList = el), id: "option-list", onChange: this.handleChange, multiple: this.multiple, selectedOptions: this.selectedOptions, onReady: () => this.updateSelectedOptionElements() }, h("slot", null))))));
191
191
  }
192
192
  get hostElement() { return this; }
193
193
  static get watchers() { return {