@rotki/ui-library 2.5.2 → 2.6.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.
@@ -1,7 +1,7 @@
1
1
  import { logicOr as p } from "@vueuse/math";
2
2
  import { computed as m, ref as b } from "vue";
3
3
  import { get as g, objectPick as w, objectOmit as M, set as x } from "@vueuse/shared";
4
- import { c as A } from "../vendor-DQixCxRS.js";
4
+ import { c as A } from "../vendor-Dt9dVBgA.js";
5
5
  import { createGlobalState as C } from "@vueuse/core";
6
6
  class I extends Error {
7
7
  constructor(e) {
@@ -1,4 +1,4 @@
1
- import { g as Vt } from "./index-CIcI4wps.js";
1
+ import { g as Vt } from "./index-BpodgU9n.js";
2
2
  const Ee = /\d/, Pe = ["-", "_", "/", "."];
3
3
  function Le(t = "") {
4
4
  if (!Ee.test(t))
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json.schemastore.org/web-types",
3
3
  "framework": "vue",
4
4
  "name": "@rotki/ui-library",
5
- "version": "2.5.2",
5
+ "version": "2.6.0",
6
6
  "js-types-syntax": "typescript",
7
7
  "description-markup": "markdown",
8
8
  "contributions": {
@@ -3478,6 +3478,16 @@
3478
3478
  "type": "boolean | undefined"
3479
3479
  }
3480
3480
  },
3481
+ {
3482
+ "name": "hide-custom-value",
3483
+ "description": "",
3484
+ "required": false,
3485
+ "default": "false",
3486
+ "value": {
3487
+ "kind": "expression",
3488
+ "type": "boolean | undefined"
3489
+ }
3490
+ },
3481
3491
  {
3482
3492
  "name": "model-value",
3483
3493
  "description": "",
@@ -3491,6 +3501,7 @@
3491
3501
  "name": "search-input",
3492
3502
  "description": "",
3493
3503
  "required": false,
3504
+ "default": "''",
3494
3505
  "value": {
3495
3506
  "kind": "expression",
3496
3507
  "type": "string | undefined"
@@ -3641,7 +3652,7 @@
3641
3652
  "arguments": [
3642
3653
  {
3643
3654
  "name": "argument",
3644
- "type": "[value: string | undefined]"
3655
+ "type": "[value: string]"
3645
3656
  }
3646
3657
  ]
3647
3658
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rotki/ui-library",
3
- "version": "2.5.2",
3
+ "version": "2.6.0",
4
4
  "description": "A vue design system and component library for rotki",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -1,487 +0,0 @@
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-DQixCxRS.js";
3
- import { computed as R, inject as J, ref as y, watch as V, onMounted as ne, watchEffect as ve, nextTick as ee } from "vue";
4
- import { get as e, set as f } from "@vueuse/shared";
5
- import { LuChevronsUpDown as Ce, 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-Cb8kepjw.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
- ]), v = 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(v),
35
- ...Object.fromEntries(w),
36
- name: m,
37
- width: o
38
- };
39
- }
40
- const Ye = [
41
- Ce,
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
- }, v = () => {
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(([C, x]) => {
101
- r.set(`--rui-${C}-darker`, x.darker), r.set(`--rui-${C}-lighter`, x.lighter), r.set(`--rui-${C}-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((C, x) => {
107
- k.setProperty(x, C);
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: v
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), v = 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(v)) == 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
- }, C = (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
- ve((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(v, X), g(X.destroy);
228
- });
229
- }), te([h, c], async () => {
230
- const g = e(v);
231
- e(w) && g && await g.update();
232
- }), {
233
- instance: v,
234
- leavePending: T,
235
- onClose: C,
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: v,
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: C } = 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 = C(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(v)) == null ? void 0 : S.parentElement) {
322
- const E = e(v).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(v).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: C,
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, void 0), 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 vt() {
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 Ct(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
- }, v = () => {
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, C) => {
426
- te(k, (x) => {
427
- const g = x[0].target.getBoundingClientRect(), b = r == null ? void 0 : r.item(C);
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: C,
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 = `${C + 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), v();
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
- vt as f,
482
- Ct as g,
483
- bt as h,
484
- mt as i,
485
- pt as j,
486
- ht as u
487
- };