@onereach/ui-components-common 25.3.0 → 25.3.1-beta.5788.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/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-Da9U8-T7.js";
|
|
2
2
|
export {
|
|
3
3
|
a as useControlAttributes,
|
|
4
4
|
u as useDateFormat,
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DropdownClose as _, DropdownOpen as s } from "./directives.js";
|
|
2
2
|
import { getItemByValue as T, getItemsByValue as a, searchItemsByLabel as t } from "./helpers.js";
|
|
3
|
-
import { D as o, L as A, o as O, M as D, T as C, a as i, b as N, c as X, d as S, e as P, f as L, g as M, h as m, i as u, j as I, k as l, l as n, m as g, u as p, n as H } from "./useValidationAttributes-
|
|
3
|
+
import { D as o, L as A, o as O, M as D, T as C, a as i, b as N, c as X, d as S, e as P, f as L, g as M, h as m, i as u, j as I, k as l, l as n, m as g, u as p, n as H } from "./useValidationAttributes-Da9U8-T7.js";
|
|
4
4
|
import { D as x, T as f } from "./TimeFormat-CdFMIbra.js";
|
|
5
5
|
import { Spacing as b } from "./types.js";
|
|
6
6
|
import { CODE_BACKSPACE as G, CODE_BREAK as c, CODE_DELETE as U, CODE_DOWN as V, CODE_END as y, CODE_ENTER as h, CODE_ESC as v, CODE_HOME as W, CODE_LEFT as k, CODE_PAGEDOWN as w, CODE_PAGEUP as K, CODE_RIGHT as Y, CODE_SPACE as j, CODE_UP as q, HSL_LIMITS as Z, PLACEMENT_BOTTOM_END as z, PLACEMENT_BOTTOM_START as Q, PLACEMENT_LEFT_END as J, PLACEMENT_LEFT_START as $, PLACEMENT_RIGHT_END as ee, PLACEMENT_RIGHT_START as Ee, PLACEMENT_TOP_END as _e, PLACEMENT_TOP_START as se, RX_ABBREVIATION_FROM_STRING as Re, RX_ARRAY_NOTATION as Te, RX_BV_PREFIX as ae, RX_DATE as te, RX_DATE_SPLIT as re, RX_DIGITS as oe, RX_ENCODED_COMMA as Ae, RX_ENCODE_REVERSE as Oe, RX_EXTENSION as De, RX_HASH as Ce, RX_HASH_ID as ie, RX_HREF as Ne, RX_HTML_TAGS as Xe, RX_HYPHENATE as Se, RX_LONG_COLOR as Pe, RX_LOWER_UPPER as Le, RX_NUMBER as Me, RX_PLUS as me, RX_QUERY_START as ue, RX_REGEXP_REPLACE as Ie, RX_SHORT_COLOR as le, RX_SPACES as ne, RX_SPACE_SPLIT as ge, RX_STAR as pe, RX_START_SPACE_WORD as He, RX_TIME as Fe, RX_TRIM_LEFT as xe, RX_TRIM_RIGHT as fe, RX_UNDERSCORE as Be, RX_UN_KEBAB as be, exclude as de, extractCssVarName as Ge, flattenDeep as ce, generateColorFromString as Ue, generateHslFromString as Ve, getAbbreviation as ye, getHashOfString as he, hexToRgb as ve, hslToColorString as We, include as ke, isAncestor as we, isArray as Ke, isDescendant as Ye, isEmpty as je, isEqual as qe, isNil as Ze, isNull as ze, isNumber as Qe, isObject as Je, isString as $e, normalize as eE, pxToRem as EE, rgbToHex as _E, toArray as sE } from "./utils.js";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useAttrs as g, computed as u, inject as
|
|
1
|
+
import { useAttrs as g, computed as u, inject as v, isRef as h, ref as d, watch as m, getCurrentInstance as y, onMounted as A } from "vue";
|
|
2
2
|
import { D as E, T as b } from "./TimeFormat-CdFMIbra.js";
|
|
3
3
|
import { r as R } from "./dom-qGGG2YCX.js";
|
|
4
4
|
import { g as S } from "./getPageElevations-BuZyM94T.js";
|
|
5
5
|
import { useMutationObserver as C, useResizeObserver as $, refDebounced as F, useMediaQuery as P } from "@vueuse/core";
|
|
6
6
|
import O from "@onereach/styles/screens.json";
|
|
7
7
|
import Z from "@onereach/styles/tailwind.config.json";
|
|
8
|
-
const
|
|
8
|
+
const V = () => {
|
|
9
9
|
const e = g();
|
|
10
10
|
return {
|
|
11
11
|
readonly: u(() => e.readonly),
|
|
12
12
|
disabled: u(() => e.disabled),
|
|
13
13
|
"force-state": u(() => e["force-state"])
|
|
14
14
|
};
|
|
15
|
-
}, Y = Symbol(), L = Symbol(), U = Symbol(),
|
|
15
|
+
}, Y = Symbol(), L = Symbol(), U = Symbol(), _ = Symbol(), q = Symbol(), W = (e) => u(() => e.value ?? v(Y, E.Short)), k = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
|
|
16
16
|
dateStyle: e.value,
|
|
17
17
|
timeZone: "UTC"
|
|
18
18
|
}).formatToParts(Date.UTC(1, 0, 1, 1, 1)).reduce((n, r) => {
|
|
@@ -36,11 +36,11 @@ const Q = () => {
|
|
|
36
36
|
return n + r.value;
|
|
37
37
|
}
|
|
38
38
|
}, "") : e.value(void 0, t.value)), G = (e, t) => {
|
|
39
|
-
const a = h(e) ? e : d(e), n = h(t) ? t : d(), r =
|
|
39
|
+
const a = h(e) ? e : d(e), n = h(t) ? t : d(), r = v(_, 0), c = v(q, 1 / 0);
|
|
40
40
|
function i(s) {
|
|
41
41
|
const o = S(s);
|
|
42
|
-
let
|
|
43
|
-
|
|
42
|
+
let l = Math.max(r, ...o) + 1;
|
|
43
|
+
l = Math.min(l, c), s.style.zIndex = String(l);
|
|
44
44
|
}
|
|
45
45
|
m([a, n], ([s]) => {
|
|
46
46
|
s && i(s);
|
|
@@ -48,34 +48,34 @@ const Q = () => {
|
|
|
48
48
|
}, J = () => {
|
|
49
49
|
const e = g(), t = y();
|
|
50
50
|
return u(() => e.id ?? (t == null ? void 0 : t.uid.toString()));
|
|
51
|
-
}, K = (e) => u(() => e.value ??
|
|
52
|
-
const { hide: a = !0, threshold: n = 0 } = t, r = h(e) ? e : d(e),
|
|
51
|
+
}, K = (e) => u(() => e.value ?? v(L, navigator.language)), ee = (e, t = {}) => {
|
|
52
|
+
const { hide: a = !0, threshold: n = 0 } = t, r = h(e) ? e : d(e), c = d([]), i = d([]);
|
|
53
53
|
function s() {
|
|
54
54
|
const o = r.value;
|
|
55
55
|
if (o) {
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
return T + D > w + x + n ? (a &&
|
|
56
|
+
const l = [...o.children].reduce(({ innerItems: p, outerItems: M }, I) => {
|
|
57
|
+
const f = I, { x: T, width: D } = f.getBoundingClientRect(), { x: w, width: x } = o.getBoundingClientRect();
|
|
58
|
+
return T + D > w + x + n ? (a && f.style.setProperty("visibility", "hidden"), {
|
|
59
59
|
innerItems: p,
|
|
60
|
-
outerItems: [...M,
|
|
61
|
-
}) : (a &&
|
|
62
|
-
innerItems: [...p,
|
|
60
|
+
outerItems: [...M, f]
|
|
61
|
+
}) : (a && f.style.removeProperty("visibility"), {
|
|
62
|
+
innerItems: [...p, f],
|
|
63
63
|
outerItems: M
|
|
64
64
|
});
|
|
65
65
|
}, {
|
|
66
66
|
innerItems: [],
|
|
67
67
|
outerItems: []
|
|
68
68
|
});
|
|
69
|
-
|
|
69
|
+
c.value = l.innerItems, i.value = l.outerItems;
|
|
70
70
|
} else
|
|
71
|
-
|
|
71
|
+
c.value = [], i.value = [];
|
|
72
72
|
}
|
|
73
73
|
return m(r, s, {
|
|
74
74
|
immediate: !0
|
|
75
75
|
}), C(r, s, {
|
|
76
76
|
childList: !0
|
|
77
77
|
}), $(r, () => R(s)), {
|
|
78
|
-
innerItems:
|
|
78
|
+
innerItems: c,
|
|
79
79
|
outerItems: i
|
|
80
80
|
};
|
|
81
81
|
}, te = (e, t, a = {}) => {
|
|
@@ -94,7 +94,7 @@ const Q = () => {
|
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
|
-
function
|
|
97
|
+
function c() {
|
|
98
98
|
n.value = "open";
|
|
99
99
|
}
|
|
100
100
|
function i() {
|
|
@@ -105,7 +105,7 @@ const Q = () => {
|
|
|
105
105
|
}
|
|
106
106
|
return {
|
|
107
107
|
state: r,
|
|
108
|
-
open:
|
|
108
|
+
open: c,
|
|
109
109
|
close: i,
|
|
110
110
|
toggle: s
|
|
111
111
|
};
|
|
@@ -115,12 +115,12 @@ function ne(e, t, a = {}) {
|
|
|
115
115
|
return n ? u({
|
|
116
116
|
get: () => e.value ?? n.value,
|
|
117
117
|
set: (r) => {
|
|
118
|
-
t("update:modelValue", r);
|
|
118
|
+
e.value !== r && t("update:modelValue", r);
|
|
119
119
|
}
|
|
120
120
|
}) : u({
|
|
121
121
|
get: () => e.value,
|
|
122
122
|
set: (r) => {
|
|
123
|
-
t("update:modelValue", r);
|
|
123
|
+
e.value !== r && t("update:modelValue", r);
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
126
|
}
|
|
@@ -134,12 +134,12 @@ function re(e) {
|
|
|
134
134
|
o instanceof Element && (a.value = o);
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
|
-
const n = u(() => i(a.value) ||
|
|
137
|
+
const n = u(() => i(a.value) || c.value), r = u(() => !n.value), c = P(`(min-width: ${O.md})`);
|
|
138
138
|
function i(s) {
|
|
139
|
-
var
|
|
139
|
+
var l;
|
|
140
140
|
if (!s)
|
|
141
141
|
return !1;
|
|
142
|
-
const o = (
|
|
142
|
+
const o = (l = s.getAttribute("force-screen")) == null ? void 0 : l.split(/\s+/);
|
|
143
143
|
return o != null && o.some((p) => ["md", "lg", "xl"].includes(p)) ? !0 : i(s.parentElement ?? void 0);
|
|
144
144
|
}
|
|
145
145
|
return {
|
|
@@ -147,7 +147,7 @@ function re(e) {
|
|
|
147
147
|
isMobile: r
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
-
const se = () => Z.theme, ue = (e) => u(() => e.value ??
|
|
150
|
+
const se = () => Z.theme, ue = (e) => u(() => e.value ?? v(U, b.Auto)), oe = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
|
|
151
151
|
timeStyle: "short",
|
|
152
152
|
hourCycle: e.value !== b.Auto ? e.value : void 0,
|
|
153
153
|
timeZone: "UTC"
|
|
@@ -196,9 +196,9 @@ const ie = () => {
|
|
|
196
196
|
export {
|
|
197
197
|
Y as D,
|
|
198
198
|
L,
|
|
199
|
-
|
|
199
|
+
_ as M,
|
|
200
200
|
U as T,
|
|
201
|
-
|
|
201
|
+
V as a,
|
|
202
202
|
W as b,
|
|
203
203
|
k as c,
|
|
204
204
|
G as d,
|
|
@@ -212,6 +212,6 @@ export {
|
|
|
212
212
|
ue as l,
|
|
213
213
|
oe as m,
|
|
214
214
|
ie as n,
|
|
215
|
-
|
|
215
|
+
q as o,
|
|
216
216
|
ae as u
|
|
217
217
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components-common",
|
|
3
|
-
"version": "25.3.0",
|
|
3
|
+
"version": "25.3.1-beta.5788.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"dev": "vite build --watch"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@onereach/styles": "^25.3.0",
|
|
62
|
+
"@onereach/styles": "^25.3.1-beta.5788.0",
|
|
63
63
|
"@vueuse/core": "11.3.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
@@ -69,6 +69,5 @@
|
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"vue": "3.3.4 || 2.6.14"
|
|
72
|
-
}
|
|
73
|
-
"gitHead": "95fc6f62df3d8b8069492c1b718f77b296aa6710"
|
|
72
|
+
}
|
|
74
73
|
}
|
|
@@ -33,7 +33,9 @@ export function useProxyModelValue<T>(
|
|
|
33
33
|
},
|
|
34
34
|
|
|
35
35
|
set: (value) => {
|
|
36
|
-
|
|
36
|
+
if (modelValue.value !== value) {
|
|
37
|
+
emit('update:modelValue', value);
|
|
38
|
+
}
|
|
37
39
|
},
|
|
38
40
|
});
|
|
39
41
|
}
|
|
@@ -44,7 +46,9 @@ export function useProxyModelValue<T>(
|
|
|
44
46
|
},
|
|
45
47
|
|
|
46
48
|
set: (value) => {
|
|
47
|
-
|
|
49
|
+
if (modelValue.value !== value) {
|
|
50
|
+
emit('update:modelValue', value);
|
|
51
|
+
}
|
|
48
52
|
},
|
|
49
53
|
});
|
|
50
54
|
}
|