bitboss-ui 2.1.2 → 2.1.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.
Files changed (181) hide show
  1. package/dist/index106.js +9 -9
  2. package/dist/index111.js +1 -1
  3. package/dist/index113.js +1 -1
  4. package/dist/index121.js +11 -11
  5. package/dist/index129.js +1 -1
  6. package/dist/index13.js +1 -1
  7. package/dist/index131.js +4 -4
  8. package/dist/index133.js +1 -1
  9. package/dist/index136.js +10 -20
  10. package/dist/index137.js +2 -2
  11. package/dist/index138.js +1 -1
  12. package/dist/index139.js +2 -2
  13. package/dist/index15.js +8 -8
  14. package/dist/index17.js +3 -3
  15. package/dist/index19.js +8 -8
  16. package/dist/index206.js +2 -138
  17. package/dist/index207.js +2 -2
  18. package/dist/index208.js +138 -2
  19. package/dist/index209.js +12 -85
  20. package/dist/index21.js +16 -16
  21. package/dist/index210.js +15 -0
  22. package/dist/index211.js +9 -27
  23. package/dist/index212.js +86 -17
  24. package/dist/index214.js +26 -12
  25. package/dist/index215.js +17 -3
  26. package/dist/index216.js +50 -11
  27. package/dist/index217.js +13 -14
  28. package/dist/index218.js +3 -4
  29. package/dist/index219.js +12 -13
  30. package/dist/index220.js +15 -10
  31. package/dist/index221.js +2 -20
  32. package/dist/index222.js +100 -191
  33. package/dist/index224.js +95 -61
  34. package/dist/index226.js +65 -12
  35. package/dist/index228.js +15 -0
  36. package/dist/index229.js +2 -34
  37. package/dist/index23.js +15 -15
  38. package/dist/index230.js +5 -2
  39. package/dist/index231.js +5 -2
  40. package/dist/index232.js +5 -18
  41. package/dist/index233.js +5 -12
  42. package/dist/index234.js +5 -6
  43. package/dist/index235.js +5 -4
  44. package/dist/index236.js +2 -106
  45. package/dist/index237.js +22 -0
  46. package/dist/index238.js +108 -95
  47. package/dist/index240.js +2 -228
  48. package/dist/index241.js +4 -3
  49. package/dist/index242.js +2 -2
  50. package/dist/index243.js +34 -2
  51. package/dist/index244.js +2 -13
  52. package/dist/index245.js +2 -5
  53. package/dist/index246.js +7 -5
  54. package/dist/index247.js +7 -5
  55. package/dist/index248.js +3 -5
  56. package/dist/index249.js +4 -5
  57. package/dist/index25.js +3 -3
  58. package/dist/index250.js +197 -5
  59. package/dist/index252.js +5 -2
  60. package/dist/index253.js +5 -177
  61. package/dist/index254.js +8 -10
  62. package/dist/index255.js +250 -3
  63. package/dist/index256.js +52 -5
  64. package/dist/index257.js +44 -5
  65. package/dist/index258.js +5 -8
  66. package/dist/index259.js +53 -243
  67. package/dist/index260.js +16 -50
  68. package/dist/index261.js +12 -44
  69. package/dist/index262.js +6 -5
  70. package/dist/index263.js +222 -54
  71. package/dist/index264.js +10 -2
  72. package/dist/index265.js +3 -9
  73. package/dist/index266.js +177 -8
  74. package/dist/index269.js +3 -9
  75. package/dist/index27.js +1 -1
  76. package/dist/index270.js +6 -3
  77. package/dist/index271.js +16 -6
  78. package/dist/index272.js +9 -16
  79. package/dist/index274.js +7 -65
  80. package/dist/index275.js +8 -5
  81. package/dist/index276.js +67 -5
  82. package/dist/index277.js +5 -8
  83. package/dist/index278.js +5 -3
  84. package/dist/index279.js +8 -17
  85. package/dist/index280.js +3 -28
  86. package/dist/index281.js +17 -3
  87. package/dist/index282.js +28 -3
  88. package/dist/index283.js +9 -0
  89. package/dist/index284.js +11 -7
  90. package/dist/index285.js +1 -1
  91. package/dist/index286.js +3 -7
  92. package/dist/index287.js +3 -11
  93. package/dist/index289.js +7 -2
  94. package/dist/index29.js +4 -4
  95. package/dist/index290.js +4 -3
  96. package/dist/index291.js +280 -3
  97. package/dist/index292.js +2 -2
  98. package/dist/index293.js +125 -4
  99. package/dist/index294.js +2 -5
  100. package/dist/index295.js +13 -278
  101. package/dist/index296.js +2 -2
  102. package/dist/index297.js +12 -121
  103. package/dist/index298.js +2 -2
  104. package/dist/index299.js +11 -10
  105. package/dist/index301.js +15 -12
  106. package/dist/index303.js +3 -16
  107. package/dist/index304.js +2 -2
  108. package/dist/index305.js +4 -19
  109. package/dist/index306.js +6 -2
  110. package/dist/index307.js +5 -6
  111. package/dist/index308.js +3 -19
  112. package/dist/index309.js +19 -2
  113. package/dist/index31.js +2 -2
  114. package/dist/index310.js +2 -27
  115. package/dist/index311.js +27 -2
  116. package/dist/index312.js +2 -2
  117. package/dist/index313.js +1 -1
  118. package/dist/index314.js +1 -1
  119. package/dist/index315.js +1 -1
  120. package/dist/index316.js +1 -21
  121. package/dist/index317.js +24 -0
  122. package/dist/index319.js +2 -701
  123. package/dist/index320.js +5 -354
  124. package/dist/index321.js +701 -58
  125. package/dist/index322.js +354 -8
  126. package/dist/index323.js +57 -5
  127. package/dist/index324.js +2 -8
  128. package/dist/index325.js +57 -32
  129. package/dist/index326.js +57 -27
  130. package/dist/index327.js +9 -0
  131. package/dist/index328.js +228 -2
  132. package/dist/index329.js +123 -222
  133. package/dist/index33.js +8 -8
  134. package/dist/index330.js +367 -56
  135. package/dist/index331.js +32 -57
  136. package/dist/index332.js +28 -47
  137. package/dist/index334.js +44 -366
  138. package/dist/index335.js +7 -6
  139. package/dist/index336.js +5 -18
  140. package/dist/index337.js +8 -7
  141. package/dist/index338.js +6 -92
  142. package/dist/index339.js +21 -0
  143. package/dist/index340.js +93 -3
  144. package/dist/index343.js +3 -436
  145. package/dist/index344.js +422 -113
  146. package/dist/index345.js +123 -43
  147. package/dist/{index342.js → index346.js} +1 -1
  148. package/dist/index347.js +49 -0
  149. package/dist/index35.js +4 -4
  150. package/dist/index37.js +20 -20
  151. package/dist/index39.js +177 -167
  152. package/dist/index41.js +2 -2
  153. package/dist/index43.js +8 -8
  154. package/dist/index45.js +8 -8
  155. package/dist/index47.js +2 -2
  156. package/dist/index49.js +3 -3
  157. package/dist/index53.js +1 -1
  158. package/dist/index55.js +1 -1
  159. package/dist/index57.js +2 -2
  160. package/dist/index61.js +3 -3
  161. package/dist/index67.js +1 -1
  162. package/dist/index79.js +2 -2
  163. package/dist/index81.js +1 -1
  164. package/dist/index83.js +2 -2
  165. package/dist/index85.js +1 -1
  166. package/dist/index87.js +1 -1
  167. package/dist/index90.js +3 -3
  168. package/dist/index92.js +2 -2
  169. package/dist/index94.js +3 -3
  170. package/dist/index96.js +1 -1
  171. package/dist/utilities/functions/percentage.d.ts +14 -21
  172. package/dist/utilities/functions/snapToStep.d.ts +1 -0
  173. package/dist/utilities/functions/transpose.d.ts +1 -0
  174. package/dist/utilities/functions/transposePercent.d.ts +9 -0
  175. package/package.json +1 -1
  176. package/dist/index213.js +0 -53
  177. package/dist/index227.js +0 -115
  178. package/dist/index251.js +0 -4
  179. package/dist/index288.js +0 -6
  180. package/dist/index318.js +0 -7
  181. package/dist/index333.js +0 -131
package/dist/index83.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as j, ref as g, watch as x, computed as m, createBlock as G, openBlock as V, resolveDynamicComponent as K, normalizeClass as O, withCtx as M, createElementVNode as c, withModifiers as y, renderSlot as U, normalizeProps as Y, guardReactiveProps as Z, createTextVNode as J, unref as Q, createVNode as W, createElementBlock as F, Fragment as X, renderList as ee, toDisplayString as te } from "vue";
2
- import { findInTree as ae } from "./index272.js";
2
+ import { findInTree as ae } from "./index271.js";
3
3
  import { useId as re } from "./index8.js";
4
4
  import oe from "./index111.js";
5
5
  /* empty css */
@@ -53,7 +53,7 @@ const le = ["accept", "autofocus", "disabled", "multiple"], se = { class: "bb-dr
53
53
  const r = a.accept[t];
54
54
  if (r.includes("/")) e.push(r);
55
55
  else {
56
- b || (b = (await import("./index271.js")).default);
56
+ b || (b = (await import("./index270.js")).default);
57
57
  const o = b.getType(r);
58
58
  if (!o)
59
59
  throw new Error(
package/dist/index85.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as v, ref as p, getCurrentInstance as c, onServerPrefetch as w, onBeforeMount as z, inject as _, watch as b, computed as f, createElementBlock as h, openBlock as $, mergeProps as g } from "vue";
2
- import { isCssColor as I } from "./index243.js";
2
+ import { isCssColor as I } from "./index240.js";
3
3
  const B = ["innerHTML"], k = /* @__PURE__ */ v({
4
4
  __name: "BbIcon",
5
5
  props: {
package/dist/index87.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as h, ref as t, onMounted as m, onBeforeUnmount as p, createBlock as g, openBlock as b, resolveDynamicComponent as w, withCtx as _, renderSlot as I } from "vue";
2
- import { throttle as c } from "./index270.js";
2
+ import { throttle as c } from "./index269.js";
3
3
  const M = /* @__PURE__ */ h({
4
4
  __name: "BbIntersection",
5
5
  props: {
package/dist/index90.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as O, mergeModels as E, useModel as P, computed as p, ref as T, watch as q, onMounted as A, createElementBlock as d, openBlock as c, withModifiers as H, normalizeStyle as K, normalizeClass as R, unref as v, createCommentVNode as y, Fragment as U, createElementVNode as l, renderSlot as s, createTextVNode as j, toDisplayString as z, nextTick as G } from "vue";
2
- import { parseSize as J } from "./index244.js";
2
+ import { parseSize as J } from "./index209.js";
3
3
  import { useId as D } from "./index8.js";
4
- import { useLocale as Q } from "./index219.js";
4
+ import { useLocale as Q } from "./index210.js";
5
5
  import { useMobile as X } from "./index9.js";
6
- import { useUntil as Y } from "./index220.js";
6
+ import { useUntil as Y } from "./index211.js";
7
7
  import { wait as h } from "./index135.js";
8
8
  const Z = ["aria-describedby", "aria-labelledby", "aria-live", "inert"], x = {
9
9
  ref: "header",
package/dist/index92.js CHANGED
@@ -3,8 +3,8 @@ import { defineComponent as V, mergeModels as W, useModel as U, computed as d, r
3
3
  /* empty css */
4
4
  import P from "./index13.js";
5
5
  /* empty css */
6
- import { debounce as X } from "./index269.js";
7
- import { useLocale as H } from "./index219.js";
6
+ import { debounce as X } from "./index272.js";
7
+ import { useLocale as H } from "./index210.js";
8
8
  import { useRoute as J } from "./index142.js";
9
9
  const K = ["aria-label"], Q = { class: "bb-pagination__page-label sr-only" }, Y = { class: "bb-pagination__page-label" }, Z = { class: "bb-pagination__page-label" }, ee = { class: "bb-pagination__page-label sr-only" }, ue = /* @__PURE__ */ V({
10
10
  __name: "BbPagination",
package/dist/index94.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { defineComponent as V, ref as m, computed as g, createBlock as k, openBlock as y, unref as l, normalizeClass as D, withCtx as v, createElementVNode as d, createCommentVNode as M, renderSlot as C, toDisplayString as z, normalizeProps as I, guardReactiveProps as O, nextTick as S } from "vue";
2
2
  import { useId as H } from "./index8.js";
3
3
  import { useIntersectionObserver as N } from "./index137.js";
4
- import { useLocale as U } from "./index219.js";
5
- import { useUntil as W } from "./index220.js";
4
+ import { useLocale as U } from "./index210.js";
5
+ import { useUntil as W } from "./index211.js";
6
6
  import q from "./index13.js";
7
7
  /* empty css */
8
- import A from "./index227.js";
8
+ import A from "./index238.js";
9
9
  /* empty css */
10
10
  const R = ["inert"], Z = { class: "bb-popover__close-label sr-only" }, ee = /* @__PURE__ */ V({
11
11
  __name: "BbPopover",
package/dist/index96.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as r, computed as a, createElementBlock as l, openBlock as s, normalizeClass as m, createElementVNode as n, normalizeStyle as c } from "vue";
2
- import { clamp as p } from "./index207.js";
2
+ import { clamp as p } from "./index206.js";
3
3
  import { getAsPercentageBetween as i } from "./index136.js";
4
4
  const _ = /* @__PURE__ */ r({
5
5
  __name: "BbProgress",
@@ -2,32 +2,25 @@
2
2
  * Get the percentage "a" represents in total
3
3
  * @returns
4
4
  */
5
- export declare const getAsPercentage: (a: number, total: number) => number;
5
+ export declare const getAsPercentage: (a: number, total: number, clamped?: boolean) => number;
6
6
  /**
7
- * Get "a" knowing the percentage
7
+ * Get a number knowing the percentage and the total
8
8
  * @returns
9
9
  */
10
- export declare const getPercentageFrom: (a: number, total: number) => number;
10
+ export declare const getValueFromPercentage: (percentage: number, of: number) => number;
11
11
  /**
12
12
  * Normalize the bounds of a value
13
13
  */
14
- export declare const getAsPercentageBetween: (a: number, min: number, max: number) => number;
14
+ export declare const getAsPercentageBetween: (a: number, min: number, max: number, clamped?: boolean) => number;
15
15
  /**
16
- * Get a value "b" that is the same percentage as "a" into it's target bounds.
17
- * EG 40% = 4 for a bound 0, 10 is transposed to 40% = 8
18
- * for bounds 0, 20, or again 40% = 4 for bound 10, 20
16
+ * Calculate the actual value that corresponds to a given percentage within an interval
17
+ * @param percentage The percentage (0-100) to convert to a value
18
+ * @param intervalStart The start of the interval
19
+ * @param intervalEnd The end of the interval
20
+ * @returns The value that corresponds to the given percentage in the interval
21
+ * @example
22
+ * getValueFromPercentageInInterval(50, -20, 60) // returns 20
23
+ * getValueFromPercentageInInterval(0, 0, 100) // returns 0
24
+ * getValueFromPercentageInInterval(100, 0, 100) // returns 100
19
25
  */
20
- type TransposeValueParameters = {
21
- value: number;
22
- originalBounds: {
23
- min: number;
24
- max: number;
25
- };
26
- targetBounds: {
27
- min: number;
28
- max: number;
29
- };
30
- step: number;
31
- };
32
- export declare const transposeValue: (params: TransposeValueParameters) => number;
33
- export {};
26
+ export declare const getValueFromPercentageInInterval: (percentage: number, intervalStart: number, intervalEnd: number) => number;
@@ -0,0 +1 @@
1
+ export declare const snapToStep: (value: number, min: number, max: number, step: number) => number;
@@ -0,0 +1 @@
1
+ export declare function transpose(value: number, fromMin: number, fromMax: number, toMin: number, toMax: number): number;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Transpose a percentage to a value
3
+ * @param value - The percentage to transpose 0 - 100
4
+ * @param min - The minimum value
5
+ * @param max - The maximum value
6
+ * @returns The value
7
+ */
8
+ export declare const transposePercent: (value: number, // 0–100
9
+ min: number, max: number) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitboss-ui",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "scripts": {
package/dist/index213.js DELETED
@@ -1,53 +0,0 @@
1
- import { computed as l, unref as o } from "vue";
2
- import { useItemText as x } from "./index279.js";
3
- import { useItemValue as w } from "./index265.js";
4
- import { hash as y } from "./index215.js";
5
- import { useLogger as D } from "./index258.js";
6
- const { getItemText: O } = x(), { getItemValue: V } = w(), { warn: H } = D(), T = (u, c, m, a, d, r) => r ? !1 : !!(c || u.disabled || a && d >= a), q = ({
7
- items: u,
8
- disabled: c,
9
- selectable: m,
10
- itemText: a,
11
- itemValue: d,
12
- selectedIndexedByHash: r,
13
- max: b = 1 / 0
14
- }) => {
15
- const v = l(() => o(c)), p = l(() => o(u)), h = l(
16
- () => Object.keys(r.value).length
17
- ), g = o(b), f = (e) => {
18
- const n = V(e, o(d)), t = y(n), i = O(e, o(a)), s = r.value[t] !== void 0, I = T(
19
- e,
20
- v.value,
21
- m,
22
- g,
23
- h.value,
24
- s
25
- );
26
- return {
27
- item: e,
28
- text: i,
29
- value: n,
30
- valueHash: t,
31
- selected: s,
32
- disabled: o(I)
33
- };
34
- };
35
- return {
36
- options: l(() => {
37
- const e = [], n = /* @__PURE__ */ new Set();
38
- for (let t = 0; t < p.value.length; t++) {
39
- const i = p.value[t];
40
- i.disabled && H(
41
- "Disabling an item by passing a disabled option to the item itself is deprecated and will be removed in a future version. Use the `disabled` prop or the `selectable` iteratee prop instead."
42
- );
43
- const s = f(i);
44
- n.has(s.valueHash) || (n.add(s.valueHash), e.push(s));
45
- }
46
- return e;
47
- }),
48
- createOption: f
49
- };
50
- };
51
- export {
52
- q as useBaseOptions
53
- };
package/dist/index227.js DELETED
@@ -1,115 +0,0 @@
1
- import { defineComponent as P, mergeModels as D, useModel as V, ref as r, watch as A, onMounted as x, computed as S, createBlock as b, openBlock as v, resolveDynamicComponent as g, normalizeStyle as z, normalizeClass as E, unref as n, withCtx as w, renderSlot as y, createCommentVNode as N, mergeProps as h, createElementVNode as C } from "vue";
2
- import { wait as F } from "./index135.js";
3
- import { useFloating as U, arrow as j } from "./index333.js";
4
- import { flip as q, offset as G, shift as H, hide as I, autoUpdate as J } from "./index334.js";
5
- const K = { class: "bb-common-popover__bubble" }, W = /* @__PURE__ */ P({
6
- __name: "CommonPopover",
7
- props: /* @__PURE__ */ D({
8
- arrowPadding: {},
9
- offset: {},
10
- block: { type: Boolean },
11
- padding: { default: 0 },
12
- placement: {},
13
- transitionDuration: { default: 250 },
14
- containerAttributes: {},
15
- dialog: { type: Boolean },
16
- renderContent: { type: Boolean, default: !0 },
17
- tag: { default: "span" }
18
- }, {
19
- modelValue: { type: Boolean, default: !1 },
20
- modelModifiers: {}
21
- }),
22
- emits: ["update:modelValue"],
23
- setup(s) {
24
- const o = s, a = V(s, "modelValue"), i = r(), t = r(), p = r(), { floatingStyles: k, placement: _, middlewareData: l, update: M } = U(
25
- i,
26
- t,
27
- {
28
- placement: o.placement,
29
- whileElementsMounted: J,
30
- middleware: [
31
- q(),
32
- G(o.offset),
33
- H({ padding: o.padding }),
34
- I(),
35
- j({
36
- element: p,
37
- padding: o.arrowPadding
38
- })
39
- ],
40
- strategy: "fixed"
41
- }
42
- ), d = (e) => {
43
- e ? (M(), o.dialog ? t.value.showModal() : t.value.showPopover()) : F(o.transitionDuration).then(() => {
44
- t.value && (o.dialog ? t.value.close() : t.value.hidePopover());
45
- });
46
- };
47
- A(a, d, { flush: "post" }), x(() => {
48
- a.value && d(a.value);
49
- });
50
- const $ = S(() => {
51
- if (l.value.arrow) {
52
- const { x: e, y: u } = l.value.arrow;
53
- return {
54
- style: {
55
- left: `${e}px`,
56
- top: `${u}px`
57
- }
58
- };
59
- }
60
- }), B = () => {
61
- a.value = !1;
62
- };
63
- return (e, u) => (v(), b(g(e.dialog ? "div" : e.tag), {
64
- ref_key: "wrapper",
65
- ref: i,
66
- class: E(["bb-common-popover", {
67
- "bb-common-popover--open": a.value && !!t.value,
68
- "bb-common-popover--block": o.block,
69
- [`bb-common-popover--${n(_)}`]: !0
70
- }]),
71
- style: z({
72
- "--transition-duration": `${o.transitionDuration}ms`
73
- })
74
- }, {
75
- default: w(() => {
76
- var m, c, f;
77
- return [
78
- y(e.$slots, "activator"),
79
- e.renderContent ? (v(), b(g(e.dialog ? "dialog" : e.tag), h({
80
- key: 0,
81
- ref_key: "content",
82
- ref: t,
83
- class: ["bb-common-popover__bubble-container", {
84
- "bb-common-popover__bubble-container--open": a.value && !!t.value
85
- }],
86
- popover: "manual",
87
- style: {
88
- ...((m = e.containerAttributes) == null ? void 0 : m.style) ?? {},
89
- ...n(k),
90
- "--arrow-offset-x": Math.round(((f = (c = n(l)) == null ? void 0 : c.arrow) == null ? void 0 : f.x) ?? 0) + "px",
91
- "--page-padding": `${e.padding}px`
92
- },
93
- tabindex: a.value ? void 0 : -1
94
- }, e.containerAttributes, { onClose: n(B) }), {
95
- default: w(() => [
96
- C("span", h({
97
- ref_key: "bubblearrow",
98
- ref: p,
99
- class: "bb-common-popover__arrow"
100
- }, $.value), null, 16),
101
- C("span", K, [
102
- y(e.$slots, "default")
103
- ])
104
- ]),
105
- _: 3
106
- }, 16, ["class", "style", "tabindex", "onClose"])) : N("", !0)
107
- ];
108
- }),
109
- _: 3
110
- }, 8, ["class", "style"]));
111
- }
112
- });
113
- export {
114
- W as default
115
- };
package/dist/index251.js DELETED
@@ -1,4 +0,0 @@
1
- const e = (t) => t;
2
- export {
3
- e as identity
4
- };
package/dist/index288.js DELETED
@@ -1,6 +0,0 @@
1
- function e(t) {
2
- return Object.prototype.toString.call(t).slice(8, -1);
3
- }
4
- export {
5
- e as getType
6
- };
package/dist/index318.js DELETED
@@ -1,7 +0,0 @@
1
- import { getDefaultExportFromCjs as t } from "./index307.js";
2
- import { __require as r } from "./index338.js";
3
- var o = r();
4
- const s = /* @__PURE__ */ t(o);
5
- export {
6
- s as default
7
- };
package/dist/index333.js DELETED
@@ -1,131 +0,0 @@
1
- import { arrow as j, computePosition as A } from "./index334.js";
2
- import { autoUpdate as W, flip as X, hide as Y, offset as Z, platform as ee, shift as ne } from "./index334.js";
3
- import { isNode as B, getNodeName as F } from "./index341.js";
4
- import { getOverflowAncestors as le } from "./index341.js";
5
- import { computed as r, ref as c, shallowRef as I, watch as x, getCurrentScope as U, onScopeDispose as k, shallowReadonly as o, unref as q } from "vue";
6
- function z(e) {
7
- return e != null && typeof e == "object" && "$el" in e;
8
- }
9
- function V(e) {
10
- if (z(e)) {
11
- const l = e.$el;
12
- return B(l) && F(l) === "#comment" ? null : l;
13
- }
14
- return e;
15
- }
16
- function i(e) {
17
- return typeof e == "function" ? e() : q(e);
18
- }
19
- function K(e) {
20
- return {
21
- name: "arrow",
22
- options: e,
23
- fn(l) {
24
- const t = V(i(e.element));
25
- return t == null ? {} : j({
26
- element: t,
27
- padding: e.padding
28
- }).fn(l);
29
- }
30
- };
31
- }
32
- function M(e) {
33
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
34
- }
35
- function C(e, l) {
36
- const t = M(e);
37
- return Math.round(l * t) / t;
38
- }
39
- function L(e, l, t) {
40
- t === void 0 && (t = {});
41
- const D = t.whileElementsMounted, s = r(() => {
42
- var n;
43
- return (n = i(t.open)) != null ? n : !0;
44
- }), O = r(() => i(t.middleware)), p = r(() => {
45
- var n;
46
- return (n = i(t.placement)) != null ? n : "bottom";
47
- }), w = r(() => {
48
- var n;
49
- return (n = i(t.strategy)) != null ? n : "absolute";
50
- }), S = r(() => {
51
- var n;
52
- return (n = i(t.transform)) != null ? n : !0;
53
- }), f = r(() => V(e.value)), u = r(() => V(l.value)), y = c(0), h = c(0), m = c(w.value), P = c(p.value), E = I({}), g = c(!1), _ = r(() => {
54
- const n = {
55
- position: m.value,
56
- left: "0",
57
- top: "0"
58
- };
59
- if (!u.value)
60
- return n;
61
- const a = C(u.value, y.value), b = C(u.value, h.value);
62
- return S.value ? {
63
- ...n,
64
- transform: "translate(" + a + "px, " + b + "px)",
65
- ...M(u.value) >= 1.5 && {
66
- willChange: "transform"
67
- }
68
- } : {
69
- position: m.value,
70
- left: a + "px",
71
- top: b + "px"
72
- };
73
- });
74
- let d;
75
- function v() {
76
- if (f.value == null || u.value == null)
77
- return;
78
- const n = s.value;
79
- A(f.value, u.value, {
80
- middleware: O.value,
81
- placement: p.value,
82
- strategy: w.value
83
- }).then((a) => {
84
- y.value = a.x, h.value = a.y, m.value = a.strategy, P.value = a.placement, E.value = a.middlewareData, g.value = n !== !1;
85
- });
86
- }
87
- function R() {
88
- typeof d == "function" && (d(), d = void 0);
89
- }
90
- function N() {
91
- if (R(), D === void 0) {
92
- v();
93
- return;
94
- }
95
- if (f.value != null && u.value != null) {
96
- d = D(f.value, u.value, v);
97
- return;
98
- }
99
- }
100
- function $() {
101
- s.value || (g.value = !1);
102
- }
103
- return x([O, p, w, s], v, {
104
- flush: "sync"
105
- }), x([f, u], N, {
106
- flush: "sync"
107
- }), x(s, $, {
108
- flush: "sync"
109
- }), U() && k(R), {
110
- x: o(y),
111
- y: o(h),
112
- strategy: o(m),
113
- placement: o(P),
114
- middlewareData: o(E),
115
- isPositioned: o(g),
116
- floatingStyles: _,
117
- update: v
118
- };
119
- }
120
- export {
121
- K as arrow,
122
- W as autoUpdate,
123
- A as computePosition,
124
- X as flip,
125
- le as getOverflowAncestors,
126
- Y as hide,
127
- Z as offset,
128
- ee as platform,
129
- ne as shift,
130
- L as useFloating
131
- };