@onereach/ui-components-common 19.3.0-beta.5083.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/assets/index.d.ts +2 -0
- package/dist/assets.js +5 -0
- package/dist/directives/dropdown-close.d.ts +4 -0
- package/dist/directives/dropdown-open.d.ts +4 -0
- package/dist/directives/index.d.ts +2 -0
- package/dist/directives.js +5 -0
- package/dist/dom-CwV-xS38.js +95 -0
- package/dist/dropdown-open-k6cFnrqA.js +20 -0
- package/dist/extractCssVarName-IHa2pGlF.js +160 -0
- package/dist/helpers/getItemByValue.d.ts +2 -0
- package/dist/helpers/getItemsByValue.d.ts +2 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/searchItemsByLabel.d.ts +2 -0
- package/dist/helpers.js +6 -0
- package/dist/hooks/index.d.ts +15 -0
- package/dist/hooks/useControlAttributes.d.ts +7 -0
- package/dist/hooks/useDateFormat.d.ts +4 -0
- package/dist/hooks/useDateMask.d.ts +4 -0
- package/dist/hooks/useElevation.d.ts +3 -0
- package/dist/hooks/useIdAttribute.d.ts +3 -0
- package/dist/hooks/useLocale.d.ts +4 -0
- package/dist/hooks/useOverflow.d.ts +11 -0
- package/dist/hooks/usePopoverState.d.ts +12 -0
- package/dist/hooks/useProxyModelValue.d.ts +8 -0
- package/dist/hooks/useResponsive/index.d.ts +1 -0
- package/dist/hooks/useResponsive/useResponsive.d.ts +6 -0
- package/dist/hooks/useTheme.d.ts +3 -0
- package/dist/hooks/useTimeFormat.d.ts +4 -0
- package/dist/hooks/useTimeMask.d.ts +4 -0
- package/dist/hooks/useToggle.d.ts +8 -0
- package/dist/hooks/useValidationAttributes.d.ts +11 -0
- package/dist/hooks.js +18 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +138 -0
- package/dist/isUndefined-B5qXrATz.js +4 -0
- package/dist/isVisible-BuGrjvTY.js +4 -0
- package/dist/searchItemsByLabel-BhinsABA.js +13 -0
- package/dist/tokens/DATE_FORMAT.d.ts +3 -0
- package/dist/tokens/LOCALE.d.ts +3 -0
- package/dist/tokens/TIME_FORMAT.d.ts +3 -0
- package/dist/tokens/index.d.ts +3 -0
- package/dist/types/DataModel.d.ts +6 -0
- package/dist/types/DateFormat.d.ts +5 -0
- package/dist/types/FilterFunction.d.ts +1 -0
- package/dist/types/FormatFunction.d.ts +2 -0
- package/dist/types/Group.d.ts +5 -0
- package/dist/types/GroupFunction.d.ts +1 -0
- package/dist/types/Id.d.ts +1 -0
- package/dist/types/Item.d.ts +5 -0
- package/dist/types/Locale.d.ts +1 -0
- package/dist/types/ModelValue.d.ts +1 -0
- package/dist/types/SearchFunction.d.ts +1 -0
- package/dist/types/TimeFormat.d.ts +5 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types.js +5 -0
- package/dist/useValidationAttributes-DxhcSj_h.js +217 -0
- package/dist/utils/constants/color.d.ts +14 -0
- package/dist/utils/constants/key-codes.d.ts +14 -0
- package/dist/utils/constants/poper.d.ts +8 -0
- package/dist/utils/constants/regex.d.ts +42 -0
- package/dist/utils/exclude.d.ts +4 -0
- package/dist/utils/extractCssVarName.d.ts +1 -0
- package/dist/utils/functions/color.d.ts +23 -0
- package/dist/utils/functions/dom.d.ts +30 -0
- package/dist/utils/functions/flattenDeep.d.ts +2 -0
- package/dist/utils/functions/hash.d.ts +2 -0
- package/dist/utils/functions/px-to-rem.d.ts +1 -0
- package/dist/utils/functions/text.d.ts +1 -0
- package/dist/utils/include.d.ts +4 -0
- package/dist/utils/index.d.ts +26 -0
- package/dist/utils/isAncestor.d.ts +4 -0
- package/dist/utils/isArray.d.ts +4 -0
- package/dist/utils/isDescendant.d.ts +4 -0
- package/dist/utils/isEmpty.d.ts +4 -0
- package/dist/utils/isEqual.d.ts +4 -0
- package/dist/utils/isNil.d.ts +4 -0
- package/dist/utils/isNull.d.ts +4 -0
- package/dist/utils/isNumber.d.ts +4 -0
- package/dist/utils/isObject.d.ts +4 -0
- package/dist/utils/isString.d.ts +4 -0
- package/dist/utils/isUndefined.d.ts +4 -0
- package/dist/utils/isVisible.d.ts +1 -0
- package/dist/utils/toArray.d.ts +4 -0
- package/dist/utils.js +109 -0
- package/package.json +77 -0
- package/src/assets/error.png +0 -0
- package/src/assets/index.ts +2 -0
- package/src/assets/success.png +0 -0
- package/src/directives/dropdown-close.ts +14 -0
- package/src/directives/dropdown-open.ts +21 -0
- package/src/directives/index.ts +2 -0
- package/src/helpers/getItemByValue.ts +12 -0
- package/src/helpers/getItemsByValue.ts +6 -0
- package/src/helpers/index.ts +3 -0
- package/src/helpers/searchItemsByLabel.ts +5 -0
- package/src/hooks/index.ts +15 -0
- package/src/hooks/useControlAttributes.ts +19 -0
- package/src/hooks/useDateFormat.ts +13 -0
- package/src/hooks/useDateMask.ts +54 -0
- package/src/hooks/useElevation.ts +32 -0
- package/src/hooks/useIdAttribute.ts +11 -0
- package/src/hooks/useLocale.ts +13 -0
- package/src/hooks/useOverflow.ts +83 -0
- package/src/hooks/usePopoverState.ts +67 -0
- package/src/hooks/useProxyModelValue.ts +50 -0
- package/src/hooks/useResponsive/index.ts +1 -0
- package/src/hooks/useResponsive/useResponsive.ts +58 -0
- package/src/hooks/useTheme.ts +8 -0
- package/src/hooks/useTimeFormat.ts +13 -0
- package/src/hooks/useTimeMask.ts +41 -0
- package/src/hooks/useToggle.ts +32 -0
- package/src/hooks/useValidationAttributes.ts +25 -0
- package/src/index.ts +6 -0
- package/src/tokens/DATE_FORMAT.ts +4 -0
- package/src/tokens/LOCALE.ts +4 -0
- package/src/tokens/TIME_FORMAT.ts +4 -0
- package/src/tokens/index.ts +3 -0
- package/src/types/DataModel.ts +3 -0
- package/src/types/DateFormat.ts +5 -0
- package/src/types/FilterFunction.ts +1 -0
- package/src/types/FormatFunction.ts +3 -0
- package/src/types/Group.ts +6 -0
- package/src/types/GroupFunction.ts +1 -0
- package/src/types/Id.ts +1 -0
- package/src/types/Item.ts +5 -0
- package/src/types/Locale.ts +1 -0
- package/src/types/ModelValue.ts +1 -0
- package/src/types/SearchFunction.ts +1 -0
- package/src/types/TimeFormat.ts +5 -0
- package/src/types/index.ts +12 -0
- package/src/utils/constants/color.ts +14 -0
- package/src/utils/constants/key-codes.ts +14 -0
- package/src/utils/constants/poper.ts +8 -0
- package/src/utils/constants/regex.ts +57 -0
- package/src/utils/exclude.ts +6 -0
- package/src/utils/extractCssVarName.ts +5 -0
- package/src/utils/functions/color.ts +55 -0
- package/src/utils/functions/dom.ts +206 -0
- package/src/utils/functions/flattenDeep.ts +5 -0
- package/src/utils/functions/hash.ts +10 -0
- package/src/utils/functions/px-to-rem.ts +2 -0
- package/src/utils/functions/text.ts +8 -0
- package/src/utils/include.ts +6 -0
- package/src/utils/index.ts +28 -0
- package/src/utils/isAncestor.ts +16 -0
- package/src/utils/isArray.ts +6 -0
- package/src/utils/isDescendant.ts +16 -0
- package/src/utils/isEmpty.ts +24 -0
- package/src/utils/isEqual.ts +23 -0
- package/src/utils/isNil.ts +8 -0
- package/src/utils/isNull.ts +6 -0
- package/src/utils/isNumber.ts +6 -0
- package/src/utils/isObject.ts +6 -0
- package/src/utils/isString.ts +6 -0
- package/src/utils/isUndefined.ts +6 -0
- package/src/utils/isVisible.ts +3 -0
- package/src/utils/toArray.ts +16 -0
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
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-DxhcSj_h.js";
|
|
2
|
+
export {
|
|
3
|
+
a as useControlAttributes,
|
|
4
|
+
u as useDateFormat,
|
|
5
|
+
t as useDateMask,
|
|
6
|
+
o as useElevation,
|
|
7
|
+
r as useIdAttribute,
|
|
8
|
+
i as useLocale,
|
|
9
|
+
l as useOverflow,
|
|
10
|
+
m as usePopoverState,
|
|
11
|
+
n as useProxyModelValue,
|
|
12
|
+
b as useResponsive,
|
|
13
|
+
d as useTheme,
|
|
14
|
+
v as useTimeFormat,
|
|
15
|
+
T as useTimeMask,
|
|
16
|
+
f as useToggle,
|
|
17
|
+
g as useValidationAttributes
|
|
18
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
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-DxhcSj_h.js";
|
|
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-BuGrjvTY.js";
|
|
9
|
+
export {
|
|
10
|
+
F as CODE_BACKSPACE,
|
|
11
|
+
c as CODE_BREAK,
|
|
12
|
+
x as CODE_DELETE,
|
|
13
|
+
b as CODE_DOWN,
|
|
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,
|
|
19
|
+
U as CODE_PAGEDOWN,
|
|
20
|
+
V as CODE_PAGEUP,
|
|
21
|
+
k as CODE_RIGHT,
|
|
22
|
+
w as CODE_SPACE,
|
|
23
|
+
j as CODE_UP,
|
|
24
|
+
r as DATE_FORMAT,
|
|
25
|
+
f as DateFormat,
|
|
26
|
+
e as DropdownClose,
|
|
27
|
+
E as DropdownOpen,
|
|
28
|
+
W as HSL_LIMITS,
|
|
29
|
+
A as LOCALE,
|
|
30
|
+
ss as MutationObs,
|
|
31
|
+
q as PLACEMENT_BOTTOM_END,
|
|
32
|
+
K as PLACEMENT_BOTTOM_START,
|
|
33
|
+
Y as PLACEMENT_LEFT_END,
|
|
34
|
+
z as PLACEMENT_LEFT_START,
|
|
35
|
+
Q as PLACEMENT_RIGHT_END,
|
|
36
|
+
Z as PLACEMENT_RIGHT_START,
|
|
37
|
+
J as PLACEMENT_TOP_END,
|
|
38
|
+
$ as PLACEMENT_TOP_START,
|
|
39
|
+
aa as RX_ABBREVIATION_FROM_STRING,
|
|
40
|
+
sa as RX_ARRAY_NOTATION,
|
|
41
|
+
ea as RX_BV_PREFIX,
|
|
42
|
+
Ea as RX_DATE,
|
|
43
|
+
_a as RX_DATE_SPLIT,
|
|
44
|
+
ta as RX_DIGITS,
|
|
45
|
+
Ra as RX_ENCODED_COMMA,
|
|
46
|
+
Ta as RX_ENCODE_REVERSE,
|
|
47
|
+
oa as RX_EXTENSION,
|
|
48
|
+
ra as RX_HASH,
|
|
49
|
+
Aa as RX_HASH_ID,
|
|
50
|
+
Oa as RX_HREF,
|
|
51
|
+
Ca as RX_HTML_TAGS,
|
|
52
|
+
ia as RX_HYPHENATE,
|
|
53
|
+
Da as RX_LONG_COLOR,
|
|
54
|
+
la as RX_LOWER_UPPER,
|
|
55
|
+
Sa as RX_NUMBER,
|
|
56
|
+
Na as RX_PLUS,
|
|
57
|
+
ma as RX_QUERY_START,
|
|
58
|
+
Xa as RX_REGEXP_REPLACE,
|
|
59
|
+
na as RX_SHORT_COLOR,
|
|
60
|
+
ua as RX_SPACES,
|
|
61
|
+
Pa as RX_SPACE_SPLIT,
|
|
62
|
+
La as RX_STAR,
|
|
63
|
+
Ma as RX_START_SPACE_WORD,
|
|
64
|
+
Ia as RX_TIME,
|
|
65
|
+
ga as RX_TRIM_LEFT,
|
|
66
|
+
da as RX_TRIM_RIGHT,
|
|
67
|
+
fa as RX_UNDERSCORE,
|
|
68
|
+
pa as RX_UN_KEBAB,
|
|
69
|
+
O as TIME_FORMAT,
|
|
70
|
+
p as TimeFormat,
|
|
71
|
+
es as addClass,
|
|
72
|
+
Es as cancelAF,
|
|
73
|
+
_s as contains,
|
|
74
|
+
Ha as exclude,
|
|
75
|
+
Fa as extractCssVarName,
|
|
76
|
+
ca as flattenDeep,
|
|
77
|
+
xa as generateColorFromString,
|
|
78
|
+
ba as generateHslFromString,
|
|
79
|
+
Ba as getAbbreviation,
|
|
80
|
+
ts as getAttr,
|
|
81
|
+
Rs as getBCR,
|
|
82
|
+
Ts as getById,
|
|
83
|
+
os as getCS,
|
|
84
|
+
ya as getHashOfString,
|
|
85
|
+
t as getItemByValue,
|
|
86
|
+
R as getItemsByValue,
|
|
87
|
+
rs as getMaxZIndex,
|
|
88
|
+
As as getStyle,
|
|
89
|
+
Os as hasAttr,
|
|
90
|
+
Cs as hasClass,
|
|
91
|
+
Ga as hexToRgb,
|
|
92
|
+
ha as hslToColorString,
|
|
93
|
+
va as include,
|
|
94
|
+
Ua as isAncestor,
|
|
95
|
+
Va as isArray,
|
|
96
|
+
ka as isDescendant,
|
|
97
|
+
wa as isEmpty,
|
|
98
|
+
ja as isEqual,
|
|
99
|
+
Wa as isNil,
|
|
100
|
+
qa as isNull,
|
|
101
|
+
Ka as isNumber,
|
|
102
|
+
Ya as isObject,
|
|
103
|
+
za as isString,
|
|
104
|
+
gs as isUndefined,
|
|
105
|
+
fs as isVisible,
|
|
106
|
+
Qa as normalize,
|
|
107
|
+
is as offset,
|
|
108
|
+
Ds as position,
|
|
109
|
+
Za as pxToRem,
|
|
110
|
+
ls as reflow,
|
|
111
|
+
Ss as removeAttr,
|
|
112
|
+
Ns as removeClass,
|
|
113
|
+
ms as removeNode,
|
|
114
|
+
Xs as removeStyle,
|
|
115
|
+
ns as requestAF,
|
|
116
|
+
Ja as rgbToHex,
|
|
117
|
+
T as searchItemsByLabel,
|
|
118
|
+
us as select,
|
|
119
|
+
Ps as selectAll,
|
|
120
|
+
Ls as setAttr,
|
|
121
|
+
Ms as setStyle,
|
|
122
|
+
$a as toArray,
|
|
123
|
+
C as useControlAttributes,
|
|
124
|
+
i as useDateFormat,
|
|
125
|
+
D as useDateMask,
|
|
126
|
+
l as useElevation,
|
|
127
|
+
S as useIdAttribute,
|
|
128
|
+
N as useLocale,
|
|
129
|
+
m as useOverflow,
|
|
130
|
+
X as usePopoverState,
|
|
131
|
+
n as useProxyModelValue,
|
|
132
|
+
u as useResponsive,
|
|
133
|
+
P as useTheme,
|
|
134
|
+
L as useTimeFormat,
|
|
135
|
+
M as useTimeMask,
|
|
136
|
+
I as useToggle,
|
|
137
|
+
g as useValidationAttributes
|
|
138
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "./dom-CwV-xS38.js";
|
|
2
|
+
import { i as s } from "./isUndefined-B5qXrATz.js";
|
|
3
|
+
const a = (t, r) => {
|
|
4
|
+
const e = r.find((n) => t === n.value);
|
|
5
|
+
if (s(e))
|
|
6
|
+
throw new Error("[getItemByValue]: Item not found.");
|
|
7
|
+
return e;
|
|
8
|
+
}, m = (t, r) => t.map((e) => a(e, r)), l = async (t, r) => r.filter((e) => new RegExp(t, "i").test(e.label));
|
|
9
|
+
export {
|
|
10
|
+
m as a,
|
|
11
|
+
a as g,
|
|
12
|
+
l as s
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type FilterFunction<T> = (value: T) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type GroupFunction<T> = (value: T) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Id = string | number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Locale = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ModelValue<T> = T | null | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type SearchFunction<T> = (value: string, items: T[]) => Promise<T[]>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './DataModel';
|
|
2
|
+
export * from './DateFormat';
|
|
3
|
+
export * from './FilterFunction';
|
|
4
|
+
export * from './FormatFunction';
|
|
5
|
+
export * from './Group';
|
|
6
|
+
export * from './GroupFunction';
|
|
7
|
+
export * from './Id';
|
|
8
|
+
export * from './Item';
|
|
9
|
+
export * from './Locale';
|
|
10
|
+
export * from './ModelValue';
|
|
11
|
+
export * from './SearchFunction';
|
|
12
|
+
export * from './TimeFormat';
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { useAttrs as h, computed as o, inject as g, isRef as p, ref as c, watch as m, getCurrentInstance as b, onMounted as R } from "vue";
|
|
2
|
+
import { DateFormat as x, TimeFormat as M } from "./types.js";
|
|
3
|
+
import { r as C } from "./dom-CwV-xS38.js";
|
|
4
|
+
import { i as E } from "./isVisible-BuGrjvTY.js";
|
|
5
|
+
import { useMutationObserver as S, useResizeObserver as $, refDebounced as F, useMediaQuery as P } from "@vueuse/core";
|
|
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 _ = () => {
|
|
10
|
+
const e = h();
|
|
11
|
+
return {
|
|
12
|
+
readonly: o(() => e.readonly),
|
|
13
|
+
disabled: o(() => e.disabled),
|
|
14
|
+
"force-state": o(() => e["force-state"])
|
|
15
|
+
};
|
|
16
|
+
}, q = Symbol(), L = Symbol(), N = Symbol(), k = (e) => o(() => e.value ?? g(q, x.Short)), G = (e, t) => o(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
|
|
17
|
+
dateStyle: e.value,
|
|
18
|
+
timeZone: "UTC"
|
|
19
|
+
}).formatToParts(Date.UTC(1, 0, 1, 1, 1)).reduce((r, n) => {
|
|
20
|
+
switch (n.type) {
|
|
21
|
+
case "year":
|
|
22
|
+
return r + n.value.replace(/^\d{2}$/, "YY").replace(/^\d{4}$/, "YYYY");
|
|
23
|
+
case "month":
|
|
24
|
+
switch (e.value) {
|
|
25
|
+
case "short":
|
|
26
|
+
return r + n.value.replace(/^\d{1}$/, "M").replace(/^\d{2}$/, "MM");
|
|
27
|
+
case "medium":
|
|
28
|
+
return r + "MMM";
|
|
29
|
+
case "long":
|
|
30
|
+
return r + "MMMM";
|
|
31
|
+
default:
|
|
32
|
+
throw new Error("[useDateMask]: `format` has an invalid value.");
|
|
33
|
+
}
|
|
34
|
+
case "day":
|
|
35
|
+
return r + n.value.replace(/^\d{1}$/, "D").replace(/^\d{2}$/, "DD");
|
|
36
|
+
default:
|
|
37
|
+
return r + n.value;
|
|
38
|
+
}
|
|
39
|
+
}, "") : e.value(void 0, t.value)), J = (e, t) => {
|
|
40
|
+
const s = p(e) ? e : c(e), r = p(t) ? t : c();
|
|
41
|
+
function n(a) {
|
|
42
|
+
return [...document.body.querySelectorAll("*")].filter(E).filter((u) => !u.isEqualNode(a)).map((u) => getComputedStyle(u)).map((u) => Number(u.zIndex)).filter((u) => !isNaN(u));
|
|
43
|
+
}
|
|
44
|
+
function l(a) {
|
|
45
|
+
a.style.zIndex = String(Math.max(0, ...n(a)) + 1);
|
|
46
|
+
}
|
|
47
|
+
m([s, r], ([a]) => {
|
|
48
|
+
a && l(a);
|
|
49
|
+
}, { immediate: !0 });
|
|
50
|
+
}, K = () => {
|
|
51
|
+
const e = h(), t = b();
|
|
52
|
+
return o(() => e.id ?? (t == null ? void 0 : t.uid.toString()));
|
|
53
|
+
}, X = (e) => o(() => e.value ?? g(L, navigator.language)), ee = (e, t = {}) => {
|
|
54
|
+
const { hide: s = !0, threshold: r = 0 } = t, n = p(e) ? e : c(e), l = c([]), a = c([]);
|
|
55
|
+
function u() {
|
|
56
|
+
const i = n.value;
|
|
57
|
+
if (i) {
|
|
58
|
+
const d = [...i.children].reduce(({ innerItems: v, outerItems: y }, T) => {
|
|
59
|
+
const f = T, { x: D, width: I } = f.getBoundingClientRect(), { x: A, width: w } = i.getBoundingClientRect();
|
|
60
|
+
return D + I > A + w + r ? (s && f.style.setProperty("visibility", "hidden"), {
|
|
61
|
+
innerItems: v,
|
|
62
|
+
outerItems: [...y, f]
|
|
63
|
+
}) : (s && f.style.removeProperty("visibility"), {
|
|
64
|
+
innerItems: [...v, f],
|
|
65
|
+
outerItems: y
|
|
66
|
+
});
|
|
67
|
+
}, {
|
|
68
|
+
innerItems: [],
|
|
69
|
+
outerItems: []
|
|
70
|
+
});
|
|
71
|
+
l.value = d.innerItems, a.value = d.outerItems;
|
|
72
|
+
} else
|
|
73
|
+
l.value = [], a.value = [];
|
|
74
|
+
}
|
|
75
|
+
return m(n, u, {
|
|
76
|
+
immediate: !0
|
|
77
|
+
}), S(n, u, {
|
|
78
|
+
childList: !0
|
|
79
|
+
}), $(n, () => C(u)), {
|
|
80
|
+
innerItems: l,
|
|
81
|
+
outerItems: a
|
|
82
|
+
};
|
|
83
|
+
}, te = (e, t, s = {}) => {
|
|
84
|
+
const r = c(e.value ? "open" : "closed");
|
|
85
|
+
m(e, (i) => {
|
|
86
|
+
r.value = i ? "open" : "closed";
|
|
87
|
+
});
|
|
88
|
+
const n = F(r, s.debounce ?? 0);
|
|
89
|
+
m(n, (i) => {
|
|
90
|
+
switch (t("update:state", i), i) {
|
|
91
|
+
case "open":
|
|
92
|
+
t("open");
|
|
93
|
+
break;
|
|
94
|
+
case "closed":
|
|
95
|
+
t("close");
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
function l() {
|
|
100
|
+
r.value = "open";
|
|
101
|
+
}
|
|
102
|
+
function a() {
|
|
103
|
+
r.value = "closed";
|
|
104
|
+
}
|
|
105
|
+
function u() {
|
|
106
|
+
r.value = r.value === "open" ? "closed" : "open";
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
state: n,
|
|
110
|
+
open: l,
|
|
111
|
+
close: a,
|
|
112
|
+
toggle: u
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
function re(e, t, s = {}) {
|
|
116
|
+
const { defaultValue: r } = s;
|
|
117
|
+
return r ? o({
|
|
118
|
+
get: () => e.value ?? r.value,
|
|
119
|
+
set: (n) => {
|
|
120
|
+
t("update:modelValue", n);
|
|
121
|
+
}
|
|
122
|
+
}) : o({
|
|
123
|
+
get: () => e.value,
|
|
124
|
+
set: (n) => {
|
|
125
|
+
t("update:modelValue", n);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function ne(e) {
|
|
130
|
+
const t = b(), s = c();
|
|
131
|
+
e ? m(e, (u) => {
|
|
132
|
+
s.value = u;
|
|
133
|
+
}) : R(() => {
|
|
134
|
+
if (t) {
|
|
135
|
+
const u = t.vnode[V ? "el" : "elm"];
|
|
136
|
+
u instanceof Element && (s.value = u);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
const r = o(() => a(s.value) || l.value), n = o(() => !r.value), l = P(`(min-width: ${O.md})`);
|
|
140
|
+
function a(u) {
|
|
141
|
+
var d;
|
|
142
|
+
if (!u)
|
|
143
|
+
return !1;
|
|
144
|
+
const i = (d = u.getAttribute("force-screen")) == null ? void 0 : d.split(/\s+/);
|
|
145
|
+
return i != null && i.some((v) => ["md", "lg", "xl"].includes(v)) ? !0 : a(u.parentElement ?? void 0);
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
isDesktop: r,
|
|
149
|
+
isMobile: n
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const ue = () => Y.theme, oe = (e) => o(() => e.value ?? g(N, M.Auto)), se = (e, t) => o(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
|
|
153
|
+
timeStyle: "short",
|
|
154
|
+
hourCycle: e.value !== M.Auto ? e.value : void 0,
|
|
155
|
+
timeZone: "UTC"
|
|
156
|
+
}).formatToParts(Date.UTC(1, 0, 1, 1, 1)).reduce((r, n) => {
|
|
157
|
+
switch (n.type) {
|
|
158
|
+
case "hour":
|
|
159
|
+
return r + n.value.replace(/^\d{1}$/, "H").replace(/^\d{2}$/, "HH");
|
|
160
|
+
case "minute":
|
|
161
|
+
return r + n.value.replace(/^\d{1}$/, "M").replace(/^\d{2}$/, "MM");
|
|
162
|
+
case "dayPeriod":
|
|
163
|
+
return r + "A";
|
|
164
|
+
default:
|
|
165
|
+
return r + n.value;
|
|
166
|
+
}
|
|
167
|
+
}, "") : e.value(void 0, t.value));
|
|
168
|
+
function ae(e = !1) {
|
|
169
|
+
const t = c(e);
|
|
170
|
+
function s() {
|
|
171
|
+
t.value = !0;
|
|
172
|
+
}
|
|
173
|
+
function r() {
|
|
174
|
+
t.value = !1;
|
|
175
|
+
}
|
|
176
|
+
function n() {
|
|
177
|
+
t.value = !t.value;
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
isActiveToggle: t,
|
|
181
|
+
show: s,
|
|
182
|
+
hide: r,
|
|
183
|
+
toggle: n
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
const ie = () => {
|
|
187
|
+
const e = h();
|
|
188
|
+
return {
|
|
189
|
+
required: o(() => e.required),
|
|
190
|
+
minlength: o(() => e.minlength),
|
|
191
|
+
maxlength: o(() => e.maxlength),
|
|
192
|
+
pattern: o(() => e.pattern),
|
|
193
|
+
min: o(() => e.min),
|
|
194
|
+
max: o(() => e.max),
|
|
195
|
+
step: o(() => e.step)
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
export {
|
|
199
|
+
q as D,
|
|
200
|
+
L,
|
|
201
|
+
N as T,
|
|
202
|
+
_ as a,
|
|
203
|
+
k as b,
|
|
204
|
+
G as c,
|
|
205
|
+
J as d,
|
|
206
|
+
K as e,
|
|
207
|
+
X as f,
|
|
208
|
+
ee as g,
|
|
209
|
+
te as h,
|
|
210
|
+
re as i,
|
|
211
|
+
ne as j,
|
|
212
|
+
ue as k,
|
|
213
|
+
oe as l,
|
|
214
|
+
se as m,
|
|
215
|
+
ie as n,
|
|
216
|
+
ae as u
|
|
217
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const CODE_BACKSPACE = 8;
|
|
2
|
+
export declare const CODE_BREAK = 19;
|
|
3
|
+
export declare const CODE_DELETE = 46;
|
|
4
|
+
export declare const CODE_DOWN = 40;
|
|
5
|
+
export declare const CODE_END = 35;
|
|
6
|
+
export declare const CODE_ENTER = 13;
|
|
7
|
+
export declare const CODE_ESC = 27;
|
|
8
|
+
export declare const CODE_HOME = 36;
|
|
9
|
+
export declare const CODE_LEFT = 37;
|
|
10
|
+
export declare const CODE_PAGEDOWN = 34;
|
|
11
|
+
export declare const CODE_PAGEUP = 33;
|
|
12
|
+
export declare const CODE_RIGHT = 39;
|
|
13
|
+
export declare const CODE_SPACE = 32;
|
|
14
|
+
export declare const CODE_UP = 38;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PLACEMENT_TOP_START = "top-start";
|
|
2
|
+
export declare const PLACEMENT_TOP_END = "top-end";
|
|
3
|
+
export declare const PLACEMENT_BOTTOM_START = "bottom-start";
|
|
4
|
+
export declare const PLACEMENT_BOTTOM_END = "bottom-end";
|
|
5
|
+
export declare const PLACEMENT_RIGHT_START = "right-start";
|
|
6
|
+
export declare const PLACEMENT_RIGHT_END = "right-end";
|
|
7
|
+
export declare const PLACEMENT_LEFT_START = "left-start";
|
|
8
|
+
export declare const PLACEMENT_LEFT_END = "left-end";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic
|
|
3
|
+
*/
|
|
4
|
+
export declare const RX_ARRAY_NOTATION: RegExp;
|
|
5
|
+
export declare const RX_BV_PREFIX: RegExp;
|
|
6
|
+
export declare const RX_DIGITS: RegExp;
|
|
7
|
+
export declare const RX_EXTENSION: RegExp;
|
|
8
|
+
export declare const RX_HASH: RegExp;
|
|
9
|
+
export declare const RX_HASH_ID: RegExp;
|
|
10
|
+
export declare const RX_HTML_TAGS: RegExp;
|
|
11
|
+
export declare const RX_HYPHENATE: RegExp;
|
|
12
|
+
export declare const RX_LOWER_UPPER: RegExp;
|
|
13
|
+
export declare const RX_NUMBER: RegExp;
|
|
14
|
+
export declare const RX_PLUS: RegExp;
|
|
15
|
+
export declare const RX_REGEXP_REPLACE: RegExp;
|
|
16
|
+
export declare const RX_SPACES: RegExp;
|
|
17
|
+
export declare const RX_SPACE_SPLIT: RegExp;
|
|
18
|
+
export declare const RX_STAR: RegExp;
|
|
19
|
+
export declare const RX_START_SPACE_WORD: RegExp;
|
|
20
|
+
export declare const RX_TRIM_LEFT: RegExp;
|
|
21
|
+
export declare const RX_TRIM_RIGHT: RegExp;
|
|
22
|
+
export declare const RX_UNDERSCORE: RegExp;
|
|
23
|
+
export declare const RX_UN_KEBAB: RegExp;
|
|
24
|
+
export declare const RX_ABBREVIATION_FROM_STRING: RegExp;
|
|
25
|
+
/**
|
|
26
|
+
* Date
|
|
27
|
+
*/
|
|
28
|
+
export declare const RX_DATE: RegExp;
|
|
29
|
+
export declare const RX_DATE_SPLIT: RegExp;
|
|
30
|
+
export declare const RX_TIME: RegExp;
|
|
31
|
+
/**
|
|
32
|
+
* URL
|
|
33
|
+
*/
|
|
34
|
+
export declare const RX_HREF: RegExp;
|
|
35
|
+
export declare const RX_ENCODED_COMMA: RegExp;
|
|
36
|
+
export declare const RX_ENCODE_REVERSE: RegExp;
|
|
37
|
+
export declare const RX_QUERY_START: RegExp;
|
|
38
|
+
/**
|
|
39
|
+
* Color
|
|
40
|
+
*/
|
|
41
|
+
export declare const RX_SHORT_COLOR: RegExp;
|
|
42
|
+
export declare const RX_LONG_COLOR: RegExp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function extractCssVarName(string: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare function hexToRgb(hex: string): {
|
|
2
|
+
r: number;
|
|
3
|
+
g: number;
|
|
4
|
+
b: number;
|
|
5
|
+
} | null;
|
|
6
|
+
export declare function rgbToHex(r: number, g: number, b: number): string;
|
|
7
|
+
export declare function generateHslFromString(str: string, limits?: Partial<Record<'h' | 's' | 'l', {
|
|
8
|
+
min: number;
|
|
9
|
+
max: number;
|
|
10
|
+
}>>): {
|
|
11
|
+
h: number;
|
|
12
|
+
s: number;
|
|
13
|
+
l: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function hslToColorString(hsl: {
|
|
16
|
+
h: number;
|
|
17
|
+
s: number;
|
|
18
|
+
l: number;
|
|
19
|
+
}): string;
|
|
20
|
+
export declare function generateColorFromString(str: string, limits?: Partial<Record<'h' | 's' | 'l', {
|
|
21
|
+
min: number;
|
|
22
|
+
max: number;
|
|
23
|
+
}>>): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const MutationObs: MutationObserver;
|
|
2
|
+
export declare const requestAF: any;
|
|
3
|
+
export declare const cancelAF: any;
|
|
4
|
+
export declare const removeNode: (el: HTMLElement) => void;
|
|
5
|
+
export declare const reflow: (el: HTMLElement) => number | null;
|
|
6
|
+
export declare const selectAll: (selector: string, root?: HTMLElement | undefined) => Element[];
|
|
7
|
+
export declare const select: (selector: string, root?: HTMLElement | undefined) => Element | null;
|
|
8
|
+
export declare const contains: (parent: HTMLElement, child: HTMLElement) => boolean;
|
|
9
|
+
export declare const getById: (id: string) => HTMLElement | null;
|
|
10
|
+
export declare const addClass: (el: HTMLElement, className: string) => void;
|
|
11
|
+
export declare const removeClass: (el: HTMLElement, className: string) => void;
|
|
12
|
+
export declare const hasClass: (el: HTMLElement, className: string) => boolean;
|
|
13
|
+
export declare const setAttr: (el: HTMLElement, attr: string, value: any) => void;
|
|
14
|
+
export declare const removeAttr: (el: HTMLElement, attr: string) => void;
|
|
15
|
+
export declare const getAttr: (el: HTMLElement, attr: string) => string | null;
|
|
16
|
+
export declare const hasAttr: (el: HTMLElement, attr: string) => boolean | null;
|
|
17
|
+
export declare const setStyle: (el: HTMLElement, prop: any, value: any) => void;
|
|
18
|
+
export declare const removeStyle: (el: HTMLElement, prop: any) => void;
|
|
19
|
+
export declare const getStyle: (el: HTMLElement, prop: any) => string | null;
|
|
20
|
+
export declare const getBCR: (el: HTMLElement) => DOMRect | null;
|
|
21
|
+
export declare const getCS: (el: HTMLElement) => CSSStyleDeclaration | Record<string, string>;
|
|
22
|
+
export declare const offset: (el: HTMLElement) => {
|
|
23
|
+
top: number;
|
|
24
|
+
left: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const position: (el: HTMLElement) => {
|
|
27
|
+
top: number;
|
|
28
|
+
left: number;
|
|
29
|
+
};
|
|
30
|
+
export declare const getMaxZIndex: (element: HTMLElement | null) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pxToRem: (value: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAbbreviation(text: string | null, limit?: number): string;
|