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
@@ -0,0 +1,345 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { h, Fragment, } from '@stencil/core';
14
+ import { loc, waitForNextPaint } from 'src/utils';
15
+ export class Q2ActionSheet {
16
+ constructor() {
17
+ this.initialSelectedOptions = [];
18
+ this.selectedOptions = { values: [], value: '' };
19
+ this.minHeight = 0.2;
20
+ this.maxHeight = 0.75;
21
+ this.generateOption = (option) => {
22
+ const optionElement = document.createElement('q2-option');
23
+ const { innerHTML } = option, attributes = __rest(option, ["innerHTML"]);
24
+ if (option.innerHTML)
25
+ optionElement.innerHTML = option.innerHTML;
26
+ Object.entries(attributes).forEach(([key, value]) => {
27
+ if (value === undefined)
28
+ return;
29
+ if (typeof value === 'boolean') {
30
+ if (value)
31
+ optionElement.setAttribute(key, '');
32
+ }
33
+ else {
34
+ optionElement.setAttribute(key, value);
35
+ }
36
+ });
37
+ return optionElement;
38
+ };
39
+ this.generateOptgroup = (option) => {
40
+ const optgroupElement = document.createElement('q2-optgroup');
41
+ if (option.label)
42
+ optgroupElement.setAttribute('label', option.label);
43
+ if (option.disabled)
44
+ optgroupElement.setAttribute('disabled', '');
45
+ if (!!option.options.length)
46
+ option.options.forEach(opt => optgroupElement.appendChild(this.generateOption(opt)));
47
+ return optgroupElement;
48
+ };
49
+ /// Event Handlers ///
50
+ this.onClick = (event) => {
51
+ const eventTarget = event.target;
52
+ if (!(eventTarget instanceof HTMLElement))
53
+ return;
54
+ const isInContent = !!eventTarget.closest('.interior, q2-action-sheet');
55
+ if (isInContent)
56
+ return;
57
+ this.onCancel(event);
58
+ };
59
+ this.onCancel = (event) => {
60
+ var _a, _b;
61
+ event.preventDefault();
62
+ const { initialSelectedOptions } = this;
63
+ this.hide({
64
+ value: (_b = (_a = initialSelectedOptions === null || initialSelectedOptions === void 0 ? void 0 : initialSelectedOptions[0]) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '',
65
+ values: initialSelectedOptions,
66
+ type: 'cancel',
67
+ });
68
+ };
69
+ this.onListChange = (event) => {
70
+ this.selectedOptions = event.detail;
71
+ };
72
+ this.onListPopoverStateChange = (event) => {
73
+ if (event.detail.open)
74
+ return;
75
+ if (event.detail.action === 'close') {
76
+ this.onCancel(event);
77
+ }
78
+ else {
79
+ this.onListDone();
80
+ }
81
+ };
82
+ this.onListDone = () => {
83
+ this.hide(Object.assign(Object.assign({}, this.selectedOptions), { type: 'confirm' }));
84
+ };
85
+ /// DOM ///
86
+ this.renderSlot = () => {
87
+ return (h("div", { class: "content", ref: el => (this.contentElement = el) }, h("slot", null)));
88
+ };
89
+ this.renderMessage = ({ data }) => {
90
+ return (h("q2-message", { type: data.type }, data.title && h("h2", null, data.title), data.description && h("p", null, data.description)));
91
+ };
92
+ this.renderList = ({ data }) => {
93
+ const { listProps } = data;
94
+ return (h(Fragment, null, h("div", { class: "content", ref: el => (this.contentElement = el) }, h("q2-option-list", { ref: el => (this.optionListElement = el), multiple: listProps.multiple, noSelect: listProps.noSelect, onChange: this.onListChange, onPopoverState: this.onListPopoverStateChange, selectedOptions: listProps.selectedOptions }, h("slot", null))), h("footer", null, listProps.multiple && (h("q2-btn", { "test-id": "btnDone", intent: "workflow-primary", onClick: this.onListDone }, loc('tecton.element.actionSheet.done'))))));
95
+ };
96
+ this.data = undefined;
97
+ this.hideClose = undefined;
98
+ this.isScrollable = false;
99
+ this.renderStatus = 'is-closing';
100
+ }
101
+ /// LifeCycle Hooks ///
102
+ componentDidLoad() {
103
+ this.dialogElement.addEventListener('cancel', this.onCancel);
104
+ this.ready.emit();
105
+ }
106
+ disconnectedCallback() {
107
+ this.dialogElement.removeEventListener('cancel', this.onCancel);
108
+ }
109
+ /// Helpers ///
110
+ storeInitialValues() {
111
+ const { data } = this;
112
+ if (!data)
113
+ return;
114
+ if (data.appearance === 'list') {
115
+ this.initialSelectedOptions = data.listProps.selectedOptions;
116
+ }
117
+ }
118
+ focusContent() {
119
+ const { data } = this;
120
+ if (!data)
121
+ return;
122
+ if (data.appearance === 'list') {
123
+ const { event } = data;
124
+ if (event instanceof KeyboardEvent) {
125
+ this.optionListElement.handleExternalKeydown(event);
126
+ }
127
+ else {
128
+ this.optionListElement.focus();
129
+ }
130
+ }
131
+ }
132
+ hidePostHook() {
133
+ const { data } = this;
134
+ if (!data)
135
+ return;
136
+ if (data.appearance === 'list') {
137
+ this.hostElement.innerHTML = null;
138
+ }
139
+ }
140
+ showPreHook() {
141
+ const { data } = this;
142
+ if (!data)
143
+ return;
144
+ if (data.appearance === 'list') {
145
+ this.hostElement.innerHTML = null;
146
+ data.options.forEach(option => {
147
+ this.hostElement.appendChild('options' in option ? this.generateOptgroup(option) : this.generateOption(option));
148
+ });
149
+ }
150
+ }
151
+ updateDialogMinMaxHeight() {
152
+ const windowHeight = window.innerHeight;
153
+ this.dialogElement.style.setProperty('--comp-dialog-min-height', `${Math.floor(windowHeight * this.minHeight)}px`);
154
+ this.dialogElement.style.setProperty('--comp-dialog-max-height', `${Math.floor(windowHeight * this.maxHeight)}px`);
155
+ }
156
+ /// Methods ///
157
+ async hide(data = { value: '', values: [], type: 'confirm' }) {
158
+ this.close.emit(data);
159
+ this.renderStatus = 'is-closing';
160
+ this.dialogElement.addEventListener('transitionend', () => {
161
+ this.dialogElement.close();
162
+ this.renderStatus = null;
163
+ this.data = undefined;
164
+ this.initialSelectedOptions = [];
165
+ this.selectedOptions = { values: [], value: '' };
166
+ this.hidePostHook();
167
+ }, { once: true });
168
+ }
169
+ async show() {
170
+ this.showPreHook();
171
+ await waitForNextPaint();
172
+ this.updateDialogMinMaxHeight();
173
+ this.storeInitialValues();
174
+ if (this.dialogElement.open)
175
+ return;
176
+ this.dialogElement.showModal();
177
+ this.renderStatus = 'is-opening';
178
+ this.dialogElement.addEventListener('transitionend', () => {
179
+ this.renderStatus = 'is-open';
180
+ this.focusContent();
181
+ }, { once: true });
182
+ }
183
+ render() {
184
+ var _a;
185
+ const { data } = this;
186
+ const showHeader = (data === null || data === void 0 ? void 0 : data.title) || !this.hideClose;
187
+ const renderStatus = this.renderStatus || '';
188
+ let RenderContent = null;
189
+ switch (data === null || data === void 0 ? void 0 : data.appearance) {
190
+ case 'message':
191
+ RenderContent = this.renderMessage;
192
+ break;
193
+ case 'list':
194
+ RenderContent = this.renderList;
195
+ break;
196
+ default:
197
+ RenderContent = this.renderSlot;
198
+ break;
199
+ }
200
+ const appearance = (data === null || data === void 0 ? void 0 : data.appearance) || 'slot';
201
+ const interiorClasses = `interior is-${appearance}`;
202
+ return (h("dialog", { ref: el => (this.dialogElement = el), class: renderStatus, onClick: this.onClick }, h("div", { class: interiorClasses }, showHeader && (h("header", null, h("div", { class: "title" }, data === null || data === void 0 ? void 0 : data.title), h("q2-btn", { class: "btn-close", "test-id": "btnClose", onClick: this.onCancel, label: "tecton.element.actionSheet.close", "hide-label": true }, h("q2-icon", { type: "close" })))), ((_a = this.data) === null || _a === void 0 ? void 0 : _a.description) && h("p", null, data.description), RenderContent && h(RenderContent, { data: this.data }))));
203
+ }
204
+ static get is() { return "q2-action-sheet"; }
205
+ static get encapsulation() { return "shadow"; }
206
+ static get originalStyleUrls() {
207
+ return {
208
+ "$": ["styles.scss"]
209
+ };
210
+ }
211
+ static get styleUrls() {
212
+ return {
213
+ "$": ["styles.css"]
214
+ };
215
+ }
216
+ static get properties() {
217
+ return {
218
+ "data": {
219
+ "type": "unknown",
220
+ "mutable": true,
221
+ "complexType": {
222
+ "original": "ActionSheetData",
223
+ "resolved": "{ appearance: \"list\"; title?: string; description?: string; event?: MouseEvent | KeyboardEvent; listProps: { multiple: boolean; selectedOptions: ActionSheetSelectedOption[]; noSelect: boolean; }; options: ActionSheetListDataOptions; } | { appearance: \"message\"; type: \"info\" | \"success\" | \"warning\" | \"error\"; title?: string; description?: string; }",
224
+ "references": {
225
+ "ActionSheetData": {
226
+ "location": "import",
227
+ "path": "q2-tecton-common/lib/utility/action-sheet"
228
+ }
229
+ }
230
+ },
231
+ "required": false,
232
+ "optional": false,
233
+ "docs": {
234
+ "tags": [],
235
+ "text": ""
236
+ }
237
+ },
238
+ "hideClose": {
239
+ "type": "boolean",
240
+ "mutable": false,
241
+ "complexType": {
242
+ "original": "boolean",
243
+ "resolved": "boolean",
244
+ "references": {}
245
+ },
246
+ "required": false,
247
+ "optional": false,
248
+ "docs": {
249
+ "tags": [],
250
+ "text": ""
251
+ },
252
+ "attribute": "hide-close",
253
+ "reflect": false
254
+ }
255
+ };
256
+ }
257
+ static get states() {
258
+ return {
259
+ "isScrollable": {},
260
+ "renderStatus": {}
261
+ };
262
+ }
263
+ static get events() {
264
+ return [{
265
+ "method": "close",
266
+ "name": "close",
267
+ "bubbles": true,
268
+ "cancelable": true,
269
+ "composed": true,
270
+ "docs": {
271
+ "tags": [],
272
+ "text": ""
273
+ },
274
+ "complexType": {
275
+ "original": "ActionSheetListCloseData",
276
+ "resolved": "ActionSheetListCloseData",
277
+ "references": {
278
+ "ActionSheetListCloseData": {
279
+ "location": "import",
280
+ "path": "q2-tecton-common/lib/utility/action-sheet"
281
+ }
282
+ }
283
+ }
284
+ }, {
285
+ "method": "ready",
286
+ "name": "ready",
287
+ "bubbles": false,
288
+ "cancelable": true,
289
+ "composed": true,
290
+ "docs": {
291
+ "tags": [],
292
+ "text": ""
293
+ },
294
+ "complexType": {
295
+ "original": "any",
296
+ "resolved": "any",
297
+ "references": {}
298
+ }
299
+ }];
300
+ }
301
+ static get methods() {
302
+ return {
303
+ "hide": {
304
+ "complexType": {
305
+ "signature": "(data?: ActionSheetListCloseData) => Promise<void>",
306
+ "parameters": [{
307
+ "tags": [],
308
+ "text": ""
309
+ }],
310
+ "references": {
311
+ "Promise": {
312
+ "location": "global"
313
+ },
314
+ "ActionSheetListCloseData": {
315
+ "location": "import",
316
+ "path": "q2-tecton-common/lib/utility/action-sheet"
317
+ }
318
+ },
319
+ "return": "Promise<void>"
320
+ },
321
+ "docs": {
322
+ "text": "",
323
+ "tags": []
324
+ }
325
+ },
326
+ "show": {
327
+ "complexType": {
328
+ "signature": "() => Promise<void>",
329
+ "parameters": [],
330
+ "references": {
331
+ "Promise": {
332
+ "location": "global"
333
+ }
334
+ },
335
+ "return": "Promise<void>"
336
+ },
337
+ "docs": {
338
+ "text": "",
339
+ "tags": []
340
+ }
341
+ }
342
+ };
343
+ }
344
+ static get elementRef() { return "hostElement"; }
345
+ }
@@ -0,0 +1,215 @@
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ *:active {
6
+ outline: none;
7
+ }
8
+
9
+ *:focus {
10
+ outline: none;
11
+ box-shadow: var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C);
12
+ }
13
+
14
+ :host {
15
+ box-shadow: none !important;
16
+ }
17
+
18
+ ::-moz-focus-inner {
19
+ border: none;
20
+ }
21
+
22
+ input,
23
+ textarea,
24
+ button {
25
+ font-family: inherit;
26
+ font-size: inherit;
27
+ font-stretch: inherit;
28
+ }
29
+
30
+ :host(.sr),
31
+ :host(.sr) button {
32
+ border: 0;
33
+ clip: rect(0 0 0 0);
34
+ height: 1px;
35
+ margin: -1px;
36
+ overflow: hidden;
37
+ padding: 0;
38
+ position: absolute;
39
+ width: 1px;
40
+ white-space: nowrap;
41
+ }
42
+
43
+ .sr,
44
+ .sr button {
45
+ border: 0;
46
+ clip: rect(0 0 0 0);
47
+ height: 1px;
48
+ margin: -1px;
49
+ overflow: hidden;
50
+ padding: 0;
51
+ position: absolute;
52
+ width: 1px;
53
+ white-space: nowrap;
54
+ }
55
+
56
+ .hidden {
57
+ display: none;
58
+ }
59
+
60
+ :host([hidden]) {
61
+ display: none;
62
+ }
63
+
64
+ .invisible {
65
+ visibility: hidden;
66
+ }
67
+
68
+ @keyframes showBackdrop {
69
+ from {
70
+ opacity: 0;
71
+ }
72
+ }
73
+ @keyframes hideBackdrop {
74
+ to {
75
+ opacity: 0;
76
+ }
77
+ }
78
+ dialog {
79
+ --comp-border-radius-default: var(--app-scale-3x, 15px) var(--app-scale-3x, 15px) 0 0;
80
+ --comp-border-radius: var(--tct-action-sheet-border-radius, var(--t-action-sheet-border-radius, var(--comp-border-radius-default)));
81
+ --comp-desktop-border-radius: var(--tct-action-sheet-border-radius, var(--t-action-sheet-border-radius, var(--app-scale-3x, 15px)));
82
+ --comp-header-size: var(--tct-action-sheet-close-size, var(--t-action-sheet-close-size, var(--t-a11y-min-size, 44px)));
83
+ --comp-dialog-background: var(--tct-action-sheet-background, var(--t-action-sheet-background, var(--t-base, #ffffff)));
84
+ --comp-dialog-color: var(--tct-action-sheet-color, var(--t-action-sheet-color, var(--t-text, #4d4d4d)));
85
+ --comp-dialog-padding: var(--tct-action-sheet-padding, var(--t-action-sheet-padding, var(--app-scale-3x, 15px)));
86
+ --comp-content-gradient-height: var(--tct-action-sheet-content-gradient-height, var(--t-action-sheet-content-gradient-height, var(--app-scale-2x, 10px)));
87
+ --comp-dialog-interior-gap-default: var(--app-scale-2x, 10px);
88
+ --comp-dialog-max-width: var(--tct-action-sheet-max-width, var(--t-action-sheet-max-width, 400px));
89
+ --comp-dialog-max-height: var(--tct-action-sheet-max-height, var(--t-action-sheet-max-height, 75vh));
90
+ --comp-dialog-min-height: var(--tct-action-sheet-min-height, var(--t-action-sheet-min-height, 20vh));
91
+ --comp-dialog-box-shadow: var(--tct-action-sheet-box-shadow, var(--t-action-sheet-box-shadow, var(--app-shadow-2, 0 3px 6px rgba(0, 0, 0, 0.3))));
92
+ position: fixed;
93
+ top: 100%;
94
+ bottom: unset;
95
+ color: var(--comp-dialog-color);
96
+ background: var(--comp-dialog-background);
97
+ transition: transform var(--tct-action-sheet-tween, var(--t-action-sheet-tween, var(--app-tween-2, 0.4s ease))), opacity var(--tct-action-sheet-tween, var(--t-action-sheet-tween, var(--app-tween-2, 0.4s ease)));
98
+ width: 100%;
99
+ max-width: var(--comp-dialog-max-width);
100
+ border: 0;
101
+ border-radius: var(--comp-border-radius);
102
+ box-shadow: var(--comp-dialog-box-shadow);
103
+ padding: 0;
104
+ height: auto;
105
+ overflow: hidden;
106
+ min-height: var(--comp-dialog-min-height);
107
+ max-height: var(--comp-dialog-max-height);
108
+ }
109
+ dialog::backdrop {
110
+ opacity: 0;
111
+ background: var(--tct-action-sheet-backdrop-background, var(--t-action-sheet-backdrop-background, var(--t-top-a2, rgba(13, 13, 13, 0.6))));
112
+ }
113
+ dialog[open].is-opening, dialog[open].is-open {
114
+ transform: translateY(-100%);
115
+ }
116
+ @media screen and (min-width: 1200px) {
117
+ dialog[open].is-opening, dialog[open].is-open {
118
+ opacity: 1;
119
+ transform: translateY(0);
120
+ }
121
+ }
122
+ dialog[open].is-opening::backdrop, dialog[open].is-open::backdrop {
123
+ opacity: 1;
124
+ animation: showBackdrop var(--tct-action-sheet-tween, var(--t-action-sheet-tween, var(--app-tween-2, 0.4s ease)));
125
+ }
126
+ dialog[open].is-closing {
127
+ transform: translateY(10%);
128
+ }
129
+ dialog[open].is-closing::backdrop {
130
+ animation: hideBackdrop var(--tct-action-sheet-tween, var(--t-action-sheet-tween, var(--app-tween-2, 0.4s ease)));
131
+ }
132
+ @media screen and (min-width: 1200px) {
133
+ dialog {
134
+ border-radius: var(--comp-desktop-border-radius);
135
+ top: 0px;
136
+ bottom: 0px;
137
+ height: fit-content;
138
+ transform: translateY(10%);
139
+ opacity: 0;
140
+ }
141
+ }
142
+
143
+ .content {
144
+ overflow-y: auto;
145
+ --comp-scrollbar-size: var(--tct-scrollbar-size, var(--t-scrollbar-size, var(--app-scale-1x, 5px)));
146
+ --comp-scrollbar-border-radius: var(--tct-scrollbar-border-radius, var(--t-scrollbar-border-radius, var(--app-border-radius-1, 3px)));
147
+ --comp-scrollbar-color: var(--tct-scrollbar-color, var(--t-scrollbar-color, var(--t-a11y-gray-color, #747474)));
148
+ scrollbar-width: thin;
149
+ scrollbar-color: var(--comp-scrollbar-color) transparent;
150
+ }
151
+ .content::-webkit-scrollbar {
152
+ width: var(--comp-scrollbar-size);
153
+ height: var(--comp-scrollbar-size);
154
+ margin: 5px;
155
+ }
156
+ .content::-webkit-scrollbar-thumb {
157
+ background: var(--comp-scrollbar-color);
158
+ border-radius: var(--comp-scrollbar-border-radius);
159
+ }
160
+ .content::-webkit-scrollbar-track {
161
+ background: transparent;
162
+ border-radius: var(--comp-scrollbar-border-radius);
163
+ }
164
+
165
+ .interior {
166
+ display: grid;
167
+ grid-template-rows: 44px 1fr auto;
168
+ gap: var(--comp-dialog-interior-gap-default);
169
+ max-height: calc(var(--comp-dialog-max-height) - var(--comp-dialog-padding));
170
+ padding: var(--comp-dialog-padding);
171
+ }
172
+ .interior.is-list header,
173
+ .interior.is-list footer {
174
+ position: relative;
175
+ }
176
+ .interior.is-list header:before,
177
+ .interior.is-list footer:before {
178
+ content: "";
179
+ display: block;
180
+ position: absolute;
181
+ left: 0;
182
+ height: var(--comp-content-gradient-height);
183
+ width: 100%;
184
+ z-index: 1;
185
+ }
186
+ .interior.is-list header:before {
187
+ top: calc(100% + var(--comp-dialog-interior-gap-default));
188
+ background: linear-gradient(to bottom, var(--t-base) 0%, var(--t-base-a0) 100%);
189
+ }
190
+ .interior.is-list footer:before {
191
+ top: calc((var(--comp-dialog-interior-gap-default) + var(--comp-content-gradient-height)) * -1);
192
+ background: linear-gradient(to top, var(--t-base) 0%, var(--t-base-a0) 100%);
193
+ }
194
+
195
+ header {
196
+ display: grid;
197
+ grid-template-columns: var(--comp-header-size) 1fr var(--comp-header-size);
198
+ grid-template-areas: ". title close";
199
+ gap: var(--app-scale-2x, 10px);
200
+ }
201
+ header .title {
202
+ grid-area: title;
203
+ text-align: center;
204
+ line-height: var(--comp-header-size);
205
+ }
206
+ header .btn-close {
207
+ grid-area: close;
208
+ width: var(--comp-header-size);
209
+ height: var(--comp-header-size);
210
+ }
211
+
212
+ footer {
213
+ display: flex;
214
+ justify-content: end;
215
+ }
@@ -52,7 +52,7 @@ export class Q2Card {
52
52
  this.resizeObserver = new ResizeObserver(() => this.determineAutoSmall());
53
53
  this.resizeObserver.observe(this.hostElement);
54
54
  }
55
- willDestroyElement() {
55
+ disconnectedCallback() {
56
56
  this.resizeObserver = null;
57
57
  }
58
58
  onHostElementFocus(event) {