@threadlabs/looma 0.1.28 → 0.2.1

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 (210) hide show
  1. package/dist/{chunk-G5AWV77V.js → chunk-WW7Y67EW.js} +32 -33
  2. package/dist/{chunk-M7FPK6GN.js → chunk-Z4W5W53T.js} +19 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/looma.cjs.js +1 -1
  5. package/dist/cjs/{positioning-D5q9DM-0.js → positioning-BiPpyC-_.js} +26 -0
  6. package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
  7. package/dist/cjs/ui-chip_2.cjs.entry.js +190 -498
  8. package/dist/cjs/ui-combobox.cjs.entry.js +708 -0
  9. package/dist/cjs/ui-context-menu.cjs.entry.js +2 -2
  10. package/dist/cjs/ui-dialog.cjs.entry.js +1 -1
  11. package/dist/cjs/ui-disclosure.cjs.entry.js +1 -1
  12. package/dist/cjs/ui-editable.cjs.entry.js +3 -3
  13. package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
  14. package/dist/cjs/ui-form-field.cjs.entry.js +1 -1
  15. package/dist/cjs/ui-icon-button.cjs.entry.js +1 -1
  16. package/dist/cjs/ui-input.cjs.entry.js +1 -1
  17. package/dist/cjs/ui-menu-item.cjs.entry.js +1 -1
  18. package/dist/cjs/ui-menu.cjs.entry.js +2 -2
  19. package/dist/cjs/ui-popover.cjs.entry.js +2 -2
  20. package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
  21. package/dist/cjs/ui-radio.cjs.entry.js +1 -1
  22. package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
  23. package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
  24. package/dist/cjs/ui-select.cjs.entry.js +1 -1
  25. package/dist/cjs/ui-switch.cjs.entry.js +2 -2
  26. package/dist/cjs/ui-tabs.cjs.entry.js +1 -1
  27. package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
  28. package/dist/cjs/ui-toast-region.cjs.entry.js +2 -2
  29. package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/ui-tree-item.cjs.entry.js +2 -2
  31. package/dist/cjs/ui-tree.cjs.entry.js +1 -1
  32. package/dist/collection/collection-manifest.json +0 -1
  33. package/dist/collection/components/ui-combobox/ui-combobox.css +23 -0
  34. package/dist/collection/components/ui-combobox/ui-combobox.js +298 -21
  35. package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
  36. package/dist/collection/components/ui-dialog/ui-dialog.js +1 -1
  37. package/dist/collection/components/ui-disclosure/ui-disclosure.js +1 -1
  38. package/dist/collection/components/ui-editable/ui-editable.js +3 -3
  39. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
  40. package/dist/collection/components/ui-form-field/ui-form-field.js +1 -1
  41. package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
  42. package/dist/collection/components/ui-input/ui-input.js +1 -1
  43. package/dist/collection/components/ui-menu/ui-menu.js +1 -1
  44. package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
  45. package/dist/collection/components/ui-popover/ui-popover.js +1 -1
  46. package/dist/collection/components/ui-radio/ui-radio.js +1 -1
  47. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  48. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
  49. package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
  50. package/dist/collection/components/ui-select/ui-select.js +1 -1
  51. package/dist/collection/components/ui-switch/ui-switch.js +2 -2
  52. package/dist/collection/components/ui-tabs/ui-tabs.js +1 -1
  53. package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
  54. package/dist/collection/components/ui-toast-region/ui-toast-region.js +1 -1
  55. package/dist/collection/components/ui-tooltip/ui-tooltip.js +1 -1
  56. package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
  57. package/dist/collection/components/ui-tree/ui-tree.js +1 -1
  58. package/dist/collection/components/ui-tree-item/ui-tree-item.js +2 -2
  59. package/dist/collection/overlay/positioning.js +26 -0
  60. package/dist/components/index.d.ts +0 -2
  61. package/dist/components/index.js +1 -1
  62. package/dist/components/p-BOC_l2hE.js +1 -0
  63. package/dist/components/{p-B1macZOS.js → p-Btk_75st.js} +1 -1
  64. package/dist/components/p-biKnomFl.js +1 -0
  65. package/dist/components/ui-affordance-scope.js +1 -1
  66. package/dist/components/ui-combobox.js +1 -1
  67. package/dist/components/ui-context-menu.js +1 -1
  68. package/dist/components/ui-dialog.js +1 -1
  69. package/dist/components/ui-disclosure.js +1 -1
  70. package/dist/components/ui-editable.js +1 -1
  71. package/dist/components/ui-floating-action-button.js +1 -1
  72. package/dist/components/ui-form-field.js +1 -1
  73. package/dist/components/ui-icon-button.js +1 -1
  74. package/dist/components/ui-input.js +1 -1
  75. package/dist/components/ui-menu-item.js +1 -1
  76. package/dist/components/ui-menu.js +1 -1
  77. package/dist/components/ui-popover.js +1 -1
  78. package/dist/components/ui-radio-group.js +1 -1
  79. package/dist/components/ui-radio.js +1 -1
  80. package/dist/components/ui-search-result-row.js +1 -1
  81. package/dist/components/ui-search-shell.js +1 -1
  82. package/dist/components/ui-select.js +1 -1
  83. package/dist/components/ui-switch.js +1 -1
  84. package/dist/components/ui-tabs.js +1 -1
  85. package/dist/components/ui-textarea.js +1 -1
  86. package/dist/components/ui-toast-region.js +1 -1
  87. package/dist/components/ui-tooltip.js +1 -1
  88. package/dist/components/ui-top-bar.js +1 -1
  89. package/dist/components/ui-tree-item.js +1 -1
  90. package/dist/components/ui-tree.js +1 -1
  91. package/dist/esm/loader.js +1 -1
  92. package/dist/esm/looma.js +1 -1
  93. package/dist/esm/{positioning-Drmwg-C1.js → positioning-Ig1jYhE1.js} +26 -0
  94. package/dist/esm/ui-affordance-scope.entry.js +1 -1
  95. package/dist/esm/ui-chip_2.entry.js +193 -501
  96. package/dist/esm/ui-combobox.entry.js +706 -0
  97. package/dist/esm/ui-context-menu.entry.js +2 -2
  98. package/dist/esm/ui-dialog.entry.js +1 -1
  99. package/dist/esm/ui-disclosure.entry.js +1 -1
  100. package/dist/esm/ui-editable.entry.js +3 -3
  101. package/dist/esm/ui-floating-action-button.entry.js +1 -1
  102. package/dist/esm/ui-form-field.entry.js +1 -1
  103. package/dist/esm/ui-icon-button.entry.js +1 -1
  104. package/dist/esm/ui-input.entry.js +1 -1
  105. package/dist/esm/ui-menu-item.entry.js +1 -1
  106. package/dist/esm/ui-menu.entry.js +2 -2
  107. package/dist/esm/ui-popover.entry.js +2 -2
  108. package/dist/esm/ui-radio-group.entry.js +1 -1
  109. package/dist/esm/ui-radio.entry.js +1 -1
  110. package/dist/esm/ui-search-result-row.entry.js +1 -1
  111. package/dist/esm/ui-search-shell.entry.js +1 -1
  112. package/dist/esm/ui-select.entry.js +1 -1
  113. package/dist/esm/ui-switch.entry.js +2 -2
  114. package/dist/esm/ui-tabs.entry.js +1 -1
  115. package/dist/esm/ui-textarea.entry.js +1 -1
  116. package/dist/esm/ui-toast-region.entry.js +2 -2
  117. package/dist/esm/ui-top-bar.entry.js +1 -1
  118. package/dist/esm/ui-tree-item.entry.js +2 -2
  119. package/dist/esm/ui-tree.entry.js +1 -1
  120. package/dist/index.cjs +516 -524
  121. package/dist/index.js +19 -2
  122. package/dist/looma/looma.esm.js +1 -1
  123. package/dist/looma/{p-32c85198.entry.js → p-08c9e253.entry.js} +1 -1
  124. package/dist/looma/{p-88e61cab.entry.js → p-0fa7062f.entry.js} +1 -1
  125. package/dist/looma/{p-9a82c523.entry.js → p-1249a806.entry.js} +1 -1
  126. package/dist/looma/p-172d67ff.entry.js +1 -0
  127. package/dist/looma/p-1c00670f.entry.js +1 -0
  128. package/dist/looma/p-22842f8c.entry.js +1 -0
  129. package/dist/looma/{p-1e1de77f.entry.js → p-2915d5c0.entry.js} +1 -1
  130. package/dist/looma/{p-2f3c1b57.entry.js → p-3b2961a6.entry.js} +1 -1
  131. package/dist/looma/{p-e07e6ac2.entry.js → p-3f60f4c8.entry.js} +1 -1
  132. package/dist/looma/p-3fba3edd.entry.js +1 -0
  133. package/dist/looma/{p-9551ebf6.entry.js → p-424d6719.entry.js} +1 -1
  134. package/dist/looma/p-4354f48f.entry.js +1 -0
  135. package/dist/looma/{p-6cc3180b.entry.js → p-4caccfce.entry.js} +1 -1
  136. package/dist/looma/{p-f431dc13.entry.js → p-6f20d470.entry.js} +1 -1
  137. package/dist/looma/{p-b68762f2.entry.js → p-7c0b5364.entry.js} +1 -1
  138. package/dist/looma/p-7ebbe74e.entry.js +1 -0
  139. package/dist/looma/{p-e82f104c.entry.js → p-8bdd9495.entry.js} +1 -1
  140. package/dist/looma/{p-df696cca.entry.js → p-9cfbf722.entry.js} +1 -1
  141. package/dist/looma/p-Ig1jYhE1.js +1 -0
  142. package/dist/looma/{p-607c3056.entry.js → p-b6ede6bb.entry.js} +1 -1
  143. package/dist/looma/{p-da6e2d01.entry.js → p-b76e2111.entry.js} +1 -1
  144. package/dist/looma/{p-1a12eb5c.entry.js → p-d372b0db.entry.js} +1 -1
  145. package/dist/looma/{p-20387ffa.entry.js → p-d4825822.entry.js} +1 -1
  146. package/dist/looma/{p-8a5e3fe1.entry.js → p-d5c3954f.entry.js} +1 -1
  147. package/dist/looma/{p-4f68f939.entry.js → p-e604e906.entry.js} +1 -1
  148. package/dist/looma/p-ec1c02e5.entry.js +1 -0
  149. package/dist/looma/{p-e406656e.entry.js → p-f1f7c5cb.entry.js} +1 -1
  150. package/dist/types/components/ui-combobox/ui-combobox.d.ts +35 -4
  151. package/dist/types/components.d.ts +56 -153
  152. package/dist/{ui-affordance-scope.entry-X5526PRP.js → ui-affordance-scope.entry-FENYADN3.js} +2 -2
  153. package/dist/{ui-avatar-group.entry-U72MPB5K.js → ui-avatar-group.entry-K7D6QKDP.js} +1 -1
  154. package/dist/{ui-avatar.entry-OC4J3LTV.js → ui-avatar.entry-WCYFUQZT.js} +1 -1
  155. package/dist/{ui-badge.entry-4MSUQRQV.js → ui-badge.entry-VZC4LONR.js} +1 -1
  156. package/dist/{ui-button.entry-22DESWN4.js → ui-button.entry-7E2KMPRF.js} +1 -1
  157. package/dist/{ui-callout.entry-LOGODDM5.js → ui-callout.entry-7WXQ47S6.js} +1 -1
  158. package/dist/{ui-checkbox.entry-XAGW3BW4.js → ui-checkbox.entry-GTSEB7ZS.js} +1 -1
  159. package/dist/{ui-tooltip.entry-AQ6UPBUP.js → ui-chip_2.entry-PG24H67I.js} +19 -4
  160. package/dist/{ui-chip_2.entry-JCPHPXAG.js → ui-combobox.entry-NTCOCZOH.js} +170 -31
  161. package/dist/{ui-context-menu.entry-24YOHF7L.js → ui-context-menu.entry-7GSDWHTP.js} +3 -3
  162. package/dist/{ui-dialog.entry-XKNYDWOQ.js → ui-dialog.entry-F53O6FBQ.js} +2 -2
  163. package/dist/{ui-disclosure.entry-2AWCGZ4C.js → ui-disclosure.entry-YWJA42GQ.js} +2 -2
  164. package/dist/{ui-editable.entry-HLEWO7BN.js → ui-editable.entry-3QPCWDPM.js} +3 -3
  165. package/dist/{ui-floating-action-button.entry-2NJDB4YN.js → ui-floating-action-button.entry-L4UC6RFM.js} +2 -2
  166. package/dist/{ui-form-field.entry-FJ5HYCTN.js → ui-form-field.entry-2VCITLQA.js} +2 -2
  167. package/dist/{ui-icon-button.entry-YZHJQ5YR.js → ui-icon-button.entry-MRRA6NVP.js} +2 -2
  168. package/dist/{ui-input.entry-JMBLMNP6.js → ui-input.entry-7LYLUJNT.js} +2 -2
  169. package/dist/{ui-menu-item.entry-VBGXM66D.js → ui-menu-item.entry-YHSIKO5W.js} +2 -2
  170. package/dist/{ui-menu.entry-I2N5H3YC.js → ui-menu.entry-ZQBF7B4T.js} +3 -3
  171. package/dist/{ui-popover.entry-7JRSJM5S.js → ui-popover.entry-2HG5ZWQX.js} +3 -3
  172. package/dist/{ui-radio-group.entry-Q2XB7P3B.js → ui-radio-group.entry-A6LI3KHW.js} +2 -2
  173. package/dist/{ui-radio.entry-NJO4NA4M.js → ui-radio.entry-WBCZZG5D.js} +2 -2
  174. package/dist/{ui-search-result-row.entry-RPMNDSRN.js → ui-search-result-row.entry-P25POOYP.js} +2 -2
  175. package/dist/{ui-search-shell.entry-FMIMYD3B.js → ui-search-shell.entry-R6IVRPSW.js} +2 -2
  176. package/dist/{ui-select.entry-7NDBWNAU.js → ui-select.entry-CAAGCELJ.js} +2 -2
  177. package/dist/{ui-switch.entry-YUCPIZE4.js → ui-switch.entry-SKU445KH.js} +3 -3
  178. package/dist/{ui-tabs.entry-FXZWV665.js → ui-tabs.entry-7BQPZEH3.js} +2 -2
  179. package/dist/{ui-textarea.entry-HHLQR5GG.js → ui-textarea.entry-OFC4YUU7.js} +2 -2
  180. package/dist/{ui-toast-region.entry-PIIBHNYA.js → ui-toast-region.entry-7VNTFVDO.js} +3 -3
  181. package/dist/{ui-top-bar.entry-S2L7ZM4U.js → ui-top-bar.entry-2N3EKMVF.js} +2 -2
  182. package/dist/{ui-tree-item.entry-UID7IJPA.js → ui-tree-item.entry-SLHAE42A.js} +3 -3
  183. package/dist/{ui-tree.entry-UMD3DNG5.js → ui-tree.entry-LF45JUC4.js} +2 -2
  184. package/package.json +1 -1
  185. package/vue/{chunk-2DDIBSFD.js → chunk-ROMBQS2L.js} +32 -89
  186. package/vue/editor/index.js +1 -1
  187. package/vue/index.d.ts +30 -107
  188. package/vue/index.js +1 -3
  189. package/dist/cjs/ui-multi-combobox.cjs.entry.js +0 -190
  190. package/dist/cjs/ui-tooltip.cjs.entry.js +0 -241
  191. package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.css +0 -33
  192. package/dist/collection/components/ui-multi-combobox/ui-multi-combobox.js +0 -553
  193. package/dist/components/p-DiyiodGX.js +0 -1
  194. package/dist/components/p-Drw41pSY.js +0 -1
  195. package/dist/components/p-d5fk1vBI.js +0 -1
  196. package/dist/components/ui-multi-combobox.d.ts +0 -11
  197. package/dist/components/ui-multi-combobox.js +0 -1
  198. package/dist/esm/ui-multi-combobox.entry.js +0 -188
  199. package/dist/esm/ui-tooltip.entry.js +0 -239
  200. package/dist/looma/p-071c139c.entry.js +0 -1
  201. package/dist/looma/p-311e54d4.entry.js +0 -1
  202. package/dist/looma/p-3957f7ef.entry.js +0 -1
  203. package/dist/looma/p-4a10a875.entry.js +0 -1
  204. package/dist/looma/p-4fc9917f.entry.js +0 -1
  205. package/dist/looma/p-63a9159f.entry.js +0 -1
  206. package/dist/looma/p-82de1112.entry.js +0 -1
  207. package/dist/looma/p-Drmwg-C1.js +0 -1
  208. package/dist/looma/p-caa37be2.entry.js +0 -1
  209. package/dist/types/components/ui-multi-combobox/ui-multi-combobox.d.ts +0 -51
  210. package/dist/ui-multi-combobox.entry-MEX7MU7P.js +0 -196
package/vue/index.d.ts CHANGED
@@ -356,7 +356,7 @@ declare const Combobox: vue.DefineComponent<vue.ExtractPropTypes<{
356
356
  required: true;
357
357
  };
358
358
  modelValue: {
359
- type: vue.PropType<string | null>;
359
+ type: vue.PropType<string | readonly _threadlabs_looma_core.MultiComboboxItem[] | null>;
360
360
  default: undefined;
361
361
  };
362
362
  query: {
@@ -385,6 +385,11 @@ declare const Combobox: vue.DefineComponent<vue.ExtractPropTypes<{
385
385
  disclosure: BooleanConstructor;
386
386
  clearable: BooleanConstructor;
387
387
  help: StringConstructor;
388
+ multiple: BooleanConstructor;
389
+ tokenSeparators: {
390
+ type: vue.PropType<readonly string[]>;
391
+ default: () => never[];
392
+ };
388
393
  }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
389
394
  [key: string]: any;
390
395
  }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
@@ -395,18 +400,22 @@ declare const Combobox: vue.DefineComponent<vue.ExtractPropTypes<{
395
400
  display: string;
396
401
  trigger: string;
397
402
  }) => true;
398
- valueChange: (_detail: _threadlabs_looma_core.ComboboxChange) => true;
403
+ valueChange: (_detail: _threadlabs_looma_core.ComboboxChange | readonly _threadlabs_looma_core.MultiComboboxItem[]) => true;
399
404
  freeEntry: (_detail: _threadlabs_looma_core.ComboboxChange) => true;
400
405
  createEntry: (_detail: _threadlabs_looma_core.ComboboxChange) => true;
401
406
  dependencyInvalidate: (_detail: _threadlabs_looma_core.ComboboxChange) => true;
402
407
  validationChange: (_detail: _threadlabs_looma_core.ComboboxValidationState) => true;
408
+ addItem: (_detail: _threadlabs_looma_core.MultiComboboxItemChange) => true;
409
+ removeItem: (_detail: _threadlabs_looma_core.MultiComboboxItemChange) => true;
410
+ createItem: (_detail: _threadlabs_looma_core.MultiComboboxCreate) => true;
411
+ optionsChange: (_detail: readonly _threadlabs_looma_core.ComboboxOption[]) => true;
403
412
  }, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
404
413
  label: {
405
414
  type: StringConstructor;
406
415
  required: true;
407
416
  };
408
417
  modelValue: {
409
- type: vue.PropType<string | null>;
418
+ type: vue.PropType<string | readonly _threadlabs_looma_core.MultiComboboxItem[] | null>;
410
419
  default: undefined;
411
420
  };
412
421
  query: {
@@ -435,6 +444,11 @@ declare const Combobox: vue.DefineComponent<vue.ExtractPropTypes<{
435
444
  disclosure: BooleanConstructor;
436
445
  clearable: BooleanConstructor;
437
446
  help: StringConstructor;
447
+ multiple: BooleanConstructor;
448
+ tokenSeparators: {
449
+ type: vue.PropType<readonly string[]>;
450
+ default: () => never[];
451
+ };
438
452
  }>> & Readonly<{
439
453
  "onUpdate:modelValue"?: (_value: string | null) => any;
440
454
  "onUpdate:query"?: (_query: string) => any;
@@ -443,133 +457,43 @@ declare const Combobox: vue.DefineComponent<vue.ExtractPropTypes<{
443
457
  display: string;
444
458
  trigger: string;
445
459
  }) => any;
446
- onValueChange?: (_detail: _threadlabs_looma_core.ComboboxChange) => any;
460
+ onValueChange?: (_detail: _threadlabs_looma_core.ComboboxChange | readonly _threadlabs_looma_core.MultiComboboxItem[]) => any;
447
461
  onFreeEntry?: (_detail: _threadlabs_looma_core.ComboboxChange) => any;
448
462
  onCreateEntry?: (_detail: _threadlabs_looma_core.ComboboxChange) => any;
449
463
  onDependencyInvalidate?: (_detail: _threadlabs_looma_core.ComboboxChange) => any;
450
464
  onValidationChange?: (_detail: _threadlabs_looma_core.ComboboxValidationState) => any;
465
+ onAddItem?: (_detail: _threadlabs_looma_core.MultiComboboxItemChange) => any;
466
+ onRemoveItem?: (_detail: _threadlabs_looma_core.MultiComboboxItemChange) => any;
467
+ onCreateItem?: (_detail: _threadlabs_looma_core.MultiComboboxCreate) => any;
468
+ onOptionsChange?: (_detail: readonly _threadlabs_looma_core.ComboboxOption<unknown>[]) => any;
451
469
  }>, {
452
470
  disabled: boolean;
453
471
  readOnly: boolean;
454
472
  required: boolean;
455
473
  disclosure: boolean;
456
474
  clearable: boolean;
457
- modelValue: string | null;
475
+ multiple: boolean;
476
+ modelValue: string | readonly _threadlabs_looma_core.MultiComboboxItem[] | null;
458
477
  query: string;
459
478
  config: _threadlabs_looma_core.ComboboxConfig;
460
479
  size: "sm" | "md";
461
480
  labelVisibility: "visible" | "sr-only";
481
+ tokenSeparators: readonly string[];
462
482
  }, vue.SlotsType<{
463
483
  option: {
464
484
  option: _threadlabs_looma_core.ComboboxOption;
465
485
  };
466
- loading: Record<string, never>;
467
- empty: Record<string, never>;
468
- error: Record<string, never>;
469
- create: Record<string, never>;
470
- start: Record<string, never>;
471
- footer: Record<string, never>;
472
- }>, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
473
- declare const MultiCombobox: vue.DefineComponent<vue.ExtractPropTypes<{
474
- label: {
475
- type: StringConstructor;
476
- required: true;
477
- };
478
- items: {
479
- type: vue.PropType<readonly _threadlabs_looma_core.MultiComboboxItem[]>;
480
- default: () => never[];
481
- };
482
- config: {
483
- type: vue.PropType<_threadlabs_looma_core.ComboboxConfig>;
484
- default: () => {};
485
- };
486
- query: {
487
- type: StringConstructor;
488
- default: undefined;
489
- };
490
- defaultQuery: StringConstructor;
491
- tokenSeparators: {
492
- type: vue.PropType<readonly string[]>;
493
- default: () => never[];
494
- };
495
- placeholder: StringConstructor;
496
- name: StringConstructor;
497
- disabled: BooleanConstructor;
498
- readOnly: BooleanConstructor;
499
- required: BooleanConstructor;
500
- }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
501
- [key: string]: any;
502
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
503
- 'update:query': (_query: string) => true;
504
- queryChange: (_detail: {
505
- query: string;
506
- display: string;
507
- trigger: string;
508
- }) => true;
509
- addItem: (_detail: _threadlabs_looma_core.MultiComboboxItemChange) => true;
510
- removeItem: (_detail: _threadlabs_looma_core.MultiComboboxItemChange) => true;
511
- createItem: (_detail: _threadlabs_looma_core.MultiComboboxCreate) => true;
512
- optionsChange: (_detail: readonly _threadlabs_looma_core.ComboboxOption[]) => true;
513
- }, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
514
- label: {
515
- type: StringConstructor;
516
- required: true;
517
- };
518
- items: {
519
- type: vue.PropType<readonly _threadlabs_looma_core.MultiComboboxItem[]>;
520
- default: () => never[];
521
- };
522
- config: {
523
- type: vue.PropType<_threadlabs_looma_core.ComboboxConfig>;
524
- default: () => {};
525
- };
526
- query: {
527
- type: StringConstructor;
528
- default: undefined;
529
- };
530
- defaultQuery: StringConstructor;
531
- tokenSeparators: {
532
- type: vue.PropType<readonly string[]>;
533
- default: () => never[];
534
- };
535
- placeholder: StringConstructor;
536
- name: StringConstructor;
537
- disabled: BooleanConstructor;
538
- readOnly: BooleanConstructor;
539
- required: BooleanConstructor;
540
- }>> & Readonly<{
541
- "onUpdate:query"?: (_query: string) => any;
542
- onQueryChange?: (_detail: {
543
- query: string;
544
- display: string;
545
- trigger: string;
546
- }) => any;
547
- onAddItem?: (_detail: _threadlabs_looma_core.MultiComboboxItemChange) => any;
548
- onRemoveItem?: (_detail: _threadlabs_looma_core.MultiComboboxItemChange) => any;
549
- onCreateItem?: (_detail: _threadlabs_looma_core.MultiComboboxCreate) => any;
550
- onOptionsChange?: (_detail: readonly _threadlabs_looma_core.ComboboxOption<unknown>[]) => any;
551
- }>, {
552
- disabled: boolean;
553
- readOnly: boolean;
554
- required: boolean;
555
- query: string;
556
- config: _threadlabs_looma_core.ComboboxConfig;
557
- items: readonly _threadlabs_looma_core.MultiComboboxItem[];
558
- tokenSeparators: readonly string[];
559
- }, vue.SlotsType<{
560
486
  item: {
561
487
  item: _threadlabs_looma_core.MultiComboboxItem;
562
488
  };
563
- option: {
564
- option: _threadlabs_looma_core.ComboboxOption;
565
- };
489
+ loading: Record<string, never>;
490
+ empty: Record<string, never>;
491
+ error: Record<string, never>;
566
492
  create: {
567
493
  query: string;
568
494
  };
495
+ start: Record<string, never>;
569
496
  footer: Record<string, never>;
570
- loading: Record<string, never>;
571
- empty: Record<string, never>;
572
- error: Record<string, never>;
573
497
  }>, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
574
498
 
575
499
  declare const Stack: vue.DefineComponent<StackProps>;
@@ -615,7 +539,6 @@ declare const Tree: vue.DefineComponent<TreeProps>;
615
539
  declare const TreeItem: vue.DefineComponent<TreeItemProps>;
616
540
  declare const ADAPTER_COMPONENT_TAG_MAP: {
617
541
  readonly Combobox: "ui-combobox";
618
- readonly MultiCombobox: "ui-multi-combobox";
619
542
  readonly Stack: "ui-stack";
620
543
  readonly Inline: "ui-inline";
621
544
  readonly Cluster: "ui-cluster";
@@ -660,4 +583,4 @@ declare const ADAPTER_COMPONENT_TAG_MAP: {
660
583
  };
661
584
  declare const VUE_ADAPTER_NOTE = "Thin adapter only: attrs and slots pass through to custom elements and DOM events map to typed callbacks.";
662
585
 
663
- export { ADAPTER_COMPONENT_TAG_MAP, type AdapterBaseProps, type AdapterComponentProps, AffordanceScope, type AffordanceScopeProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Callout, type CalloutProps, Center, type CenterProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Cluster, type ClusterProps, Combobox, ContextMenu, type ContextMenuProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, Editable, type EditableProps, FloatingActionButton, type FloatingActionButtonProps, FormField, type FormFieldProps, Grid, type GridProps, IconButton, type IconButtonProps, Inline, type InlineProps, Input, type InputProps, Menu, MenuItem, type MenuItemProps, type MenuProps, MultiCombobox, Popover, type PopoverProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Reel, type ReelProps, SearchResultRow, type SearchResultRowProps, SearchShell, type SearchShellProps, Select, type SelectProps, Separator, type SeparatorProps, Sidebar, type SidebarProps, Stack, type StackProps, Switch, type SwitchProps, Switcher, type SwitcherProps, Tabs, type TabsProps, Textarea, type TextareaProps, ToastRegion, type ToastRegionProps, Tooltip, type TooltipProps, TopBar, type TopBarProps, Tree, TreeItem, type TreeItemProps, type TreeProps, VUE_ADAPTER_NOTE, type VueAdapterEventMap };
586
+ export { ADAPTER_COMPONENT_TAG_MAP, type AdapterBaseProps, type AdapterComponentProps, AffordanceScope, type AffordanceScopeProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, Button, type ButtonProps, Callout, type CalloutProps, Center, type CenterProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Cluster, type ClusterProps, Combobox, ContextMenu, type ContextMenuProps, Dialog, type DialogProps, Disclosure, type DisclosureProps, Editable, type EditableProps, FloatingActionButton, type FloatingActionButtonProps, FormField, type FormFieldProps, Grid, type GridProps, IconButton, type IconButtonProps, Inline, type InlineProps, Input, type InputProps, Menu, MenuItem, type MenuItemProps, type MenuProps, Popover, type PopoverProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Reel, type ReelProps, SearchResultRow, type SearchResultRowProps, SearchShell, type SearchShellProps, Select, type SelectProps, Separator, type SeparatorProps, Sidebar, type SidebarProps, Stack, type StackProps, Switch, type SwitchProps, Switcher, type SwitcherProps, Tabs, type TabsProps, Textarea, type TextareaProps, ToastRegion, type ToastRegionProps, Tooltip, type TooltipProps, TopBar, type TopBarProps, Tree, TreeItem, type TreeItemProps, type TreeProps, VUE_ADAPTER_NOTE, type VueAdapterEventMap };
package/vue/index.js CHANGED
@@ -23,7 +23,6 @@ import {
23
23
  Input,
24
24
  Menu,
25
25
  MenuItem,
26
- MultiCombobox,
27
26
  Popover,
28
27
  Radio,
29
28
  RadioGroup,
@@ -44,7 +43,7 @@ import {
44
43
  Tree,
45
44
  TreeItem,
46
45
  VUE_ADAPTER_NOTE
47
- } from "./chunk-2DDIBSFD.js";
46
+ } from "./chunk-ROMBQS2L.js";
48
47
  export {
49
48
  ADAPTER_COMPONENT_TAG_MAP,
50
49
  AffordanceScope,
@@ -70,7 +69,6 @@ export {
70
69
  Input,
71
70
  Menu,
72
71
  MenuItem,
73
- MultiCombobox,
74
72
  Popover,
75
73
  Radio,
76
74
  RadioGroup,
@@ -1,190 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-BHG9Rpil.js');
4
-
5
- const uiMultiComboboxCss = () => `:host{display:block;min-inline-size:0;color:var(--ui-text-primary);font:inherit}ui-combobox::part(field){flex-wrap:wrap;align-items:center;gap:var(--ui-space-1);min-block-size:var(--ui-multi-combobox-min-block-size, 2.5rem);padding:var(--ui-space-1)}ui-combobox::part(input){flex:1 0 var(--ui-multi-combobox-input-min-inline-size, 5rem);width:auto;min-block-size:1.75rem;padding:var(--ui-space-0-5) var(--ui-space-1)}.items{display:contents}.item{appearance:none;display:inline-flex;min-inline-size:0;max-inline-size:min(100%, var(--ui-multi-combobox-item-max-inline-size, 12rem));overflow:hidden;padding:0;border:0;border-radius:var(--ui-radius-1);background:transparent;color:inherit;font:inherit;cursor:default}.item>slot{display:block;min-inline-size:0;max-inline-size:100%;overflow:hidden}.item>slot::slotted(*){min-inline-size:0;max-inline-size:100%}.item:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:1px}.item:disabled{opacity:.6}`;
6
-
7
- const UIMultiCombobox = class {
8
- constructor(hostRef) {
9
- index.registerInstance(this, hostRef);
10
- this.queryChange = index.createEvent(this, "query-change");
11
- this.addItem = index.createEvent(this, "add-item");
12
- this.removeItem = index.createEvent(this, "remove-item");
13
- this.createItem = index.createEvent(this, "create-item");
14
- this.optionsChange = index.createEvent(this, "options-change");
15
- }
16
- get host() { return index.getElement(this); }
17
- label = '';
18
- placeholder = '';
19
- items = [];
20
- config = {};
21
- query;
22
- defaultQuery = '';
23
- /** Characters that commit the current query and leave the input ready for the next item. */
24
- tokenSeparators = [];
25
- disabled = false;
26
- readOnly = false;
27
- required = false;
28
- name = '';
29
- queryChange;
30
- addItem;
31
- removeItem;
32
- createItem;
33
- optionsChange;
34
- raw = '';
35
- rows = [];
36
- combobox;
37
- filteredConfig;
38
- filteredConfigSource;
39
- filteredSelection = '';
40
- componentWillLoad() { this.raw = this.query ?? this.defaultQuery; }
41
- syncQuery() {
42
- if (this.query !== undefined)
43
- this.raw = this.query;
44
- }
45
- get selectedValues() { return new Set(this.items.map(item => item.value)); }
46
- get comboboxConfig() {
47
- const selectionKey = this.items.map(item => item.value).join('\u0000');
48
- if (this.filteredConfig && this.filteredConfigSource === this.config && this.filteredSelection === selectionKey) {
49
- return this.filteredConfig;
50
- }
51
- const ownerFilter = this.config.filter;
52
- const selected = this.selectedValues;
53
- this.filteredConfigSource = this.config;
54
- this.filteredSelection = selectionKey;
55
- this.filteredConfig = {
56
- ...this.config,
57
- filter: (option, query, context) => !selected.has(option.value)
58
- && (ownerFilter ? ownerFilter(option, query, context) : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase())),
59
- };
60
- return this.filteredConfig;
61
- }
62
- setQuery(query, trigger) {
63
- if (this.query === undefined)
64
- this.raw = query;
65
- this.queryChange.emit({ query, display: query, trigger });
66
- }
67
- clearCommittedQuery(input, trigger) {
68
- // Clear the native control before another key can arrive. Controlled adapters
69
- // still receive query-change, but do not need to round-trip before typing resumes.
70
- input.value = '';
71
- this.raw = '';
72
- this.setQuery('', trigger);
73
- }
74
- onQueryChange = (event) => {
75
- event.stopPropagation();
76
- this.setQuery(event.detail.query, event.detail.trigger);
77
- };
78
- onOptionsChange = (event) => {
79
- event.stopPropagation();
80
- this.rows = event.detail;
81
- this.optionsChange.emit(event.detail);
82
- };
83
- onValueChange = (event) => {
84
- event.stopPropagation();
85
- if (event.detail.kind !== 'selection' || !event.detail.option)
86
- return;
87
- const item = event.detail.option;
88
- this.addItem.emit({ item, index: this.items.length, trigger: event.detail.trigger });
89
- // ui-combobox emits its selection value before the matching label query.
90
- // Clear after both owner notifications so the stale label cannot win.
91
- queueMicrotask(() => this.setQuery('', event.detail.trigger));
92
- };
93
- onCreateEntry = (event) => {
94
- event.stopPropagation();
95
- const query = event.detail.query.trim();
96
- if (!query)
97
- return;
98
- this.setQuery('', event.detail.trigger);
99
- this.createItem.emit({ query, trigger: event.detail.trigger });
100
- };
101
- commitQuery(input, trigger) {
102
- const query = this.raw.trim();
103
- if (!query)
104
- return;
105
- const normalizedQuery = query.toLocaleLowerCase();
106
- const option = this.rows.find(row => row.label.trim().toLocaleLowerCase() === normalizedQuery);
107
- if (option) {
108
- this.clearCommittedQuery(input, trigger);
109
- this.addItem.emit({ item: option, index: this.items.length, trigger });
110
- }
111
- else if (this.config.allowCreate) {
112
- this.clearCommittedQuery(input, trigger);
113
- this.createItem.emit({ query, trigger });
114
- }
115
- }
116
- remove(index, trigger) {
117
- const item = this.items[index];
118
- if (!item || item.disabled || this.disabled || this.readOnly)
119
- return;
120
- this.removeItem.emit({ item, index, trigger });
121
- requestAnimationFrame(() => {
122
- const buttons = this.host.shadowRoot?.querySelectorAll('[part="item"]') ?? [];
123
- const next = buttons[Math.min(index, buttons.length - 1)] ?? buttons[index - 1];
124
- if (next && next.dataset.value !== item.value)
125
- next.focus();
126
- else
127
- void this.focusInput();
128
- });
129
- }
130
- focusItem(index) {
131
- this.host.shadowRoot?.querySelectorAll('[part="item"]')[index]?.focus();
132
- }
133
- onItemKeyDown = (event, index) => {
134
- if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
135
- return;
136
- if (event.key === 'ArrowLeft') {
137
- event.preventDefault();
138
- event.stopPropagation();
139
- this.focusItem(Math.max(0, index - 1));
140
- }
141
- else if (event.key === 'ArrowRight') {
142
- event.preventDefault();
143
- event.stopPropagation();
144
- if (index === this.items.length - 1)
145
- void this.focusInput();
146
- else
147
- this.focusItem(index + 1);
148
- }
149
- else if (event.key === 'Backspace' || event.key === 'Delete') {
150
- event.preventDefault();
151
- event.stopPropagation();
152
- this.remove(index, 'keyboard');
153
- }
154
- };
155
- onKeyDown = (event) => {
156
- if (event.defaultPrevented || event.isComposing || this.disabled || this.readOnly || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
157
- return;
158
- const input = event.composedPath().find(node => node instanceof HTMLInputElement);
159
- if (!input)
160
- return;
161
- if (this.tokenSeparators.includes(event.key)) {
162
- event.preventDefault();
163
- event.stopPropagation();
164
- this.commitQuery(input, 'keyboard');
165
- return;
166
- }
167
- if (this.raw || (input.selectionStart ?? 0) > 0)
168
- return;
169
- if (event.key === 'ArrowLeft' && this.items.length) {
170
- event.preventDefault();
171
- this.focusItem(this.items.length - 1);
172
- }
173
- else if (event.key === 'Backspace' && this.items.length) {
174
- event.preventDefault();
175
- this.remove(this.items.length - 1, 'keyboard');
176
- }
177
- };
178
- async focusInput() { await this.combobox?.focusInput(); }
179
- render() {
180
- return index.h(index.Host, { key: 'ba4db0fdca6cae344fe6b0bf06c933a9a90d2d3f', onKeyDown: this.onKeyDown }, index.h("ui-combobox", { key: 'f5901b0b078b479425114d998618828cc458e7dd', ref: element => this.combobox = element, label: this.label, "label-visibility": "sr-only", placeholder: this.placeholder, name: this.name, value: null, query: this.raw, config: this.comboboxConfig, size: "sm", disabled: this.disabled, readOnly: this.readOnly, required: this.required, "onQuery-change": this.onQueryChange, "onValue-change": this.onValueChange, "onCreate-entry": this.onCreateEntry, "onOptions-change": this.onOptionsChange }, index.h("div", { key: '374c80862302d5c36f4849f42e5ed13222addd1c', slot: "start", class: "items", role: "group", "aria-label": `Selected ${this.label}` }, this.items.map((item, index$1) => index.h("button", { type: "button", part: "item", class: "item", "data-value": item.value, tabIndex: -1, disabled: this.disabled || this.readOnly || item.disabled, "aria-label": `${item.label}, press Delete or Backspace to remove`, onKeyDown: event => this.onItemKeyDown(event, index$1) }, index.h("slot", { name: `item-${item.id}` }, index.h("ui-chip", { appearance: "pill" }, item.label))))), this.rows.map(option => index.h("span", { slot: `option-${option.id}` }, index.h("slot", { name: `option-${option.id}` }, option.label))), index.h("span", { key: 'a23781c153e154cdff7066868c2da956e26b7d52', slot: "create" }, index.h("slot", { key: 'e3bde0d1e549e785fff877a1a7aac10df308f7a3', name: "create" }, "Create \u201C", this.raw, "\u201D")), index.h("span", { key: '5837c4cde35d5984aaf1d364f1b850b9d63ff8ca', slot: "loading" }, index.h("slot", { key: '1bdfa30849bea752bc5c93268b3427c964d1b5d3', name: "loading" }, "Loading suggestions\u2026")), index.h("span", { key: '519d7b1a7f28f9d19cd441598a690c8b4fdacf5b', slot: "empty" }, index.h("slot", { key: '3163150e0f1edebb50509a5dacd576e4568eaaae', name: "empty" }, "No suggestions.")), index.h("span", { key: '655e4f85d70eb97f0f0ecb2bac7b4228f5cf580f', slot: "error" }, index.h("slot", { key: 'a22667db30ee30003855ee69774eff3a4aab8566', name: "error" }, "Unable to load suggestions.")), index.h("div", { key: 'b01b74f3fc7136a3bf1875c81b9f3a662f3e993c', slot: "footer" }, index.h("slot", { key: '7565ee0798072eebc6d1c458f89ce6c7941577dd', name: "footer" }))));
181
- }
182
- static get watchers() { return {
183
- "query": [{
184
- "syncQuery": 0
185
- }]
186
- }; }
187
- };
188
- UIMultiCombobox.style = uiMultiComboboxCss();
189
-
190
- exports.ui_multi_combobox = UIMultiCombobox;
@@ -1,241 +0,0 @@
1
- 'use strict';
2
-
3
- var index = require('./index-BHG9Rpil.js');
4
- var manager = require('./manager-Ce25WRtl.js');
5
- var events = require('./events-TcQIzpNv.js');
6
- var controlledState = require('./controlled-state-BFya8rAX.js');
7
- var positioning = require('./positioning-D5q9DM-0.js');
8
-
9
- const uiTooltipCss = () => `:host{position:fixed;inset:auto;margin:0;display:inline-block;box-sizing:border-box;padding:0;border:0;border-radius:0;background:transparent;opacity:0;transform:translateY(4px);transition:opacity var(--ui-motion-fast) var(--ui-motion-ease), transform var(--ui-motion-fast) var(--ui-motion-ease), display var(--ui-motion-fast) allow-discrete, overlay var(--ui-motion-fast) allow-discrete}.tooltip__surface{box-sizing:border-box;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);padding:var(--ui-space-2) var(--ui-space-3);font-size:var(--ui-font-size-sm);box-shadow:var(--ui-shadow-md)}:host(:popover-open){opacity:1;transform:translateY(0)}@starting-style{:host(:popover-open){opacity:0;transform:translateY(4px)}}:host([hidden]){display:none !important}@media (prefers-reduced-motion: reduce){:host{transition:none}}`;
10
-
11
- const UITooltip = class {
12
- constructor(hostRef) {
13
- index.registerInstance(this, hostRef);
14
- this.opened = index.createEvent(this, "open");
15
- this.closed = index.createEvent(this, "close");
16
- }
17
- get host() { return index.getElement(this); }
18
- for = '';
19
- /** Controlled open state. Omit it to use defaultOpen and local interaction state. */
20
- open;
21
- defaultOpen = false;
22
- placement = 'top-start';
23
- /** Pointer hover intent delay in milliseconds. Keyboard focus is immediate. */
24
- showDelay = 500;
25
- /** Pointer leave grace period in milliseconds. */
26
- hideDelay = 100;
27
- /** Click or tap pins the description; activate again to dismiss. */
28
- toggleOnClick = false;
29
- pinned = false;
30
- focused = false;
31
- opened;
32
- closed;
33
- internalOpen = false;
34
- overlayId = `ui-tooltip-${Math.random().toString(36).slice(2, 11)}`;
35
- trigger = null;
36
- surface = null;
37
- showTimer = null;
38
- hideTimer = null;
39
- syncFromProp() {
40
- this.clearTimers();
41
- if (controlledState.isControlled(this.open))
42
- this.internalOpen = this.open;
43
- }
44
- resetSurface() {
45
- this.syncTrigger();
46
- this.setupSurface();
47
- this.syncOverlay();
48
- }
49
- syncOverlay() {
50
- if (this.internalOpen) {
51
- this.surface?.show();
52
- manager.openOverlay({
53
- id: this.overlayId,
54
- modal: false,
55
- element: this.host,
56
- relatedElements: this.trigger ? [this.trigger] : undefined,
57
- dismissible: true,
58
- requestClose: (reason, trigger) => this.handleRequestClose(reason, trigger),
59
- });
60
- }
61
- else {
62
- this.surface?.hide();
63
- manager.closeOverlay(this.overlayId);
64
- }
65
- }
66
- componentDidLoad() {
67
- if (!this.host.id)
68
- this.host.id = this.overlayId;
69
- this.internalOpen = controlledState.controlledOrDefault(this.open, this.defaultOpen);
70
- this.syncTrigger();
71
- this.setupSurface();
72
- this.host.addEventListener('pointerenter', this.onSurfaceEnter);
73
- this.host.addEventListener('pointerleave', this.onTriggerLeave);
74
- this.syncOverlay();
75
- }
76
- componentDidUpdate() {
77
- this.syncTrigger();
78
- }
79
- disconnectedCallback() {
80
- this.clearTimers();
81
- this.detachTriggerListeners();
82
- this.surface?.destroy();
83
- this.surface = null;
84
- this.host.removeEventListener('pointerenter', this.onSurfaceEnter);
85
- this.host.removeEventListener('pointerleave', this.onTriggerLeave);
86
- manager.closeOverlay(this.overlayId);
87
- }
88
- syncTrigger() {
89
- const next = this.for
90
- ? this.host.getRootNode().getElementById(this.for)
91
- : this.host.previousElementSibling;
92
- if (next === this.trigger)
93
- return;
94
- this.detachTriggerListeners();
95
- this.trigger = next;
96
- this.attachTriggerListeners();
97
- this.surface?.setAnchor(next);
98
- }
99
- setupSurface() {
100
- this.surface?.destroy();
101
- this.surface = positioning.createAnchoredSurface(this.host, {
102
- anchor: this.trigger,
103
- placement: this.placement,
104
- });
105
- }
106
- attachTriggerListeners() {
107
- this.detachTriggerListeners();
108
- if (!this.trigger)
109
- return;
110
- const ids = new Set((this.trigger.getAttribute('aria-describedby') || '').split(/\s+/).filter(Boolean));
111
- ids.add(this.host.id);
112
- this.trigger.setAttribute('aria-describedby', [...ids].join(' '));
113
- this.trigger.addEventListener('click', this.onTriggerClick);
114
- this.trigger.addEventListener('keydown', this.onTriggerKeydown);
115
- this.trigger.addEventListener('pointerenter', this.onTriggerEnter);
116
- this.trigger.addEventListener('pointerleave', this.onTriggerLeave);
117
- this.trigger.addEventListener('focusin', this.onTriggerFocusIn);
118
- this.trigger.addEventListener('focusout', this.onTriggerFocusOut);
119
- }
120
- detachTriggerListeners() {
121
- if (!this.trigger)
122
- return;
123
- const ids = (this.trigger.getAttribute('aria-describedby') || '').split(/\s+/).filter(id => id && id !== this.host.id);
124
- if (ids.length)
125
- this.trigger.setAttribute('aria-describedby', ids.join(' '));
126
- else
127
- this.trigger.removeAttribute('aria-describedby');
128
- this.trigger.removeEventListener('click', this.onTriggerClick);
129
- this.trigger.removeEventListener('keydown', this.onTriggerKeydown);
130
- this.trigger.removeEventListener('pointerenter', this.onTriggerEnter);
131
- this.trigger.removeEventListener('pointerleave', this.onTriggerLeave);
132
- this.trigger.removeEventListener('focusin', this.onTriggerFocusIn);
133
- this.trigger.removeEventListener('focusout', this.onTriggerFocusOut);
134
- }
135
- clearShowTimer() {
136
- if (this.showTimer === null)
137
- return;
138
- clearTimeout(this.showTimer);
139
- this.showTimer = null;
140
- }
141
- clearHideTimer() {
142
- if (this.hideTimer === null)
143
- return;
144
- clearTimeout(this.hideTimer);
145
- this.hideTimer = null;
146
- }
147
- clearTimers() {
148
- this.clearShowTimer();
149
- this.clearHideTimer();
150
- }
151
- setInteractionOpen(nextOpen, trigger) {
152
- if (this.internalOpen === nextOpen)
153
- return;
154
- if (!controlledState.isControlled(this.open))
155
- this.internalOpen = nextOpen;
156
- events.dispatchDetail(this.host, nextOpen ? 'open' : 'close', {
157
- open: nextOpen,
158
- reason: 'action',
159
- trigger,
160
- });
161
- }
162
- onSurfaceEnter = () => this.clearHideTimer();
163
- onTriggerClick = (event) => {
164
- if (!this.toggleOnClick)
165
- return;
166
- this.clearTimers();
167
- this.pinned = !this.pinned;
168
- this.setInteractionOpen(this.pinned, event.detail === 0 ? 'keyboard' : 'pointer');
169
- };
170
- onTriggerKeydown = (event) => {
171
- if (event.key === 'Escape')
172
- this.clearTimers();
173
- };
174
- onTriggerEnter = (event) => {
175
- if (event.pointerType === 'touch')
176
- return;
177
- this.clearHideTimer();
178
- if (this.internalOpen || this.showTimer !== null)
179
- return;
180
- this.showTimer = setTimeout(() => {
181
- this.showTimer = null;
182
- this.setInteractionOpen(true, 'pointer');
183
- }, Math.max(0, this.showDelay));
184
- };
185
- onTriggerLeave = () => {
186
- this.clearShowTimer();
187
- if (this.focused || this.pinned || !this.internalOpen || this.hideTimer !== null)
188
- return;
189
- this.hideTimer = setTimeout(() => {
190
- this.hideTimer = null;
191
- this.setInteractionOpen(false, 'pointer');
192
- }, Math.max(0, this.hideDelay));
193
- };
194
- onTriggerFocusIn = () => {
195
- this.focused = true;
196
- this.clearTimers();
197
- this.setInteractionOpen(true, 'keyboard');
198
- };
199
- onTriggerFocusOut = (e) => {
200
- const related = e.relatedTarget;
201
- if (related && this.host.contains(related))
202
- return;
203
- this.focused = false;
204
- this.pinned = false;
205
- this.clearTimers();
206
- this.setInteractionOpen(false, 'keyboard');
207
- };
208
- handleRequestClose(reason, trigger) {
209
- if (reason === 'escape' || (reason === 'light-dismiss' && this.toggleOnClick)) {
210
- this.pinned = false;
211
- this.clearTimers();
212
- if (!controlledState.isControlled(this.open))
213
- this.internalOpen = false;
214
- events.dispatchDetail(this.host, 'close', {
215
- open: false,
216
- reason,
217
- trigger: trigger,
218
- });
219
- }
220
- }
221
- render() {
222
- return (index.h(index.Host, { key: '2216e8f56c408e775140200881c9bfd99b45f381', role: "tooltip", hidden: !this.internalOpen, "data-open": this.internalOpen ? '' : undefined }, index.h("div", { key: 'a547e43fb5f6c3c2f62cf7f1fb9198dc0024a28d', class: "tooltip__surface" }, index.h("slot", { key: 'dc8863505e8140565588c57ea200b7f548fb5df3' }))));
223
- }
224
- static get watchers() { return {
225
- "open": [{
226
- "syncFromProp": 0
227
- }],
228
- "for": [{
229
- "resetSurface": 0
230
- }],
231
- "placement": [{
232
- "resetSurface": 0
233
- }],
234
- "internalOpen": [{
235
- "syncOverlay": 0
236
- }]
237
- }; }
238
- };
239
- UITooltip.style = uiTooltipCss();
240
-
241
- exports.ui_tooltip = UITooltip;