@ulu/frontend-vue 0.6.2 → 0.6.3
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.
- package/dist/composables/useUluFloating.d.ts +18 -8
- package/dist/composables/useUluFloating.d.ts.map +1 -1
- package/dist/composables/useUluFloating.js +25 -25
- package/dist/mcp-data.json +3453 -3421
- package/dist/plugins/popovers/UluPopover.vue.d.ts.map +1 -1
- package/dist/plugins/popovers/UluPopover.vue.js +38 -0
- package/lib/composables/useUluFloating.js +9 -7
- package/lib/plugins/popovers/UluPopover.vue +38 -0
- package/package.json +1 -1
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* @typedef {object} UluFloatingConfig
|
|
6
6
|
* @property {Placement} placement - The placement of the floating element.
|
|
7
|
-
* @property {
|
|
8
|
-
* @property {
|
|
9
|
-
* @property {
|
|
10
|
-
* @property {
|
|
7
|
+
* @property {Boolean|Object} inline - Whether the floating element is inline. If object is passed will be passed as configuration for the floating ui "inline" plugin.
|
|
8
|
+
* @property {Number|Object} offset - The offset of the floating element. If object is passed will be passed as configuration for the floating ui "offset" plugin.
|
|
9
|
+
* @property {Object} flip - This plugin is always added, if object is passed will be passed as configuration for the floating ui "flip" plugin.
|
|
10
|
+
* @property {Object} shift - This plugin is always added, if object is passed will be passed as configuration for the floating ui "shift" plugin.
|
|
11
|
+
* @property {Boolean} arrow - Whether the floating element has an arrow.
|
|
12
|
+
* @property {Function} onReady - Callback function when the floating element is ready.
|
|
11
13
|
*/
|
|
12
14
|
/**
|
|
13
15
|
* Composable for using floating-ui
|
|
@@ -32,13 +34,21 @@ export type UluFloatingConfig = {
|
|
|
32
34
|
*/
|
|
33
35
|
placement: Placement;
|
|
34
36
|
/**
|
|
35
|
-
* - Whether the floating element is inline.
|
|
37
|
+
* - Whether the floating element is inline. If object is passed will be passed as configuration for the floating ui "inline" plugin.
|
|
36
38
|
*/
|
|
37
|
-
inline: boolean;
|
|
39
|
+
inline: boolean | Object;
|
|
38
40
|
/**
|
|
39
|
-
* - The offset of the floating element.
|
|
41
|
+
* - The offset of the floating element. If object is passed will be passed as configuration for the floating ui "offset" plugin.
|
|
40
42
|
*/
|
|
41
|
-
offset: number;
|
|
43
|
+
offset: number | Object;
|
|
44
|
+
/**
|
|
45
|
+
* - This plugin is always added, if object is passed will be passed as configuration for the floating ui "flip" plugin.
|
|
46
|
+
*/
|
|
47
|
+
flip: Object;
|
|
48
|
+
/**
|
|
49
|
+
* - This plugin is always added, if object is passed will be passed as configuration for the floating ui "shift" plugin.
|
|
50
|
+
*/
|
|
51
|
+
shift: Object;
|
|
42
52
|
/**
|
|
43
53
|
* - Whether the floating element has an arrow.
|
|
44
54
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUluFloating.d.ts","sourceRoot":"","sources":["../../lib/composables/useUluFloating.js"],"names":[],"mappings":"AAcA;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"useUluFloating.d.ts","sourceRoot":"","sources":["../../lib/composables/useUluFloating.js"],"names":[],"mappings":"AAcA;;GAEG;AAEH;;;;;;;;;GASG;AAEH;;;;;;GAMG;AACH,wCALW,OAAO,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,WAC9B,OAAO,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,UAC9B,OAAO,KAAK,EAAE,GAAG,CAAC,iBAAiB,CAAC,GAClC;IAAC,cAAc,EAAE,OAAO,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,SAAS,EAAE,OAAO,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAAC,cAAc,EAAE,OAAO,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,MAAM,WAAW;IAAC,YAAY,EAAE,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAAC,WAAW,EAAE,OAAO,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,YAAY,EAAE,OAAO,KAAK,EAAE,GAAG,CAAC,WAAW,CAAC,CAAA;CAAC,CAkE7R;wBArFY,OAAO,kBAAkB,EAAE,SAAS;;;;;eAKnC,SAAS;;;;YACT,UAAQ,MAAM;;;;YACd,SAAO,MAAM;;;;UACb,MAAM;;;;WACN,MAAM"}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as u, computed as n, watch as d } from "vue";
|
|
2
2
|
import { useFloating as v, autoUpdate as F, inline as S, offset as R, flip as U, shift as $, arrow as b } from "@floating-ui/vue";
|
|
3
|
-
function D(m, f,
|
|
4
|
-
const
|
|
3
|
+
function D(m, f, r) {
|
|
4
|
+
const s = u(null), o = u([]), w = n(() => r.value?.placement), {
|
|
5
5
|
floatingStyles: h,
|
|
6
6
|
placement: y,
|
|
7
|
-
middlewareData:
|
|
8
|
-
update:
|
|
9
|
-
isPositioned:
|
|
7
|
+
middlewareData: i,
|
|
8
|
+
update: l,
|
|
9
|
+
isPositioned: p
|
|
10
10
|
} = v(m, f, {
|
|
11
11
|
placement: w,
|
|
12
12
|
whileElementsMounted: F,
|
|
13
|
-
middleware:
|
|
13
|
+
middleware: o
|
|
14
14
|
});
|
|
15
15
|
d(
|
|
16
|
-
[
|
|
17
|
-
([
|
|
18
|
-
const
|
|
19
|
-
|
|
16
|
+
[r, s],
|
|
17
|
+
([t, a]) => {
|
|
18
|
+
const e = [];
|
|
19
|
+
t && (t.inline && e.push(S(t.inline)), t.offset && e.push(R(t.offset)), e.push(U(t.flip)), e.push($(t.shift)), t.arrow && a && e.push(b({ element: a })), o.value = e);
|
|
20
20
|
},
|
|
21
21
|
{ immediate: !0, deep: !0 }
|
|
22
22
|
);
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
return
|
|
23
|
+
const x = n(() => {
|
|
24
|
+
const t = i.value?.arrow;
|
|
25
|
+
return t ? {
|
|
26
26
|
position: "absolute",
|
|
27
|
-
left:
|
|
28
|
-
top:
|
|
27
|
+
left: t?.x != null ? `${t.x}px` : "",
|
|
28
|
+
top: t?.y != null ? `${t.y}px` : ""
|
|
29
29
|
} : null;
|
|
30
30
|
});
|
|
31
|
-
d(
|
|
32
|
-
|
|
31
|
+
d(r, (t) => {
|
|
32
|
+
t && t.onReady && t.onReady({ update: l, isPositioned: p });
|
|
33
33
|
});
|
|
34
|
-
const
|
|
34
|
+
const c = n(() => r.value?.strategy === "fixed");
|
|
35
35
|
return {
|
|
36
36
|
floatingStyles: h,
|
|
37
37
|
placement: y,
|
|
38
|
-
middlewareData:
|
|
39
|
-
update:
|
|
40
|
-
isPositioned:
|
|
41
|
-
arrowStyles:
|
|
42
|
-
contentArrow:
|
|
43
|
-
isFixedStrategy:
|
|
38
|
+
middlewareData: i,
|
|
39
|
+
update: l,
|
|
40
|
+
isPositioned: p,
|
|
41
|
+
arrowStyles: x,
|
|
42
|
+
contentArrow: s,
|
|
43
|
+
isFixedStrategy: c
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
46
|
export {
|