@onereach/ui-components-common 20.2.0-beta.5168.0 → 20.2.0-beta.5171.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.
@@ -0,0 +1,19 @@
1
+ function f(e) {
2
+ return e.offsetWidth > 0 && e.offsetHeight > 0;
3
+ }
4
+ function l(e) {
5
+ const i = document.body.querySelectorAll("*"), n = [];
6
+ for (const t of i)
7
+ if (!t.isEqualNode(e) && f(t)) {
8
+ const s = t.style;
9
+ if (s && s.zIndex !== "") {
10
+ const o = Number(s.zIndex);
11
+ isNaN(o) || n.push(o);
12
+ }
13
+ }
14
+ return n;
15
+ }
16
+ export {
17
+ l as g,
18
+ f as i
19
+ };
package/dist/hooks.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, b as u, c as t, d as o, e as r, f as i, g as l, h as m, i as n, j as b, k as d, l as v, m as T, u as f, n as g } from "./useValidationAttributes-Cp_70z2s.js";
1
+ import { a, b as u, c as t, d as o, e as r, f as i, g as l, h as m, i as n, j as b, k as d, l as v, m as T, u as f, n as g } from "./useValidationAttributes-B5payAIP.js";
2
2
  export {
3
3
  a as useControlAttributes,
4
4
  u as useDateFormat,
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import { D as e, a as E } from "./dropdown-open-k6cFnrqA.js";
2
- import { g as t, a as R, s as T } from "./searchItemsByLabel-BhinsABA.js";
3
- import { D as r, L as A, T as O, a as C, b as i, c as D, d as l, e as S, f as N, g as m, h as X, i as n, j as u, k as P, l as L, m as M, u as I, n as g } from "./useValidationAttributes-Cp_70z2s.js";
2
+ import { g as _, a as R, s as T } from "./searchItemsByLabel-BhinsABA.js";
3
+ import { D as r, L as A, T as O, a as C, b as i, c as l, d as D, e as S, f as N, g as m, h as X, i as n, j as P, k as u, l as L, m as M, u as g, n as I } from "./useValidationAttributes-B5payAIP.js";
4
4
  import { DateFormat as f, TimeFormat as p } from "./types.js";
5
- import { C as F, a as c, b as x, c as b, d as B, e as y, f as G, g as h, h as v, i as U, j as V, k, l as w, m as j, H as W, p as q, o as K, t as Y, s as z, r as Q, q as Z, n as J, P as $, Q as aa, R as sa, u as ea, S as Ea, T as _a, v as ta, W as Ra, X as Ta, w as oa, x as ra, y as Aa, V as Oa, z as Ca, A as ia, _ as Da, B as la, D as Sa, E as Na, Y as ma, F as Xa, Z as na, G as ua, I as Pa, J as La, K as Ma, U as Ia, L as ga, M as da, N as fa, O as pa, $ as Ha, am as Fa, a5 as ca, a4 as xa, a2 as ba, a9 as Ba, a6 as ya, a0 as Ga, a3 as ha, aa as va, ab as Ua, ac as Va, ad as ka, ae as wa, af as ja, ag as Wa, ah as qa, ai as Ka, aj as Ya, ak as za, a7 as Qa, a8 as Za, a1 as Ja, al as $a } from "./extractCssVarName-IHa2pGlF.js";
6
- import { M as ss, f as es, c as Es, e as _s, l as ts, q as Rs, g as Ts, t as os, w as rs, p as As, m as Os, i as Cs, u as is, v as Ds, b as ls, k as Ss, h as Ns, a as ms, o as Xs, r as ns, d as us, s as Ps, j as Ls, n as Ms } from "./dom-CwV-xS38.js";
7
- import { i as gs } from "./isUndefined-B5qXrATz.js";
8
- import { i as fs } from "./isVisible-BogKi39W.js";
5
+ import { C as F, a as c, b as x, c as b, d as B, e as v, f as y, g as G, h, i as U, j as V, k, l as w, m as j, H as W, p as q, o as K, t as Y, s as z, r as Q, q as Z, n as J, P as $, Q as aa, R as sa, u as ea, S as Ea, T as ta, v as _a, W as Ra, X as Ta, w as oa, x as ra, y as Aa, V as Oa, z as Ca, A as ia, _ as la, B as Da, D as Sa, E as Na, Y as ma, F as Xa, Z as na, G as Pa, I as ua, J as La, K as Ma, U as ga, L as Ia, M as da, N as fa, O as pa, $ as Ha, am as Fa, a5 as ca, a4 as xa, a2 as ba, a9 as Ba, a6 as va, a0 as ya, a3 as Ga, aa as ha, ab as Ua, ac as Va, ad as ka, ae as wa, af as ja, ag as Wa, ah as qa, ai as Ka, aj as Ya, ak as za, a7 as Qa, a8 as Za, a1 as Ja, al as $a } from "./extractCssVarName-IHa2pGlF.js";
6
+ import { M as ss, f as es, c as Es, e as ts, l as _s, q as Rs, g as Ts, t as os, w as rs, p as As, m as Os, i as Cs, u as is, v as ls, b as Ds, k as Ss, h as Ns, a as ms, o as Xs, r as ns, d as Ps, s as us, j as Ls, n as Ms } from "./dom-CwV-xS38.js";
7
+ import { i as Is } from "./isUndefined-B5qXrATz.js";
8
+ import { g as fs, i as ps } from "./getPageElevations-DGY7uGUG.js";
9
9
  export {
10
10
  F as CODE_BACKSPACE,
11
11
  c as CODE_BREAK,
12
12
  x as CODE_DELETE,
13
13
  b as CODE_DOWN,
14
14
  B as CODE_END,
15
- y as CODE_ENTER,
16
- G as CODE_ESC,
17
- h as CODE_HOME,
18
- v as CODE_LEFT,
15
+ v as CODE_ENTER,
16
+ y as CODE_ESC,
17
+ G as CODE_HOME,
18
+ h as CODE_LEFT,
19
19
  U as CODE_PAGEDOWN,
20
20
  V as CODE_PAGEUP,
21
21
  k as CODE_RIGHT,
@@ -40,8 +40,8 @@ export {
40
40
  sa as RX_ARRAY_NOTATION,
41
41
  ea as RX_BV_PREFIX,
42
42
  Ea as RX_DATE,
43
- _a as RX_DATE_SPLIT,
44
- ta as RX_DIGITS,
43
+ ta as RX_DATE_SPLIT,
44
+ _a as RX_DIGITS,
45
45
  Ra as RX_ENCODED_COMMA,
46
46
  Ta as RX_ENCODE_REVERSE,
47
47
  oa as RX_EXTENSION,
@@ -50,19 +50,19 @@ export {
50
50
  Oa as RX_HREF,
51
51
  Ca as RX_HTML_TAGS,
52
52
  ia as RX_HYPHENATE,
53
- Da as RX_LONG_COLOR,
54
- la as RX_LOWER_UPPER,
53
+ la as RX_LONG_COLOR,
54
+ Da as RX_LOWER_UPPER,
55
55
  Sa as RX_NUMBER,
56
56
  Na as RX_PLUS,
57
57
  ma as RX_QUERY_START,
58
58
  Xa as RX_REGEXP_REPLACE,
59
59
  na as RX_SHORT_COLOR,
60
- ua as RX_SPACES,
61
- Pa as RX_SPACE_SPLIT,
60
+ Pa as RX_SPACES,
61
+ ua as RX_SPACE_SPLIT,
62
62
  La as RX_STAR,
63
63
  Ma as RX_START_SPACE_WORD,
64
- Ia as RX_TIME,
65
- ga as RX_TRIM_LEFT,
64
+ ga as RX_TIME,
65
+ Ia as RX_TRIM_LEFT,
66
66
  da as RX_TRIM_RIGHT,
67
67
  fa as RX_UNDERSCORE,
68
68
  pa as RX_UN_KEBAB,
@@ -70,27 +70,28 @@ export {
70
70
  p as TimeFormat,
71
71
  es as addClass,
72
72
  Es as cancelAF,
73
- _s as contains,
73
+ ts as contains,
74
74
  Ha as exclude,
75
75
  Fa as extractCssVarName,
76
76
  ca as flattenDeep,
77
77
  xa as generateColorFromString,
78
78
  ba as generateHslFromString,
79
79
  Ba as getAbbreviation,
80
- ts as getAttr,
80
+ _s as getAttr,
81
81
  Rs as getBCR,
82
82
  Ts as getById,
83
83
  os as getCS,
84
- ya as getHashOfString,
85
- t as getItemByValue,
84
+ va as getHashOfString,
85
+ _ as getItemByValue,
86
86
  R as getItemsByValue,
87
87
  rs as getMaxZIndex,
88
+ fs as getPageElevations,
88
89
  As as getStyle,
89
90
  Os as hasAttr,
90
91
  Cs as hasClass,
91
- Ga as hexToRgb,
92
- ha as hslToColorString,
93
- va as include,
92
+ ya as hexToRgb,
93
+ Ga as hslToColorString,
94
+ ha as include,
94
95
  Ua as isAncestor,
95
96
  Va as isArray,
96
97
  ka as isDescendant,
@@ -101,13 +102,13 @@ export {
101
102
  Ka as isNumber,
102
103
  Ya as isObject,
103
104
  za as isString,
104
- gs as isUndefined,
105
- fs as isVisible,
105
+ Is as isUndefined,
106
+ ps as isVisible,
106
107
  Qa as normalize,
107
108
  is as offset,
108
- Ds as position,
109
+ ls as position,
109
110
  Za as pxToRem,
110
- ls as reflow,
111
+ Ds as reflow,
111
112
  Ss as removeAttr,
112
113
  Ns as removeClass,
113
114
  ms as removeNode,
@@ -115,24 +116,24 @@ export {
115
116
  ns as requestAF,
116
117
  Ja as rgbToHex,
117
118
  T as searchItemsByLabel,
118
- us as select,
119
- Ps as selectAll,
119
+ Ps as select,
120
+ us as selectAll,
120
121
  Ls as setAttr,
121
122
  Ms as setStyle,
122
123
  $a as toArray,
123
124
  C as useControlAttributes,
124
125
  i as useDateFormat,
125
- D as useDateMask,
126
- l as useElevation,
126
+ l as useDateMask,
127
+ D as useElevation,
127
128
  S as useIdAttribute,
128
129
  N as useLocale,
129
130
  m as useOverflow,
130
131
  X as usePopoverState,
131
132
  n as useProxyModelValue,
132
- u as useResponsive,
133
- P as useTheme,
133
+ P as useResponsive,
134
+ u as useTheme,
134
135
  L as useTimeFormat,
135
136
  M as useTimeMask,
136
- I as useToggle,
137
- g as useValidationAttributes
137
+ g as useToggle,
138
+ I as useValidationAttributes
138
139
  };
@@ -1,19 +1,19 @@
1
- import { useAttrs as h, computed as u, inject as g, isRef as p, ref as d, watch as v, getCurrentInstance as b, onMounted as x } from "vue";
2
- import { DateFormat as R, TimeFormat as M } from "./types.js";
1
+ import { useAttrs as h, computed as u, inject as g, isRef as p, ref as c, watch as v, getCurrentInstance as M, onMounted as R } from "vue";
2
+ import { DateFormat as x, TimeFormat as b } from "./types.js";
3
3
  import { r as C } from "./dom-CwV-xS38.js";
4
- import { i as E } from "./isVisible-BogKi39W.js";
5
- import { useMutationObserver as S, useResizeObserver as $, refDebounced as F, useMediaQuery as P } from "@vueuse/core";
4
+ import { g as E } from "./getPageElevations-DGY7uGUG.js";
5
+ import { useMutationObserver as $, useResizeObserver as F, refDebounced as S, useMediaQuery as P } from "@vueuse/core";
6
6
  import O from "@onereach/styles/screens.json";
7
- import { isVue3 as V } from "@/constants";
8
- import Y from "@onereach/styles/tailwind.config.json";
9
- const _ = () => {
7
+ import { isVue3 as Y } from "@/constants";
8
+ import L from "@onereach/styles/tailwind.config.json";
9
+ const k = () => {
10
10
  const e = h();
11
11
  return {
12
12
  readonly: u(() => e.readonly),
13
13
  disabled: u(() => e.disabled),
14
14
  "force-state": u(() => e["force-state"])
15
15
  };
16
- }, q = Symbol(), L = Symbol(), z = Symbol(), k = (e) => u(() => e.value ?? g(q, R.Short)), G = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
16
+ }, V = Symbol(), U = Symbol(), q = Symbol(), G = (e) => u(() => e.value ?? g(V, x.Short)), J = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
17
17
  dateStyle: e.value,
18
18
  timeZone: "UTC"
19
19
  }).formatToParts(Date.UTC(1, 0, 1, 1, 1)).reduce((r, n) => {
@@ -36,37 +36,28 @@ const _ = () => {
36
36
  default:
37
37
  return r + n.value;
38
38
  }
39
- }, "") : e.value(void 0, t.value)), J = (e, t) => {
40
- const s = p(e) ? e : d(e), r = p(t) ? t : d();
39
+ }, "") : e.value(void 0, t.value)), K = (e, t) => {
40
+ const o = p(e) ? e : c(e), r = p(t) ? t : c();
41
41
  function n(a) {
42
- return Array.from(document.body.querySelectorAll("*")).reduce((o, i) => {
43
- if (!i.isEqualNode(a) && E(i)) {
44
- const c = Number(getComputedStyle(i).zIndex);
45
- isNaN(c) || o.push(c);
46
- }
47
- return o;
48
- }, []);
49
- }
50
- function l(a) {
51
- a.style.zIndex = String(Math.max(0, ...n(a)) + 1);
42
+ a.style.zIndex = String(Math.max(0, ...E(a)) + 1);
52
43
  }
53
- v([s, r], ([a]) => {
54
- a && l(a);
44
+ v([o, r], ([a]) => {
45
+ a && n(a);
55
46
  }, { immediate: !0 });
56
- }, K = () => {
57
- const e = h(), t = b();
47
+ }, N = () => {
48
+ const e = h(), t = M();
58
49
  return u(() => e.id ?? (t == null ? void 0 : t.uid.toString()));
59
- }, X = (e) => u(() => e.value ?? g(L, navigator.language)), ee = (e, t = {}) => {
60
- const { hide: s = !0, threshold: r = 0 } = t, n = p(e) ? e : d(e), l = d([]), a = d([]);
61
- function o() {
50
+ }, X = (e) => u(() => e.value ?? g(U, navigator.language)), ee = (e, t = {}) => {
51
+ const { hide: o = !0, threshold: r = 0 } = t, n = p(e) ? e : c(e), a = c([]), l = c([]);
52
+ function s() {
62
53
  const i = n.value;
63
54
  if (i) {
64
- const c = [...i.children].reduce(({ innerItems: m, outerItems: y }, T) => {
65
- const f = T, { x: I, width: A } = f.getBoundingClientRect(), { x: D, width: w } = i.getBoundingClientRect();
66
- return I + A > D + w + r ? (s && f.style.setProperty("visibility", "hidden"), {
55
+ const d = [...i.children].reduce(({ innerItems: m, outerItems: y }, T) => {
56
+ const f = T, { x: D, width: I } = f.getBoundingClientRect(), { x: w, width: A } = i.getBoundingClientRect();
57
+ return D + I > w + A + r ? (o && f.style.setProperty("visibility", "hidden"), {
67
58
  innerItems: m,
68
59
  outerItems: [...y, f]
69
- }) : (s && f.style.removeProperty("visibility"), {
60
+ }) : (o && f.style.removeProperty("visibility"), {
70
61
  innerItems: [...m, f],
71
62
  outerItems: y
72
63
  });
@@ -74,24 +65,24 @@ const _ = () => {
74
65
  innerItems: [],
75
66
  outerItems: []
76
67
  });
77
- l.value = c.innerItems, a.value = c.outerItems;
68
+ a.value = d.innerItems, l.value = d.outerItems;
78
69
  } else
79
- l.value = [], a.value = [];
70
+ a.value = [], l.value = [];
80
71
  }
81
- return v(n, o, {
72
+ return v(n, s, {
82
73
  immediate: !0
83
- }), S(n, o, {
74
+ }), $(n, s, {
84
75
  childList: !0
85
- }), $(n, () => C(o)), {
86
- innerItems: l,
87
- outerItems: a
76
+ }), F(n, () => C(s)), {
77
+ innerItems: a,
78
+ outerItems: l
88
79
  };
89
- }, te = (e, t, s = {}) => {
90
- const r = d(e.value ? "open" : "closed");
80
+ }, te = (e, t, o = {}) => {
81
+ const r = c(e.value ? "open" : "closed");
91
82
  v(e, (i) => {
92
83
  r.value = i ? "open" : "closed";
93
84
  });
94
- const n = F(r, s.debounce ?? 0);
85
+ const n = S(r, o.debounce ?? 0);
95
86
  v(n, (i) => {
96
87
  switch (t("update:state", i), i) {
97
88
  case "open":
@@ -102,24 +93,24 @@ const _ = () => {
102
93
  break;
103
94
  }
104
95
  });
105
- function l() {
96
+ function a() {
106
97
  r.value = "open";
107
98
  }
108
- function a() {
99
+ function l() {
109
100
  r.value = "closed";
110
101
  }
111
- function o() {
102
+ function s() {
112
103
  r.value = r.value === "open" ? "closed" : "open";
113
104
  }
114
105
  return {
115
106
  state: n,
116
- open: l,
117
- close: a,
118
- toggle: o
107
+ open: a,
108
+ close: l,
109
+ toggle: s
119
110
  };
120
111
  };
121
- function re(e, t, s = {}) {
122
- const { defaultValue: r } = s;
112
+ function re(e, t, o = {}) {
113
+ const { defaultValue: r } = o;
123
114
  return r ? u({
124
115
  get: () => e.value ?? r.value,
125
116
  set: (n) => {
@@ -133,31 +124,31 @@ function re(e, t, s = {}) {
133
124
  });
134
125
  }
135
126
  function ne(e) {
136
- const t = b(), s = d();
137
- e ? v(e, (o) => {
138
- s.value = o;
139
- }) : x(() => {
127
+ const t = M(), o = c();
128
+ e ? v(e, (s) => {
129
+ o.value = s;
130
+ }) : R(() => {
140
131
  if (t) {
141
- const o = t.vnode[V ? "el" : "elm"];
142
- o instanceof Element && (s.value = o);
132
+ const s = t.vnode[Y ? "el" : "elm"];
133
+ s instanceof Element && (o.value = s);
143
134
  }
144
135
  });
145
- const r = u(() => a(s.value) || l.value), n = u(() => !r.value), l = P(`(min-width: ${O.md})`);
146
- function a(o) {
147
- var c;
148
- if (!o)
136
+ const r = u(() => l(o.value) || a.value), n = u(() => !r.value), a = P(`(min-width: ${O.md})`);
137
+ function l(s) {
138
+ var d;
139
+ if (!s)
149
140
  return !1;
150
- const i = (c = o.getAttribute("force-screen")) == null ? void 0 : c.split(/\s+/);
151
- return i != null && i.some((m) => ["md", "lg", "xl"].includes(m)) ? !0 : a(o.parentElement ?? void 0);
141
+ const i = (d = s.getAttribute("force-screen")) == null ? void 0 : d.split(/\s+/);
142
+ return i != null && i.some((m) => ["md", "lg", "xl"].includes(m)) ? !0 : l(s.parentElement ?? void 0);
152
143
  }
153
144
  return {
154
145
  isDesktop: r,
155
146
  isMobile: n
156
147
  };
157
148
  }
158
- const ue = () => Y.theme, oe = (e) => u(() => e.value ?? g(z, M.Auto)), se = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
149
+ const ue = () => L.theme, oe = (e) => u(() => e.value ?? g(q, b.Auto)), se = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
159
150
  timeStyle: "short",
160
- hourCycle: e.value !== M.Auto ? e.value : void 0,
151
+ hourCycle: e.value !== b.Auto ? e.value : void 0,
161
152
  timeZone: "UTC"
162
153
  }).formatToParts(Date.UTC(1, 0, 1, 1, 1)).reduce((r, n) => {
163
154
  switch (n.type) {
@@ -172,8 +163,8 @@ const ue = () => Y.theme, oe = (e) => u(() => e.value ?? g(z, M.Auto)), se = (e,
172
163
  }
173
164
  }, "") : e.value(void 0, t.value));
174
165
  function ae(e = !1) {
175
- const t = d(e);
176
- function s() {
166
+ const t = c(e);
167
+ function o() {
177
168
  t.value = !0;
178
169
  }
179
170
  function r() {
@@ -184,7 +175,7 @@ function ae(e = !1) {
184
175
  }
185
176
  return {
186
177
  isActiveToggle: t,
187
- show: s,
178
+ show: o,
188
179
  hide: r,
189
180
  toggle: n
190
181
  };
@@ -202,14 +193,14 @@ const ie = () => {
202
193
  };
203
194
  };
204
195
  export {
205
- q as D,
206
- L,
207
- z as T,
208
- _ as a,
209
- k as b,
210
- G as c,
211
- J as d,
212
- K as e,
196
+ V as D,
197
+ U as L,
198
+ q as T,
199
+ k as a,
200
+ G as b,
201
+ J as c,
202
+ K as d,
203
+ N as e,
213
204
  X as f,
214
205
  ee as g,
215
206
  te as h,
@@ -0,0 +1 @@
1
+ export declare function getPageElevations(currentElement: HTMLElement): number[];
@@ -24,3 +24,4 @@ export * from './isUndefined';
24
24
  export * from './isVisible';
25
25
  export * from './toArray';
26
26
  export * from './extractCssVarName';
27
+ export * from './getPageElevations';
@@ -1 +1 @@
1
- export declare const isVisible: (element: HTMLElement) => boolean;
1
+ export declare function isVisible(element: HTMLElement): boolean;
package/dist/utils.js CHANGED
@@ -1,7 +1,7 @@
1
- import { C as E, a as _, b as R, c as e, d as T, e as t, f as A, g as C, h as O, i as r, j as S, k as o, l as N, m as i, H as D, p as X, o as P, t as l, s as L, r as n, q as M, n as I, P as g, Q as H, R as m, u as c, S as d, T as f, v as B, W as x, X as F, w as G, x as b, y as p, V as U, z as u, A as h, _ as y, B as v, D as V, E as W, Y as j, F as q, Z as K, G as Y, I as k, J as w, K as z, U as Q, L as Z, M as J, N as $, O as aa, $ as sa, am as Ea, a5 as _a, a4 as Ra, a2 as ea, a9 as Ta, a6 as ta, a0 as Aa, a3 as Ca, aa as Oa, ab as ra, ac as Sa, ad as oa, ae as Na, af as ia, ag as Da, ah as Xa, ai as Pa, aj as la, ak as La, a7 as na, a8 as Ma, a1 as Ia, al as ga } from "./extractCssVarName-IHa2pGlF.js";
2
- import { M as ma, f as ca, c as da, e as fa, l as Ba, q as xa, g as Fa, t as Ga, w as ba, p as pa, m as Ua, i as ua, u as ha, v as ya, b as va, k as Va, h as Wa, a as ja, o as qa, r as Ka, d as Ya, s as ka, j as wa, n as za } from "./dom-CwV-xS38.js";
1
+ import { C as E, a as _, b as R, c as e, d as T, e as t, f as A, g as C, h as O, i as r, j as S, k as o, l as i, m as N, H as D, p as X, o as P, t as l, s as n, r as L, q as M, n as g, P as I, Q as H, R as m, u as c, S as d, T as f, v as B, W as x, X as F, w as G, x as b, y as p, V as U, z as u, A as h, _ as v, B as y, D as V, E as W, Y as j, F as q, Z as K, G as Y, I as k, J as w, K as z, U as Q, L as Z, M as J, N as $, O as aa, $ as sa, am as Ea, a5 as _a, a4 as Ra, a2 as ea, a9 as Ta, a6 as ta, a0 as Aa, a3 as Ca, aa as Oa, ab as ra, ac as Sa, ad as oa, ae as ia, af as Na, ag as Da, ah as Xa, ai as Pa, aj as la, ak as na, a7 as La, a8 as Ma, a1 as ga, al as Ia } from "./extractCssVarName-IHa2pGlF.js";
2
+ import { M as ma, f as ca, c as da, e as fa, l as Ba, q as xa, g as Fa, t as Ga, w as ba, p as pa, m as Ua, i as ua, u as ha, v as va, b as ya, k as Va, h as Wa, a as ja, o as qa, r as Ka, d as Ya, s as ka, j as wa, n as za } from "./dom-CwV-xS38.js";
3
3
  import { i as Za } from "./isUndefined-B5qXrATz.js";
4
- import { i as $a } from "./isVisible-BogKi39W.js";
4
+ import { g as $a, i as as } from "./getPageElevations-DGY7uGUG.js";
5
5
  export {
6
6
  E as CODE_BACKSPACE,
7
7
  _ as CODE_BREAK,
@@ -15,18 +15,18 @@ export {
15
15
  r as CODE_PAGEDOWN,
16
16
  S as CODE_PAGEUP,
17
17
  o as CODE_RIGHT,
18
- N as CODE_SPACE,
19
- i as CODE_UP,
18
+ i as CODE_SPACE,
19
+ N as CODE_UP,
20
20
  D as HSL_LIMITS,
21
21
  ma as MutationObs,
22
22
  X as PLACEMENT_BOTTOM_END,
23
23
  P as PLACEMENT_BOTTOM_START,
24
24
  l as PLACEMENT_LEFT_END,
25
- L as PLACEMENT_LEFT_START,
26
- n as PLACEMENT_RIGHT_END,
25
+ n as PLACEMENT_LEFT_START,
26
+ L as PLACEMENT_RIGHT_END,
27
27
  M as PLACEMENT_RIGHT_START,
28
- I as PLACEMENT_TOP_END,
29
- g as PLACEMENT_TOP_START,
28
+ g as PLACEMENT_TOP_END,
29
+ I as PLACEMENT_TOP_START,
30
30
  H as RX_ABBREVIATION_FROM_STRING,
31
31
  m as RX_ARRAY_NOTATION,
32
32
  c as RX_BV_PREFIX,
@@ -41,8 +41,8 @@ export {
41
41
  U as RX_HREF,
42
42
  u as RX_HTML_TAGS,
43
43
  h as RX_HYPHENATE,
44
- y as RX_LONG_COLOR,
45
- v as RX_LOWER_UPPER,
44
+ v as RX_LONG_COLOR,
45
+ y as RX_LOWER_UPPER,
46
46
  V as RX_NUMBER,
47
47
  W as RX_PLUS,
48
48
  j as RX_QUERY_START,
@@ -72,6 +72,7 @@ export {
72
72
  Ga as getCS,
73
73
  ta as getHashOfString,
74
74
  ba as getMaxZIndex,
75
+ $a as getPageElevations,
75
76
  pa as getStyle,
76
77
  Ua as hasAttr,
77
78
  ua as hasClass,
@@ -81,29 +82,29 @@ export {
81
82
  ra as isAncestor,
82
83
  Sa as isArray,
83
84
  oa as isDescendant,
84
- Na as isEmpty,
85
- ia as isEqual,
85
+ ia as isEmpty,
86
+ Na as isEqual,
86
87
  Da as isNil,
87
88
  Xa as isNull,
88
89
  Pa as isNumber,
89
90
  la as isObject,
90
- La as isString,
91
+ na as isString,
91
92
  Za as isUndefined,
92
- $a as isVisible,
93
- na as normalize,
93
+ as as isVisible,
94
+ La as normalize,
94
95
  ha as offset,
95
- ya as position,
96
+ va as position,
96
97
  Ma as pxToRem,
97
- va as reflow,
98
+ ya as reflow,
98
99
  Va as removeAttr,
99
100
  Wa as removeClass,
100
101
  ja as removeNode,
101
102
  qa as removeStyle,
102
103
  Ka as requestAF,
103
- Ia as rgbToHex,
104
+ ga as rgbToHex,
104
105
  Ya as select,
105
106
  ka as selectAll,
106
107
  wa as setAttr,
107
108
  za as setStyle,
108
- ga as toArray
109
+ Ia as toArray
109
110
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components-common",
3
- "version": "20.2.0-beta.5168.0",
3
+ "version": "20.2.0-beta.5171.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -13,3 +13,4 @@ export * from './useTimeFormat';
13
13
  export * from './useTimeMask';
14
14
  export { default as useToggle } from './useToggle';
15
15
  export * from './useValidationAttributes';
16
+
@@ -1,6 +1,6 @@
1
1
  import { MaybeElementRef } from '@vueuse/core';
2
2
  import { isRef, Ref, ref, watch } from 'vue';
3
- import { isVisible } from '../utils';
3
+ import { getPageElevations } from '../utils';
4
4
 
5
5
  export const useElevation = (
6
6
  element: MaybeElementRef<HTMLElement | undefined>,
@@ -9,19 +9,6 @@ export const useElevation = (
9
9
  const elementRef = isRef(element) ? element : ref(element);
10
10
  const triggerRef = isRef(trigger) ? trigger : ref();
11
11
 
12
- // Functions
13
- function getPageElevations(currentElement: HTMLElement): number[] {
14
- return Array.from(document.body.querySelectorAll('*'))
15
- .reduce((acc: number[], element) => {
16
- if (!element.isEqualNode(currentElement) && isVisible(element as HTMLElement)) {
17
- const zIndex = Number(getComputedStyle(element).zIndex);
18
- if (!isNaN(zIndex)) {
19
- acc.push(zIndex);
20
- }
21
- }
22
- return acc;
23
- }, []);
24
- }
25
12
 
26
13
  function setElementElevation(element: HTMLElement): void {
27
14
  element.style.zIndex = String(Math.max(0, ...getPageElevations(element)) + 1);
@@ -0,0 +1,20 @@
1
+ import { isVisible } from './isVisible';
2
+
3
+ export function getPageElevations(currentElement: HTMLElement): number[] {
4
+ const elements = document.body.querySelectorAll('*');
5
+ const elevations: number[] = [];
6
+
7
+ for (const element of elements) {
8
+ if (!element.isEqualNode(currentElement) && isVisible(element as HTMLElement)) {
9
+ const style = (element as HTMLElement).style;
10
+ if (style && style.zIndex !== '') {
11
+ const zIndex = Number(style.zIndex);
12
+ if (!isNaN(zIndex)) {
13
+ elevations.push(zIndex);
14
+ }
15
+ }
16
+ }
17
+ }
18
+
19
+ return elevations;
20
+ }
@@ -26,3 +26,4 @@ export * from './isUndefined';
26
26
  export * from './isVisible';
27
27
  export * from './toArray';
28
28
  export * from './extractCssVarName';
29
+ export * from './getPageElevations';
@@ -1,3 +1,3 @@
1
- export const isVisible = (element: HTMLElement): boolean => {
1
+ export function isVisible(element: HTMLElement): boolean {
2
2
  return element.offsetWidth > 0 && element.offsetHeight > 0;
3
- };
3
+ }
@@ -1,4 +0,0 @@
1
- const s = (i) => i.offsetWidth > 0 && i.offsetHeight > 0;
2
- export {
3
- s as i
4
- };