@rotki/ui-library 2.1.0 → 2.2.1

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.
Files changed (32) hide show
  1. package/README.md +1 -0
  2. package/dist/__test__/transition-group-stub.d.ts +2 -0
  3. package/dist/components/date-time-picker/RuiDateTimePicker.vue.d.ts +79 -0
  4. package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue.d.ts +48 -0
  5. package/dist/components/date-time-picker/timezones.d.ts +1 -0
  6. package/dist/components/date-time-picker/types.d.ts +5 -0
  7. package/dist/components/date-time-picker/use-input-handler.d.ts +9 -0
  8. package/dist/components/date-time-picker/use-keyboard-handler.d.ts +29 -0
  9. package/dist/components/date-time-picker/utils.d.ts +4 -0
  10. package/dist/components/index.d.ts +2 -1
  11. package/dist/components/index.es.js +5063 -3815
  12. package/dist/components/time-picker/RuiTimePicker.vue.d.ts +16 -0
  13. package/dist/composables/{index-DOuH9rdn.js → index-DLKNQD1b.js} +68 -67
  14. package/dist/composables/index.es.js +1 -1
  15. package/dist/icons/icons_1.d.ts +4 -4
  16. package/dist/icons/icons_1.es.js +388 -388
  17. package/dist/icons/icons_2.d.ts +7 -7
  18. package/dist/icons/icons_2.es.js +1024 -1024
  19. package/dist/icons/icons_3.d.ts +9 -9
  20. package/dist/icons/icons_3.es.js +1035 -1035
  21. package/dist/icons/icons_4.d.ts +9 -0
  22. package/dist/icons/icons_4.es.js +320 -284
  23. package/dist/icons/index.d.ts +1 -1
  24. package/dist/icons/index.es.js +1348 -1339
  25. package/dist/index-hpmutpFo.js +32 -0
  26. package/dist/index.es.js +1478 -1482
  27. package/dist/style.css +1 -1
  28. package/dist/utils/{index-CxHG7aHQ.js → index-BOcQQzr3.js} +4 -4
  29. package/dist/vendor-1jxxZILY.js +2051 -0
  30. package/dist/web-types.json +480 -1
  31. package/package.json +31 -35
  32. package/dist/vendor-BeEprDAU.js +0 -1624
@@ -1,4 +1,5 @@
1
1
  import { TimeAccuracy } from '../../consts/time-accuracy';
2
+ export type TimePickerSelection = 'hour' | 'minute' | 'second' | 'millisecond';
2
3
  export interface RuiTimePickerProps {
3
4
  accuracy?: TimeAccuracy;
4
5
  borderless?: boolean;
@@ -6,11 +7,26 @@ export interface RuiTimePickerProps {
6
7
  type __VLS_Props = RuiTimePickerProps;
7
8
  type __VLS_PublicProps = __VLS_Props & {
8
9
  modelValue: Date | undefined;
10
+ 'hour'?: number | undefined;
11
+ 'minute'?: number | undefined;
12
+ 'second'?: number | undefined;
13
+ 'millisecond'?: number | undefined;
14
+ 'selection'?: TimePickerSelection;
9
15
  };
10
16
  declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
17
  "update:modelValue": (value: Date | undefined) => any;
18
+ "update:hour": (value: number | undefined) => any;
19
+ "update:minute": (value: number | undefined) => any;
20
+ "update:second": (value: number | undefined) => any;
21
+ "update:millisecond": (value: number | undefined) => any;
22
+ "update:selection": (value: TimePickerSelection) => any;
12
23
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
24
  "onUpdate:modelValue"?: ((value: Date | undefined) => any) | undefined;
25
+ "onUpdate:hour"?: ((value: number | undefined) => any) | undefined;
26
+ "onUpdate:minute"?: ((value: number | undefined) => any) | undefined;
27
+ "onUpdate:second"?: ((value: number | undefined) => any) | undefined;
28
+ "onUpdate:millisecond"?: ((value: number | undefined) => any) | undefined;
29
+ "onUpdate:selection"?: ((value: TimePickerSelection) => any) | undefined;
14
30
  }>, {
15
31
  borderless: boolean;
16
32
  accuracy: TimeAccuracy;
@@ -1,13 +1,13 @@
1
1
  import { useWindowSize as se, breakpointsTailwind as re, useBreakpoints as ie, createSharedComposable as ce, useColorMode as ae, unrefElement as Y, useResizeObserver as ee, useVirtualList as le, useArrayMap as ue, watchOnce as fe, useEventListener as K, 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 be, g as Le } from "../vendor-BeEprDAU.js";
2
+ import { c as G, p as pe, a as me, b as he, o as ge, f as ye, e as we, g as Le, h as be } from "../vendor-1jxxZILY.js";
3
3
  import { computed as M, inject as te, ref as h, watch as W, onMounted as ne, watchEffect as ve, nextTick as Z } from "vue";
4
4
  import { get as e, set as l } from "@vueuse/shared";
5
- import { LuChevronsUpDown as Ce, LuArrowUp as xe, LuArrowDown as Te, LuArrowLeft as Se, LuArrowRight as ke, LuChevronUp as Ee, LuChevronDown as Pe, LuChevronLeft as Ie, LuChevronRight as Oe, LuChevronsLeft as $e, LuChevronsRight as Be, LuCircleAlert as De, LuCheck as Ae, LuCircleX as Me, LuCircleCheck as Re, LuCheckboxBlank as ze, LuCheckboxFill as He, LuCheckboxIndeterminateFill as _e, LuCheckboxBlankCircle as qe, LuCheckboxBlankCircleFill as je, LuRadioButtonFill as Ue } from "../icons/icons_1.es.js";
6
- import { LuEllipsis as Ve, LuInfo as We, LuEye as Fe, LuEyeOff as Ne } from "../icons/icons_2.es.js";
7
- import { LuTriangleAlert as Xe, LuX as Ke } from "../icons/icons_4.es.js";
8
- import { e as Ge } from "../utils/index-CxHG7aHQ.js";
5
+ import { LuChevronsUpDown as Ce, LuArrowUp as xe, LuArrowDown as Te, LuArrowLeft as Se, LuArrowRight as ke, LuChevronUp as Ee, LuChevronDown as Pe, LuChevronLeft as Ie, LuChevronRight as Oe, LuChevronsLeft as $e, LuChevronsRight as Be, LuCircleAlert as De, LuCheck as Ae, LuCircleX as Me, LuCircleCheck as Re, LuCheckboxBlank as ze, LuCheckboxFill as He, LuCheckboxIndeterminateFill as _e, LuCheckboxBlankCircle as qe, LuCheckboxBlankCircleFill as je, LuRadioButtonFill as Ue, LuClock as Ve } from "../icons/icons_1.es.js";
6
+ import { LuEllipsis as We, LuInfo as Fe, LuEye as Ne, LuEyeOff as Xe } from "../icons/icons_2.es.js";
7
+ import { LuTriangleAlert as Ke, LuX as Ge } from "../icons/icons_4.es.js";
8
+ import { c as Je } from "../utils/index-BOcQQzr3.js";
9
9
  import { d as oe, T as O } from "../types/index-CN6Ip1GL.js";
10
- function ft() {
10
+ function dt() {
11
11
  const { width: r } = se(), f = {
12
12
  xs: 0,
13
13
  ...re
@@ -37,12 +37,12 @@ function ft() {
37
37
  width: r
38
38
  };
39
39
  }
40
- const Je = [
40
+ const Qe = [
41
41
  Ce,
42
- Ve,
43
- Xe,
44
- Ke,
45
42
  We,
43
+ Ke,
44
+ Ge,
45
+ Fe,
46
46
  xe,
47
47
  Te,
48
48
  Se,
@@ -54,8 +54,8 @@ const Je = [
54
54
  $e,
55
55
  Be,
56
56
  De,
57
- Fe,
58
57
  Ne,
58
+ Xe,
59
59
  Ae,
60
60
  Me,
61
61
  Re,
@@ -64,26 +64,27 @@ const Je = [
64
64
  _e,
65
65
  qe,
66
66
  je,
67
- Ue
68
- ], Qe = Symbol.for("rui:icons");
69
- function dt(r) {
67
+ Ue,
68
+ Ve
69
+ ], Ye = Symbol.for("rui:icons");
70
+ function pt(r) {
70
71
  const f = (r == null ? void 0 : r.registeredIcons) || [];
71
72
  return {
72
73
  registeredIcons: {
73
74
  ...Object.fromEntries(
74
75
  [
75
- ...Je,
76
+ ...Qe,
76
77
  ...f
77
78
  ].map(({ components: p, name: y }) => [y, p])
78
79
  )
79
80
  }
80
81
  };
81
82
  }
82
- function pt() {
83
- const r = te(Qe);
84
- return Ge(r, "Could not find icons injection"), r;
83
+ function mt() {
84
+ const r = te(Ye);
85
+ return Je(r, "Could not find icons injection"), r;
85
86
  }
86
- const V = h({ ...oe }), mt = ce(() => {
87
+ const V = h({ ...oe }), ht = ce(() => {
87
88
  const { state: r, store: f } = ae(), p = M(() => e(f) === O.auto), y = M(() => e(r) === O.light), c = M(() => e(r) === O.dark), g = M(() => e(y) ? e(V).light : e(V).dark), i = (n) => {
88
89
  l(f, n || O.auto);
89
90
  }, v = () => {
@@ -128,18 +129,18 @@ const V = h({ ...oe }), mt = ce(() => {
128
129
  resize: !0,
129
130
  scroll: !0,
130
131
  strategy: "absolute"
131
- }, Ye = pe({
132
+ }, Ze = pe({
132
133
  defaultModifiers: [
133
134
  ...me,
134
135
  he,
135
136
  ge,
136
137
  ye,
137
138
  we,
138
- be,
139
- Le
139
+ Le,
140
+ be
140
141
  ]
141
142
  });
142
- function ht(r, f = h(!1), p = h(0), y = h(0), c) {
143
+ function gt(r, f = h(!1), p = h(0), y = h(0), c) {
143
144
  const g = h(null), i = h(null), v = h(null), w = h(!1), d = h(), n = h(), a = h(!1), x = h(!1), o = () => {
144
145
  l(a, !1);
145
146
  }, u = () => {
@@ -148,17 +149,17 @@ function ht(r, f = h(!1), p = h(0), y = h(0), c) {
148
149
  }, P = (m = !1) => {
149
150
  if (!e(f) && (e(n) && (clearTimeout(e(n)), l(n, void 0)), l(x, !1), !e(d))) {
150
151
  l(a, !0);
151
- const L = setTimeout(() => {
152
+ const b = setTimeout(() => {
152
153
  l(w, !0), l(d, void 0);
153
154
  }, m ? 0 : e(p));
154
- l(d, L);
155
+ l(d, b);
155
156
  }
156
157
  }, C = (m = !1) => {
157
158
  if (!e(f) && (e(d) && (clearTimeout(e(d)), l(d, void 0)), !e(n))) {
158
- const L = setTimeout(() => {
159
+ const b = setTimeout(() => {
159
160
  e(w) || o(), l(w, !1), l(n, void 0);
160
161
  }, m ? 0 : e(y));
161
- l(n, L);
162
+ l(n, b);
162
163
  }
163
164
  }, T = () => {
164
165
  l(x, !0);
@@ -167,21 +168,21 @@ function ht(r, f = h(!1), p = h(0), y = h(0), c) {
167
168
  ve((m) => {
168
169
  if (!e(i) || !e(g) && !e(c))
169
170
  return;
170
- const L = Y(i), B = e(c) || Y(g);
171
- if (!(L instanceof HTMLElement) || !B)
171
+ const b = Y(i), B = e(c) || Y(g);
172
+ if (!(b instanceof HTMLElement) || !B)
172
173
  return;
173
174
  const {
174
175
  adaptive: R = $.adaptive,
175
176
  gpuAcceleration: E = $.gpuAcceleration,
176
177
  locked: z = $.locked,
177
- offsetDistance: b = $.offsetDistance,
178
+ offsetDistance: L = $.offsetDistance,
178
179
  offsetSkid: F = $.offsetSkid,
179
180
  overflowPadding: j = $.overflowPadding,
180
181
  placement: U = $.placement,
181
182
  resize: H = $.resize,
182
183
  scroll: _ = $.scroll,
183
184
  strategy: N = $.strategy
184
- } = e(r), X = Ye(B, L, {
185
+ } = e(r), X = Ze(B, b, {
185
186
  modifiers: [
186
187
  {
187
188
  enabled: !z,
@@ -196,7 +197,7 @@ function ht(r, f = h(!1), p = h(0), y = h(0), c) {
196
197
  {
197
198
  name: "offset",
198
199
  options: {
199
- offset: [F, b]
200
+ offset: [F, L]
200
201
  }
201
202
  },
202
203
  {
@@ -242,7 +243,7 @@ function ht(r, f = h(!1), p = h(0), y = h(0), c) {
242
243
  updatePopper: u
243
244
  };
244
245
  }
245
- function Ze({
246
+ function et({
246
247
  keyAttr: r,
247
248
  textAttr: f
248
249
  }) {
@@ -258,7 +259,7 @@ function Ze({
258
259
  getText: p
259
260
  };
260
261
  }
261
- function gt({
262
+ function yt({
262
263
  appendWidth: r,
263
264
  autoFocus: f,
264
265
  autoSelectFirst: p,
@@ -277,10 +278,10 @@ function gt({
277
278
  const u = M(() => {
278
279
  const t = e(w);
279
280
  return c ? t.filter((s) => !H(s)) : t;
280
- }), { getIdentifier: P, getText: C } = Ze({
281
+ }), { getIdentifier: P, getText: C } = et({
281
282
  keyAttr: i,
282
283
  textAttr: x
283
- }), { containerProps: T, list: m, scrollTo: L, wrapperProps: B } = le(
284
+ }), { containerProps: T, list: m, scrollTo: b, wrapperProps: B } = le(
284
285
  u,
285
286
  {
286
287
  itemHeight: g,
@@ -289,7 +290,7 @@ function gt({
289
290
  ), R = ue(m, ({ data: t, index: s }) => ({ _index: s, item: t })), E = h(!1), z = M(() => {
290
291
  const t = e(o);
291
292
  return !i || !t ? t : Array.isArray(t) ? t.map((s) => s[i]) : t[i];
292
- }), b = h(e(p) ? 0 : -1), F = M(() => {
293
+ }), L = h(e(p) ? 0 : -1), F = M(() => {
293
294
  const t = { max: 0, min: 0 }, s = 30, I = 1.5, S = e(y) ? 12 : 13;
294
295
  e(u).forEach((D) => {
295
296
  var J, Q;
@@ -314,14 +315,14 @@ function gt({
314
315
  return U(t) !== -1;
315
316
  }
316
317
  async function _(t = !1) {
317
- const s = e(b);
318
+ const s = e(L);
318
319
  s > -1 && await Z(() => {
319
320
  var S, q;
320
321
  if ((S = e(v)) == null ? void 0 : S.parentElement) {
321
322
  const k = e(v).getElementsByClassName("highlighted")[0];
322
323
  if (k)
323
324
  (q = k.scrollIntoView) == null || q.call(k, { behavior: t ? "smooth" : "auto", block: "nearest" }), e(f) && "focus" in k && typeof k.focus == "function" && (k == null || k.focus());
324
- else if (L(s), e(f)) {
325
+ else if (b(s), e(f)) {
325
326
  const D = e(v).getElementsByClassName("highlighted")[0];
326
327
  D && "focus" in D && typeof D.focus == "function" && D.focus();
327
328
  }
@@ -334,7 +335,7 @@ function gt({
334
335
  const s = e(o);
335
336
  if (Array.isArray(s) && s.length > 0 || s) {
336
337
  const I = e(u).findIndex(H);
337
- I > -1 && l(b, I);
338
+ I > -1 && l(L, I);
338
339
  }
339
340
  fe(m, async () => {
340
341
  await _();
@@ -342,15 +343,15 @@ function gt({
342
343
  }
343
344
  });
344
345
  }
345
- return W(E, N), W(b, async (t, s) => {
346
+ return W(E, N), W(L, async (t, s) => {
346
347
  t !== s && await _(!0);
347
348
  }), W(u, async () => {
348
- e(b) !== -1 ? e(p) ? (l(b, 0), await _()) : (l(b, -1), L(0)) : L(0);
349
+ e(L) !== -1 ? e(p) ? (l(L, 0), await _()) : (l(L, -1), b(0)) : b(0);
349
350
  }), {
350
351
  applyHighlighted: () => {
351
352
  if (!a || !e(E))
352
353
  return;
353
- const t = e(b);
354
+ const t = e(L);
354
355
  if (t === -1)
355
356
  return;
356
357
  const s = e(u).find((I, S) => t === S);
@@ -359,7 +360,7 @@ function gt({
359
360
  containerProps: T,
360
361
  getIdentifier: P,
361
362
  getText: C,
362
- highlightedIndex: b,
363
+ highlightedIndex: L,
363
364
  isActiveItem: H,
364
365
  isOpen: E,
365
366
  itemIndexInValue: U,
@@ -369,10 +370,10 @@ function gt({
369
370
  j(!0);
370
371
  return;
371
372
  }
372
- let s = e(b);
373
+ let s = e(L);
373
374
  s += t ? -1 : 1;
374
375
  const S = e(u).length;
375
- s >= S ? l(b, 0) : s < 0 ? l(b, S - 1) : l(b, s);
376
+ s >= S ? l(L, 0) : s < 0 ? l(L, S - 1) : l(L, s);
376
377
  },
377
378
  optionsWithSelectedHidden: u,
378
379
  renderedData: R,
@@ -381,8 +382,8 @@ function gt({
381
382
  wrapperProps: B
382
383
  };
383
384
  }
384
- const et = Symbol.for("rui:table");
385
- function yt(r) {
385
+ const tt = Symbol.for("rui:table");
386
+ function wt(r) {
386
387
  return {
387
388
  globalItemsPerPage: !1,
388
389
  itemsPerPage: h(10),
@@ -391,8 +392,8 @@ function yt(r) {
391
392
  ...r
392
393
  };
393
394
  }
394
- function wt() {
395
- const r = te(et);
395
+ function Lt() {
396
+ const r = te(tt);
396
397
  if (!r)
397
398
  throw new Error("Could not find rui table options injection");
398
399
  return r;
@@ -415,8 +416,8 @@ function bt(r = h(!1), f) {
415
416
  ), u = n == null ? void 0 : n.querySelectorAll(i.th);
416
417
  u == null || u.forEach((P, C) => {
417
418
  ee(P, (T) => {
418
- const m = T[0].target.getBoundingClientRect(), L = o == null ? void 0 : o.item(C);
419
- L && (L.style.width = `${m.width}px`);
419
+ const m = T[0].target.getBoundingClientRect(), b = o == null ? void 0 : o.item(C);
420
+ b && (b.style.width = `${m.width}px`);
420
421
  });
421
422
  });
422
423
  };
@@ -442,13 +443,13 @@ function bt(r = h(!1), f) {
442
443
  height: P,
443
444
  left: C,
444
445
  width: T
445
- } = x, { bottom: m, top: L } = n, B = e(f) ?? 0;
446
+ } = x, { bottom: m, top: b } = n, B = e(f) ?? 0;
446
447
  o.style.width = `${T}px`;
447
448
  const R = d.querySelectorAll(i.row), E = (z = R.item(R.length - 1)) == null ? void 0 : z.getBoundingClientRect();
448
- if (L <= B && m > B && R.length > 1) {
449
+ if (b <= B && m > B && R.length > 1) {
449
450
  l(c, !0), o.style.left = `${C + g}px`;
450
- const b = (E == null ? void 0 : E.height) ?? 0;
451
- m <= b + P + B ? o.style.top = `${m - b - P}px` : o.style.top = `${B}px`;
451
+ const L = (E == null ? void 0 : E.height) ?? 0;
452
+ m <= L + P + B ? o.style.top = `${m - L - P}px` : o.style.top = `${B}px`;
452
453
  } else
453
454
  l(c, !1), o.style.left = `${g}px`, o.style.top = "0";
454
455
  };
@@ -461,16 +462,16 @@ function bt(r = h(!1), f) {
461
462
  };
462
463
  }
463
464
  export {
464
- Qe as I,
465
- et as T,
466
- ht as a,
467
- mt as b,
468
- Ze as c,
469
- gt as d,
470
- wt as e,
465
+ Ye as I,
466
+ tt as T,
467
+ gt as a,
468
+ ht as b,
469
+ et as c,
470
+ yt as d,
471
+ Lt as e,
471
472
  bt as f,
472
- yt as g,
473
- dt as h,
474
- ft as i,
475
- pt as u
473
+ wt as g,
474
+ pt as h,
475
+ dt as i,
476
+ mt as u
476
477
  };
@@ -1,4 +1,4 @@
1
- import { i as o, u as a, b as u } from "./index-DOuH9rdn.js";
1
+ import { i as o, u as a, b as u } from "./index-DLKNQD1b.js";
2
2
  export {
3
3
  o as useBreakpoint,
4
4
  a as useIcons,
@@ -326,6 +326,7 @@ export declare const LuCarFront: GeneratedIcon;
326
326
  export declare const LuCarTaxiFront: GeneratedIcon;
327
327
  export declare const LuCar: GeneratedIcon;
328
328
  export declare const LuCaravan: GeneratedIcon;
329
+ export declare const LuCardSim: GeneratedIcon;
329
330
  export declare const LuCarrot: GeneratedIcon;
330
331
  export declare const LuCaseLower: GeneratedIcon;
331
332
  export declare const LuCaseSensitive: GeneratedIcon;
@@ -359,6 +360,7 @@ export declare const LuChartPie: GeneratedIcon;
359
360
  export declare const LuChartScatter: GeneratedIcon;
360
361
  export declare const LuChartSpline: GeneratedIcon;
361
362
  export declare const LuCheckCheck: GeneratedIcon;
363
+ export declare const LuCheckLine: GeneratedIcon;
362
364
  export declare const LuCheck: GeneratedIcon;
363
365
  export declare const LuChefHat: GeneratedIcon;
364
366
  export declare const LuCherry: GeneratedIcon;
@@ -415,6 +417,7 @@ export declare const LuCirclePause: GeneratedIcon;
415
417
  export declare const LuCirclePercent: GeneratedIcon;
416
418
  export declare const LuCirclePlay: GeneratedIcon;
417
419
  export declare const LuCirclePlus: GeneratedIcon;
420
+ export declare const LuCirclePoundSterling: GeneratedIcon;
418
421
  export declare const LuCirclePower: GeneratedIcon;
419
422
  export declare const LuCircleSlash2: GeneratedIcon;
420
423
  export declare const LuCircleSlash: GeneratedIcon;
@@ -457,6 +460,7 @@ export declare const LuClockFading: GeneratedIcon;
457
460
  export declare const LuClockPlus: GeneratedIcon;
458
461
  export declare const LuClock: GeneratedIcon;
459
462
  export declare const LuCloudAlert: GeneratedIcon;
463
+ export declare const LuCloudCheck: GeneratedIcon;
460
464
  export declare const LuCloudCog: GeneratedIcon;
461
465
  export declare const LuCloudDownload: GeneratedIcon;
462
466
  export declare const LuCloudDrizzle: GeneratedIcon;
@@ -495,7 +499,3 @@ export declare const LuComputer: GeneratedIcon;
495
499
  export declare const LuConciergeBell: GeneratedIcon;
496
500
  export declare const LuCone: GeneratedIcon;
497
501
  export declare const LuConstruction: GeneratedIcon;
498
- export declare const LuContactRound: GeneratedIcon;
499
- export declare const LuContact: GeneratedIcon;
500
- export declare const LuContainer: GeneratedIcon;
501
- export declare const LuContrast: GeneratedIcon;