q2-tecton-elements 1.23.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 (201) hide show
  1. package/dist/cjs/action-sheet-4b366e9a.js +84 -0
  2. package/dist/cjs/{index-0648c2ec.js → index-e00b4210.js} +28 -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 +1 -1
  6. package/dist/cjs/q2-btn_2.cjs.entry.js +1 -1
  7. package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
  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 -6
  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-checkbox/index.js +2 -2
  42. package/dist/collection/components/q2-dropdown/index.js +1 -1
  43. package/dist/collection/components/q2-loading/index.js +1 -1
  44. package/dist/collection/components/q2-optgroup/styles.css +2 -2
  45. package/dist/collection/components/q2-option/index.js +1 -56
  46. package/dist/collection/components/q2-option/styles.css +7 -0
  47. package/dist/collection/components/q2-option-list/index.js +290 -102
  48. package/dist/collection/components/q2-pill/index.js +79 -18
  49. package/dist/collection/components/q2-pill/styles.css +1 -2
  50. package/dist/collection/components/q2-popover/index.js +17 -3
  51. package/dist/collection/components/q2-popover/styles.css +10 -67
  52. package/dist/collection/components/q2-radio/index.js +2 -2
  53. package/dist/collection/components/q2-select/index.js +179 -427
  54. package/dist/collection/components/q2-select/styles.css +5 -11
  55. package/dist/collection/components/q2-tag/index.js +38 -5
  56. package/dist/collection/utils/action-sheet.js +79 -0
  57. package/dist/collection/utils/index.js +26 -5
  58. package/dist/components/action-sheet.js +81 -0
  59. package/dist/components/index.d.ts +1 -0
  60. package/dist/components/index.js +1 -0
  61. package/dist/components/index10.js +1 -1
  62. package/dist/components/index11.js +42 -353
  63. package/dist/components/index12.js +44 -99
  64. package/dist/components/index13.js +495 -583
  65. package/dist/components/index14.js +137 -0
  66. package/dist/components/index15.js +626 -0
  67. package/dist/components/index5.js +1 -1
  68. package/dist/components/index6.js +1 -1
  69. package/dist/components/index7.js +1 -1
  70. package/dist/components/index8.js +1 -1
  71. package/dist/components/index9.js +2 -2
  72. package/dist/components/q2-action-sheet.d.ts +11 -0
  73. package/dist/components/q2-action-sheet.js +282 -0
  74. package/dist/components/q2-calendar.js +1 -1
  75. package/dist/components/q2-card.js +1 -1
  76. package/dist/components/q2-carousel-pane.js +1 -1
  77. package/dist/components/q2-carousel.js +1 -1
  78. package/dist/components/q2-chart-area.js +1 -1
  79. package/dist/components/q2-chart-bar.js +1 -1
  80. package/dist/components/q2-chart-donut.js +1 -1
  81. package/dist/components/q2-checkbox-group.js +1 -1
  82. package/dist/components/q2-checkbox.js +1 -1
  83. package/dist/components/q2-dropdown.js +2 -2
  84. package/dist/components/q2-editable-field.js +1 -1
  85. package/dist/components/q2-loc.js +1 -1
  86. package/dist/components/q2-month-picker.js +1 -1
  87. package/dist/components/q2-optgroup.js +1 -70
  88. package/dist/components/q2-option-list.js +1 -1
  89. package/dist/components/q2-option.js +1 -76
  90. package/dist/components/q2-pagination.js +1 -1
  91. package/dist/components/q2-pill.js +62 -21
  92. package/dist/components/q2-popover.js +1 -1
  93. package/dist/components/q2-radio-group.js +1 -1
  94. package/dist/components/q2-radio.js +3 -3
  95. package/dist/components/q2-section.js +1 -1
  96. package/dist/components/q2-select.js +179 -427
  97. package/dist/components/q2-stepper-pane.js +1 -1
  98. package/dist/components/q2-stepper-vertical.js +1 -1
  99. package/dist/components/q2-stepper.js +1 -1
  100. package/dist/components/q2-tab-container.js +1 -1
  101. package/dist/components/q2-tag.js +24 -8
  102. package/dist/components/q2-textarea.js +1 -1
  103. package/dist/esm/action-sheet-a9597b32.js +81 -0
  104. package/dist/esm/{index-501fd22e.js → index-ca21e539.js} +27 -6
  105. package/dist/esm/loader.js +1 -1
  106. package/dist/esm/q2-action-sheet.entry.js +214 -0
  107. package/dist/esm/q2-badge_2.entry.js +1 -1
  108. package/dist/esm/q2-btn_2.entry.js +1 -1
  109. package/dist/esm/q2-calendar.entry.js +1 -1
  110. package/dist/esm/q2-card.entry.js +1 -1
  111. package/dist/esm/q2-carousel-pane.entry.js +1 -1
  112. package/dist/esm/q2-carousel.entry.js +1 -1
  113. package/dist/esm/q2-chart-area.entry.js +1 -1
  114. package/dist/esm/q2-chart-bar.entry.js +1 -1
  115. package/dist/esm/q2-chart-donut.entry.js +1 -1
  116. package/dist/esm/q2-checkbox-group.entry.js +1 -1
  117. package/dist/esm/q2-checkbox.entry.js +1 -1
  118. package/dist/esm/q2-dropdown-item.entry.js +1 -1
  119. package/dist/esm/q2-dropdown.entry.js +1 -1
  120. package/dist/esm/q2-editable-field.entry.js +1 -1
  121. package/dist/esm/q2-icon.entry.js +1 -1
  122. package/dist/esm/q2-loc.entry.js +1 -1
  123. package/dist/esm/q2-message.entry.js +1 -1
  124. package/dist/esm/q2-month-picker.entry.js +1 -1
  125. package/dist/esm/q2-optgroup_2.entry.js +88 -0
  126. package/dist/esm/q2-option-list_2.entry.js +226 -86
  127. package/dist/esm/q2-pagination.entry.js +1 -1
  128. package/dist/esm/q2-pill.entry.js +57 -18
  129. package/dist/esm/q2-radio-group.entry.js +1 -1
  130. package/dist/esm/q2-radio.entry.js +1 -1
  131. package/dist/esm/q2-section.entry.js +1 -1
  132. package/dist/esm/q2-select.entry.js +148 -409
  133. package/dist/esm/q2-stepper-pane.entry.js +1 -1
  134. package/dist/esm/q2-stepper-vertical.entry.js +1 -1
  135. package/dist/esm/q2-stepper.entry.js +1 -1
  136. package/dist/esm/q2-tab-container.entry.js +1 -1
  137. package/dist/esm/q2-tag.entry.js +21 -6
  138. package/dist/esm/q2-tecton-elements.js +1 -1
  139. package/dist/esm/q2-textarea.entry.js +1 -1
  140. package/dist/q2-tecton-elements/{p-3e9a30c4.entry.js → p-0473f4f7.entry.js} +1 -1
  141. package/dist/q2-tecton-elements/{p-5b1aba1a.entry.js → p-13a1390b.entry.js} +1 -1
  142. package/dist/q2-tecton-elements/{p-ebd7efa5.entry.js → p-13deb3ed.entry.js} +1 -1
  143. package/dist/q2-tecton-elements/{p-45d61789.entry.js → p-1d854203.entry.js} +1 -1
  144. package/dist/q2-tecton-elements/p-1f71774f.entry.js +1 -0
  145. package/dist/q2-tecton-elements/{p-6b7e1ebd.entry.js → p-256d3fe6.entry.js} +1 -1
  146. package/dist/q2-tecton-elements/{p-8dea9a0c.entry.js → p-282f0f8c.entry.js} +1 -1
  147. package/dist/q2-tecton-elements/{p-3603fcdc.entry.js → p-30969629.entry.js} +1 -1
  148. package/dist/q2-tecton-elements/p-30cd888b.entry.js +1 -0
  149. package/dist/q2-tecton-elements/{p-3fd5d010.entry.js → p-37cf9c97.entry.js} +1 -1
  150. package/dist/q2-tecton-elements/{p-53be87c8.entry.js → p-388349b5.entry.js} +1 -1
  151. package/dist/q2-tecton-elements/p-5589ae0f.entry.js +1 -0
  152. package/dist/q2-tecton-elements/{p-604b22a8.entry.js → p-619aed74.entry.js} +1 -1
  153. package/dist/q2-tecton-elements/{p-d68b5eb3.entry.js → p-63b67260.entry.js} +1 -1
  154. package/dist/q2-tecton-elements/{p-ba73ee1f.entry.js → p-63e363ad.entry.js} +1 -1
  155. package/dist/q2-tecton-elements/{p-d7b27803.entry.js → p-6736df05.entry.js} +1 -1
  156. package/dist/q2-tecton-elements/p-72fe10cc.entry.js +1 -0
  157. package/dist/q2-tecton-elements/{p-68ef0786.entry.js → p-75b817c6.entry.js} +1 -1
  158. package/dist/q2-tecton-elements/{p-a2add94e.entry.js → p-7a116095.entry.js} +1 -1
  159. package/dist/q2-tecton-elements/{p-d88e4383.entry.js → p-7c94119b.entry.js} +1 -1
  160. package/dist/q2-tecton-elements/{p-24f4571d.entry.js → p-90572e43.entry.js} +1 -1
  161. package/dist/q2-tecton-elements/p-91153c61.entry.js +1 -0
  162. package/dist/q2-tecton-elements/{p-70b01387.entry.js → p-9792de8a.entry.js} +1 -1
  163. package/dist/q2-tecton-elements/p-9acfa94e.js +1 -0
  164. package/dist/q2-tecton-elements/p-a1926e65.js +1 -0
  165. package/dist/q2-tecton-elements/{p-d27b2caa.entry.js → p-b3a8cdc5.entry.js} +1 -1
  166. package/dist/q2-tecton-elements/{p-9b101e22.entry.js → p-ce3f203c.entry.js} +1 -1
  167. package/dist/q2-tecton-elements/{p-bf41e71b.entry.js → p-ce91cd9b.entry.js} +1 -1
  168. package/dist/q2-tecton-elements/{p-18629cbf.entry.js → p-cefc9d0b.entry.js} +1 -1
  169. package/dist/q2-tecton-elements/p-d05beeb7.entry.js +1 -0
  170. package/dist/q2-tecton-elements/{p-6be86940.entry.js → p-dc7c8371.entry.js} +1 -1
  171. package/dist/q2-tecton-elements/{p-acc77332.entry.js → p-e58581fc.entry.js} +1 -1
  172. package/dist/q2-tecton-elements/{p-38a33baa.entry.js → p-e886c55b.entry.js} +1 -1
  173. package/dist/q2-tecton-elements/{p-7aa80653.entry.js → p-f94e7043.entry.js} +1 -1
  174. package/dist/q2-tecton-elements/{p-78fac0fa.entry.js → p-fcb7d191.entry.js} +1 -1
  175. package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
  176. package/dist/test/helpers.js +3 -2
  177. package/dist/types/components/q2-action-sheet/index.d.ts +52 -0
  178. package/dist/types/components/q2-checkbox/index.d.ts +4 -1
  179. package/dist/types/components/q2-option/index.d.ts +0 -3
  180. package/dist/types/components/q2-option-list/index.d.ts +16 -8
  181. package/dist/types/components/q2-pill/index.d.ts +10 -1
  182. package/dist/types/components/q2-popover/index.d.ts +2 -0
  183. package/dist/types/components/q2-select/index.d.ts +45 -47
  184. package/dist/types/components/q2-tag/index.d.ts +3 -2
  185. package/dist/types/components.d.ts +42 -13
  186. package/dist/types/global.d.ts +9 -2
  187. package/dist/types/utils/action-sheet.d.ts +12 -0
  188. package/dist/types/utils/index.d.ts +3 -1
  189. package/dist/types/workspace/workspace/Tecton_tecton-production_master/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
  190. package/package.json +3 -2
  191. package/dist/cjs/q2-optgroup.cjs.entry.js +0 -56
  192. package/dist/cjs/q2-option.cjs.entry.js +0 -46
  193. package/dist/esm/q2-optgroup.entry.js +0 -52
  194. package/dist/esm/q2-option.entry.js +0 -42
  195. package/dist/q2-tecton-elements/p-2c20fc43.entry.js +0 -1
  196. package/dist/q2-tecton-elements/p-3813f51d.entry.js +0 -1
  197. package/dist/q2-tecton-elements/p-a510290a.js +0 -1
  198. package/dist/q2-tecton-elements/p-ba76ecfd.entry.js +0 -1
  199. package/dist/q2-tecton-elements/p-bbdae095.entry.js +0 -1
  200. package/dist/q2-tecton-elements/p-f1d06917.entry.js +0 -1
  201. package/dist/q2-tecton-elements/p-f6e868c1.entry.js +0 -1
@@ -5,6 +5,7 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { ActionSheetData, ActionSheetListCloseData } from "q2-tecton-common/lib/utility/action-sheet";
8
9
  import { IChartData } from "src/utils/charting";
9
10
  import { IDonutChartData } from "./components/q2-chart-donut/index";
10
11
  import { IEventDetail } from "./components/q2-input/types";
@@ -14,6 +15,12 @@ import { IStepperPaneEvent } from "./components/q2-stepper-pane/index";
14
15
  export namespace Components {
15
16
  interface ClickElsewhere {
16
17
  }
18
+ interface Q2ActionSheet {
19
+ "data": ActionSheetData;
20
+ "hide": (data?: ActionSheetListCloseData) => Promise<void>;
21
+ "hideClose": boolean;
22
+ "show": () => Promise<void>;
23
+ }
17
24
  interface Q2Avatar {
18
25
  "icon": string;
19
26
  "initials": string;
@@ -303,18 +310,16 @@ export namespace Components {
303
310
  "display": string;
304
311
  "hidden": boolean;
305
312
  "multiline": boolean;
306
- "noSelect": boolean;
307
- "optionId": string;
308
313
  "role": string;
309
314
  "selected": boolean;
310
- "tabindex": string;
311
315
  "value": string;
312
316
  }
313
317
  interface Q2OptionList {
314
318
  "align": 'left' | 'right';
315
319
  "customSearch": boolean;
316
- "direction": 'up' | 'down';
317
320
  "disabled": boolean;
321
+ "getContents": () => Promise<(HTMLQ2OptgroupElement | HTMLQ2OptionElement)[]>;
322
+ "getOptions": () => Promise<HTMLQ2OptionElement[]>;
318
323
  "handleExternalKeydown": (event: KeyboardEvent) => Promise<void>;
319
324
  "multiple": boolean;
320
325
  "noSelect": boolean;
@@ -322,6 +327,7 @@ export namespace Components {
322
327
  "selectedOptions": IOptionValue[];
323
328
  "setActiveElement": (index: number) => Promise<void>;
324
329
  "setDefaultActiveElement": () => Promise<void>;
330
+ "showSelected": boolean;
325
331
  "type": 'menu' | 'listbox';
326
332
  }
327
333
  interface Q2Pagination {
@@ -336,6 +342,7 @@ export namespace Components {
336
342
  interface Q2Pill {
337
343
  "active": boolean;
338
344
  "disabled": boolean;
345
+ "hoist": boolean;
339
346
  "label": string;
340
347
  "maxLength": number;
341
348
  "multiple": boolean;
@@ -390,6 +397,7 @@ export namespace Components {
390
397
  "disabled": boolean;
391
398
  "errors": string[];
392
399
  "hideLabel": boolean;
400
+ "hoist": boolean;
393
401
  "invalid": boolean;
394
402
  "label": string;
395
403
  "minRows": number;
@@ -400,7 +408,7 @@ export namespace Components {
400
408
  "popDirection": 'up' | 'down';
401
409
  "readonly": boolean;
402
410
  "searchable": boolean;
403
- "selectedOptions": any;
411
+ "selectedOptions": string[];
404
412
  "value": string;
405
413
  }
406
414
  interface Q2Stepper {
@@ -436,6 +444,7 @@ export namespace Components {
436
444
  "value": string;
437
445
  }
438
446
  interface Q2Tag {
447
+ "hoist": boolean;
439
448
  "label": string;
440
449
  "open": boolean;
441
450
  "popoverDirection": 'up' | 'down';
@@ -489,6 +498,10 @@ export interface ClickElsewhereCustomEvent<T> extends CustomEvent<T> {
489
498
  detail: T;
490
499
  target: HTMLClickElsewhereElement;
491
500
  }
501
+ export interface Q2ActionSheetCustomEvent<T> extends CustomEvent<T> {
502
+ detail: T;
503
+ target: HTMLQ2ActionSheetElement;
504
+ }
492
505
  export interface Q2CalendarCustomEvent<T> extends CustomEvent<T> {
493
506
  detail: T;
494
507
  target: HTMLQ2CalendarElement;
@@ -604,6 +617,12 @@ declare global {
604
617
  prototype: HTMLClickElsewhereElement;
605
618
  new (): HTMLClickElsewhereElement;
606
619
  };
620
+ interface HTMLQ2ActionSheetElement extends Components.Q2ActionSheet, HTMLStencilElement {
621
+ }
622
+ var HTMLQ2ActionSheetElement: {
623
+ prototype: HTMLQ2ActionSheetElement;
624
+ new (): HTMLQ2ActionSheetElement;
625
+ };
607
626
  interface HTMLQ2AvatarElement extends Components.Q2Avatar, HTMLStencilElement {
608
627
  }
609
628
  var HTMLQ2AvatarElement: {
@@ -852,6 +871,7 @@ declare global {
852
871
  };
853
872
  interface HTMLElementTagNameMap {
854
873
  "click-elsewhere": HTMLClickElsewhereElement;
874
+ "q2-action-sheet": HTMLQ2ActionSheetElement;
855
875
  "q2-avatar": HTMLQ2AvatarElement;
856
876
  "q2-badge": HTMLQ2BadgeElement;
857
877
  "q2-btn": HTMLQ2BtnElement;
@@ -899,6 +919,12 @@ declare namespace LocalJSX {
899
919
  interface ClickElsewhere {
900
920
  "onChange"?: (event: ClickElsewhereCustomEvent<any>) => void;
901
921
  }
922
+ interface Q2ActionSheet {
923
+ "data"?: ActionSheetData;
924
+ "hideClose"?: boolean;
925
+ "onClose"?: (event: Q2ActionSheetCustomEvent<ActionSheetListCloseData>) => void;
926
+ "onReady"?: (event: Q2ActionSheetCustomEvent<any>) => void;
927
+ }
902
928
  interface Q2Avatar {
903
929
  "icon"?: string;
904
930
  "initials"?: string;
@@ -1061,7 +1087,7 @@ declare namespace LocalJSX {
1061
1087
  "indeterminate"?: boolean;
1062
1088
  "label"?: string;
1063
1089
  "name"?: string;
1064
- "onChange"?: (event: Q2CheckboxCustomEvent<any>) => void;
1090
+ "onChange"?: (event: Q2CheckboxCustomEvent<{ value: string; checked: boolean }>) => void;
1065
1091
  "readonly"?: boolean;
1066
1092
  "type"?: string;
1067
1093
  "value"?: string;
@@ -1202,24 +1228,22 @@ declare namespace LocalJSX {
1202
1228
  "display"?: string;
1203
1229
  "hidden"?: boolean;
1204
1230
  "multiline"?: boolean;
1205
- "noSelect"?: boolean;
1206
- "optionId"?: string;
1207
1231
  "role"?: string;
1208
1232
  "selected"?: boolean;
1209
- "tabindex"?: string;
1210
1233
  "value"?: string;
1211
1234
  }
1212
1235
  interface Q2OptionList {
1213
1236
  "align"?: 'left' | 'right';
1214
1237
  "customSearch"?: boolean;
1215
- "direction"?: 'up' | 'down';
1216
1238
  "disabled"?: boolean;
1217
1239
  "multiple"?: boolean;
1218
1240
  "noSelect"?: boolean;
1219
1241
  "onChange"?: (event: Q2OptionListCustomEvent<{ value: string; values: IOptionValue[] }>) => void;
1220
- "onPopoverState"?: (event: Q2OptionListCustomEvent<{ open: boolean }>) => void;
1242
+ "onPopoverState"?: (event: Q2OptionListCustomEvent<{ open: boolean; action: 'close' | 'select' | 'open' }>) => void;
1243
+ "onReady"?: (event: Q2OptionListCustomEvent<any>) => void;
1221
1244
  "role"?: 'listbox' | 'menu';
1222
1245
  "selectedOptions"?: IOptionValue[];
1246
+ "showSelected"?: boolean;
1223
1247
  "type"?: 'menu' | 'listbox';
1224
1248
  }
1225
1249
  interface Q2Pagination {
@@ -1235,6 +1259,7 @@ declare namespace LocalJSX {
1235
1259
  interface Q2Pill {
1236
1260
  "active"?: boolean;
1237
1261
  "disabled"?: boolean;
1262
+ "hoist"?: boolean;
1238
1263
  "label"?: string;
1239
1264
  "maxLength"?: number;
1240
1265
  "multiple"?: boolean;
@@ -1293,19 +1318,20 @@ declare namespace LocalJSX {
1293
1318
  "disabled"?: boolean;
1294
1319
  "errors"?: string[];
1295
1320
  "hideLabel"?: boolean;
1321
+ "hoist"?: boolean;
1296
1322
  "invalid"?: boolean;
1297
1323
  "label"?: string;
1298
1324
  "minRows"?: number;
1299
1325
  "multilineOptions"?: boolean;
1300
1326
  "multiple"?: boolean;
1301
- "onChange"?: (event: Q2SelectCustomEvent<any>) => void;
1327
+ "onChange"?: (event: Q2SelectCustomEvent<{ value: string; selectedOptions: string[] }>) => void;
1302
1328
  "onInput"?: (event: Q2SelectCustomEvent<any>) => void;
1303
1329
  "optional"?: boolean;
1304
1330
  "placeholder"?: string;
1305
1331
  "popDirection"?: 'up' | 'down';
1306
1332
  "readonly"?: boolean;
1307
1333
  "searchable"?: boolean;
1308
- "selectedOptions"?: any;
1334
+ "selectedOptions"?: string[];
1309
1335
  "value"?: string;
1310
1336
  }
1311
1337
  interface Q2Stepper {
@@ -1348,6 +1374,7 @@ declare namespace LocalJSX {
1348
1374
  "value"?: string;
1349
1375
  }
1350
1376
  interface Q2Tag {
1377
+ "hoist"?: boolean;
1351
1378
  "label"?: string;
1352
1379
  "onClick"?: (event: Q2TagCustomEvent<{ value: string }>) => void;
1353
1380
  "open"?: boolean;
@@ -1402,6 +1429,7 @@ declare namespace LocalJSX {
1402
1429
  }
1403
1430
  interface IntrinsicElements {
1404
1431
  "click-elsewhere": ClickElsewhere;
1432
+ "q2-action-sheet": Q2ActionSheet;
1405
1433
  "q2-avatar": Q2Avatar;
1406
1434
  "q2-badge": Q2Badge;
1407
1435
  "q2-btn": Q2Btn;
@@ -1450,6 +1478,7 @@ declare module "@stencil/core" {
1450
1478
  export namespace JSX {
1451
1479
  interface IntrinsicElements {
1452
1480
  "click-elsewhere": LocalJSX.ClickElsewhere & JSXBase.HTMLAttributes<HTMLClickElsewhereElement>;
1481
+ "q2-action-sheet": LocalJSX.Q2ActionSheet & JSXBase.HTMLAttributes<HTMLQ2ActionSheetElement>;
1453
1482
  "q2-avatar": LocalJSX.Q2Avatar & JSXBase.HTMLAttributes<HTMLQ2AvatarElement>;
1454
1483
  "q2-badge": LocalJSX.Q2Badge & JSXBase.HTMLAttributes<HTMLQ2BadgeElement>;
1455
1484
  "q2-btn": LocalJSX.Q2Btn & JSXBase.HTMLAttributes<HTMLQ2BtnElement>;
@@ -1,19 +1,26 @@
1
- import { LocFn, ResizeIframeFn, ResolveMenuFn, NavigateToFn, ShowOverpanelFn, IDict } from './util';
1
+ import { ShowActionSheetFn } from 'q2-tecton-common/lib/utility/action-sheet';
2
+ import { LocFn, ResizeIframeFn, ResolveMenuFn, NavigateToFn, ShowOverpanelFn } from './util';
2
3
 
3
4
  declare global {
4
5
  interface Window {
6
+ tecton: {
7
+ actions: Record<string, any>;
8
+ sources: Record<string, any>;
9
+ };
5
10
  TectonElements?: {
6
11
  loc: LocFn;
7
12
  resizeIframe: ResizeIframeFn;
8
13
  resolveMenu: ResolveMenuFn;
9
14
  navigateTo: NavigateToFn;
10
15
  showOverpanel: ShowOverpanelFn;
16
+ showActionSheet?: ShowActionSheetFn;
11
17
  };
12
18
  Tecton?: {
13
19
  inMobileApp: boolean;
14
20
  noStrings: boolean;
15
21
  platformUrl: string;
16
- platformDimensions: IDict<any>;
22
+ platformDimensions: Record<string, any>;
23
+ useActionSheets?: boolean;
17
24
  };
18
25
  __forceSmoothScrollPolyfill__: boolean;
19
26
  }
@@ -0,0 +1,12 @@
1
+ import { ActionSheetListCloseData, ActionSheetListData } from 'q2-tecton-common/lib/utility/action-sheet';
2
+ interface IActionSheetComponent {
3
+ hoist: boolean;
4
+ }
5
+ export declare const shouldShowActionSheet: (component: IActionSheetComponent, event?: KeyboardEvent | MouseEvent) => boolean;
6
+ export declare const buildListData: (component: IActionSheetListComponent, event?: MouseEvent | KeyboardEvent) => Promise<ActionSheetListData>;
7
+ interface IActionSheetListComponent {
8
+ optionList: HTMLQ2OptionListElement;
9
+ label: string;
10
+ }
11
+ export declare const showActionSheetList: (component: IActionSheetListComponent, event?: MouseEvent | KeyboardEvent) => Promise<ActionSheetListCloseData>;
12
+ export {};
@@ -10,6 +10,7 @@ import { Q2Loading } from 'src/components/q2-loading';
10
10
  import { Q2Radio } from 'src/components/q2-radio';
11
11
  import { Q2Select } from 'src/components/q2-select';
12
12
  import { FormFieldTypes, IDict } from 'src/util';
13
+ export declare function isHostLosingFocus(event: FocusEvent, hostElement: HTMLElement): boolean;
13
14
  export declare function isRelatedTargetWithinHost(event: FocusEvent, element: HTMLElement): boolean;
14
15
  export declare function isEventFromElement(event: Event, element: HTMLElement): boolean;
15
16
  export declare function overrideFocus(hostElement: HTMLElement): void;
@@ -18,7 +19,8 @@ export declare function isFirefox(): boolean;
18
19
  export declare function isTouchDevice(): boolean;
19
20
  export declare function isSafari(): boolean;
20
21
  export declare function createGuid(): number;
21
- export declare function nextPaint(fn: () => void, execute?: boolean): void;
22
+ export declare function nextPaint(fn: (value?: unknown) => void): void;
23
+ export declare function waitForNextPaint(): Promise<unknown>;
22
24
  export declare function capitalize(value: string): string;
23
25
  export declare function pick(props: string[]): (obj: object) => object;
24
26
  export declare function loc(key: string, subs?: IDict<any> | string[]): string;
@@ -11,6 +11,6 @@ export declare function setWindowHeight(height: number): void;
11
11
  export declare function makeDomRect(customAttributes: any): any;
12
12
  export declare const base64Image = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=";
13
13
  export declare function getActiveElementTestId(page: E2EPage): Promise<string>;
14
- export declare const getFocusedValue: (page: E2EPage) => Promise<string>;
14
+ export declare const getFocusedOptionValue: (page: E2EPage) => Promise<string>;
15
15
  export declare const getFocusedTagName: (page: E2EPage) => Promise<string>;
16
16
  export declare function getFocusedAttribute(page: E2EPage, attribute: string): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q2-tecton-elements",
3
- "version": "1.23.0",
3
+ "version": "1.24.0",
4
4
  "description": "Q2 Tecton Custom Elements",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -49,8 +49,9 @@
49
49
  "dependencies": {
50
50
  "@stencil/core": "2.19.2",
51
51
  "puppeteer": "^10.4.0",
52
+ "q2-tecton-common": "^1.24.0",
52
53
  "smoothscroll-polyfill": "^0.4.4",
53
54
  "swiper": "8.4.4"
54
55
  },
55
- "gitHead": "618b0e86c3a5d915bfa221fdc27d5501c90766b6"
56
+ "gitHead": "bb916e889c04fc16a7d1bf2ea19014ca57da1a34"
56
57
  }
@@ -1,56 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-734296a7.js');
6
- const index$1 = require('./index-0648c2ec.js');
7
-
8
- 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}.q2-optgroup-header{--comp-header-padding:var(--tct-scale-1, var(--app-scale-1x, 5px)) var(--tct-scale-2, var(--app-scale-2x, 10px));background:var(--tct-optgroup-header-bg, var(--t-optgroup-header-bg, var(--tct-gray-13, var(--t-gray-13, var(--tct-gray-l2, var(--app-gray-l2, #e6e6e6))))));padding:var(--tct-optgroup-header-padding, var(--t-optgroup-header-padding, var(--comp-header-padding)));font-weight:var(--tct-optgroup-header-font-weight, var(--t-optgroup-header-font-weight, 600));text-transform:var(--tct-optgroup-header-text-transform, var(--t-optgroup-header-text-transform, uppercase));position:sticky;top:var(--comp-multi-select-header-height, 0);z-index:1}";
9
-
10
- const Q2Optgroup = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.guid = index$1.createGuid();
14
- this.setHidden = () => {
15
- this.hidden = this.options.every(opt => opt.hidden || opt._multiSelectHidden);
16
- };
17
- this.disabled = false;
18
- this.label = undefined;
19
- this.hidden = false;
20
- }
21
- /// LIFECYCLE HOOKS ///
22
- componentWillLoad() {
23
- const observer = new MutationObserver(this.setHidden);
24
- observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
25
- this.mutationObserver = observer;
26
- // set initially
27
- this.setHidden();
28
- this.disabledWatcher(this.disabled);
29
- }
30
- disconnectedCallback() {
31
- this.mutationObserver.disconnect();
32
- this.mutationObserver = null;
33
- }
34
- get headerId() {
35
- return `q2-optgroup-header-${this.guid}`;
36
- }
37
- get options() {
38
- return Array.from(this.hostElement.querySelectorAll('q2-option'));
39
- }
40
- ///// OBSERVERS ///////
41
- disabledWatcher(disabled) {
42
- this.options.forEach(opt => {
43
- opt.disabledGroup = !!disabled;
44
- });
45
- }
46
- render() {
47
- return (index.h("div", { class: "q2-optgroup-container", hidden: this.hidden, "aria-labelledby": this.headerId, role: "group" }, index.h("div", { class: "q2-optgroup-header", id: this.headerId }, (this.label && index$1.loc(this.label)) || ''), index.h("div", { class: "q2-optgroup-options" }, index.h("slot", null))));
48
- }
49
- get hostElement() { return index.getElement(this); }
50
- static get watchers() { return {
51
- "disabled": ["disabledWatcher"]
52
- }; }
53
- };
54
- Q2Optgroup.style = stylesCss;
55
-
56
- exports.q2_optgroup = Q2Optgroup;
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-734296a7.js');
6
-
7
- 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{--comp-padding:0 var(--app-scale-2x, 10px);--comp-selected-icon-size:var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, var(--tct-scale-3, var(--app-scale-3x, 15px))));padding:var(--tct-option-padding, var(--t-option-padding, var(--comp-padding)));min-height:44px;align-items:center;cursor:pointer;grid-template-columns:var(--comp-selected-icon-size) 1fr;align-items:center;grid-template-areas:\"icon content\";gap:var(--tct-scale-1, var(--app-scale-1x, 5px))}:host([multiline]){--comp-padding:var(--app-scale-2, 10px) var(--app-scale-2, 10px);--comp-selected-icon-size:var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, 26px))}:host([_no-select]){grid-template-columns:1fr;grid-template-areas:\"content\"}:host([aria-disabled]){cursor:not-allowed;opacity:var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4));pointer-events:none}:host([aria-hidden]){display:none}:host(:not([hidden]):not([aria-hidden])){display:grid}:host(:not([aria-disabled]):hover),:host([active]),:host(:focus){background-color:var(--tct-option-active-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2)))))}:host(:focus){border:1px solid #33b4ff}q2-icon{grid-area:icon;--tct-icon-size:var(--comp-selected-icon-size)}.content{display:block;grid-area:content}:host(:not([multiline])) .content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}";
8
-
9
- const Q2Option = class {
10
- constructor(hostRef) {
11
- index.registerInstance(this, hostRef);
12
- this.role = 'option';
13
- this.tabindex = '-1';
14
- this.display = undefined;
15
- this.value = undefined;
16
- this.disabled = undefined;
17
- this.optionId = undefined;
18
- this.disabledGroup = undefined;
19
- this.selected = undefined;
20
- this.hidden = undefined;
21
- this.multiline = undefined;
22
- this.active = undefined;
23
- this.noSelect = undefined;
24
- this._multiSelectHidden = false;
25
- }
26
- componentWillLoad() {
27
- this.handleDisplay();
28
- }
29
- handleDisplay() {
30
- if (this.display || this.multiline)
31
- return;
32
- this.display = this.hostElement.textContent.trim();
33
- }
34
- render() {
35
- const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
36
- const isDisabled = disabled || disabledGroup;
37
- return (index.h(index.Host, { "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && index.h("q2-icon", { type: "checkmark" }), index.h("div", { class: "content" }, index.h("slot", null))));
38
- }
39
- get hostElement() { return index.getElement(this); }
40
- static get watchers() { return {
41
- "display": ["handleDisplay"]
42
- }; }
43
- };
44
- Q2Option.style = stylesCss;
45
-
46
- exports.q2_option = Q2Option;
@@ -1,52 +0,0 @@
1
- import { r as registerInstance, h, g as getElement } from './index-bb1c8c7f.js';
2
- import { c as createGuid, l as loc } from './index-501fd22e.js';
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}.q2-optgroup-header{--comp-header-padding:var(--tct-scale-1, var(--app-scale-1x, 5px)) var(--tct-scale-2, var(--app-scale-2x, 10px));background:var(--tct-optgroup-header-bg, var(--t-optgroup-header-bg, var(--tct-gray-13, var(--t-gray-13, var(--tct-gray-l2, var(--app-gray-l2, #e6e6e6))))));padding:var(--tct-optgroup-header-padding, var(--t-optgroup-header-padding, var(--comp-header-padding)));font-weight:var(--tct-optgroup-header-font-weight, var(--t-optgroup-header-font-weight, 600));text-transform:var(--tct-optgroup-header-text-transform, var(--t-optgroup-header-text-transform, uppercase));position:sticky;top:var(--comp-multi-select-header-height, 0);z-index:1}";
5
-
6
- const Q2Optgroup = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.guid = createGuid();
10
- this.setHidden = () => {
11
- this.hidden = this.options.every(opt => opt.hidden || opt._multiSelectHidden);
12
- };
13
- this.disabled = false;
14
- this.label = undefined;
15
- this.hidden = false;
16
- }
17
- /// LIFECYCLE HOOKS ///
18
- componentWillLoad() {
19
- const observer = new MutationObserver(this.setHidden);
20
- observer.observe(this.hostElement, { childList: true, attributes: true, subtree: true });
21
- this.mutationObserver = observer;
22
- // set initially
23
- this.setHidden();
24
- this.disabledWatcher(this.disabled);
25
- }
26
- disconnectedCallback() {
27
- this.mutationObserver.disconnect();
28
- this.mutationObserver = null;
29
- }
30
- get headerId() {
31
- return `q2-optgroup-header-${this.guid}`;
32
- }
33
- get options() {
34
- return Array.from(this.hostElement.querySelectorAll('q2-option'));
35
- }
36
- ///// OBSERVERS ///////
37
- disabledWatcher(disabled) {
38
- this.options.forEach(opt => {
39
- opt.disabledGroup = !!disabled;
40
- });
41
- }
42
- render() {
43
- return (h("div", { class: "q2-optgroup-container", hidden: this.hidden, "aria-labelledby": this.headerId, role: "group" }, h("div", { class: "q2-optgroup-header", id: this.headerId }, (this.label && loc(this.label)) || ''), h("div", { class: "q2-optgroup-options" }, h("slot", null))));
44
- }
45
- get hostElement() { return getElement(this); }
46
- static get watchers() { return {
47
- "disabled": ["disabledWatcher"]
48
- }; }
49
- };
50
- Q2Optgroup.style = stylesCss;
51
-
52
- export { Q2Optgroup as q2_optgroup };
@@ -1,42 +0,0 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-bb1c8c7f.js';
2
-
3
- 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{--comp-padding:0 var(--app-scale-2x, 10px);--comp-selected-icon-size:var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, var(--tct-scale-3, var(--app-scale-3x, 15px))));padding:var(--tct-option-padding, var(--t-option-padding, var(--comp-padding)));min-height:44px;align-items:center;cursor:pointer;grid-template-columns:var(--comp-selected-icon-size) 1fr;align-items:center;grid-template-areas:\"icon content\";gap:var(--tct-scale-1, var(--app-scale-1x, 5px))}:host([multiline]){--comp-padding:var(--app-scale-2, 10px) var(--app-scale-2, 10px);--comp-selected-icon-size:var(--tct-option-selected-icon-size, var(--t-option-selected-icon-size, 26px))}:host([_no-select]){grid-template-columns:1fr;grid-template-areas:\"content\"}:host([aria-disabled]){cursor:not-allowed;opacity:var(--tct-disabled-opacity, var(--app-disabled-opacity, 0.4));pointer-events:none}:host([aria-hidden]){display:none}:host(:not([hidden]):not([aria-hidden])){display:grid}:host(:not([aria-disabled]):hover),:host([active]),:host(:focus){background-color:var(--tct-option-active-bg, var(--tct-gray-14, var(--t-gray-14, var(--tct-gray-l3, var(--app-gray-l3, #f2f2f2)))))}:host(:focus){border:1px solid #33b4ff}q2-icon{grid-area:icon;--tct-icon-size:var(--comp-selected-icon-size)}.content{display:block;grid-area:content}:host(:not([multiline])) .content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}";
4
-
5
- const Q2Option = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.role = 'option';
9
- this.tabindex = '-1';
10
- this.display = undefined;
11
- this.value = undefined;
12
- this.disabled = undefined;
13
- this.optionId = undefined;
14
- this.disabledGroup = undefined;
15
- this.selected = undefined;
16
- this.hidden = undefined;
17
- this.multiline = undefined;
18
- this.active = undefined;
19
- this.noSelect = undefined;
20
- this._multiSelectHidden = false;
21
- }
22
- componentWillLoad() {
23
- this.handleDisplay();
24
- }
25
- handleDisplay() {
26
- if (this.display || this.multiline)
27
- return;
28
- this.display = this.hostElement.textContent.trim();
29
- }
30
- render() {
31
- const { disabled, disabledGroup, selected, _multiSelectHidden } = this;
32
- const isDisabled = disabled || disabledGroup;
33
- return (h(Host, { "aria-disabled": isDisabled ? 'true' : undefined, "aria-selected": selected ? 'true' : undefined, "aria-hidden": _multiSelectHidden ? 'true' : undefined }, this.selected && h("q2-icon", { type: "checkmark" }), h("div", { class: "content" }, h("slot", null))));
34
- }
35
- get hostElement() { return getElement(this); }
36
- static get watchers() { return {
37
- "display": ["handleDisplay"]
38
- }; }
39
- };
40
- Q2Option.style = stylesCss;
41
-
42
- export { Q2Option as q2_option };
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as o,H as e,g as s}from"./p-926a3e80.js";import{o as n,i as r}from"./p-a510290a.js";const a=class{constructor(o){t(this,o),this.change=i(this,"change",7),this.popoverState=i(this,"popoverState",7),this.scheduledAfterRender=[],this.keydownHandler=(t,i)=>{t.stopPropagation();const{activeIndex:o,customSearch:e,allOptions:s}=this,{key:n,shiftKey:r}=t;let a;switch(n){case" ":case"Enter":if(i){this.setDefaultActiveElement();break}if(t.preventDefault(),a=s.find((t=>t.active)),!a||a.disabled)break;this.selectOption(a.value);break;case"ArrowUp":if(t.preventDefault(),0===o)break;if(void 0===o)this.setDefaultActiveElement();else{const t=this.getNextVisibleIndex(-1);if(-1===t)break;this.adjustActiveOptionAndScroll(t-o)}break;case"ArrowDown":if(t.preventDefault(),o===s.length-1)break;if(void 0===o)this.setDefaultActiveElement();else{const t=this.getNextVisibleIndex(1);if(-1===t)break;this.adjustActiveOptionAndScroll(t-o)}break;case"Home":t.preventDefault(),this.openDropdownWithActiveElement(0);break;case"End":t.preventDefault(),this.openDropdownWithActiveElement(s.length-1);break;case"PageUp":t.preventDefault(),this.openDropdownWithActiveElement(Math.max(o-10,0));break;case"PageDown":t.preventDefault(),this.openDropdownWithActiveElement(Math.min(o+10,s.length-1));break;case"Tab":if(i)break;if(r)break;if(a=s.find((t=>t.active)),!a||a.disabled)return;this.selectOption(a.value);break;case"Esc":case"Escape":this.noSelect&&this.setActiveElement(null),this.popoverState.emit({open:!1});break;default:if(e)break;if(!n.match(/^[A-Za-z0-9]$/))break;this.searchAndFocus(n)}},this.focusoutHandler=t=>{const{relatedTarget:i}=t,o=this.allOptions.includes(i),e=!o&&this.hostElement.contains(i);(o||e)&&t.stopPropagation()},this.clickHandler=t=>{const i=t.target;"q2-option"!==i.localName||i.disabled||this.selectOption(i.value)},this.role="listbox",this.direction="down",this.customSearch=void 0,this.noSelect=void 0,this.align=void 0,this.selectedOptions=[],this.multiple=void 0,this.disabled=void 0,this.type=void 0,this.hasOptions=void 0}componentWillLoad(){this.hasOptions=!!this.hostElement.querySelectorAll("q2-option").length}componentDidLoad(){n(this.hostElement),this.checkOptions(),this.selectedOptionsUpdated()}componentDidRender(){this.scheduledAfterRender.forEach((t=>t())),this.scheduledAfterRender=[]}get allOptions(){return this.getRootSlot(this.hostElement)}checkOptions(){const{noSelect:t,type:i,allOptions:o}=this;if(!t&&!i)return;const e="menu"===i?"menuitem":"option";o.forEach((o=>{t&&(o.noSelect=!0),i&&(o.role=e)}))}getRootSlot(t){var i;const o=t.querySelector("slot"),e=null!==(i=null==o?void 0:o.assignedElements())&&void 0!==i?i:Array.from(t.children);return e.length&&"SLOT"===e[0].tagName?this.getRootSlot(e[0]):e}scrollToActiveOption(){const t=this.allOptions[this.activeIndex];null==t||t.scrollIntoView({block:"nearest"})}resizeIframe(){var t,i;return null===(i=null===(t=window.TectonElements)||void 0===t?void 0:t.resizeIframe)||void 0===i?void 0:i.call(t)}openDropdownWithActiveElement(t){this.disabled||(this.activeIndex=t,this.popoverState.emit({open:!0}),this.setActiveOption(),this.setFocusedOption(),this.scheduledAfterRender.push((()=>{this.scrollToActiveOption(),this.resizeIframe()})))}getDefaultActiveIndex(){const{allOptions:t}=this,i=t.findIndex((t=>t.selected));if(i>-1)return i;const o=t.findIndex((t=>!t.hidden));return o>-1?o:0}updateSingleOptionAttrs(){var t,i;const{allOptions:o,selectedOptions:e}=this,s=null!==(i=null===(t=e[0])||void 0===t?void 0:t.value)&&void 0!==i?i:void 0;o.forEach((t=>{t.selected=t.value===s}))}updateMultipleOptionAttrs(){const{allOptions:t,selectedOptions:i}=this,o=i.map((t=>t.value));t.forEach((t=>{t.selected=o.includes(t.value)}))}setActiveOption(){const t=this.activeIndex;this.allOptions.forEach(((i,o)=>{i.active=t===o}))}setFocusedOption(){const t=this.allOptions[this.activeIndex];t&&setTimeout((()=>{t.focus()}),25)}getNextVisibleIndex(t){let i=this.activeIndex+t;for(;i>=0&&i<=this.allOptions.length-1;){const{display:o,visibility:e}=window.getComputedStyle(this.allOptions[i]);if("none"!==o&&"hidden"!==e)return i;i+=t}return-1}selectOption(t){const i=this.allOptions.find((({value:i})=>i===t)),o={value:t,display:i.display||i.innerText.trim()},{multiple:e,noSelect:s}=this;let n;if(e){const{selectedOptions:i=[]}=this;n=i.find((({value:i})=>i===t))?i.filter((({value:i})=>i!==t)):[...i,o]}else n=[o];s?this.setActiveElement(null):this.selectedOptions=n,this.change.emit({value:t,values:n}),e||this.popoverState.emit({open:!1})}adjustActiveOptionAndScroll(t){this.activeIndex+=t,this.setActiveOption(),this.setFocusedOption(),this.scrollToActiveOption()}resetTimer(){this.searchStringTimer&&clearTimeout(this.searchStringTimer),this.searchStringTimer=window.setTimeout((()=>{this.searchString=null}),2e3)}searchAndFocus(t){this.resetTimer();let i=this.searchString?`${this.searchString}${t}`:t;i=i.replace(/[^0-9a-z]/gi,""),this.searchString=i;const o=new RegExp(i,"i"),e=this.allOptions.findIndex((t=>t.value===i||t.textContent.match(o)));-1!==e&&this.setActiveElement(e)}selectedOptionsUpdated(){this.multiple?this.updateMultipleOptionAttrs():this.updateSingleOptionAttrs()}delegateFocus(t){r(t,this.hostElement)&&(this.popoverState.emit({open:!0}),this.setDefaultActiveElement())}handleClick(t){t.stopPropagation()}async setDefaultActiveElement(){this.activeIndex=this.getDefaultActiveIndex(),this.setActiveOption(),this.setFocusedOption()}async setActiveElement(t){this.activeIndex=t,this.setActiveOption(),this.setFocusedOption()}async handleExternalKeydown(t){["ArrowDown","ArrowUp","PageDown","PageUp","Home","End"].includes(t.key)&&this.popoverState.emit({open:!0}),["ArrowDown","ArrowUp"].includes(t.key)?(t.preventDefault(),this.setDefaultActiveElement()):this.keydownHandler(t,!0)}render(){return o(e,null,o("div",{class:"content",ref:t=>this.contentElement=t,onFocusout:this.focusoutHandler},o("div",{class:"options",role:this.type||"listbox",onKeyDown:this.keydownHandler,onClick:this.clickHandler},o("slot",null))))}get hostElement(){return s(this)}static get watchers(){return{selectedOptions:["selectedOptionsUpdated"]}}};a.style="*{box-sizing:border-box}*:active{outline:none}*:focus{outline:none;box-shadow:var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C)}:host{box-shadow:none !important}::-moz-focus-inner{border:none}input,textarea,button{font-family:inherit;font-size:inherit;font-stretch:inherit}:host(.sr),:host(.sr) button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sr,.sr button{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.hidden{display:none}:host([hidden]){display:none}.invisible{visibility:hidden}:host{position:relative;width:100%;display:block;line-height:var(--tct-option-list-line-height, var(--t-option-list-line-height, var(--app-line-height, 1.428571429em)))}.content{text-align:start}:host([is-sizeable]) .content{display:block;height:auto}";const h=class{constructor(o){t(this,o),this.popoverStateChanged=i(this,"popoverStateChanged",7),this.privateDirection="down",this.direction=void 0,this.align=void 0,this.open=void 0,this.block=void 0,this.minHeight=void 0,this.controlElement=void 0}componentDidLoad(){this.open&&this.determinePopDirection()}componentWillRender(){this.containerElement&&this.containerElement&&this.open&&this.determinePopDirection()}async toggle(){this.open=!this.open}openChanged(t){this.popoverStateChanged.emit({open:t})}popoverStateHandler(t){const{detail:{open:i}}=t;i!==this.open&&(this.open=i,t.stopPropagation())}determinePopDirection(){var t,i,o,e,s;const{containerElement:n,contentElement:r,direction:a,controlElement:h}=this;if(n&&(n.style.maxHeight=null),a)return this.privateDirection=a;const l=r.clientHeight,{top:d,height:c}=null!==(t=null==h?void 0:h.getBoundingClientRect())&&void 0!==t?t:{top:0,height:0},p=((null===(o=null===(i=window.Tecton)||void 0===i?void 0:i.platformDimensions)||void 0===o?void 0:o.scrollY)||0)+((null===(s=null===(e=window.Tecton)||void 0===e?void 0:e.platformDimensions)||void 0===s?void 0:s.innerHeight)||window.innerHeight)-d-c,v=l<=d;if(p>l)return this.privateDirection="down";if(v||!this.minHeight)return this.determinePopOffset(),this.privateDirection="up";const{minHeight:u=150}=this;if(p>=u+5){const t=Math.max(p-5,u);return n.style.setProperty("--comp-pop-max-height",`${t}px`),this.privateDirection="down"}{const t=Math.max(d,u);return n.style.setProperty("--comp-pop-max-height",`${t}px`),this.determinePopOffset(),this.privateDirection="up"}}determinePopOffset(){var t;const{controlElement:i,containerElement:o}=this,e=null!==(t=null==i?void 0:i.getBoundingClientRect().height)&&void 0!==t?t:0;o.style.setProperty("--comp-pop-offset",`${e}px`)}render(){return o("div",{ref:t=>this.containerElement=t,class:["container",this.privateDirection].join(" "),role:"menu"},o("div",{ref:t=>this.contentElement=t,class:"content"},o("slot",null)))}get hostElement(){return s(this)}static get watchers(){return{open:["openChanged"]}}};h.style="*{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}*{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:inline-flex;width:100%}.container{display:block;overflow:hidden;opacity:0;height:0;position:absolute;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%}:host([align=right]) .container{right:0;text-align:end;left:unset}:host([open]) .container{display:block;height:auto;overflow:auto;opacity:1;visibility:visible}.container.up{bottom:var(--comp-pop-offset)}click-elsewhere{position:relative;display:block}.content{height:auto}";export{a as q2_option_list,h as q2_popover}
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as a,g as o}from"./p-926a3e80.js";import{o as e,i as r,l as s}from"./p-a510290a.js";const n=class{constructor(a){t(this,a),this.click=i(this,"click",7),this.activateFirstOption=!1,this.determineHasOptions=()=>{const t=!!this.hostElement.querySelectorAll("q2-option").length;this.hasOptions=t},this.onClickElsewhere=t=>{"click-elsewhere"===t.target.localName&&(t.stopPropagation(),this.popoverElement.open=!1)},this.handleChange=t=>{if(t.stopPropagation(),!this.hasOptions)return;const{value:i}=t.detail;this.click.emit({value:i})},this.handleClick=t=>{t.stopPropagation(),this.activateFirstOption=!1,this.popoverElement.toggle()},this.handleKeydown=t=>{this.activateFirstOption=!0,this.optionList.handleExternalKeydown(t)},this.handleButtonFocusout=t=>{var i;const a=t.relatedTarget;null!==(i="Q2-OPTION"===(null==a?void 0:a.tagName))&&void 0!==i&&i||(this.open=!1)},this.handleWrapperClick=()=>{this.dropdownBtn.focus(),this.dropdownBtn.click()},this.open=void 0,this.role="listitem",this.label=void 0,this.theme=void 0,this.popoverMinHeight=150,this.popoverDirection=void 0,this.hasOptions=void 0}componentWillLoad(){const t=new MutationObserver(this.determineHasOptions);t.observe(this.hostElement,{childList:!0,attributes:!0}),this.mutationObserver=t}componentDidLoad(){e(this.hostElement)}disconnectedCallback(){this.mutationObserver.disconnect(),this.mutationObserver=null}delegateFocus(t){r(t,this.hostElement)&&this.hasOptions&&this.dropdownBtn.focus()}popoverStateHandler({detail:{open:t}}){this.open!==t&&(this.open=t),t&&this.activateFirstOption?(this.optionList.focus(),this.activateFirstOption=!1):(this.optionList.setActiveElement(null),this.dropdownBtn.focus())}render(){const{hasOptions:t,open:i}=this,o=["tag-wrapper"];return t&&o.push("has-options"),a("click-elsewhere",{onChange:this.onClickElsewhere},a("div",{class:o.join(" "),onClick:t=>t.stopPropagation()},a("div",{class:"tag"},this.label),this.hasOptions&&a("div",{class:"btn-wrapper",onClick:this.handleWrapperClick},a("button",{ref:t=>this.dropdownBtn=t,"test-id":"btn-control",onClick:this.handleClick,onKeyDown:this.handleKeydown,onFocusout:this.handleButtonFocusout,"aria-controls":"option-list","aria-haspopup":"true","aria-expanded":i?"true":"false","aria-label":s("tecton.element.tag.viewOptions")},a("q2-icon",{type:"options"})))),this.hasOptions&&a("q2-popover",{ref:t=>this.popoverElement=t,controlElement:this.dropdownBtn,open:this.open,minHeight:this.popoverMinHeight,direction:this.popoverDirection},a("q2-option-list",{id:"option-list",ref:t=>this.optionList=t,onChange:this.handleChange,align:"right",type:"menu","no-select":!0},a("slot",null))))}get hostElement(){return o(this)}};n.style="*{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:inline-block;position:relative;line-height:0}:host(:not(:last-child)){margin-inline-end:var(--tct-tag-margin, var(--t-tag-margin, var(--app-scale-2x, 10px)))}.tag-wrapper{--comp-tag-btn-size:var(--tct-tag-btn-size, var(--t-tag-btn-size, var(--app-scale-6x, 30px)));--comp-tag-background:var(--tct-tag-background, var(--t-tag-background, var(--t-gray-13, #e6e6e6)));--comp-tag-color:var(--tct-tag-color, var(--t-tag-color, var(--t-gray-3, #262626)));position:relative}:host([theme=primary]) .tag-wrapper{--comp-tag-background:var(--t-primary-l5, #61c4ff);--comp-tag-color:var(--t-primary-text, #ffffff)}:host([theme=secondary]) .tag-wrapper{--comp-tag-background:var(--t-secondary-l5, #d9e1e6);--comp-tag-color:var(--t-secondary-text, #000000)}:host([theme=tertiary]) .tag-wrapper{--comp-tag-background:var(--t-tertiary-l5, #f4fafe);--comp-tag-color:var(--t-tertiary-text, #000000)}.tag{height:var(--tct-tag-height, var(--t-tag-height, var(--app-scale-6x, 30px)));line-height:var(--tct-tag-height, var(--t-tag-height, var(--app-scale-6x, 30px)));padding-inline:var(--tct-tag-padding-inline, var(--t-tag-padding-inline, var(--app-scale-3x, 15px)));background:var(--comp-tag-background);color:var(--comp-tag-color);border-radius:var(--tct-tag-border-radius, var(--t-tag-border-radius, var(--app-border-radius-1, 3px)))}.has-options .tag{padding-right:var(--comp-tag-btn-size)}.btn-wrapper{--comp-tag-clickable-size:var(--tct-tag-clickable-size, var(--t-tag-clickable-size, 44px));--comp-tag-btn-offset:calc(calc(calc(var(--comp-tag-clickable-size) - var(--comp-tag-btn-size)) / 2) * -1);height:var(--comp-tag-clickable-size);width:var(--comp-tag-clickable-size);display:flex;align-items:center;justify-content:center;position:absolute;right:var(--comp-tag-btn-offset);top:var(--comp-tag-btn-offset);cursor:pointer}button{width:var(--comp-tag-btn-size);height:var(--comp-tag-btn-size);stroke:var(--comp-tag-color);--tct-icon-stroke-primary:var(--comp-tag-color);cursor:pointer;border:0;background:transparent;display:flex;align-items:center;justify-content:center;padding:0;--tct-icon-size:18px}";export{n as q2_tag}
@@ -1 +0,0 @@
1
- import{h as o}from"./p-926a3e80.js";var n,i=(function(o){o.exports={polyfill:function(){var o=window,n=document;if(!("scrollBehavior"in n.documentElement.style)||!0===o.__forceSmoothScrollPolyfill__){var i,t=o.HTMLElement||o.Element,e={scroll:o.scroll||o.scrollTo,scrollBy:o.scrollBy,elementScroll:t.prototype.scroll||a,scrollIntoView:t.prototype.scrollIntoView},r=o.performance&&o.performance.now?o.performance.now.bind(o.performance):Date.now,l=(i=o.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(i)?1:0);o.scroll=o.scrollTo=function(){void 0!==arguments[0]&&(!0!==s(arguments[0])?h.call(o,n.body,void 0!==arguments[0].left?~~arguments[0].left:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:o.scrollY||o.pageYOffset):e.scroll.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:o.scrollX||o.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:o.scrollY||o.pageYOffset))},o.scrollBy=function(){void 0!==arguments[0]&&(s(arguments[0])?e.scrollBy.call(o,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):h.call(o,n.body,~~arguments[0].left+(o.scrollX||o.pageXOffset),~~arguments[0].top+(o.scrollY||o.pageYOffset)))},t.prototype.scroll=t.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==s(arguments[0])){var o=arguments[0].left,n=arguments[0].top;h.call(this,this,void 0===o?this.scrollLeft:~~o,void 0===n?this.scrollTop:~~n)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");e.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},t.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==s(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):e.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},t.prototype.scrollIntoView=function(){if(!0!==s(arguments[0])){var i=v(this),t=i.getBoundingClientRect(),r=this.getBoundingClientRect();i!==n.body?(h.call(this,i,i.scrollLeft+r.left-t.left,i.scrollTop+r.top-t.top),"fixed"!==o.getComputedStyle(i).position&&o.scrollBy({left:t.left,top:t.top,behavior:"smooth"})):o.scrollBy({left:r.left,top:r.top,behavior:"smooth"})}else e.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function a(o,n){this.scrollLeft=o,this.scrollTop=n}function s(o){if(null===o||"object"!=typeof o||void 0===o.behavior||"auto"===o.behavior||"instant"===o.behavior)return!0;if("object"==typeof o&&"smooth"===o.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+o.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(o,n){return"Y"===n?o.clientHeight+l<o.scrollHeight:"X"===n?o.clientWidth+l<o.scrollWidth:void 0}function d(n,i){var t=o.getComputedStyle(n,null)["overflow"+i];return"auto"===t||"scroll"===t}function c(o){var n=u(o,"Y")&&d(o,"Y"),i=u(o,"X")&&d(o,"X");return n||i}function v(o){for(;o!==n.body&&!1===c(o);)o=o.parentNode||o.host;return o}function f(n){var i,t,e,l=(r()-n.startTime)/468;l=l>1?1:l,i=.5*(1-Math.cos(Math.PI*l)),n.method.call(n.scrollable,t=n.startX+(n.x-n.startX)*i,e=n.startY+(n.y-n.startY)*i),t===n.x&&e===n.y||o.requestAnimationFrame(f.bind(o,n))}function h(i,t,l){var s,u,d,c,v=r();i===n.body?(s=o,u=o.scrollX||o.pageXOffset,d=o.scrollY||o.pageYOffset,c=e.scroll):(s=i,u=i.scrollLeft,d=i.scrollTop,c=a),f({scrollable:s,method:c,startTime:v,startX:u,startY:d,x:t,y:l})}}}}(n={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),n.exports);function t(o,n){return o.relatedTarget!==n&&!n.contains(o.relatedTarget)}function e(o,n){var i;return(null===(i=o.composedPath)||void 0===i?void 0:i.call(o)[0])===n}function r(o){o.focus=()=>null==o?void 0:o.dispatchEvent(new FocusEvent("focus",{bubbles:!1}))}function l(){return!!function(){const o=navigator.userAgent.toLowerCase();return o.includes("safari")&&!o.includes("chrome")}()&&(i.polyfill(),window.__forceSmoothScrollPolyfill__=!0)}function a(){return navigator.userAgent.toLowerCase().includes("firefox")}function s(){return"ontouchstart"in window||navigator.maxTouchPoints>0}let u=1e3;function d(){return u++}function c(o,n){n?o():requestAnimationFrame((()=>c(o,!0)))}function v(o,n){var i,t,e;return o?!0===(null===(i=window.Tecton)||void 0===i?void 0:i.noStrings)?o:null!==(e=null===(t=null===window||void 0===window?void 0:window.TectonElements)||void 0===t?void 0:t.loc(o,n))&&void 0!==e?e:o:""}function f(n){const{label:i,hideLabel:t}=n;if(!i||t)return;let e="";return n.optional&&(e=o("span",{class:"optional-tag"},v("tecton.element.input.optional"))),n.readonly&&(e=o("span",{class:"optional-tag"},v("tecton.element.input.readonly"))),o("label",{htmlFor:n.inputId,class:n.readonly?"readonly-field":""},v(n.label),e)}function h(o){const{ariaLabel:n}=o;n&&("hideLabel"in o&&(o.hideLabel=!0),o.label=v(n),o.ariaLabel=void 0)}function p(n){return o("div",{class:"messages-container"},o("q2-message",{appearance:"minimal",description:!0,type:n.hasError?"danger":"info"},o("ul",{id:n.inputDescribedBy},n.messages.map((n=>o("li",null,v(n)))))))}function w(o){const n=o.hostElement.shadowRoot.querySelector(".messages-container"),i=n.querySelector("q2-message");c((()=>{const t=o.showMessages&&o.hasFocus?i.getBoundingClientRect().height:0;n.style.getPropertyValue("height")!==`${t}px`&&(0===t?(i.classList.add("invisible"),n.style.removeProperty("height")):(i.classList.remove("invisible"),n.style.setProperty("height",`${t}px`)))}))}function m(o){var n,i,t,e;const{dropdownContainer:r,popDirection:l}=o;if(r&&(r.style.maxHeight=null),l)return o.privatePopDirection=l;const a=o.inputField||o.controlElement,s=o.minPopHeight||null;r.classList.add("sizable");const u=r.getBoundingClientRect().height;r.classList.remove("sizable");const{top:d,height:c}=a.getBoundingClientRect(),v=((null===(i=null===(n=window.Tecton)||void 0===n?void 0:n.platformDimensions)||void 0===i?void 0:i.scrollY)||0)+((null===(e=null===(t=window.Tecton)||void 0===t?void 0:t.platformDimensions)||void 0===e?void 0:e.innerHeight)||window.innerHeight)-d-c,f=u<=d;if(v>u)return o.privatePopDirection="down";if(f||!s)return b(o),o.privatePopDirection="up";if(v>=s+5){const n=Math.max(v-5,s);return r.style.maxHeight=`${n}px`,o.privatePopDirection="down"}{const n=Math.max(d,s);return r.style.maxHeight=`${n}px`,b(o),o.privatePopDirection="up"}}const b=({dropdownContainer:o,inputField:n})=>{var i,t;if(!n)return;const e=null===(t=null===(i=n.shadowRoot)||void 0===i?void 0:i.querySelector(".input-field"))||void 0===t?void 0:t.getBoundingClientRect().height;o.style.setProperty("--comp-dropup-offset",`${e}px`)},y=()=>{var o,n;return null===(n=null===(o=window.TectonElements)||void 0===o?void 0:o.resizeIframe)||void 0===n?void 0:n.call(o)},g=o=>{!o.intent&&["primary","secondary"].includes(o.color)&&(o.intent=`workflow-${o.color}`,o.color=void 0)};export{s as a,t as b,d as c,l as d,w as e,f,a as g,h,e as i,g as j,v as l,p as m,c as n,r as o,y as r,m as s}
@@ -1 +0,0 @@
1
- import{r as t,h as e,g as r}from"./p-926a3e80.js";import{c as o,l as i}from"./p-a510290a.js";const a=class{constructor(e){t(this,e),this.guid=o(),this.setHidden=()=>{this.hidden=this.options.every((t=>t.hidden||t._multiSelectHidden))},this.disabled=!1,this.label=void 0,this.hidden=!1}componentWillLoad(){const t=new MutationObserver(this.setHidden);t.observe(this.hostElement,{childList:!0,attributes:!0,subtree:!0}),this.mutationObserver=t,this.setHidden(),this.disabledWatcher(this.disabled)}disconnectedCallback(){this.mutationObserver.disconnect(),this.mutationObserver=null}get headerId(){return`q2-optgroup-header-${this.guid}`}get options(){return Array.from(this.hostElement.querySelectorAll("q2-option"))}disabledWatcher(t){this.options.forEach((e=>{e.disabledGroup=!!t}))}render(){return e("div",{class:"q2-optgroup-container",hidden:this.hidden,"aria-labelledby":this.headerId,role:"group"},e("div",{class:"q2-optgroup-header",id:this.headerId},this.label&&i(this.label)||""),e("div",{class:"q2-optgroup-options"},e("slot",null)))}get hostElement(){return r(this)}static get watchers(){return{disabled:["disabledWatcher"]}}};a.style="*{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}.q2-optgroup-header{--comp-header-padding:var(--tct-scale-1, var(--app-scale-1x, 5px)) var(--tct-scale-2, var(--app-scale-2x, 10px));background:var(--tct-optgroup-header-bg, var(--t-optgroup-header-bg, var(--tct-gray-13, var(--t-gray-13, var(--tct-gray-l2, var(--app-gray-l2, #e6e6e6))))));padding:var(--tct-optgroup-header-padding, var(--t-optgroup-header-padding, var(--comp-header-padding)));font-weight:var(--tct-optgroup-header-font-weight, var(--t-optgroup-header-font-weight, 600));text-transform:var(--tct-optgroup-header-text-transform, var(--t-optgroup-header-text-transform, uppercase));position:sticky;top:var(--comp-multi-select-header-height, 0);z-index:1}";export{a as q2_optgroup}