@onereach/ui-components-common 20.2.0-beta.5175.0 → 20.2.0-beta.5179.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.
- package/dist/getPageElevations-BuZyM94T.js +16 -0
- package/dist/hooks.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{useValidationAttributes-UaCQNb1-.js → useValidationAttributes-Cilw02AC.js} +61 -61
- package/dist/utils.js +1 -1
- package/package.json +1 -1
- package/src/hooks/useElevation.ts +2 -2
- package/src/utils/getPageElevations.ts +3 -6
- package/dist/getPageElevations-Bw0hYzn6.js +0 -19
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function i(e) {
|
|
2
|
+
return e.offsetWidth > 0 && e.offsetHeight > 0;
|
|
3
|
+
}
|
|
4
|
+
function l(e) {
|
|
5
|
+
const s = document.body.querySelectorAll("*"), n = [];
|
|
6
|
+
for (const t of s)
|
|
7
|
+
if (!t.isEqualNode(e) && i(t)) {
|
|
8
|
+
const o = getComputedStyle(t, null).getPropertyValue("z-index");
|
|
9
|
+
o !== null && o !== "auto" && n.push(parseInt(o));
|
|
10
|
+
}
|
|
11
|
+
return n;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
l as g,
|
|
15
|
+
i
|
|
16
|
+
};
|
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-
|
|
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-Cilw02AC.js";
|
|
2
2
|
export {
|
|
3
3
|
a as useControlAttributes,
|
|
4
4
|
u as useDateFormat,
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { D as e, a as E } from "./dropdown-open-k6cFnrqA.js";
|
|
2
2
|
import { g as _, a as R, s as T } from "./searchItemsByLabel-CPGAoUEr.js";
|
|
3
|
-
import { D as r, L as A, T as C, a as O, 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 u, k as P, l as L, m as M, u as g, n as I } from "./useValidationAttributes-
|
|
3
|
+
import { D as r, L as A, T as C, a as O, 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 u, k as P, l as L, m as M, u as g, n as I } from "./useValidationAttributes-Cilw02AC.js";
|
|
4
4
|
import { DateFormat as f, TimeFormat as p } from "./types.js";
|
|
5
5
|
import { C as x, a as F, b as c, 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 q, p as W, 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 Ca, z as Oa, 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 ua, I as Pa, 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 xa, a5 as Fa, a4 as ca, 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 qa, ah as Wa, ai as Ka, aj as Ya, ak as za, a7 as Qa, a8 as Za, a1 as Ja, al as $a } from "./extractCssVarName-FgXy_HI0.js";
|
|
6
6
|
import { M as ss, h as es, c as Es, f as ts, m as _s, t as Rs, g as Ts, u as os, x as rs, q as As, n as Cs, j as Os, v as is, w as ls, d as Ds, l as Ss, i as Ns, b as ms, p as Xs, r as ns, a as us, e as Ps, s as Ls, k as Ms, o as gs } from "./dom-DzNS5tBj.js";
|
|
7
7
|
import { i as ds } from "./isUndefined-B5qXrATz.js";
|
|
8
|
-
import { g as ps, i as Hs } from "./getPageElevations-
|
|
8
|
+
import { g as ps, i as Hs } from "./getPageElevations-BuZyM94T.js";
|
|
9
9
|
export {
|
|
10
10
|
x as CODE_BACKSPACE,
|
|
11
11
|
F as CODE_BREAK,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
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
|
|
3
|
-
import {
|
|
4
|
-
import { g as
|
|
5
|
-
import { useMutationObserver as
|
|
6
|
-
import
|
|
7
|
-
import { isVue3 as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
2
|
+
import { DateFormat as x, TimeFormat as b } from "./types.js";
|
|
3
|
+
import { r as C } from "./dom-DzNS5tBj.js";
|
|
4
|
+
import { g as E } from "./getPageElevations-BuZyM94T.js";
|
|
5
|
+
import { useMutationObserver as $, useResizeObserver as F, refDebounced as S, useMediaQuery as P } from "@vueuse/core";
|
|
6
|
+
import O from "@onereach/styles/screens.json";
|
|
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
|
-
},
|
|
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,28 +36,28 @@ const G = () => {
|
|
|
36
36
|
default:
|
|
37
37
|
return r + n.value;
|
|
38
38
|
}
|
|
39
|
-
}, "") : e.value(void 0, t.value)),
|
|
40
|
-
const
|
|
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
|
-
a.style.zIndex = String(Math.max(0,
|
|
42
|
+
a.style.zIndex = String(Math.max(0, ...E(a)) + 1);
|
|
43
43
|
}
|
|
44
|
-
v([
|
|
45
|
-
a &&
|
|
44
|
+
v([o, r], ([a]) => {
|
|
45
|
+
a && n(a);
|
|
46
46
|
}, { immediate: !0 });
|
|
47
|
-
},
|
|
47
|
+
}, N = () => {
|
|
48
48
|
const e = h(), t = M();
|
|
49
49
|
return u(() => e.id ?? (t == null ? void 0 : t.uid.toString()));
|
|
50
|
-
},
|
|
51
|
-
const { hide:
|
|
52
|
-
function
|
|
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() {
|
|
53
53
|
const i = n.value;
|
|
54
54
|
if (i) {
|
|
55
55
|
const d = [...i.children].reduce(({ innerItems: m, outerItems: y }, T) => {
|
|
56
56
|
const f = T, { x: D, width: I } = f.getBoundingClientRect(), { x: w, width: A } = i.getBoundingClientRect();
|
|
57
|
-
return D + I > w + A + r ? (
|
|
57
|
+
return D + I > w + A + r ? (o && f.style.setProperty("visibility", "hidden"), {
|
|
58
58
|
innerItems: m,
|
|
59
59
|
outerItems: [...y, f]
|
|
60
|
-
}) : (
|
|
60
|
+
}) : (o && f.style.removeProperty("visibility"), {
|
|
61
61
|
innerItems: [...m, f],
|
|
62
62
|
outerItems: y
|
|
63
63
|
});
|
|
@@ -69,20 +69,20 @@ const G = () => {
|
|
|
69
69
|
} else
|
|
70
70
|
a.value = [], l.value = [];
|
|
71
71
|
}
|
|
72
|
-
return v(n,
|
|
72
|
+
return v(n, s, {
|
|
73
73
|
immediate: !0
|
|
74
|
-
}),
|
|
74
|
+
}), $(n, s, {
|
|
75
75
|
childList: !0
|
|
76
|
-
}),
|
|
76
|
+
}), F(n, () => C(s)), {
|
|
77
77
|
innerItems: a,
|
|
78
78
|
outerItems: l
|
|
79
79
|
};
|
|
80
|
-
},
|
|
80
|
+
}, te = (e, t, o = {}) => {
|
|
81
81
|
const r = c(e.value ? "open" : "closed");
|
|
82
82
|
v(e, (i) => {
|
|
83
83
|
r.value = i ? "open" : "closed";
|
|
84
84
|
});
|
|
85
|
-
const n =
|
|
85
|
+
const n = S(r, o.debounce ?? 0);
|
|
86
86
|
v(n, (i) => {
|
|
87
87
|
switch (t("update:state", i), i) {
|
|
88
88
|
case "open":
|
|
@@ -99,18 +99,18 @@ const G = () => {
|
|
|
99
99
|
function l() {
|
|
100
100
|
r.value = "closed";
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function s() {
|
|
103
103
|
r.value = r.value === "open" ? "closed" : "open";
|
|
104
104
|
}
|
|
105
105
|
return {
|
|
106
106
|
state: n,
|
|
107
107
|
open: a,
|
|
108
108
|
close: l,
|
|
109
|
-
toggle:
|
|
109
|
+
toggle: s
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
|
-
function
|
|
113
|
-
const { defaultValue: r } =
|
|
112
|
+
function re(e, t, o = {}) {
|
|
113
|
+
const { defaultValue: r } = o;
|
|
114
114
|
return r ? u({
|
|
115
115
|
get: () => e.value ?? r.value,
|
|
116
116
|
set: (n) => {
|
|
@@ -123,30 +123,30 @@ function ne(e, t, s = {}) {
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
const t = M(),
|
|
128
|
-
e ? v(e, (
|
|
129
|
-
|
|
126
|
+
function ne(e) {
|
|
127
|
+
const t = M(), o = c();
|
|
128
|
+
e ? v(e, (s) => {
|
|
129
|
+
o.value = s;
|
|
130
130
|
}) : R(() => {
|
|
131
131
|
if (t) {
|
|
132
|
-
const
|
|
133
|
-
|
|
132
|
+
const s = t.vnode[Y ? "el" : "elm"];
|
|
133
|
+
s instanceof Element && (o.value = s);
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
|
-
const r = u(() => l(
|
|
137
|
-
function l(
|
|
136
|
+
const r = u(() => l(o.value) || a.value), n = u(() => !r.value), a = P(`(min-width: ${O.md})`);
|
|
137
|
+
function l(s) {
|
|
138
138
|
var d;
|
|
139
|
-
if (!
|
|
139
|
+
if (!s)
|
|
140
140
|
return !1;
|
|
141
|
-
const i = (d =
|
|
142
|
-
return i != null && i.some((m) => ["md", "lg", "xl"].includes(m)) ? !0 : l(
|
|
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);
|
|
143
143
|
}
|
|
144
144
|
return {
|
|
145
145
|
isDesktop: r,
|
|
146
146
|
isMobile: n
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
|
-
const
|
|
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, {
|
|
150
150
|
timeStyle: "short",
|
|
151
151
|
hourCycle: e.value !== b.Auto ? e.value : void 0,
|
|
152
152
|
timeZone: "UTC"
|
|
@@ -162,9 +162,9 @@ const se = () => V.theme, oe = (e) => u(() => e.value ?? g(H, b.Auto)), ae = (e,
|
|
|
162
162
|
return r + n.value;
|
|
163
163
|
}
|
|
164
164
|
}, "") : e.value(void 0, t.value));
|
|
165
|
-
function
|
|
165
|
+
function ae(e = !1) {
|
|
166
166
|
const t = c(e);
|
|
167
|
-
function
|
|
167
|
+
function o() {
|
|
168
168
|
t.value = !0;
|
|
169
169
|
}
|
|
170
170
|
function r() {
|
|
@@ -175,12 +175,12 @@ function ie(e = !1) {
|
|
|
175
175
|
}
|
|
176
176
|
return {
|
|
177
177
|
isActiveToggle: t,
|
|
178
|
-
show:
|
|
178
|
+
show: o,
|
|
179
179
|
hide: r,
|
|
180
180
|
toggle: n
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
|
-
const
|
|
183
|
+
const ie = () => {
|
|
184
184
|
const e = h();
|
|
185
185
|
return {
|
|
186
186
|
required: u(() => e.required),
|
|
@@ -193,22 +193,22 @@ const le = () => {
|
|
|
193
193
|
};
|
|
194
194
|
};
|
|
195
195
|
export {
|
|
196
|
-
|
|
196
|
+
V as D,
|
|
197
197
|
U as L,
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
198
|
+
q as T,
|
|
199
|
+
k as a,
|
|
200
|
+
G as b,
|
|
201
|
+
J as c,
|
|
202
|
+
K as d,
|
|
203
|
+
N as e,
|
|
204
|
+
X as f,
|
|
205
|
+
ee as g,
|
|
206
|
+
te as h,
|
|
207
|
+
re as i,
|
|
208
|
+
ne as j,
|
|
209
|
+
ue as k,
|
|
210
210
|
oe as l,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
211
|
+
se as m,
|
|
212
|
+
ie as n,
|
|
213
|
+
ae as u
|
|
214
214
|
};
|
package/dist/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as E, a as _, b as e, c as R, 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 I, n as M, P as g, Q as H, R as m, u as c, S as d, T as f, v as x, W as B, 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 q, Y as W, F as j, 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 ea, a2 as Ra, 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 Ia, a1 as Ma, al as ga } from "./extractCssVarName-FgXy_HI0.js";
|
|
2
2
|
import { M as ma, h as ca, c as da, f as fa, m as xa, t as Ba, g as Fa, u as Ga, x as ba, q as pa, n as ua, j as Ua, v as ha, w as va, d as ya, l as Va, i as qa, b as Wa, p as ja, r as Ka, a as Ya, e as ka, s as wa, k as za, o as Qa } from "./dom-DzNS5tBj.js";
|
|
3
3
|
import { i as Ja } from "./isUndefined-B5qXrATz.js";
|
|
4
|
-
import { g as as, i as ss } from "./getPageElevations-
|
|
4
|
+
import { g as as, i as ss } from "./getPageElevations-BuZyM94T.js";
|
|
5
5
|
export {
|
|
6
6
|
E as CODE_BACKSPACE,
|
|
7
7
|
_ as CODE_BREAK,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MaybeElementRef } from '@vueuse/core';
|
|
2
2
|
import { isRef, Ref, ref, watch } from 'vue';
|
|
3
|
-
import { getPageElevations
|
|
3
|
+
import { getPageElevations } from '../utils';
|
|
4
4
|
|
|
5
5
|
export const useElevation = (
|
|
6
6
|
element: MaybeElementRef<HTMLElement | undefined>,
|
|
@@ -17,7 +17,7 @@ export const useElevation = (
|
|
|
17
17
|
// Effects
|
|
18
18
|
watch([elementRef, triggerRef], ([element]) => {
|
|
19
19
|
if (element) {
|
|
20
|
-
|
|
20
|
+
setElementElevation(element as HTMLElement);
|
|
21
21
|
}
|
|
22
22
|
}, { immediate: true });
|
|
23
23
|
};
|
|
@@ -6,12 +6,9 @@ export function getPageElevations(currentElement: HTMLElement): number[] {
|
|
|
6
6
|
|
|
7
7
|
for (const element of elements) {
|
|
8
8
|
if (!element.isEqualNode(currentElement) && isVisible(element as HTMLElement)) {
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
if (zIndex || zIndex !== 0) {
|
|
13
|
-
elevations.push(zIndex);
|
|
14
|
-
}
|
|
9
|
+
const zIndex = getComputedStyle(element, null).getPropertyValue('z-index');
|
|
10
|
+
if (zIndex !== null && zIndex !== 'auto') {
|
|
11
|
+
elevations.push(parseInt(zIndex));
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
14
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function f(e) {
|
|
2
|
-
return e.offsetWidth > 0 && e.offsetHeight > 0;
|
|
3
|
-
}
|
|
4
|
-
function l(e) {
|
|
5
|
-
const i = document.body.querySelectorAll("*"), o = [];
|
|
6
|
-
for (const t of i)
|
|
7
|
-
if (!t.isEqualNode(e) && f(t)) {
|
|
8
|
-
const n = t.style;
|
|
9
|
-
if (n && n.zIndex !== "") {
|
|
10
|
-
const s = Number.parseInt(n.zIndex, 10);
|
|
11
|
-
(s || s !== 0) && o.push(s);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return o;
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
l as g,
|
|
18
|
-
f as i
|
|
19
|
-
};
|