@ulu/frontend-vue 0.1.3-beta.4 → 0.1.3-beta.5

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.
@@ -218,16 +218,7 @@ const ho = ["id", "data-placement"], mo = ["innerHTML"], go = {
218
218
  * The directive name to use (default 'ulu-tooltip' = <el v-ulu-tooltip="'hello world'">)
219
219
  * @type {String}
220
220
  */
221
- directiveName: "ulu-tooltip",
222
- /**
223
- * The element that the tooltip should be rendered within
224
- * - Default bottom of the body (on top of everything)
225
- * - Doesn't need to be inline for accessibility since tooltips are just an enhancement
226
- * content displayed within them should be hidden for assistive devices,
227
- * they are not visible to assistive devices
228
- * @type {String}
229
- */
230
- tooltipTeleportTo: "body"
221
+ directiveName: "ulu-tooltip"
231
222
  },
232
223
  /**
233
224
  * Default Popover Options
@@ -269,6 +260,15 @@ const ho = ["id", "data-placement"], mo = ["innerHTML"], go = {
269
260
  * @type {Object}
270
261
  */
271
262
  tooltip: {
263
+ /**
264
+ * The element that the tooltip should be rendered within
265
+ * - Default bottom of the body if this is unset
266
+ * - Doesn't need to be inline for accessibility since tooltips are just an enhancement
267
+ * content displayed within them should be hidden for assistive devices,
268
+ * they are not visible to assistive devices
269
+ * @type {String}
270
+ */
271
+ teleportTo: null,
272
272
  /**
273
273
  * Optional class binding for tooltip element
274
274
  * @type {String|Object|Array}
@@ -541,6 +541,10 @@ function oh(e, s = {}) {
541
541
  trigger: null,
542
542
  config: {}
543
543
  }), l = (d, v) => {
544
+ if (d && !v.teleportTo) {
545
+ const y = d.closest("dialog");
546
+ y && (v.teleportTo = y);
547
+ }
544
548
  n.trigger && n.trigger !== d && n.trigger?.removeAttribute && n.trigger.removeAttribute("aria-describedby"), d?.setAttribute && d.setAttribute("aria-describedby", Ys), n.trigger = d, n.config = v, n.visible = !0;
545
549
  }, o = () => {
546
550
  n.trigger?.removeAttribute && n.trigger.removeAttribute("aria-describedby"), n.visible = !1;
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../lib/plugins/popovers/defaults.js"],"names":[],"mappings":";gBAGY,MAAM;;;;;;;;;iBAuDN,MAAM"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../../lib/plugins/popovers/defaults.js"],"names":[],"mappings":";gBAGY,MAAM;;;;;;;;;iBA8CN,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/plugins/popovers/index.js"],"names":[],"mappings":"AAiDA;;;;GAIG;AACH,qCAHW,MAAM,gBACN,MAAM,QAuIhB;AArLD;;GAEG;AACH,kCAAmC,mBAAmB,CAAC;AAEvD;;GAEG;AACH,gCAAiC,iBAAiB,CAAC;AAEnD;;GAEG;AACH,yBAA0B,oBAAoB,CAAC;;;AAcxC,gDAJI,GAAC,mBACD,MAAM,GACJ,MAAM,GAAC,IAAI,CAgBvB;2BA3C0B,iBAAiB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../lib/plugins/popovers/index.js"],"names":[],"mappings":"AAiDA;;;;GAIG;AACH,qCAHW,MAAM,gBACN,MAAM,QAgJhB;AA9LD;;GAEG;AACH,kCAAmC,mBAAmB,CAAC;AAEvD;;GAEG;AACH,gCAAiC,iBAAiB,CAAC;AAEnD;;GAEG;AACH,yBAA0B,oBAAoB,CAAC;;;AAcxC,gDAJI,GAAC,mBACD,MAAM,GACJ,MAAM,GAAC,IAAI,CAgBvB;2BA3C0B,iBAAiB"}
@@ -9,16 +9,7 @@ export default {
9
9
  * @type {String}
10
10
  */
11
11
  directiveName: "ulu-tooltip",
12
- /**
13
- * The element that the tooltip should be rendered within
14
- * - Default bottom of the body (on top of everything)
15
- * - Doesn't need to be inline for accessibility since tooltips are just an enhancement
16
- * content displayed within them should be hidden for assistive devices,
17
- * they are not visible to assistive devices
18
- * @type {String}
19
- */
20
- tooltipTeleportTo: "body",
21
- },
12
+ },
22
13
  /**
23
14
  * Default Popover Options
24
15
  */
@@ -59,6 +50,15 @@ export default {
59
50
  * @type {Object}
60
51
  */
61
52
  tooltip: {
53
+ /**
54
+ * The element that the tooltip should be rendered within
55
+ * - Default bottom of the body if this is unset
56
+ * - Doesn't need to be inline for accessibility since tooltips are just an enhancement
57
+ * content displayed within them should be hidden for assistive devices,
58
+ * they are not visible to assistive devices
59
+ * @type {String}
60
+ */
61
+ teleportTo: null,
62
62
  /**
63
63
  * Optional class binding for tooltip element
64
64
  * @type {String|Object|Array}
@@ -70,6 +70,15 @@ export default function install(app, userOptions = {}) {
70
70
  config: {},
71
71
  });
72
72
  const showTooltip = (triggerEl, configObj) => {
73
+ // If a teleport target isn't already specified in the config,
74
+ // try to find a parent dialog to teleport to automatically.
75
+ if (triggerEl && !configObj.teleportTo) {
76
+ const dialog = triggerEl.closest("dialog");
77
+ if (dialog) {
78
+ configObj.teleportTo = dialog;
79
+ }
80
+ }
81
+
73
82
  // If a tooltip is already active for a different element, remove its attribute.
74
83
  if (tooltipState.trigger && tooltipState.trigger !== triggerEl) {
75
84
  if (tooltipState.trigger?.removeAttribute) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend-vue",
3
- "version": "0.1.3-beta.4",
3
+ "version": "0.1.3-beta.5",
4
4
  "description": "A modular and tree-shakeable Vue 3 component library for the Ulu frontend",
5
5
  "type": "module",
6
6
  "files": [