q2-tecton-elements 1.25.1 → 1.26.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.
Files changed (132) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/q2-badge_2.cjs.entry.js +22 -22
  3. package/dist/cjs/q2-btn_2.cjs.entry.js +4 -4
  4. package/dist/cjs/q2-calendar.cjs.entry.js +2 -2
  5. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  6. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  7. package/dist/cjs/q2-checkbox.cjs.entry.js +4 -4
  8. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  10. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-option-list_2.cjs.entry.js +55 -16
  12. package/dist/cjs/q2-pill.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-radio-group.cjs.entry.js +8 -6
  14. package/dist/cjs/q2-radio.cjs.entry.js +4 -4
  15. package/dist/cjs/q2-select.cjs.entry.js +5 -2
  16. package/dist/cjs/q2-tab-container.cjs.entry.js +14 -2
  17. package/dist/cjs/q2-tab-pane.cjs.entry.js +6 -1
  18. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  19. package/dist/cjs/q2-tooltip.cjs.entry.js +17 -2
  20. package/dist/cjs/tecton-tab-pane.cjs.entry.js +5 -0
  21. package/dist/collection/collection-manifest.json +2 -2
  22. package/dist/collection/components/q2-btn/index.js +52 -43
  23. package/dist/collection/components/q2-calendar/index.js +48 -39
  24. package/dist/collection/components/q2-carousel/index.js +21 -18
  25. package/dist/collection/components/q2-checkbox/index.js +42 -36
  26. package/dist/collection/components/q2-checkbox-group/index.js +1 -1
  27. package/dist/collection/components/q2-dropdown/index.js +25 -22
  28. package/dist/collection/components/q2-dropdown-item/index.js +11 -8
  29. package/dist/collection/components/q2-editable-field/index.js +32 -24
  30. package/dist/collection/components/q2-input/index.js +72 -50
  31. package/dist/collection/components/q2-loading/index.js +18 -15
  32. package/dist/collection/components/q2-pill/styles.css +1 -1
  33. package/dist/collection/components/q2-popover/index.js +55 -16
  34. package/dist/collection/components/q2-popover/styles.css +1 -1
  35. package/dist/collection/components/q2-radio/index.js +24 -21
  36. package/dist/collection/components/q2-radio/styles.css +6 -6
  37. package/dist/collection/components/q2-radio-group/index.js +14 -9
  38. package/dist/collection/components/q2-select/index.js +25 -19
  39. package/dist/collection/components/q2-tab-container/index.js +18 -6
  40. package/dist/collection/components/q2-tab-pane/index.js +55 -0
  41. package/dist/collection/components/q2-tooltip/index.js +42 -3
  42. package/dist/collection/components/tecton-tab-pane/index.js +55 -0
  43. package/dist/components/index14.js +56 -17
  44. package/dist/components/index5.js +7 -7
  45. package/dist/components/index6.js +4 -4
  46. package/dist/components/index8.js +23 -23
  47. package/dist/components/index9.js +3 -3
  48. package/dist/components/q2-calendar.js +6 -6
  49. package/dist/components/q2-carousel.js +2 -2
  50. package/dist/components/q2-checkbox-group.js +1 -1
  51. package/dist/components/q2-checkbox.js +7 -7
  52. package/dist/components/q2-dropdown.js +4 -4
  53. package/dist/components/q2-editable-field.js +4 -4
  54. package/dist/components/q2-pill.js +1 -1
  55. package/dist/components/q2-radio-group.js +10 -8
  56. package/dist/components/q2-radio.js +7 -7
  57. package/dist/components/q2-select.js +6 -3
  58. package/dist/components/q2-tab-container.js +14 -2
  59. package/dist/components/q2-tab-pane.js +8 -1
  60. package/dist/components/q2-tooltip.js +19 -3
  61. package/dist/components/tecton-tab-pane.js +7 -0
  62. package/dist/docs.json +427 -40
  63. package/dist/esm/loader.js +1 -1
  64. package/dist/esm/q2-badge_2.entry.js +22 -22
  65. package/dist/esm/q2-btn_2.entry.js +4 -4
  66. package/dist/esm/q2-calendar.entry.js +2 -2
  67. package/dist/esm/q2-carousel.entry.js +1 -1
  68. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  69. package/dist/esm/q2-checkbox.entry.js +4 -4
  70. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  71. package/dist/esm/q2-dropdown.entry.js +1 -1
  72. package/dist/esm/q2-editable-field.entry.js +1 -1
  73. package/dist/esm/q2-option-list_2.entry.js +55 -16
  74. package/dist/esm/q2-pill.entry.js +1 -1
  75. package/dist/esm/q2-radio-group.entry.js +8 -6
  76. package/dist/esm/q2-radio.entry.js +4 -4
  77. package/dist/esm/q2-select.entry.js +5 -2
  78. package/dist/esm/q2-tab-container.entry.js +14 -2
  79. package/dist/esm/q2-tab-pane.entry.js +6 -1
  80. package/dist/esm/q2-tecton-elements.js +1 -1
  81. package/dist/esm/q2-tooltip.entry.js +17 -2
  82. package/dist/esm/tecton-tab-pane.entry.js +5 -0
  83. package/dist/q2-tecton-elements/p-09639e95.entry.js +1 -0
  84. package/dist/q2-tecton-elements/p-0b82891e.entry.js +1 -0
  85. package/dist/q2-tecton-elements/{p-73c12774.entry.js → p-0cbad3bc.entry.js} +1 -1
  86. package/dist/q2-tecton-elements/p-159d94cc.entry.js +1 -0
  87. package/dist/q2-tecton-elements/p-18808c27.entry.js +1 -0
  88. package/dist/q2-tecton-elements/p-4734a577.entry.js +1 -0
  89. package/dist/q2-tecton-elements/{p-fa8cb091.entry.js → p-55d192b3.entry.js} +1 -1
  90. package/dist/q2-tecton-elements/p-5878b8bd.entry.js +1 -0
  91. package/dist/q2-tecton-elements/{p-f573fe5a.entry.js → p-721d0aee.entry.js} +1 -1
  92. package/dist/q2-tecton-elements/{p-d4909df7.entry.js → p-74ac19cd.entry.js} +1 -1
  93. package/dist/q2-tecton-elements/{p-82fef3f9.entry.js → p-87cecc80.entry.js} +1 -1
  94. package/dist/q2-tecton-elements/p-8d703466.entry.js +1 -0
  95. package/dist/q2-tecton-elements/{p-3fe98171.entry.js → p-a411f2f3.entry.js} +1 -1
  96. package/dist/q2-tecton-elements/{p-30069b63.entry.js → p-a7679912.entry.js} +1 -1
  97. package/dist/q2-tecton-elements/p-b8420bfe.entry.js +1 -0
  98. package/dist/q2-tecton-elements/{p-406f8ca9.entry.js → p-bc8a507b.entry.js} +1 -1
  99. package/dist/q2-tecton-elements/{p-f83d2df5.entry.js → p-bfaff58b.entry.js} +1 -1
  100. package/dist/q2-tecton-elements/p-e43d437d.entry.js +1 -0
  101. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  102. package/dist/test/helpers.js +11 -0
  103. package/dist/types/components/q2-btn/index.d.ts +6 -3
  104. package/dist/types/components/q2-calendar/index.d.ts +5 -2
  105. package/dist/types/components/q2-carousel/index.d.ts +2 -1
  106. package/dist/types/components/q2-checkbox/index.d.ts +6 -4
  107. package/dist/types/components/q2-checkbox-group/index.d.ts +1 -1
  108. package/dist/types/components/q2-dropdown/index.d.ts +3 -2
  109. package/dist/types/components/q2-dropdown-item/index.d.ts +2 -1
  110. package/dist/types/components/q2-editable-field/index.d.ts +5 -3
  111. package/dist/types/components/q2-input/index.d.ts +31 -7
  112. package/dist/types/components/q2-loading/index.d.ts +4 -3
  113. package/dist/types/components/q2-popover/index.d.ts +5 -1
  114. package/dist/types/components/q2-radio/index.d.ts +3 -2
  115. package/dist/types/components/q2-radio-group/index.d.ts +3 -2
  116. package/dist/types/components/q2-select/index.d.ts +2 -1
  117. package/dist/types/components/q2-tab-container/index.d.ts +5 -2
  118. package/dist/types/components/q2-tab-pane/index.d.ts +3 -0
  119. package/dist/types/components/q2-tooltip/index.d.ts +4 -1
  120. package/dist/types/components/tecton-tab-pane/index.d.ts +3 -0
  121. package/dist/types/components.d.ts +140 -24
  122. package/dist/types/workspace/workspace/{tecton-production_release_1.25.x → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +2 -1
  123. package/package.json +3 -3
  124. package/dist/q2-tecton-elements/p-18d9cea8.entry.js +0 -1
  125. package/dist/q2-tecton-elements/p-2313e9a9.entry.js +0 -1
  126. package/dist/q2-tecton-elements/p-2b9c1815.entry.js +0 -1
  127. package/dist/q2-tecton-elements/p-3410c675.entry.js +0 -1
  128. package/dist/q2-tecton-elements/p-471e5d58.entry.js +0 -1
  129. package/dist/q2-tecton-elements/p-a6bfe392.entry.js +0 -1
  130. package/dist/q2-tecton-elements/p-c01d0332.entry.js +0 -1
  131. package/dist/q2-tecton-elements/p-df91e954.entry.js +0 -1
  132. package/dist/q2-tecton-elements/p-e8e113c2.entry.js +0 -1
@@ -2,7 +2,7 @@ import { h, Fragment, } from '@stencil/core';
2
2
  import { createGuid, isEventFromElement, loc, overrideFocus } from 'src/utils';
3
3
  export class Q2RadioGroup {
4
4
  constructor() {
5
- this.id = `radio-group-${createGuid()}`;
5
+ this._id = `radio-group-${createGuid()}`;
6
6
  this.onMutationObserved = () => {
7
7
  this.valueUpdated(this.value);
8
8
  this.nameUpdated();
@@ -33,8 +33,7 @@ export class Q2RadioGroup {
33
33
  /////// LIFECYCLE HOOK ///////
34
34
  componentWillLoad() {
35
35
  this.onMutationObserved();
36
- if (this.tilelayout)
37
- this.tileLayout = this.tilelayout;
36
+ this.handleDeprecatedTilelayout(this.tilelayout);
38
37
  }
39
38
  componentDidLoad() {
40
39
  const observer = new MutationObserver(this.onMutationObserved);
@@ -50,7 +49,7 @@ export class Q2RadioGroup {
50
49
  }
51
50
  nameUpdated() {
52
51
  this.radioElements.forEach(radio => {
53
- radio.name = this.name || this.id;
52
+ radio.name = this.name || this._id;
54
53
  });
55
54
  }
56
55
  disabledUpdated() {
@@ -62,8 +61,11 @@ export class Q2RadioGroup {
62
61
  const readonly = this.readonly;
63
62
  this.radioElements.forEach(radio => (radio.groupReadonly = readonly));
64
63
  }
65
- tilelayoutUpdated(tilelayout) {
64
+ handleDeprecatedTilelayout(tilelayout) {
65
+ if (typeof tilelayout !== 'boolean')
66
+ return;
66
67
  this.tileLayout = tilelayout;
68
+ this.tilelayout = undefined;
67
69
  }
68
70
  tileLayoutUpdated(tileLayout) {
69
71
  this.radioElements.forEach(radio => {
@@ -254,7 +256,7 @@ export class Q2RadioGroup {
254
256
  },
255
257
  "tileLayout": {
256
258
  "type": "boolean",
257
- "mutable": false,
259
+ "mutable": true,
258
260
  "complexType": {
259
261
  "original": "boolean",
260
262
  "resolved": "boolean",
@@ -307,7 +309,7 @@ export class Q2RadioGroup {
307
309
  },
308
310
  "tilelayout": {
309
311
  "type": "boolean",
310
- "mutable": false,
312
+ "mutable": true,
311
313
  "complexType": {
312
314
  "original": "boolean",
313
315
  "resolved": "boolean",
@@ -316,7 +318,10 @@ export class Q2RadioGroup {
316
318
  "required": false,
317
319
  "optional": false,
318
320
  "docs": {
319
- "tags": [],
321
+ "tags": [{
322
+ "name": "deprecated",
323
+ "text": undefined
324
+ }],
320
325
  "text": ""
321
326
  },
322
327
  "attribute": "tilelayout",
@@ -358,7 +363,7 @@ export class Q2RadioGroup {
358
363
  "methodName": "readonlyUpdated"
359
364
  }, {
360
365
  "propName": "tilelayout",
361
- "methodName": "tilelayoutUpdated"
366
+ "methodName": "handleDeprecatedTilelayout"
362
367
  }, {
363
368
  "propName": "tileLayout",
364
369
  "methodName": "tileLayoutUpdated"
@@ -121,7 +121,6 @@ export class Q2Select {
121
121
  this.label = undefined;
122
122
  this.hideLabel = undefined;
123
123
  this.value = undefined;
124
- this.ariaLabel = undefined;
125
124
  this.selectedOptions = [];
126
125
  this.disabled = false;
127
126
  this.readonly = false;
@@ -135,6 +134,7 @@ export class Q2Select {
135
134
  this.optional = false;
136
135
  this.placeholder = undefined;
137
136
  this.hoist = !!((_a = window.Tecton) === null || _a === void 0 ? void 0 : _a.useActionSheets);
137
+ this.ariaLabel = undefined;
138
138
  this.open = false;
139
139
  this.showSelected = false;
140
140
  this.searchText = '';
@@ -187,7 +187,10 @@ export class Q2Select {
187
187
  get popoverMinHeight() {
188
188
  const { minRows } = this;
189
189
  const firstOption = this.hostElement.querySelector('q2-option:not([hidden])');
190
- const minHeight = firstOption ? window.getComputedStyle(firstOption).minHeight : '44px';
190
+ let minHeight = firstOption && window.getComputedStyle(firstOption).minHeight;
191
+ // Safari doesn't return a min-height for non-visible items
192
+ if (!minHeight || minHeight === '0px')
193
+ minHeight = '44px';
191
194
  return minRows * parseInt(minHeight);
192
195
  }
193
196
  get selectedDisplay() {
@@ -527,23 +530,6 @@ export class Q2Select {
527
530
  "attribute": "value",
528
531
  "reflect": false
529
532
  },
530
- "ariaLabel": {
531
- "type": "string",
532
- "mutable": true,
533
- "complexType": {
534
- "original": "string",
535
- "resolved": "string",
536
- "references": {}
537
- },
538
- "required": false,
539
- "optional": false,
540
- "docs": {
541
- "tags": [],
542
- "text": ""
543
- },
544
- "attribute": "aria-label",
545
- "reflect": true
546
- },
547
533
  "selectedOptions": {
548
534
  "type": "unknown",
549
535
  "mutable": true,
@@ -769,6 +755,26 @@ export class Q2Select {
769
755
  "attribute": "hoist",
770
756
  "reflect": false,
771
757
  "defaultValue": "!!window.Tecton?.useActionSheets"
758
+ },
759
+ "ariaLabel": {
760
+ "type": "string",
761
+ "mutable": true,
762
+ "complexType": {
763
+ "original": "string",
764
+ "resolved": "string",
765
+ "references": {}
766
+ },
767
+ "required": false,
768
+ "optional": false,
769
+ "docs": {
770
+ "tags": [{
771
+ "name": "deprecated",
772
+ "text": undefined
773
+ }],
774
+ "text": ""
775
+ },
776
+ "attribute": "aria-label",
777
+ "reflect": true
772
778
  }
773
779
  };
774
780
  }
@@ -19,11 +19,13 @@ export class Q2TabContainer {
19
19
  });
20
20
  };
21
21
  this.setTabs = () => {
22
- this.tabs = this.tabPanes.map(({ label, value, badgeCount, badgeDescription }) => ({
22
+ this.tabs = this.tabPanes.map(({ label, value, badgeCount, badgeDescription, badgeTheme, badgeStatus }) => ({
23
23
  label: (label && loc(label)) || '',
24
24
  value,
25
25
  badgeCount,
26
26
  badgeDescription,
27
+ badgeTheme,
28
+ badgeStatus,
27
29
  }));
28
30
  };
29
31
  this.onTabClick = (event) => {
@@ -214,7 +216,17 @@ export class Q2TabContainer {
214
216
  return (h("li", { role: "presentation" }, h("button", { id: `tab-${this.guid}-${index}`, "data-value": value, "test-id": "tabLink", tabIndex: isSelected ? 0 : -1, role: "tab", "aria-selected": isSelected ? 'true' : 'false', "aria-controls": `tab-pane-${this.guid}-${index}`, onClick: this.onTabClick, onKeyDown: this.onTabKeyDown }, tab.badgeCount === undefined ? label : this.generateTabWithBadge(tab, isSelected))));
215
217
  }
216
218
  generateTabWithBadge(tab, isSelected) {
217
- return (h("div", { class: "tab-pane-badge", "aria-label": `${tab.label}, ${tab.badgeCount} ${tab.badgeDescription || loc('tecton.element.tab.pane.new')}` }, tab.label, h("q2-badge", { value: tab.badgeCount, theme: isSelected ? 'primary' : undefined })));
219
+ let theme;
220
+ if (!tab.badgeStatus && isSelected)
221
+ theme = tab.badgeTheme || 'primary';
222
+ let description;
223
+ if (tab.badgeDescription)
224
+ description = loc(tab.badgeDescription);
225
+ else if (tab.badgeStatus)
226
+ description = loc(`tecton.element.tab.pane.${tab.badgeStatus}`, [tab.badgeCount]);
227
+ else
228
+ description = loc('tecton.element.tab.pane.new');
229
+ return (h("div", { class: "tab-pane-badge", "aria-label": `${tab.label}, ${tab.badgeCount} ${description}` }, tab.label, h("q2-badge", { value: tab.badgeCount, theme: theme, status: tab.badgeStatus })));
218
230
  }
219
231
  static get is() { return "q2-tab-container"; }
220
232
  static get encapsulation() { return "shadow"; }
@@ -251,8 +263,8 @@ export class Q2TabContainer {
251
263
  "type": "string",
252
264
  "mutable": false,
253
265
  "complexType": {
254
- "original": "string",
255
- "resolved": "string",
266
+ "original": "'main' | 'section'",
267
+ "resolved": "\"main\" | \"section\"",
256
268
  "references": {}
257
269
  },
258
270
  "required": false,
@@ -285,8 +297,8 @@ export class Q2TabContainer {
285
297
  "type": "string",
286
298
  "mutable": false,
287
299
  "complexType": {
288
- "original": "string",
289
- "resolved": "string",
300
+ "original": "'alt' | undefined",
301
+ "resolved": "\"alt\"",
290
302
  "references": {}
291
303
  },
292
304
  "required": false,
@@ -7,6 +7,8 @@ export class Q2TabPane {
7
7
  this.selected = undefined;
8
8
  this.badgeCount = undefined;
9
9
  this.badgeDescription = undefined;
10
+ this.badgeTheme = undefined;
11
+ this.badgeStatus = undefined;
10
12
  this.index = undefined;
11
13
  this.guid = undefined;
12
14
  }
@@ -132,6 +134,50 @@ export class Q2TabPane {
132
134
  "attribute": "badge-description",
133
135
  "reflect": true
134
136
  },
137
+ "badgeTheme": {
138
+ "type": "string",
139
+ "mutable": false,
140
+ "complexType": {
141
+ "original": "Q2Badge['theme']",
142
+ "resolved": "\"primary\" | \"secondary\" | \"tertiary\"",
143
+ "references": {
144
+ "Q2Badge": {
145
+ "location": "import",
146
+ "path": "../q2-badge"
147
+ }
148
+ }
149
+ },
150
+ "required": false,
151
+ "optional": false,
152
+ "docs": {
153
+ "tags": [],
154
+ "text": ""
155
+ },
156
+ "attribute": "badge-theme",
157
+ "reflect": true
158
+ },
159
+ "badgeStatus": {
160
+ "type": "string",
161
+ "mutable": false,
162
+ "complexType": {
163
+ "original": "Q2Badge['status']",
164
+ "resolved": "\"alert\" | \"info\" | \"success\" | \"warning\"",
165
+ "references": {
166
+ "Q2Badge": {
167
+ "location": "import",
168
+ "path": "../q2-badge"
169
+ }
170
+ }
171
+ },
172
+ "required": false,
173
+ "optional": false,
174
+ "docs": {
175
+ "tags": [],
176
+ "text": ""
177
+ },
178
+ "attribute": "badge-status",
179
+ "reflect": true
180
+ },
135
181
  "index": {
136
182
  "type": "number",
137
183
  "mutable": false,
@@ -190,6 +236,15 @@ export class Q2TabPane {
190
236
  return [{
191
237
  "propName": "badgeCount",
192
238
  "methodName": "badgeObserver"
239
+ }, {
240
+ "propName": "badgeDescription",
241
+ "methodName": "badgeObserver"
242
+ }, {
243
+ "propName": "badgeTheme",
244
+ "methodName": "badgeObserver"
245
+ }, {
246
+ "propName": "badgeStatus",
247
+ "methodName": "badgeObserver"
193
248
  }];
194
249
  }
195
250
  }
@@ -1,4 +1,5 @@
1
1
  import { h, Fragment } from '@stencil/core';
2
+ import { isEventFromElement, overrideFocus } from 'src/utils';
2
3
  export class Q2Tooltip {
3
4
  constructor() {
4
5
  this.animationEndCount = 0;
@@ -7,9 +8,14 @@ export class Q2Tooltip {
7
8
  this.multiline = undefined;
8
9
  this.persistent = undefined;
9
10
  this.immediate = undefined;
11
+ this.focusable = false;
10
12
  this.position = 'n';
11
13
  this.focusClass = undefined;
12
14
  }
15
+ /// LifeCycle Hooks ///
16
+ componentDidLoad() {
17
+ overrideFocus(this.hostElement);
18
+ }
13
19
  /// Getters ///
14
20
  get shouldBeVisible() {
15
21
  if (this.persistent)
@@ -58,21 +64,30 @@ export class Q2Tooltip {
58
64
  break;
59
65
  }
60
66
  }
61
- focusHandler() {
67
+ focusCaptureHandler() {
62
68
  this.checkFocusClass();
63
69
  }
70
+ focusHandler(event) {
71
+ if (!isEventFromElement(event, this.hostElement))
72
+ return;
73
+ if (!this.focusable)
74
+ return;
75
+ this.tooltipElement.focus();
76
+ }
64
77
  focusOutHandler() {
65
78
  if (this.shouldBeVisible)
66
79
  return;
67
80
  if (this.focusClass === 'has-generic-focus')
68
81
  this.focusClass = 'has-generic-focus-out';
82
+ else
83
+ this.focusClass = null;
69
84
  }
70
85
  render() {
71
86
  const { focusClass } = this;
72
87
  const classes = ['tooltip'];
73
88
  if (focusClass)
74
89
  classes.push(focusClass);
75
- return this.label ? (h(Fragment, null, h("div", { ref: el => (this.tooltipElement = el), class: classes.join(' '), "aria-label": this.label, onAnimationEnd: () => this.animationEndHandler(), role: "tooltip" }, h("slot", null)))) : (h("slot", null));
90
+ return this.label ? (h(Fragment, null, h("div", { tabindex: this.focusable ? 0 : undefined, ref: el => (this.tooltipElement = el), class: classes.join(' '), "aria-label": this.label, onAnimationEnd: () => this.animationEndHandler(), role: "tooltip", "test-id": "tooltipContainer" }, h("slot", null)))) : (h("slot", null));
76
91
  }
77
92
  static get is() { return "q2-tooltip"; }
78
93
  static get encapsulation() { return "shadow"; }
@@ -173,6 +188,24 @@ export class Q2Tooltip {
173
188
  "attribute": "immediate",
174
189
  "reflect": true
175
190
  },
191
+ "focusable": {
192
+ "type": "boolean",
193
+ "mutable": false,
194
+ "complexType": {
195
+ "original": "boolean",
196
+ "resolved": "boolean",
197
+ "references": {}
198
+ },
199
+ "required": false,
200
+ "optional": false,
201
+ "docs": {
202
+ "tags": [],
203
+ "text": ""
204
+ },
205
+ "attribute": "focusable",
206
+ "reflect": true,
207
+ "defaultValue": "false"
208
+ },
176
209
  "position": {
177
210
  "type": "string",
178
211
  "mutable": false,
@@ -208,10 +241,16 @@ export class Q2Tooltip {
208
241
  "passive": false
209
242
  }, {
210
243
  "name": "focus",
211
- "method": "focusHandler",
244
+ "method": "focusCaptureHandler",
212
245
  "target": undefined,
213
246
  "capture": true,
214
247
  "passive": false
248
+ }, {
249
+ "name": "focus",
250
+ "method": "focusHandler",
251
+ "target": undefined,
252
+ "capture": false,
253
+ "passive": false
215
254
  }, {
216
255
  "name": "focusout",
217
256
  "method": "focusOutHandler",
@@ -19,6 +19,8 @@ export class TectonTabPane {
19
19
  this.minHeight = undefined;
20
20
  this.badgeCount = undefined;
21
21
  this.badgeDescription = undefined;
22
+ this.badgeTheme = undefined;
23
+ this.badgeStatus = undefined;
22
24
  this.authPayload = undefined;
23
25
  this.showForm = undefined;
24
26
  this._showForm = undefined;
@@ -278,6 +280,50 @@ export class TectonTabPane {
278
280
  "attribute": "badge-description",
279
281
  "reflect": true
280
282
  },
283
+ "badgeTheme": {
284
+ "type": "string",
285
+ "mutable": false,
286
+ "complexType": {
287
+ "original": "Q2Badge['theme']",
288
+ "resolved": "\"primary\" | \"secondary\" | \"tertiary\"",
289
+ "references": {
290
+ "Q2Badge": {
291
+ "location": "import",
292
+ "path": "../q2-badge"
293
+ }
294
+ }
295
+ },
296
+ "required": false,
297
+ "optional": false,
298
+ "docs": {
299
+ "tags": [],
300
+ "text": ""
301
+ },
302
+ "attribute": "badge-theme",
303
+ "reflect": true
304
+ },
305
+ "badgeStatus": {
306
+ "type": "string",
307
+ "mutable": false,
308
+ "complexType": {
309
+ "original": "Q2Badge['status']",
310
+ "resolved": "\"alert\" | \"info\" | \"success\" | \"warning\"",
311
+ "references": {
312
+ "Q2Badge": {
313
+ "location": "import",
314
+ "path": "../q2-badge"
315
+ }
316
+ }
317
+ },
318
+ "required": false,
319
+ "optional": false,
320
+ "docs": {
321
+ "tags": [],
322
+ "text": ""
323
+ },
324
+ "attribute": "badge-status",
325
+ "reflect": true
326
+ },
281
327
  "authPayload": {
282
328
  "type": "unknown",
283
329
  "mutable": false,
@@ -340,6 +386,15 @@ export class TectonTabPane {
340
386
  return [{
341
387
  "propName": "badgeCount",
342
388
  "methodName": "badgeObserver"
389
+ }, {
390
+ "propName": "badgeDescription",
391
+ "methodName": "badgeObserver"
392
+ }, {
393
+ "propName": "badgeTheme",
394
+ "methodName": "badgeObserver"
395
+ }, {
396
+ "propName": "badgeStatus",
397
+ "methodName": "badgeObserver"
343
398
  }, {
344
399
  "propName": "selected",
345
400
  "methodName": "selectedObserver"
@@ -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}.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}";
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"]]]);
@@ -18,17 +18,17 @@ const Q2Btn = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
18
18
  this.ariaSelected = undefined;
19
19
  this.label = undefined;
20
20
  this.hideLabel = undefined;
21
- this.ariaLabel = undefined;
22
21
  this.tabIndex = undefined;
23
22
  this.intent = undefined;
24
- this.color = undefined;
25
23
  this.disabled = undefined;
26
24
  this.type = undefined;
27
25
  this.loading = undefined;
28
26
  this.badge = undefined;
29
27
  this.active = undefined;
30
- this.fab = undefined;
31
28
  this.block = undefined;
29
+ this.color = undefined;
30
+ this.fab = undefined;
31
+ this.ariaLabel = undefined;
32
32
  this.iconPosition = undefined;
33
33
  }
34
34
  ////////// LIFECYCLE HOOKS ////////
@@ -110,17 +110,17 @@ const Q2Btn = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
110
110
  "ariaSelected": [1, "aria-selected"],
111
111
  "label": [1537],
112
112
  "hideLabel": [1540, "hide-label"],
113
- "ariaLabel": [1537, "aria-label"],
114
113
  "tabIndex": [2, "tab-index"],
115
- "intent": [513],
116
- "color": [513],
114
+ "intent": [1537],
117
115
  "disabled": [516],
118
116
  "type": [513],
119
117
  "loading": [516],
120
118
  "badge": [516],
121
119
  "active": [516],
122
- "fab": [516],
123
120
  "block": [516],
121
+ "color": [1537],
122
+ "fab": [516],
123
+ "ariaLabel": [1537, "aria-label"],
124
124
  "iconPosition": [32]
125
125
  }, [[2, "click", "disable"], [0, "focus", "delegateFocus"]]]);
126
126
  function defineCustomElement() {