@rotki/ui-library 2.2.1 → 2.4.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/README.md +62 -0
- package/dist/components/date-time-picker/RuiDateTimePicker.vue.d.ts +3 -3
- package/dist/components/index.es.js +3194 -3171
- package/dist/composables/index-DggmQIbL.js +487 -0
- package/dist/composables/index.es.js +1 -1
- package/dist/composables/use-rui-i18n.d.ts +13 -0
- package/dist/i18n/keys-CNGXWOJX.js +19 -0
- package/dist/i18n/keys.d.ts +13 -0
- package/dist/index-B4Z0iEL-.js +53 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +1715 -1711
- package/dist/style.css +1 -1
- package/dist/utils/{index-BOcQQzr3.js → index-B__GIRn7.js} +1 -1
- package/dist/vendor-DONK-IZM.js +1770 -0
- package/dist/web-types.json +2 -2
- package/package.json +1 -1
- package/dist/composables/index-DLKNQD1b.js +0 -477
- package/dist/index-hpmutpFo.js +0 -32
- package/dist/vendor-1jxxZILY.js +0 -2051
|
@@ -0,0 +1,487 @@
|
|
|
1
|
+
import { useWindowSize as se, breakpointsTailwind as re, useBreakpoints as ie, createSharedComposable as ce, useColorMode as ae, unrefElement as Z, useResizeObserver as te, useVirtualList as le, useArrayMap as ue, watchOnce as fe, useEventListener as F, useMutationObserver as de } from "@vueuse/core";
|
|
2
|
+
import { c as G, p as pe, d as me, a as he, o as ge, f as ye, b as we, e as Le, g as be } from "../vendor-DONK-IZM.js";
|
|
3
|
+
import { computed as R, inject as J, ref as y, watch as V, onMounted as ne, watchEffect as Ce, nextTick as ee } from "vue";
|
|
4
|
+
import { get as e, set as f } from "@vueuse/shared";
|
|
5
|
+
import { LuChevronsUpDown as ve, LuArrowUp as Te, LuArrowDown as xe, LuArrowLeft as Se, LuArrowRight as Ee, LuChevronUp as Ie, LuChevronDown as ke, LuChevronLeft as Pe, LuChevronRight as Oe, LuChevronsLeft as $e, LuChevronsRight as Be, LuCircleAlert as De, LuCheck as Ae, LuCircleX as Re, LuCircleCheck as Me, LuCheckboxBlank as _e, LuCheckboxFill as ze, LuCheckboxIndeterminateFill as He, LuCheckboxBlankCircle as je, LuCheckboxBlankCircleFill as qe, LuRadioButtonFill as Ue, LuClock as Ne } from "../icons/icons_1.es.js";
|
|
6
|
+
import { LuEllipsis as Ve, LuInfo as We, LuEye as Ke, LuEyeOff as Xe } from "../icons/icons_2.es.js";
|
|
7
|
+
import { LuTriangleAlert as Fe, LuX as Ge } from "../icons/icons_4.es.js";
|
|
8
|
+
import { c as Je } from "../utils/index-B__GIRn7.js";
|
|
9
|
+
import { d as oe, T as O } from "../types/index-CN6Ip1GL.js";
|
|
10
|
+
function pt() {
|
|
11
|
+
const { width: o } = se(), l = {
|
|
12
|
+
xs: 0,
|
|
13
|
+
...re
|
|
14
|
+
}, p = ie(l), a = Object.keys, s = a(l), h = s.map(
|
|
15
|
+
(n, u) => [
|
|
16
|
+
n,
|
|
17
|
+
u < s.length - 1 ? p.between(n, s[u + 1]) : p[n]
|
|
18
|
+
]
|
|
19
|
+
), c = h.map(([n, u]) => [
|
|
20
|
+
G(`is_${n}`),
|
|
21
|
+
u
|
|
22
|
+
]), C = s.map((n) => [
|
|
23
|
+
G(`is_${n}_and_up`),
|
|
24
|
+
p.greaterOrEqual(n)
|
|
25
|
+
]), w = s.map((n) => [
|
|
26
|
+
G(`is_${n}_and_down`),
|
|
27
|
+
p.smaller(n)
|
|
28
|
+
]), m = R(() => {
|
|
29
|
+
var n;
|
|
30
|
+
return ((n = h.find((u) => e(u[1]))) == null ? void 0 : n[0]) || "";
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
...Object.fromEntries(c),
|
|
34
|
+
...Object.fromEntries(C),
|
|
35
|
+
...Object.fromEntries(w),
|
|
36
|
+
name: m,
|
|
37
|
+
width: o
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const Ye = [
|
|
41
|
+
ve,
|
|
42
|
+
Ve,
|
|
43
|
+
Fe,
|
|
44
|
+
Ge,
|
|
45
|
+
We,
|
|
46
|
+
Te,
|
|
47
|
+
xe,
|
|
48
|
+
Se,
|
|
49
|
+
Ee,
|
|
50
|
+
Ie,
|
|
51
|
+
ke,
|
|
52
|
+
Pe,
|
|
53
|
+
Oe,
|
|
54
|
+
$e,
|
|
55
|
+
Be,
|
|
56
|
+
De,
|
|
57
|
+
Ke,
|
|
58
|
+
Xe,
|
|
59
|
+
Ae,
|
|
60
|
+
Re,
|
|
61
|
+
Me,
|
|
62
|
+
_e,
|
|
63
|
+
ze,
|
|
64
|
+
He,
|
|
65
|
+
je,
|
|
66
|
+
qe,
|
|
67
|
+
Ue,
|
|
68
|
+
Ne
|
|
69
|
+
], Qe = Symbol.for("rui:icons");
|
|
70
|
+
function mt(o) {
|
|
71
|
+
const l = (o == null ? void 0 : o.registeredIcons) || [];
|
|
72
|
+
return {
|
|
73
|
+
registeredIcons: {
|
|
74
|
+
...Object.fromEntries(
|
|
75
|
+
[
|
|
76
|
+
...Ye,
|
|
77
|
+
...l
|
|
78
|
+
].map(({ components: p, name: a }) => [a, p])
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function ht() {
|
|
84
|
+
const o = J(Qe);
|
|
85
|
+
return Je(o, "Could not find icons injection"), o;
|
|
86
|
+
}
|
|
87
|
+
const N = y({ ...oe }), gt = ce(() => {
|
|
88
|
+
const { state: o, store: l } = ae(), p = R(() => e(l) === O.auto), a = R(() => e(o) === O.light), s = R(() => e(o) === O.dark), h = R(() => e(a) ? e(N).light : e(N).dark), c = (n) => {
|
|
89
|
+
f(l, n || O.auto);
|
|
90
|
+
}, C = () => {
|
|
91
|
+
e(p) ? c(O.light) : e(a) ? c(O.dark) : e(s) && c(O.auto);
|
|
92
|
+
}, w = (n) => {
|
|
93
|
+
f(N, n);
|
|
94
|
+
};
|
|
95
|
+
return {
|
|
96
|
+
config: N,
|
|
97
|
+
init: (n) => {
|
|
98
|
+
c(n.mode ?? O.auto), w(n.config ?? { ...oe }), typeof window < "u" && V([a, h], ([u, T]) => {
|
|
99
|
+
const r = /* @__PURE__ */ new Map();
|
|
100
|
+
Object.entries(T).forEach(([v, x]) => {
|
|
101
|
+
r.set(`--rui-${v}-darker`, x.darker), r.set(`--rui-${v}-lighter`, x.lighter), r.set(`--rui-${v}-main`, x.DEFAULT);
|
|
102
|
+
});
|
|
103
|
+
const d = u ? O.light : O.dark;
|
|
104
|
+
r.set("--rui-text-disabled", `var(--rui-${d}-text-disabled)`), r.set("--rui-text-primary", `var(--rui-${d}-text-primary)`), r.set("--rui-text-secondary", `var(--rui-${d}-text-secondary)`);
|
|
105
|
+
const k = document.documentElement.style;
|
|
106
|
+
r.forEach((v, x) => {
|
|
107
|
+
k.setProperty(x, v);
|
|
108
|
+
});
|
|
109
|
+
}, { immediate: !0 });
|
|
110
|
+
},
|
|
111
|
+
isAutoControlled: p,
|
|
112
|
+
isDark: s,
|
|
113
|
+
isLight: a,
|
|
114
|
+
setThemeConfig: w,
|
|
115
|
+
state: o,
|
|
116
|
+
store: l,
|
|
117
|
+
switchThemeScheme: c,
|
|
118
|
+
theme: h,
|
|
119
|
+
toggleThemeMode: C
|
|
120
|
+
};
|
|
121
|
+
}), $ = {
|
|
122
|
+
adaptive: !0,
|
|
123
|
+
gpuAcceleration: !0,
|
|
124
|
+
locked: !1,
|
|
125
|
+
offsetDistance: 8,
|
|
126
|
+
offsetSkid: 0,
|
|
127
|
+
overflowPadding: 8,
|
|
128
|
+
placement: "bottom",
|
|
129
|
+
resize: !0,
|
|
130
|
+
scroll: !0,
|
|
131
|
+
strategy: "absolute"
|
|
132
|
+
}, Ze = pe({
|
|
133
|
+
defaultModifiers: [
|
|
134
|
+
...me,
|
|
135
|
+
he,
|
|
136
|
+
ge,
|
|
137
|
+
ye,
|
|
138
|
+
we,
|
|
139
|
+
Le,
|
|
140
|
+
be
|
|
141
|
+
]
|
|
142
|
+
});
|
|
143
|
+
function yt(o, l = y(!1), p = y(0), a = y(0), s) {
|
|
144
|
+
const h = y(null), c = y(null), C = y(null), w = y(!1), m = y(), n = y(), u = y(!1), T = y(!1), r = () => {
|
|
145
|
+
f(u, !1);
|
|
146
|
+
}, d = () => {
|
|
147
|
+
var g;
|
|
148
|
+
(g = e(C)) == null || g.update();
|
|
149
|
+
}, k = (g = !1) => {
|
|
150
|
+
if (!e(l) && (e(n) && (clearTimeout(e(n)), f(n, void 0)), f(T, !1), !e(m))) {
|
|
151
|
+
f(u, !0);
|
|
152
|
+
const b = setTimeout(() => {
|
|
153
|
+
f(w, !0), f(m, void 0);
|
|
154
|
+
}, g ? 0 : e(p));
|
|
155
|
+
f(m, b);
|
|
156
|
+
}
|
|
157
|
+
}, v = (g = !1) => {
|
|
158
|
+
if (!e(l) && (e(m) && (clearTimeout(e(m)), f(m, void 0)), !e(n))) {
|
|
159
|
+
const b = setTimeout(() => {
|
|
160
|
+
e(w) || r(), f(w, !1), f(n, void 0);
|
|
161
|
+
}, g ? 0 : e(a));
|
|
162
|
+
f(n, b);
|
|
163
|
+
}
|
|
164
|
+
}, x = () => {
|
|
165
|
+
f(T, !0);
|
|
166
|
+
};
|
|
167
|
+
return ne(() => {
|
|
168
|
+
Ce((g) => {
|
|
169
|
+
if (!e(c) || !e(h) && !e(s))
|
|
170
|
+
return;
|
|
171
|
+
const b = Z(c), B = e(s) || Z(h);
|
|
172
|
+
if (!(b instanceof HTMLElement) || !B)
|
|
173
|
+
return;
|
|
174
|
+
const {
|
|
175
|
+
adaptive: M = $.adaptive,
|
|
176
|
+
gpuAcceleration: I = $.gpuAcceleration,
|
|
177
|
+
locked: _ = $.locked,
|
|
178
|
+
offsetDistance: L = $.offsetDistance,
|
|
179
|
+
offsetSkid: W = $.offsetSkid,
|
|
180
|
+
overflowPadding: q = $.overflowPadding,
|
|
181
|
+
placement: U = $.placement,
|
|
182
|
+
resize: z = $.resize,
|
|
183
|
+
scroll: H = $.scroll,
|
|
184
|
+
strategy: K = $.strategy
|
|
185
|
+
} = e(o), X = Ze(B, b, {
|
|
186
|
+
modifiers: [
|
|
187
|
+
{
|
|
188
|
+
enabled: !_,
|
|
189
|
+
name: "flip"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: "preventOverflow",
|
|
193
|
+
options: {
|
|
194
|
+
padding: q
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "offset",
|
|
199
|
+
options: {
|
|
200
|
+
offset: [W, L]
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "computeStyles",
|
|
205
|
+
options: {
|
|
206
|
+
adaptive: M,
|
|
207
|
+
gpuAcceleration: I
|
|
208
|
+
}
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
name: "eventListeners",
|
|
212
|
+
options: {
|
|
213
|
+
resize: z,
|
|
214
|
+
scroll: H
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "arrow",
|
|
219
|
+
options: {
|
|
220
|
+
padding: 4
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
placement: U,
|
|
225
|
+
strategy: K
|
|
226
|
+
});
|
|
227
|
+
f(C, X), g(X.destroy);
|
|
228
|
+
});
|
|
229
|
+
}), te([h, c], async () => {
|
|
230
|
+
const g = e(C);
|
|
231
|
+
e(w) && g && await g.update();
|
|
232
|
+
}), {
|
|
233
|
+
instance: C,
|
|
234
|
+
leavePending: T,
|
|
235
|
+
onClose: v,
|
|
236
|
+
onLeavePending: x,
|
|
237
|
+
onOpen: k,
|
|
238
|
+
onPopperLeave: r,
|
|
239
|
+
open: w,
|
|
240
|
+
popper: c,
|
|
241
|
+
popperEnter: u,
|
|
242
|
+
reference: h,
|
|
243
|
+
updatePopper: d
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function et({
|
|
247
|
+
keyAttr: o,
|
|
248
|
+
textAttr: l
|
|
249
|
+
}) {
|
|
250
|
+
function p(s) {
|
|
251
|
+
var h;
|
|
252
|
+
return l ? typeof l == "function" ? l(s) : (h = s[l]) == null ? void 0 : h.toString() : s == null ? void 0 : s.toString();
|
|
253
|
+
}
|
|
254
|
+
function a(s) {
|
|
255
|
+
return o ? s[o] : s;
|
|
256
|
+
}
|
|
257
|
+
return {
|
|
258
|
+
getIdentifier: a,
|
|
259
|
+
getText: p
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function wt({
|
|
263
|
+
appendWidth: o,
|
|
264
|
+
autoFocus: l,
|
|
265
|
+
autoSelectFirst: p,
|
|
266
|
+
dense: a,
|
|
267
|
+
hideSelected: s,
|
|
268
|
+
itemHeight: h = 48,
|
|
269
|
+
keyAttr: c,
|
|
270
|
+
menuRef: C,
|
|
271
|
+
options: w,
|
|
272
|
+
overscan: m = 5,
|
|
273
|
+
prependWidth: n,
|
|
274
|
+
setValue: u,
|
|
275
|
+
textAttr: T,
|
|
276
|
+
value: r
|
|
277
|
+
}) {
|
|
278
|
+
const d = R(() => {
|
|
279
|
+
const t = e(w);
|
|
280
|
+
return s ? t.filter((i) => !z(i)) : t;
|
|
281
|
+
}), { getIdentifier: k, getText: v } = et({
|
|
282
|
+
keyAttr: c,
|
|
283
|
+
textAttr: T
|
|
284
|
+
}), { containerProps: x, list: g, scrollTo: b, wrapperProps: B } = le(
|
|
285
|
+
d,
|
|
286
|
+
{
|
|
287
|
+
itemHeight: h,
|
|
288
|
+
overscan: m
|
|
289
|
+
}
|
|
290
|
+
), M = ue(g, ({ data: t, index: i }) => ({ _index: i, item: t })), I = y(!1), _ = R(() => {
|
|
291
|
+
const t = e(r);
|
|
292
|
+
return !c || !t ? t : Array.isArray(t) ? t.map((i) => i[c]) : t[c];
|
|
293
|
+
}), L = y(e(p) ? 0 : -1), W = R(() => {
|
|
294
|
+
const t = { max: 0, min: 0 }, i = 30, P = 1.5, S = e(a) ? 12 : 13;
|
|
295
|
+
e(d).forEach((D) => {
|
|
296
|
+
var Y, Q;
|
|
297
|
+
const A = ((Q = (Y = v(D)) == null ? void 0 : Y.toString()) == null ? void 0 : Q.length) ?? 0;
|
|
298
|
+
t.min === 0 && t.max === 0 ? (t.min = A, t.max = A) : A < t.min ? t.min = A : A > t.max && (t.max = A);
|
|
299
|
+
});
|
|
300
|
+
const j = t.max - t.min;
|
|
301
|
+
function E(D) {
|
|
302
|
+
const A = (n ? n + 0.5 : 0) + (o ? o + 0.5 : 0);
|
|
303
|
+
return `${Math.min(D * S / 16 + P + A, i)}rem`;
|
|
304
|
+
}
|
|
305
|
+
return j <= 5 ? E(t.max) : E(t.min + j / 2);
|
|
306
|
+
});
|
|
307
|
+
function q(t = !1) {
|
|
308
|
+
f(I, t);
|
|
309
|
+
}
|
|
310
|
+
function U(t) {
|
|
311
|
+
const i = e(r), P = Array.isArray(i) ? i : i ? [i] : [];
|
|
312
|
+
return P.length === 0 ? -1 : P.findIndex((S) => c ? S[c] === t[c] : S === t);
|
|
313
|
+
}
|
|
314
|
+
function z(t) {
|
|
315
|
+
return U(t) !== -1;
|
|
316
|
+
}
|
|
317
|
+
async function H(t = !1) {
|
|
318
|
+
const i = e(L);
|
|
319
|
+
i > -1 && await ee(() => {
|
|
320
|
+
var S, j;
|
|
321
|
+
if ((S = e(C)) == null ? void 0 : S.parentElement) {
|
|
322
|
+
const E = e(C).getElementsByClassName("highlighted")[0];
|
|
323
|
+
if (E)
|
|
324
|
+
(j = E.scrollIntoView) == null || j.call(E, { behavior: t ? "smooth" : "auto", block: "nearest" }), e(l) && "focus" in E && typeof E.focus == "function" && (E == null || E.focus());
|
|
325
|
+
else if (b(i), e(l)) {
|
|
326
|
+
const D = e(C).getElementsByClassName("highlighted")[0];
|
|
327
|
+
D && "focus" in D && typeof D.focus == "function" && D.focus();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
async function K(t) {
|
|
333
|
+
await ee(() => {
|
|
334
|
+
if (t) {
|
|
335
|
+
const i = e(r);
|
|
336
|
+
if (Array.isArray(i) && i.length > 0 || i) {
|
|
337
|
+
const P = e(d).findIndex(z);
|
|
338
|
+
P > -1 && f(L, P);
|
|
339
|
+
}
|
|
340
|
+
fe(g, async () => {
|
|
341
|
+
await H();
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
return V(I, K), V(L, async (t, i) => {
|
|
347
|
+
t !== i && await H(!0);
|
|
348
|
+
}), V(d, async () => {
|
|
349
|
+
e(L) !== -1 ? e(p) ? (f(L, 0), await H()) : (f(L, -1), b(0)) : b(0);
|
|
350
|
+
}), {
|
|
351
|
+
applyHighlighted: () => {
|
|
352
|
+
if (!u || !e(I))
|
|
353
|
+
return;
|
|
354
|
+
const t = e(L);
|
|
355
|
+
if (t === -1)
|
|
356
|
+
return;
|
|
357
|
+
const i = e(d).find((P, S) => t === S);
|
|
358
|
+
i && u(i);
|
|
359
|
+
},
|
|
360
|
+
containerProps: x,
|
|
361
|
+
getIdentifier: k,
|
|
362
|
+
getText: v,
|
|
363
|
+
highlightedIndex: L,
|
|
364
|
+
isActiveItem: z,
|
|
365
|
+
isOpen: I,
|
|
366
|
+
itemIndexInValue: U,
|
|
367
|
+
menuWidth: W,
|
|
368
|
+
moveHighlight: (t) => {
|
|
369
|
+
if (!e(I)) {
|
|
370
|
+
q(!0);
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
let i = e(L);
|
|
374
|
+
i += t ? -1 : 1;
|
|
375
|
+
const S = e(d).length;
|
|
376
|
+
i >= S ? f(L, 0) : i < 0 ? f(L, S - 1) : f(L, i);
|
|
377
|
+
},
|
|
378
|
+
optionsWithSelectedHidden: d,
|
|
379
|
+
renderedData: M,
|
|
380
|
+
toggle: q,
|
|
381
|
+
valueKey: _,
|
|
382
|
+
wrapperProps: B
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
const tt = Symbol("rui:i18n");
|
|
386
|
+
function Lt() {
|
|
387
|
+
const o = J(tt), l = (a, s) => {
|
|
388
|
+
if (o != null && o.te(a))
|
|
389
|
+
return o == null ? void 0 : o.t(a, s);
|
|
390
|
+
};
|
|
391
|
+
return { t: (a, s, h) => typeof s == "string" ? l(a) ?? s ?? a : l(a, s) ?? h ?? a };
|
|
392
|
+
}
|
|
393
|
+
const nt = Symbol.for("rui:table");
|
|
394
|
+
function bt(o) {
|
|
395
|
+
return {
|
|
396
|
+
globalItemsPerPage: !1,
|
|
397
|
+
itemsPerPage: y(10),
|
|
398
|
+
limits: [10, 25, 50, 100],
|
|
399
|
+
stickyOffset: y(0),
|
|
400
|
+
...o
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
function Ct() {
|
|
404
|
+
const o = J(nt);
|
|
405
|
+
if (!o)
|
|
406
|
+
throw new Error("Could not find rui table options injection");
|
|
407
|
+
return o;
|
|
408
|
+
}
|
|
409
|
+
function vt(o = y(!1), l) {
|
|
410
|
+
const p = y(null), a = y(null), s = y(!1), h = -0.5, c = {
|
|
411
|
+
head: ":scope > thead[data-id=head-main]",
|
|
412
|
+
headClone: ":scope > thead[data-id=head-clone]",
|
|
413
|
+
row: ":scope > tbody > tr:not([hidden])",
|
|
414
|
+
th: ":scope > th"
|
|
415
|
+
}, C = () => {
|
|
416
|
+
const m = e(p);
|
|
417
|
+
if (!e(o) || !m)
|
|
418
|
+
return;
|
|
419
|
+
const n = m.querySelector(
|
|
420
|
+
`${c.headClone} > tr`
|
|
421
|
+
), u = m.querySelector(`${c.head} > tr`) ?? null, T = () => {
|
|
422
|
+
const r = u == null ? void 0 : u.querySelectorAll(
|
|
423
|
+
c.th
|
|
424
|
+
), d = n == null ? void 0 : n.querySelectorAll(c.th);
|
|
425
|
+
d == null || d.forEach((k, v) => {
|
|
426
|
+
te(k, (x) => {
|
|
427
|
+
const g = x[0].target.getBoundingClientRect(), b = r == null ? void 0 : r.item(v);
|
|
428
|
+
b && (b.style.width = `${g.width}px`);
|
|
429
|
+
});
|
|
430
|
+
});
|
|
431
|
+
};
|
|
432
|
+
de(n, (r) => {
|
|
433
|
+
for (const d of r)
|
|
434
|
+
(d.type === "childList" || d.type === "attributes") && T();
|
|
435
|
+
}, {
|
|
436
|
+
attributes: !0,
|
|
437
|
+
childList: !0,
|
|
438
|
+
subtree: !0
|
|
439
|
+
}), T();
|
|
440
|
+
}, w = () => {
|
|
441
|
+
var _;
|
|
442
|
+
const m = e(p);
|
|
443
|
+
if (!e(o) || !m)
|
|
444
|
+
return;
|
|
445
|
+
const n = m.getBoundingClientRect(), u = m.querySelector(
|
|
446
|
+
c.headClone
|
|
447
|
+
), T = u == null ? void 0 : u.getBoundingClientRect(), r = m.querySelector(c.head) ?? null, d = r == null ? void 0 : r.getBoundingClientRect();
|
|
448
|
+
if (!n || !T || !r || !u || !d)
|
|
449
|
+
return;
|
|
450
|
+
const {
|
|
451
|
+
height: k,
|
|
452
|
+
left: v,
|
|
453
|
+
width: x
|
|
454
|
+
} = T, { bottom: g, top: b } = n, B = e(l) ?? 0;
|
|
455
|
+
r.style.width = `${x}px`;
|
|
456
|
+
const M = m.querySelectorAll(c.row), I = (_ = M.item(M.length - 1)) == null ? void 0 : _.getBoundingClientRect();
|
|
457
|
+
if (b <= B && g > B && M.length > 1) {
|
|
458
|
+
f(s, !0), r.style.left = `${v + h}px`;
|
|
459
|
+
const L = (I == null ? void 0 : I.height) ?? 0;
|
|
460
|
+
g <= L + k + B ? r.style.top = `${g - L - k}px` : r.style.top = `${B}px`;
|
|
461
|
+
} else
|
|
462
|
+
f(s, !1), r.style.left = `${h}px`, r.style.top = "0";
|
|
463
|
+
};
|
|
464
|
+
return ne(() => {
|
|
465
|
+
w(), F(a, "scroll", w), F(document.body, "scroll", w), F(window, "resize", w), C();
|
|
466
|
+
}), {
|
|
467
|
+
stick: s,
|
|
468
|
+
table: p,
|
|
469
|
+
tableScroller: a
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
export {
|
|
473
|
+
Qe as I,
|
|
474
|
+
tt as R,
|
|
475
|
+
nt as T,
|
|
476
|
+
yt as a,
|
|
477
|
+
gt as b,
|
|
478
|
+
et as c,
|
|
479
|
+
wt as d,
|
|
480
|
+
Lt as e,
|
|
481
|
+
Ct as f,
|
|
482
|
+
vt as g,
|
|
483
|
+
bt as h,
|
|
484
|
+
mt as i,
|
|
485
|
+
pt as j,
|
|
486
|
+
ht as u
|
|
487
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const RUI_I18N_INJECTION_KEY: unique symbol;
|
|
2
|
+
interface I18nProvider {
|
|
3
|
+
t: {
|
|
4
|
+
(key: string, fallback: string): string;
|
|
5
|
+
(key: string, params: Record<string, any>, fallback: string): string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface RuiI18nProvider {
|
|
9
|
+
t: (key: string, params?: Record<string, any>) => string;
|
|
10
|
+
te: (key: string) => boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function useRuiI8n(): I18nProvider;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const a = {
|
|
2
|
+
dateTimePicker: {
|
|
3
|
+
dateAfterMax: "rui.date_time_picker.date_after_max",
|
|
4
|
+
dateBeforeMin: "rui.date_time_picker.date_before_min",
|
|
5
|
+
dateInFuture: "rui.date_time_picker.date_in_future"
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
function t(r) {
|
|
9
|
+
return Object.values(r).flatMap(
|
|
10
|
+
(e) => typeof e == "string" ? [e] : t(e)
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function i() {
|
|
14
|
+
return t(a);
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
a as R,
|
|
18
|
+
i as t
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const RUI_I18N_KEYS: {
|
|
2
|
+
readonly dateTimePicker: {
|
|
3
|
+
readonly dateAfterMax: "rui.date_time_picker.date_after_max";
|
|
4
|
+
readonly dateBeforeMin: "rui.date_time_picker.date_before_min";
|
|
5
|
+
readonly dateInFuture: "rui.date_time_picker.date_in_future";
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves all translation keys available in the library.
|
|
10
|
+
*
|
|
11
|
+
* @return {string[]} An array of strings representing flattened translation keys.
|
|
12
|
+
*/
|
|
13
|
+
export declare function translationKeys(): string[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { h as b, i as u, R as s, b as f, T as m, I as p } from "./composables/index-DggmQIbL.js";
|
|
2
|
+
import "./types/index-CN6Ip1GL.js";
|
|
3
|
+
import i from "dayjs";
|
|
4
|
+
import { u as c, h as n } from "./vendor-DONK-IZM.js";
|
|
5
|
+
import "./components/index.es.js";
|
|
6
|
+
import "./consts/colors-D563Ic3q.js";
|
|
7
|
+
import "./i18n/keys-CNGXWOJX.js";
|
|
8
|
+
import "./icons/index.es.js";
|
|
9
|
+
import "./icons/icons_1.es.js";
|
|
10
|
+
import "./icons/icons_2.es.js";
|
|
11
|
+
import "./icons/icons_3.es.js";
|
|
12
|
+
import "./icons/icons_4.es.js";
|
|
13
|
+
function N(t) {
|
|
14
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
15
|
+
}
|
|
16
|
+
function z(t = {}) {
|
|
17
|
+
var r, l;
|
|
18
|
+
const { theme: o } = t, e = Object.freeze({
|
|
19
|
+
icons: u({
|
|
20
|
+
registeredIcons: (r = t.theme) == null ? void 0 : r.icons
|
|
21
|
+
}),
|
|
22
|
+
table: b((l = t.defaults) == null ? void 0 : l.table)
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
defaults: e,
|
|
26
|
+
install: (a) => {
|
|
27
|
+
f().init({ ...o }), a.provide(m, e.table), a.provide(p, e.icons), i.extend(c), i.extend(n);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function C(t) {
|
|
32
|
+
if (!t || typeof t != "object")
|
|
33
|
+
throw new Error("i18nInstance must be an object");
|
|
34
|
+
if (!t.global || typeof t.global != "object")
|
|
35
|
+
throw new Error("i18nInstance must have a global property");
|
|
36
|
+
if (!t.global.t || typeof t.global.t != "function")
|
|
37
|
+
throw new Error("i18nInstance.global.t must be a function");
|
|
38
|
+
if (!t.global.te || typeof t.global.te != "function")
|
|
39
|
+
throw new Error("i18nInstance.global.te must be a function");
|
|
40
|
+
return {
|
|
41
|
+
install: (o) => {
|
|
42
|
+
o.provide(s, {
|
|
43
|
+
t: t.global.t.bind(t.global),
|
|
44
|
+
te: t.global.te.bind(t.global)
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
C as a,
|
|
51
|
+
z as c,
|
|
52
|
+
N as g
|
|
53
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import '@/style.scss';
|
|
|
6
6
|
export * from './components';
|
|
7
7
|
export * from './composables';
|
|
8
8
|
export { contextColors, type ContextColorsType } from './consts/colors';
|
|
9
|
+
export { translationKeys } from './i18n/keys';
|
|
9
10
|
export * from './icons';
|
|
10
11
|
export { type InitThemeOptions, type ThemeConfig, type ThemeContent, type ThemeData, ThemeMode, } from './types/theme';
|
|
11
12
|
export { StepperState };
|
|
@@ -22,3 +23,6 @@ export declare function createRui(options?: RuiOptions): {
|
|
|
22
23
|
}>;
|
|
23
24
|
install: (app: App) => void;
|
|
24
25
|
};
|
|
26
|
+
export declare function createRuiI8nPlugin(i18nInstance: any): {
|
|
27
|
+
install: (app: App) => void;
|
|
28
|
+
};
|