q2-tecton-elements 1.23.0-alpha.0 → 1.24.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 (236) hide show
  1. package/dist/cjs/action-sheet-4b366e9a.js +84 -0
  2. package/dist/cjs/charting-d02cba1f.js +3127 -0
  3. package/dist/cjs/{index-3518c78c.js → index-e00b4210.js} +33 -7
  4. package/dist/cjs/{installCanvasRenderer-b4d10c92.js → installCanvasRenderer-6c4fbcc9.js} +230 -1130
  5. package/dist/cjs/installLabelLayout-d6b548fe.js +1048 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/q2-action-sheet.cjs.entry.js +218 -0
  8. package/dist/cjs/q2-badge_2.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-btn_2.cjs.entry.js +2 -2
  10. package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-card.cjs.entry.js +2 -2
  12. package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-chart-area.cjs.entry.js +4569 -0
  15. package/dist/cjs/q2-chart-bar.cjs.entry.js +25 -3133
  16. package/dist/cjs/q2-chart-donut.cjs.entry.js +9 -8
  17. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  18. package/dist/cjs/q2-checkbox.cjs.entry.js +2 -2
  19. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  22. package/dist/cjs/q2-icon.cjs.entry.js +1 -1
  23. package/dist/cjs/q2-loading-element.cjs.entry.js +1 -1
  24. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  25. package/dist/cjs/q2-message.cjs.entry.js +1 -1
  26. package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
  27. package/dist/cjs/q2-optgroup_2.cjs.entry.js +93 -0
  28. package/dist/cjs/q2-option-list_2.cjs.entry.js +230 -88
  29. package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
  30. package/dist/cjs/q2-pill.cjs.entry.js +57 -18
  31. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  32. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  33. package/dist/cjs/q2-section.cjs.entry.js +1 -1
  34. package/dist/cjs/q2-select.cjs.entry.js +149 -409
  35. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  36. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
  37. package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
  38. package/dist/cjs/q2-tab-container.cjs.entry.js +1 -1
  39. package/dist/cjs/q2-tag.cjs.entry.js +21 -6
  40. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  41. package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
  42. package/dist/collection/collection-manifest.json +2 -0
  43. package/dist/collection/components/q2-action-sheet/index.js +345 -0
  44. package/dist/collection/components/q2-action-sheet/styles.css +215 -0
  45. package/dist/collection/components/q2-card/index.js +1 -1
  46. package/dist/collection/components/q2-chart-area/index.js +622 -0
  47. package/dist/collection/components/q2-chart-area/styles.css +82 -0
  48. package/dist/collection/components/q2-chart-bar/index.js +4 -4
  49. package/dist/collection/components/q2-chart-bar/styles.css +3 -6
  50. package/dist/collection/components/q2-chart-donut/index.js +1 -1
  51. package/dist/collection/components/q2-checkbox/index.js +2 -2
  52. package/dist/collection/components/q2-checkbox/styles.css +1 -0
  53. package/dist/collection/components/q2-dropdown/index.js +1 -1
  54. package/dist/collection/components/q2-loading/index.js +1 -1
  55. package/dist/collection/components/q2-loading/skeleton/q2-loading-element/styles.css +4 -0
  56. package/dist/collection/components/q2-loading/styles.css +4 -0
  57. package/dist/collection/components/q2-optgroup/styles.css +2 -2
  58. package/dist/collection/components/q2-option/index.js +1 -56
  59. package/dist/collection/components/q2-option/styles.css +7 -0
  60. package/dist/collection/components/q2-option-list/index.js +290 -102
  61. package/dist/collection/components/q2-pill/index.js +79 -18
  62. package/dist/collection/components/q2-pill/styles.css +1 -2
  63. package/dist/collection/components/q2-popover/index.js +21 -5
  64. package/dist/collection/components/q2-popover/styles.css +10 -67
  65. package/dist/collection/components/q2-radio/index.js +2 -2
  66. package/dist/collection/components/q2-select/index.js +197 -427
  67. package/dist/collection/components/q2-select/styles.css +5 -11
  68. package/dist/collection/components/q2-tag/index.js +38 -5
  69. package/dist/collection/utils/action-sheet.js +79 -0
  70. package/dist/collection/utils/index.js +31 -7
  71. package/dist/components/action-sheet.js +81 -0
  72. package/dist/components/charting.js +3113 -0
  73. package/dist/components/index.d.ts +2 -0
  74. package/dist/components/index.js +2 -0
  75. package/dist/components/index10.js +1 -1
  76. package/dist/components/index11.js +42 -353
  77. package/dist/components/index12.js +44 -97
  78. package/dist/components/index13.js +495 -580
  79. package/dist/components/index14.js +137 -0
  80. package/dist/components/index15.js +626 -0
  81. package/dist/components/index5.js +1 -1
  82. package/dist/components/index6.js +1 -1
  83. package/dist/components/index7.js +1 -1
  84. package/dist/components/index8.js +1 -1
  85. package/dist/components/index9.js +3 -3
  86. package/dist/components/installCanvasRenderer.js +188 -1123
  87. package/dist/components/installLabelLayout.js +1042 -0
  88. package/dist/components/q2-action-sheet.d.ts +11 -0
  89. package/dist/components/q2-action-sheet.js +282 -0
  90. package/dist/components/q2-calendar.js +1 -1
  91. package/dist/components/q2-card.js +2 -2
  92. package/dist/components/q2-carousel-pane.js +1 -1
  93. package/dist/components/q2-carousel.js +1 -1
  94. package/dist/components/q2-chart-area.d.ts +11 -0
  95. package/dist/components/q2-chart-area.js +4604 -0
  96. package/dist/components/q2-chart-bar.js +11 -3119
  97. package/dist/components/q2-chart-donut.js +4 -3
  98. package/dist/components/q2-checkbox-group.js +1 -1
  99. package/dist/components/q2-checkbox.js +2 -2
  100. package/dist/components/q2-dropdown.js +2 -2
  101. package/dist/components/q2-editable-field.js +1 -1
  102. package/dist/components/q2-loading-element.js +1 -1
  103. package/dist/components/q2-loc.js +1 -1
  104. package/dist/components/q2-month-picker.js +1 -1
  105. package/dist/components/q2-optgroup.js +1 -70
  106. package/dist/components/q2-option-list.js +1 -1
  107. package/dist/components/q2-option.js +1 -76
  108. package/dist/components/q2-pagination.js +1 -1
  109. package/dist/components/q2-pill.js +62 -21
  110. package/dist/components/q2-popover.js +1 -1
  111. package/dist/components/q2-radio-group.js +1 -1
  112. package/dist/components/q2-radio.js +3 -3
  113. package/dist/components/q2-section.js +1 -1
  114. package/dist/components/q2-select.js +181 -427
  115. package/dist/components/q2-stepper-pane.js +1 -1
  116. package/dist/components/q2-stepper-vertical.js +1 -1
  117. package/dist/components/q2-stepper.js +1 -1
  118. package/dist/components/q2-tab-container.js +1 -1
  119. package/dist/components/q2-tag.js +24 -8
  120. package/dist/components/q2-textarea.js +1 -1
  121. package/dist/esm/action-sheet-a9597b32.js +81 -0
  122. package/dist/esm/charting-2a73ba8e.js +3113 -0
  123. package/dist/esm/{index-9c591682.js → index-ca21e539.js} +32 -8
  124. package/dist/esm/{installCanvasRenderer-0143b52d.js → installCanvasRenderer-4a470516.js} +188 -1123
  125. package/dist/esm/installLabelLayout-d660eaad.js +1042 -0
  126. package/dist/esm/loader.js +1 -1
  127. package/dist/esm/q2-action-sheet.entry.js +214 -0
  128. package/dist/esm/q2-badge_2.entry.js +1 -1
  129. package/dist/esm/q2-btn_2.entry.js +2 -2
  130. package/dist/esm/q2-calendar.entry.js +1 -1
  131. package/dist/esm/q2-card.entry.js +2 -2
  132. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  133. package/dist/esm/q2-carousel.entry.js +1 -1
  134. package/dist/esm/q2-chart-area.entry.js +4565 -0
  135. package/dist/esm/q2-chart-bar.entry.js +11 -3119
  136. package/dist/esm/q2-chart-donut.entry.js +4 -3
  137. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  138. package/dist/esm/q2-checkbox.entry.js +2 -2
  139. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  140. package/dist/esm/q2-dropdown.entry.js +1 -1
  141. package/dist/esm/q2-editable-field.entry.js +1 -1
  142. package/dist/esm/q2-icon.entry.js +1 -1
  143. package/dist/esm/q2-loading-element.entry.js +1 -1
  144. package/dist/esm/q2-loc.entry.js +1 -1
  145. package/dist/esm/q2-message.entry.js +1 -1
  146. package/dist/esm/q2-month-picker.entry.js +1 -1
  147. package/dist/esm/q2-optgroup_2.entry.js +88 -0
  148. package/dist/esm/q2-option-list_2.entry.js +230 -88
  149. package/dist/esm/q2-pagination.entry.js +1 -1
  150. package/dist/esm/q2-pill.entry.js +57 -18
  151. package/dist/esm/q2-radio-group.entry.js +1 -1
  152. package/dist/esm/q2-radio.entry.js +1 -1
  153. package/dist/esm/q2-section.entry.js +1 -1
  154. package/dist/esm/q2-select.entry.js +149 -409
  155. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  156. package/dist/esm/q2-stepper-vertical.entry.js +1 -1
  157. package/dist/esm/q2-stepper.entry.js +1 -1
  158. package/dist/esm/q2-tab-container.entry.js +1 -1
  159. package/dist/esm/q2-tag.entry.js +21 -6
  160. package/dist/esm/q2-tecton-elements.js +1 -1
  161. package/dist/esm/q2-textarea.entry.js +1 -1
  162. package/dist/q2-tecton-elements/{p-db873db2.entry.js → p-0473f4f7.entry.js} +1 -1
  163. package/dist/q2-tecton-elements/{p-520c40f6.entry.js → p-13a1390b.entry.js} +1 -1
  164. package/dist/q2-tecton-elements/{p-9ebb283a.entry.js → p-13deb3ed.entry.js} +1 -1
  165. package/dist/q2-tecton-elements/{p-0ba564b1.entry.js → p-1d854203.entry.js} +1 -1
  166. package/dist/q2-tecton-elements/p-1f71774f.entry.js +1 -0
  167. package/dist/q2-tecton-elements/{p-18cc4758.entry.js → p-256d3fe6.entry.js} +1 -1
  168. package/dist/q2-tecton-elements/{p-9281adaa.entry.js → p-282f0f8c.entry.js} +1 -1
  169. package/dist/q2-tecton-elements/{p-2d2c5af2.entry.js → p-30969629.entry.js} +1 -1
  170. package/dist/q2-tecton-elements/p-30cd888b.entry.js +1 -0
  171. package/dist/q2-tecton-elements/{p-fc134a5d.entry.js → p-37cf9c97.entry.js} +1 -1
  172. package/dist/q2-tecton-elements/{p-fb37e67e.entry.js → p-388349b5.entry.js} +1 -1
  173. package/dist/q2-tecton-elements/p-458b1987.js +1 -0
  174. package/dist/q2-tecton-elements/p-52063431.js +39 -0
  175. package/dist/q2-tecton-elements/p-5589ae0f.entry.js +1 -0
  176. package/dist/q2-tecton-elements/p-619aed74.entry.js +1 -0
  177. package/dist/q2-tecton-elements/{p-4625184b.entry.js → p-63b67260.entry.js} +1 -1
  178. package/dist/q2-tecton-elements/{p-e4dc9ac0.entry.js → p-63e363ad.entry.js} +1 -1
  179. package/dist/q2-tecton-elements/{p-cbd1289a.entry.js → p-6736df05.entry.js} +1 -1
  180. package/dist/q2-tecton-elements/p-72fe10cc.entry.js +1 -0
  181. package/dist/q2-tecton-elements/{p-c4640b55.entry.js → p-75b817c6.entry.js} +1 -1
  182. package/dist/q2-tecton-elements/{p-c3f27fe2.entry.js → p-7a116095.entry.js} +1 -1
  183. package/dist/q2-tecton-elements/p-7c94119b.entry.js +1 -0
  184. package/dist/q2-tecton-elements/p-833398d1.js +1 -0
  185. package/dist/q2-tecton-elements/{p-ce015552.entry.js → p-90572e43.entry.js} +1 -1
  186. package/dist/q2-tecton-elements/p-91153c61.entry.js +1 -0
  187. package/dist/q2-tecton-elements/p-9792de8a.entry.js +1 -0
  188. package/dist/q2-tecton-elements/p-9acfa94e.js +1 -0
  189. package/dist/q2-tecton-elements/p-a1926e65.js +1 -0
  190. package/dist/q2-tecton-elements/{p-ffb48ccc.entry.js → p-b3a8cdc5.entry.js} +1 -1
  191. package/dist/q2-tecton-elements/p-ce3f203c.entry.js +1 -0
  192. package/dist/q2-tecton-elements/{p-041b3a82.entry.js → p-ce91cd9b.entry.js} +1 -1
  193. package/dist/q2-tecton-elements/{p-b8b00394.entry.js → p-cefc9d0b.entry.js} +1 -1
  194. package/dist/q2-tecton-elements/p-d05beeb7.entry.js +1 -0
  195. package/dist/q2-tecton-elements/p-dc7c8371.entry.js +1 -0
  196. package/dist/q2-tecton-elements/{p-16c11d74.entry.js → p-e58581fc.entry.js} +1 -1
  197. package/dist/q2-tecton-elements/{p-f800fd1e.entry.js → p-e886c55b.entry.js} +1 -1
  198. package/dist/q2-tecton-elements/{p-6e6b5b80.entry.js → p-f0ec4d2c.entry.js} +1 -1
  199. package/dist/q2-tecton-elements/{p-97aa8423.entry.js → p-f94e7043.entry.js} +1 -1
  200. package/dist/q2-tecton-elements/{p-c444a60b.entry.js → p-fcb7d191.entry.js} +1 -1
  201. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  202. package/dist/test/helpers.js +3 -2
  203. package/dist/types/components/q2-action-sheet/index.d.ts +52 -0
  204. package/dist/types/components/q2-card/index.d.ts +1 -1
  205. package/dist/types/components/q2-chart-area/index.d.ts +40 -0
  206. package/dist/types/components/q2-chart-bar/index.d.ts +2 -2
  207. package/dist/types/components/q2-chart-donut/index.d.ts +1 -1
  208. package/dist/types/components/q2-checkbox/index.d.ts +4 -1
  209. package/dist/types/components/q2-option/index.d.ts +0 -3
  210. package/dist/types/components/q2-option-list/index.d.ts +16 -8
  211. package/dist/types/components/q2-pill/index.d.ts +10 -1
  212. package/dist/types/components/q2-popover/index.d.ts +2 -0
  213. package/dist/types/components/q2-select/index.d.ts +46 -47
  214. package/dist/types/components/q2-tag/index.d.ts +3 -2
  215. package/dist/types/components.d.ts +100 -13
  216. package/dist/types/global.d.ts +10 -1
  217. package/dist/types/utils/action-sheet.d.ts +12 -0
  218. package/dist/types/utils/index.d.ts +3 -1
  219. package/dist/types/workspace/workspace/{_production_release_1.22.x-alpha → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
  220. package/package.json +3 -2
  221. package/dist/cjs/q2-optgroup.cjs.entry.js +0 -56
  222. package/dist/cjs/q2-option.cjs.entry.js +0 -46
  223. package/dist/esm/q2-optgroup.entry.js +0 -52
  224. package/dist/esm/q2-option.entry.js +0 -42
  225. package/dist/q2-tecton-elements/p-0d8dd75a.entry.js +0 -1
  226. package/dist/q2-tecton-elements/p-0fad9c5a.entry.js +0 -1
  227. package/dist/q2-tecton-elements/p-1f85cced.js +0 -39
  228. package/dist/q2-tecton-elements/p-2c9b1308.entry.js +0 -1
  229. package/dist/q2-tecton-elements/p-5e374fbd.js +0 -1
  230. package/dist/q2-tecton-elements/p-6b52a262.entry.js +0 -1
  231. package/dist/q2-tecton-elements/p-aaf42539.entry.js +0 -1
  232. package/dist/q2-tecton-elements/p-cf41970f.entry.js +0 -1
  233. package/dist/q2-tecton-elements/p-de164483.entry.js +0 -1
  234. package/dist/q2-tecton-elements/p-e6d26f39.entry.js +0 -1
  235. package/dist/q2-tecton-elements/p-f1d06917.entry.js +0 -1
  236. package/dist/q2-tecton-elements/p-f35bf6a3.entry.js +0 -1
@@ -1,10 +1,19 @@
1
- import { h } from '@stencil/core';
1
+ import { h, } from '@stencil/core';
2
2
  import { isEventFromElement, loc, overrideFocus, resizeIframe } from 'src/utils';
3
+ import { shouldShowActionSheet, showActionSheetList } from 'src/utils/action-sheet';
3
4
  export class Q2Pill {
4
5
  constructor() {
6
+ var _a;
5
7
  this.scheduledAfterRender = [];
6
8
  this.activateFirstOption = false;
7
9
  /// Helpers ///
10
+ this.updateSelectedOptionElements = async () => {
11
+ var _a;
12
+ const { selectedOptions } = this;
13
+ const selectedValues = selectedOptions.map(option => option.value);
14
+ const options = await ((_a = this.optionList) === null || _a === void 0 ? void 0 : _a.getOptions());
15
+ this.selectedOptionElements = options === null || options === void 0 ? void 0 : options.filter(option => selectedValues.includes(option.value));
16
+ };
8
17
  this.determineHasOptions = () => {
9
18
  const hasOptions = !!this.hostElement.querySelectorAll('q2-option').length;
10
19
  this.hasOptions = hasOptions;
@@ -24,7 +33,12 @@ export class Q2Pill {
24
33
  return;
25
34
  if (this.hasOptions) {
26
35
  this.activateFirstOption = false;
27
- await this.popoverElement.toggle();
36
+ if (shouldShowActionSheet(this)) {
37
+ this.executeActionSheet(event);
38
+ }
39
+ else {
40
+ await this.popoverElement.toggle();
41
+ }
28
42
  }
29
43
  else {
30
44
  const { value, label } = this;
@@ -38,23 +52,22 @@ export class Q2Pill {
38
52
  });
39
53
  }
40
54
  };
41
- this.handleKeydown = (event) => {
55
+ this.handleKeydown = async (event) => {
42
56
  if (!this.hasOptions || this.disabled)
43
57
  return;
44
- this.activateFirstOption = true;
45
- this.optionList.handleExternalKeydown(event);
58
+ if (shouldShowActionSheet(this, event)) {
59
+ this.executeActionSheet(event);
60
+ }
61
+ else {
62
+ this.activateFirstOption = true;
63
+ this.optionList.handleExternalKeydown(event);
64
+ }
46
65
  };
47
66
  this.handleChange = event => {
48
67
  event.stopPropagation();
49
68
  if (!this.hasOptions)
50
69
  return;
51
- const { value, values } = event.detail;
52
- const isActive = !!values.length;
53
- if (!this.hostElement.onchange) {
54
- this.selectedOptions = values;
55
- this.active = isActive;
56
- }
57
- this.change.emit({ value, values, active: isActive });
70
+ this.handleSelectionChanges(event.detail);
58
71
  };
59
72
  this.handleWrapperClick = () => {
60
73
  this.primaryBtn.focus();
@@ -67,6 +80,7 @@ export class Q2Pill {
67
80
  this.popoverElement.open = false;
68
81
  }
69
82
  };
83
+ this.hoist = !!((_a = window.Tecton) === null || _a === void 0 ? void 0 : _a.useActionSheets);
70
84
  this.disabled = undefined;
71
85
  this.active = undefined;
72
86
  this.open = undefined;
@@ -79,6 +93,7 @@ export class Q2Pill {
79
93
  this.popoverMinHeight = 150;
80
94
  this.popoverDirection = undefined;
81
95
  this.hasOptions = undefined;
96
+ this.selectedOptionElements = [];
82
97
  }
83
98
  /// LifeCycle Hooks ///
84
99
  componentWillLoad() {
@@ -99,11 +114,11 @@ export class Q2Pill {
99
114
  }
100
115
  /// Getters ///
101
116
  get buttonContent() {
102
- const { label, selectedOptions, hasOptions } = this;
103
- if (!hasOptions || selectedOptions.length === 0)
117
+ const { label, selectedOptions, selectedOptionElements, hasOptions } = this;
118
+ if (!hasOptions || selectedOptionElements.length === 0)
104
119
  return label;
105
- else if (selectedOptions.length === 1)
106
- return selectedOptions[0].display;
120
+ else if (selectedOptionElements.length === 1)
121
+ return selectedOptionElements[0].display;
107
122
  return loc('tecton.element.pill.activeCount', { count: selectedOptions.length });
108
123
  }
109
124
  get truncatedButtonContent() {
@@ -113,6 +128,27 @@ export class Q2Pill {
113
128
  else
114
129
  return buttonContent;
115
130
  }
131
+ async executeActionSheet(event) {
132
+ const result = await showActionSheetList(this, event);
133
+ this.handleSelectionChanges(result);
134
+ }
135
+ handleSelectionChanges(changeDetails) {
136
+ const { value = '', values = [] } = changeDetails;
137
+ const isActive = !!values.length;
138
+ if (!this.hostElement.onchange) {
139
+ this.selectedOptions = values;
140
+ this.active = isActive;
141
+ }
142
+ this.change.emit({
143
+ value,
144
+ values,
145
+ active: isActive,
146
+ });
147
+ }
148
+ /// Watchers ///
149
+ selectedOptionsWatcher() {
150
+ this.updateSelectedOptionElements();
151
+ }
116
152
  /// Listeners ///
117
153
  delegateFocus(event) {
118
154
  if (!isEventFromElement(event, this.hostElement))
@@ -146,7 +182,7 @@ export class Q2Pill {
146
182
  wrapperClassNames.push('has-icon');
147
183
  if (hasOptions)
148
184
  wrapperClassNames.push('has-options');
149
- 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.primaryBtnWrapper, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection }, h("q2-option-list", { ref: el => (this.optionList = el), id: "option-list", onChange: this.handleChange, multiple: this.multiple, selectedOptions: this.selectedOptions }, h("slot", null))))));
185
+ 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.primaryBtnWrapper, open: this.open, minHeight: this.popoverMinHeight, direction: this.popoverDirection, align: "right" }, h("q2-option-list", { ref: el => (this.optionList = el), id: "option-list", onChange: this.handleChange, multiple: this.multiple, selectedOptions: this.selectedOptions, onReady: () => this.updateSelectedOptionElements() }, h("slot", null))))));
150
186
  }
151
187
  static get is() { return "q2-pill"; }
152
188
  static get encapsulation() { return "shadow"; }
@@ -162,6 +198,24 @@ export class Q2Pill {
162
198
  }
163
199
  static get properties() {
164
200
  return {
201
+ "hoist": {
202
+ "type": "boolean",
203
+ "mutable": false,
204
+ "complexType": {
205
+ "original": "boolean",
206
+ "resolved": "boolean",
207
+ "references": {}
208
+ },
209
+ "required": false,
210
+ "optional": false,
211
+ "docs": {
212
+ "tags": [],
213
+ "text": ""
214
+ },
215
+ "attribute": "hoist",
216
+ "reflect": false,
217
+ "defaultValue": "!!window.Tecton?.useActionSheets"
218
+ },
165
219
  "disabled": {
166
220
  "type": "boolean",
167
221
  "mutable": false,
@@ -358,7 +412,8 @@ export class Q2Pill {
358
412
  }
359
413
  static get states() {
360
414
  return {
361
- "hasOptions": {}
415
+ "hasOptions": {},
416
+ "selectedOptionElements": {}
362
417
  };
363
418
  }
364
419
  static get events() {
@@ -385,6 +440,12 @@ export class Q2Pill {
385
440
  }];
386
441
  }
387
442
  static get elementRef() { return "hostElement"; }
443
+ static get watchers() {
444
+ return [{
445
+ "propName": "selectedOptions",
446
+ "methodName": "selectedOptionsWatcher"
447
+ }];
448
+ }
388
449
  static get listeners() {
389
450
  return [{
390
451
  "name": "focus",
@@ -232,6 +232,5 @@ div.btn-close {
232
232
  }
233
233
 
234
234
  q2-popover {
235
- position: relative;
236
- top: calc((var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2 * -1);
235
+ top: calc(var(--comp-pill-min-height) - (var(--comp-pill-min-height) - var(--comp-pill-btn-height)) / 2);
237
236
  }
@@ -1,13 +1,15 @@
1
1
  import { h, } from '@stencil/core';
2
+ import { nextPaint, resizeIframe } from 'src/utils';
2
3
  export class Q2Popover {
3
4
  constructor() {
4
- this.privateDirection = 'down';
5
+ this.scheduledAfterRender = [];
5
6
  this.direction = undefined;
6
7
  this.align = undefined;
7
8
  this.open = undefined;
8
9
  this.block = undefined;
9
10
  this.minHeight = undefined;
10
11
  this.controlElement = undefined;
12
+ this.privateDirection = 'down';
11
13
  }
12
14
  /// Lifecycle hooks ///
13
15
  componentDidLoad() {
@@ -15,8 +17,14 @@ export class Q2Popover {
15
17
  this.determinePopDirection();
16
18
  }
17
19
  componentWillRender() {
18
- if (this.containerElement && this.containerElement && this.open)
19
- this.determinePopDirection();
20
+ if (this.containerElement && this.open)
21
+ nextPaint(() => this.determinePopDirection());
22
+ }
23
+ componentDidRender() {
24
+ setTimeout(() => {
25
+ this.scheduledAfterRender.forEach(fn => fn());
26
+ this.scheduledAfterRender = [];
27
+ }, 25);
20
28
  }
21
29
  /// Methods ///
22
30
  async toggle() {
@@ -25,6 +33,7 @@ export class Q2Popover {
25
33
  /// Watchers ///
26
34
  openChanged(open) {
27
35
  this.popoverStateChanged.emit({ open });
36
+ this.scheduledAfterRender.push(resizeIframe);
28
37
  }
29
38
  /// Listeners ///
30
39
  popoverStateHandler(event) {
@@ -36,7 +45,7 @@ export class Q2Popover {
36
45
  }
37
46
  /// Helpers ///
38
47
  determinePopDirection() {
39
- var _a;
48
+ var _a, _b, _c, _d, _e;
40
49
  const { containerElement, contentElement, direction, controlElement } = this;
41
50
  if (containerElement)
42
51
  containerElement.style.maxHeight = null;
@@ -48,7 +57,9 @@ export class Q2Popover {
48
57
  top: 0,
49
58
  height: 0,
50
59
  };
51
- const bottomOffset = window.innerHeight - topOffset - height;
60
+ const scrollY = ((_c = (_b = window.Tecton) === null || _b === void 0 ? void 0 : _b.platformDimensions) === null || _c === void 0 ? void 0 : _c.scrollY) || 0;
61
+ const innerHeight = ((_e = (_d = window.Tecton) === null || _d === void 0 ? void 0 : _d.platformDimensions) === null || _e === void 0 ? void 0 : _e.innerHeight) || window.innerHeight;
62
+ const bottomOffset = scrollY + innerHeight - topOffset - height;
52
63
  const canShowFullSizeBelow = bottomOffset > contentHeight;
53
64
  const canShowFullSizeAbove = contentHeight <= topOffset;
54
65
  // Prefer full size above or below
@@ -206,6 +217,11 @@ export class Q2Popover {
206
217
  }
207
218
  };
208
219
  }
220
+ static get states() {
221
+ return {
222
+ "privateDirection": {}
223
+ };
224
+ }
209
225
  static get events() {
210
226
  return [{
211
227
  "method": "popoverStateChanged",
@@ -65,84 +65,26 @@ button {
65
65
  visibility: hidden;
66
66
  }
67
67
 
68
- * {
69
- box-sizing: border-box;
70
- }
71
-
72
- *:active {
73
- outline: none;
74
- }
75
-
76
- *:focus {
77
- outline: none;
78
- box-shadow: var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C);
79
- }
80
-
81
68
  :host {
82
- box-shadow: none !important;
83
- }
84
-
85
- ::-moz-focus-inner {
86
- border: none;
87
- }
88
-
89
- input,
90
- textarea,
91
- button {
92
- font-family: inherit;
93
- font-size: inherit;
94
- font-stretch: inherit;
95
- }
96
-
97
- :host(.sr),
98
- :host(.sr) button {
99
- border: 0;
100
- clip: rect(0 0 0 0);
101
- height: 1px;
102
- margin: -1px;
103
- overflow: hidden;
104
- padding: 0;
105
- position: absolute;
106
- width: 1px;
107
- white-space: nowrap;
69
+ display: block;
70
+ width: 100%;
108
71
  }
109
72
 
110
- .sr,
111
- .sr button {
112
- border: 0;
113
- clip: rect(0 0 0 0);
114
- height: 1px;
115
- margin: -1px;
116
- overflow: hidden;
117
- padding: 0;
73
+ :host([align=right]) {
74
+ display: block;
118
75
  position: absolute;
119
- width: 1px;
120
- white-space: nowrap;
121
- }
122
-
123
- .hidden {
124
- display: none;
125
- }
126
-
127
- :host([hidden]) {
128
- display: none;
129
- }
130
-
131
- .invisible {
132
- visibility: hidden;
133
- }
134
-
135
- :host {
136
- display: inline-flex;
137
- width: 100%;
76
+ right: 0;
77
+ text-align: end;
78
+ left: unset;
138
79
  }
139
80
 
140
81
  .container {
141
- display: block;
82
+ display: none;
142
83
  overflow: hidden;
143
84
  opacity: 0;
144
85
  height: 0;
145
86
  position: absolute;
87
+ top: var(--tct-popover-top, var(--t-popover-top, initial));
146
88
  visibility: hidden;
147
89
  background-color: var(--tct-popover-background-color, var(--t-popover-background-color, var(--app-white, #ffffff)));
148
90
  color: var(--tct-popover-text-color, var(--t-popover-text-color, var(--t-text, #4d4d4d)));
@@ -178,6 +120,7 @@ button {
178
120
  left: unset;
179
121
  right: unset;
180
122
  width: 100%;
123
+ min-width: unset;
181
124
  }
182
125
  :host([align=right]) .container {
183
126
  right: 0;
@@ -75,7 +75,7 @@ export class Q2Radio {
75
75
  return {
76
76
  "label": {
77
77
  "type": "string",
78
- "mutable": false,
78
+ "mutable": true,
79
79
  "complexType": {
80
80
  "original": "string",
81
81
  "resolved": "string",
@@ -179,7 +179,7 @@ export class Q2Radio {
179
179
  },
180
180
  "ariaLabel": {
181
181
  "type": "string",
182
- "mutable": false,
182
+ "mutable": true,
183
183
  "complexType": {
184
184
  "original": "string",
185
185
  "resolved": "string",