q2-tecton-elements 1.23.0 → 1.25.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 (212) hide show
  1. package/dist/cjs/action-sheet-4b366e9a.js +84 -0
  2. package/dist/cjs/{index-0648c2ec.js → index-dc92e71f.js} +32 -5
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/q2-action-sheet.cjs.entry.js +218 -0
  5. package/dist/cjs/q2-badge_2.cjs.entry.js +46 -17
  6. package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
  7. package/dist/cjs/q2-calendar.cjs.entry.js +2 -4
  8. package/dist/cjs/q2-card.cjs.entry.js +1 -1
  9. package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
  10. package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
  11. package/dist/cjs/q2-chart-area.cjs.entry.js +1 -1
  12. package/dist/cjs/q2-chart-bar.cjs.entry.js +1 -1
  13. package/dist/cjs/q2-chart-donut.cjs.entry.js +1 -1
  14. package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
  15. package/dist/cjs/q2-checkbox.cjs.entry.js +1 -1
  16. package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
  17. package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
  18. package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
  19. package/dist/cjs/q2-icon.cjs.entry.js +1 -1
  20. package/dist/cjs/q2-loc.cjs.entry.js +1 -1
  21. package/dist/cjs/q2-message.cjs.entry.js +1 -1
  22. package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
  23. package/dist/cjs/q2-optgroup_2.cjs.entry.js +93 -0
  24. package/dist/cjs/q2-option-list_2.cjs.entry.js +226 -86
  25. package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
  26. package/dist/cjs/q2-pill.cjs.entry.js +57 -18
  27. package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
  28. package/dist/cjs/q2-radio.cjs.entry.js +1 -1
  29. package/dist/cjs/q2-section.cjs.entry.js +1 -1
  30. package/dist/cjs/q2-select.cjs.entry.js +148 -409
  31. package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
  32. package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
  33. package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
  34. package/dist/cjs/q2-tab-container.cjs.entry.js +1 -1
  35. package/dist/cjs/q2-tag.cjs.entry.js +21 -7
  36. package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
  37. package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
  38. package/dist/collection/collection-manifest.json +1 -0
  39. package/dist/collection/components/q2-action-sheet/index.js +345 -0
  40. package/dist/collection/components/q2-action-sheet/styles.css +215 -0
  41. package/dist/collection/components/q2-calendar/index.js +2 -4
  42. package/dist/collection/components/q2-checkbox/index.js +2 -2
  43. package/dist/collection/components/q2-dropdown/index.js +1 -1
  44. package/dist/collection/components/q2-input/index.js +46 -17
  45. package/dist/collection/components/q2-loading/index.js +1 -1
  46. package/dist/collection/components/q2-optgroup/styles.css +2 -2
  47. package/dist/collection/components/q2-option/index.js +3 -58
  48. package/dist/collection/components/q2-option/styles.css +7 -0
  49. package/dist/collection/components/q2-option-list/index.js +290 -102
  50. package/dist/collection/components/q2-pill/index.js +79 -18
  51. package/dist/collection/components/q2-pill/styles.css +1 -2
  52. package/dist/collection/components/q2-popover/index.js +17 -3
  53. package/dist/collection/components/q2-popover/styles.css +10 -67
  54. package/dist/collection/components/q2-radio/index.js +2 -2
  55. package/dist/collection/components/q2-select/index.js +179 -427
  56. package/dist/collection/components/q2-select/styles.css +5 -11
  57. package/dist/collection/components/q2-tag/index.js +33 -19
  58. package/dist/collection/utils/action-sheet.js +79 -0
  59. package/dist/collection/utils/index.js +29 -5
  60. package/dist/components/action-sheet.js +81 -0
  61. package/dist/components/index.d.ts +1 -0
  62. package/dist/components/index.js +1 -0
  63. package/dist/components/index10.js +1 -1
  64. package/dist/components/index11.js +42 -353
  65. package/dist/components/index12.js +44 -99
  66. package/dist/components/index13.js +495 -583
  67. package/dist/components/index14.js +137 -0
  68. package/dist/components/index15.js +629 -0
  69. package/dist/components/index5.js +1 -1
  70. package/dist/components/index6.js +1 -1
  71. package/dist/components/index7.js +1 -1
  72. package/dist/components/index8.js +46 -17
  73. package/dist/components/index9.js +2 -2
  74. package/dist/components/q2-action-sheet.d.ts +11 -0
  75. package/dist/components/q2-action-sheet.js +282 -0
  76. package/dist/components/q2-calendar.js +2 -4
  77. package/dist/components/q2-card.js +1 -1
  78. package/dist/components/q2-carousel-pane.js +1 -1
  79. package/dist/components/q2-carousel.js +1 -1
  80. package/dist/components/q2-chart-area.js +1 -1
  81. package/dist/components/q2-chart-bar.js +1 -1
  82. package/dist/components/q2-chart-donut.js +1 -1
  83. package/dist/components/q2-checkbox-group.js +1 -1
  84. package/dist/components/q2-checkbox.js +1 -1
  85. package/dist/components/q2-dropdown.js +2 -2
  86. package/dist/components/q2-editable-field.js +1 -1
  87. package/dist/components/q2-loc.js +1 -1
  88. package/dist/components/q2-month-picker.js +1 -1
  89. package/dist/components/q2-optgroup.js +1 -70
  90. package/dist/components/q2-option-list.js +1 -1
  91. package/dist/components/q2-option.js +1 -76
  92. package/dist/components/q2-pagination.js +1 -1
  93. package/dist/components/q2-pill.js +62 -21
  94. package/dist/components/q2-popover.js +1 -1
  95. package/dist/components/q2-radio-group.js +1 -1
  96. package/dist/components/q2-radio.js +3 -3
  97. package/dist/components/q2-section.js +1 -1
  98. package/dist/components/q2-select.js +179 -427
  99. package/dist/components/q2-stepper-pane.js +1 -1
  100. package/dist/components/q2-stepper-vertical.js +1 -1
  101. package/dist/components/q2-stepper.js +1 -1
  102. package/dist/components/q2-tab-container.js +1 -1
  103. package/dist/components/q2-tag.js +25 -11
  104. package/dist/components/q2-textarea.js +1 -1
  105. package/dist/docs.d.ts +148 -0
  106. package/dist/docs.json +8755 -0
  107. package/dist/esm/action-sheet-a9597b32.js +81 -0
  108. package/dist/esm/{index-501fd22e.js → index-d4a87058.js} +30 -6
  109. package/dist/esm/loader.js +1 -1
  110. package/dist/esm/q2-action-sheet.entry.js +214 -0
  111. package/dist/esm/q2-badge_2.entry.js +46 -17
  112. package/dist/esm/q2-btn_2.entry.js +1 -1
  113. package/dist/esm/q2-calendar.entry.js +2 -4
  114. package/dist/esm/q2-card.entry.js +1 -1
  115. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  116. package/dist/esm/q2-carousel.entry.js +1 -1
  117. package/dist/esm/q2-chart-area.entry.js +1 -1
  118. package/dist/esm/q2-chart-bar.entry.js +1 -1
  119. package/dist/esm/q2-chart-donut.entry.js +1 -1
  120. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  121. package/dist/esm/q2-checkbox.entry.js +1 -1
  122. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  123. package/dist/esm/q2-dropdown.entry.js +1 -1
  124. package/dist/esm/q2-editable-field.entry.js +1 -1
  125. package/dist/esm/q2-icon.entry.js +1 -1
  126. package/dist/esm/q2-loc.entry.js +1 -1
  127. package/dist/esm/q2-message.entry.js +1 -1
  128. package/dist/esm/q2-month-picker.entry.js +1 -1
  129. package/dist/esm/q2-optgroup_2.entry.js +88 -0
  130. package/dist/esm/q2-option-list_2.entry.js +226 -86
  131. package/dist/esm/q2-pagination.entry.js +1 -1
  132. package/dist/esm/q2-pill.entry.js +57 -18
  133. package/dist/esm/q2-radio-group.entry.js +1 -1
  134. package/dist/esm/q2-radio.entry.js +1 -1
  135. package/dist/esm/q2-section.entry.js +1 -1
  136. package/dist/esm/q2-select.entry.js +148 -409
  137. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  138. package/dist/esm/q2-stepper-vertical.entry.js +1 -1
  139. package/dist/esm/q2-stepper.entry.js +1 -1
  140. package/dist/esm/q2-tab-container.entry.js +1 -1
  141. package/dist/esm/q2-tag.entry.js +22 -8
  142. package/dist/esm/q2-tecton-elements.js +1 -1
  143. package/dist/esm/q2-textarea.entry.js +1 -1
  144. package/dist/q2-tecton-elements/p-059065e4.js +1 -0
  145. package/dist/q2-tecton-elements/{p-9b101e22.entry.js → p-1a744921.entry.js} +1 -1
  146. package/dist/q2-tecton-elements/{p-3fd5d010.entry.js → p-1b95e43f.entry.js} +1 -1
  147. package/dist/q2-tecton-elements/{p-3603fcdc.entry.js → p-1ea4b8bd.entry.js} +1 -1
  148. package/dist/q2-tecton-elements/{p-53be87c8.entry.js → p-1f3eb04c.entry.js} +1 -1
  149. package/dist/q2-tecton-elements/p-25839309.entry.js +1 -0
  150. package/dist/q2-tecton-elements/{p-38a33baa.entry.js → p-274ec152.entry.js} +1 -1
  151. package/dist/q2-tecton-elements/{p-6be86940.entry.js → p-2ba9e1a2.entry.js} +1 -1
  152. package/dist/q2-tecton-elements/{p-ebd7efa5.entry.js → p-2c309c54.entry.js} +1 -1
  153. package/dist/q2-tecton-elements/{p-3e9a30c4.entry.js → p-2cc70f49.entry.js} +1 -1
  154. package/dist/q2-tecton-elements/{p-604b22a8.entry.js → p-2ceb41c4.entry.js} +1 -1
  155. package/dist/q2-tecton-elements/p-2e938b20.entry.js +1 -0
  156. package/dist/q2-tecton-elements/{p-5b1aba1a.entry.js → p-306a4bc7.entry.js} +1 -1
  157. package/dist/q2-tecton-elements/p-32f44993.entry.js +1 -0
  158. package/dist/q2-tecton-elements/{p-d7b27803.entry.js → p-3a9aac19.entry.js} +1 -1
  159. package/dist/q2-tecton-elements/p-3c73ce3f.entry.js +1 -0
  160. package/dist/q2-tecton-elements/p-4a95f78e.entry.js +1 -0
  161. package/dist/q2-tecton-elements/{p-6b7e1ebd.entry.js → p-4b48a49d.entry.js} +1 -1
  162. package/dist/q2-tecton-elements/p-4b92e44e.entry.js +1 -0
  163. package/dist/q2-tecton-elements/p-5ecb9c27.entry.js +1 -0
  164. package/dist/q2-tecton-elements/p-6779270e.entry.js +1 -0
  165. package/dist/q2-tecton-elements/{p-70b01387.entry.js → p-72fc58e7.entry.js} +1 -1
  166. package/dist/q2-tecton-elements/p-7ac02ae5.entry.js +1 -0
  167. package/dist/q2-tecton-elements/{p-78fac0fa.entry.js → p-7c168977.entry.js} +1 -1
  168. package/dist/q2-tecton-elements/{p-d27b2caa.entry.js → p-7c9bf80a.entry.js} +1 -1
  169. package/dist/q2-tecton-elements/p-83d678c7.entry.js +1 -0
  170. package/dist/q2-tecton-elements/p-a1926e65.js +1 -0
  171. package/dist/q2-tecton-elements/{p-24f4571d.entry.js → p-a3a5b57b.entry.js} +1 -1
  172. package/dist/q2-tecton-elements/p-a6296870.entry.js +1 -0
  173. package/dist/q2-tecton-elements/{p-45d61789.entry.js → p-a64e7eb1.entry.js} +1 -1
  174. package/dist/q2-tecton-elements/{p-8dea9a0c.entry.js → p-ad83984e.entry.js} +1 -1
  175. package/dist/q2-tecton-elements/{p-bf41e71b.entry.js → p-bf0ed24a.entry.js} +1 -1
  176. package/dist/q2-tecton-elements/{p-a2add94e.entry.js → p-bff85959.entry.js} +1 -1
  177. package/dist/q2-tecton-elements/{p-7aa80653.entry.js → p-c4a9ab25.entry.js} +1 -1
  178. package/dist/q2-tecton-elements/p-ea5383ba.entry.js +1 -0
  179. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  180. package/dist/test/helpers.js +3 -2
  181. package/dist/types/components/q2-action-sheet/index.d.ts +52 -0
  182. package/dist/types/components/q2-checkbox/index.d.ts +4 -1
  183. package/dist/types/components/q2-input/index.d.ts +5 -0
  184. package/dist/types/components/q2-option/index.d.ts +1 -4
  185. package/dist/types/components/q2-option-list/index.d.ts +16 -8
  186. package/dist/types/components/q2-pill/index.d.ts +10 -1
  187. package/dist/types/components/q2-popover/index.d.ts +2 -0
  188. package/dist/types/components/q2-select/index.d.ts +45 -47
  189. package/dist/types/components/q2-tag/index.d.ts +3 -3
  190. package/dist/types/components.d.ts +44 -17
  191. package/dist/types/global.d.ts +9 -2
  192. package/dist/types/utils/action-sheet.d.ts +12 -0
  193. package/dist/types/utils/index.d.ts +4 -1
  194. package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
  195. package/package.json +4 -2
  196. package/dist/cjs/q2-optgroup.cjs.entry.js +0 -56
  197. package/dist/cjs/q2-option.cjs.entry.js +0 -46
  198. package/dist/esm/q2-optgroup.entry.js +0 -52
  199. package/dist/esm/q2-option.entry.js +0 -42
  200. package/dist/q2-tecton-elements/p-18629cbf.entry.js +0 -1
  201. package/dist/q2-tecton-elements/p-2c20fc43.entry.js +0 -1
  202. package/dist/q2-tecton-elements/p-3813f51d.entry.js +0 -1
  203. package/dist/q2-tecton-elements/p-68ef0786.entry.js +0 -1
  204. package/dist/q2-tecton-elements/p-a510290a.js +0 -1
  205. package/dist/q2-tecton-elements/p-acc77332.entry.js +0 -1
  206. package/dist/q2-tecton-elements/p-ba73ee1f.entry.js +0 -1
  207. package/dist/q2-tecton-elements/p-ba76ecfd.entry.js +0 -1
  208. package/dist/q2-tecton-elements/p-bbdae095.entry.js +0 -1
  209. package/dist/q2-tecton-elements/p-d68b5eb3.entry.js +0 -1
  210. package/dist/q2-tecton-elements/p-d88e4383.entry.js +0 -1
  211. package/dist/q2-tecton-elements/p-f1d06917.entry.js +0 -1
  212. package/dist/q2-tecton-elements/p-f6e868c1.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) {
@@ -208,6 +217,11 @@ export class Q2Popover {
208
217
  }
209
218
  };
210
219
  }
220
+ static get states() {
221
+ return {
222
+ "privateDirection": {}
223
+ };
224
+ }
211
225
  static get events() {
212
226
  return [{
213
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",