@rotki/ui-library 2.1.0 → 2.2.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 +1 -0
- package/dist/__test__/transition-group-stub.d.ts +2 -0
- package/dist/components/date-time-picker/RuiDateTimePicker.vue.d.ts +79 -0
- package/dist/components/date-time-picker/RuiDateTimePickerMenu.vue.d.ts +48 -0
- package/dist/components/date-time-picker/timezones.d.ts +1 -0
- package/dist/components/date-time-picker/types.d.ts +5 -0
- package/dist/components/date-time-picker/use-input-handler.d.ts +9 -0
- package/dist/components/date-time-picker/use-keyboard-handler.d.ts +29 -0
- package/dist/components/date-time-picker/utils.d.ts +4 -0
- package/dist/components/index.es.js +2131 -2127
- package/dist/components/time-picker/RuiTimePicker.vue.d.ts +16 -0
- package/dist/composables/{index-DOuH9rdn.js → index-iDflJtNX.js} +2 -2
- package/dist/composables/index.es.js +1 -1
- package/dist/icons/icons_1.d.ts +4 -4
- package/dist/icons/icons_1.es.js +388 -388
- package/dist/icons/icons_2.d.ts +7 -7
- package/dist/icons/icons_2.es.js +1024 -1024
- package/dist/icons/icons_3.d.ts +9 -9
- package/dist/icons/icons_3.es.js +1035 -1035
- package/dist/icons/icons_4.d.ts +9 -0
- package/dist/icons/icons_4.es.js +320 -284
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.es.js +1348 -1339
- package/dist/index-CIC9boM_.js +32 -0
- package/dist/index.es.js +1694 -1699
- package/dist/style.css +1 -1
- package/dist/utils/{index-CxHG7aHQ.js → index-CTepEwum.js} +1 -1
- package/dist/vendor-D4VGlT8H.js +2051 -0
- package/dist/web-types.json +480 -1
- package/package.json +31 -35
- package/dist/vendor-BeEprDAU.js +0 -1624
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ A Vue component library and design system for rotki
|
|
|
5
5
|
[](https://www.npmjs.com/package/@rotki/ui-library)
|
|
6
6
|
[](https://github.com/rotki/ui-library/actions/workflows/ci.yml)
|
|
7
7
|
[](https://codecov.io/gh/rotki/ui-library)
|
|
8
|
+
[](https://github.com/rotki/ui-library/blob/main/LICENSE.md)
|
|
8
9
|
|
|
9
10
|
## Getting started
|
|
10
11
|
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { TimeAccuracy } from '../../consts/time-accuracy';
|
|
2
|
+
type DateFormat = 'year-first' | 'month-first' | 'day-first';
|
|
3
|
+
type DateTimeModelType = 'date' | 'epoch-ms' | 'epoch';
|
|
4
|
+
type ModelValueType<T extends DateTimeModelType> = T extends 'date' ? Date | undefined : T extends 'epoch-ms' ? number | undefined : T extends 'epoch' ? number | undefined : Date | number | undefined;
|
|
5
|
+
export interface RuiDateTimePickerProps {
|
|
6
|
+
minDate?: Date | number;
|
|
7
|
+
maxDate?: Date | number;
|
|
8
|
+
format?: DateFormat;
|
|
9
|
+
type?: DateTimeModelType;
|
|
10
|
+
accuracy?: TimeAccuracy;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
allowEmpty?: boolean;
|
|
13
|
+
readonly?: boolean;
|
|
14
|
+
dense?: boolean;
|
|
15
|
+
label?: string;
|
|
16
|
+
variant?: 'default' | 'filled' | 'outlined';
|
|
17
|
+
hint?: string;
|
|
18
|
+
errorMessages?: string | string[];
|
|
19
|
+
successMessages?: string | string[];
|
|
20
|
+
hideDetails?: boolean;
|
|
21
|
+
}
|
|
22
|
+
type __VLS_Props = RuiDateTimePickerProps;
|
|
23
|
+
declare const props: Readonly<{}> & {
|
|
24
|
+
readonly disabled: boolean;
|
|
25
|
+
readonly readonly: boolean;
|
|
26
|
+
readonly allowEmpty: boolean;
|
|
27
|
+
readonly dense: boolean;
|
|
28
|
+
readonly type: DateTimeModelType;
|
|
29
|
+
readonly hideDetails: boolean;
|
|
30
|
+
readonly label: string;
|
|
31
|
+
readonly variant: "default" | "outlined" | "filled";
|
|
32
|
+
readonly hint: string | undefined;
|
|
33
|
+
readonly maxDate: number | Date | undefined;
|
|
34
|
+
readonly minDate: number | Date | undefined;
|
|
35
|
+
readonly format: DateFormat;
|
|
36
|
+
readonly accuracy: TimeAccuracy;
|
|
37
|
+
readonly errorMessages: string | string[];
|
|
38
|
+
readonly successMessages: string | string[];
|
|
39
|
+
} & {
|
|
40
|
+
readonly readonly: boolean;
|
|
41
|
+
readonly disabled: boolean;
|
|
42
|
+
readonly hideDetails: boolean;
|
|
43
|
+
readonly dense: boolean;
|
|
44
|
+
readonly allowEmpty: boolean;
|
|
45
|
+
};
|
|
46
|
+
type __VLS_Slots = {
|
|
47
|
+
'menu-content': () => any;
|
|
48
|
+
};
|
|
49
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
50
|
+
modelValue: ModelValueType<typeof props.type>;
|
|
51
|
+
};
|
|
52
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
53
|
+
"update:modelValue": (value: number | Date | undefined) => any;
|
|
54
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
55
|
+
"onUpdate:modelValue"?: ((value: number | Date | undefined) => any) | undefined;
|
|
56
|
+
}>, {
|
|
57
|
+
readonly: boolean;
|
|
58
|
+
variant: "default" | "filled" | "outlined";
|
|
59
|
+
type: DateTimeModelType;
|
|
60
|
+
label: string;
|
|
61
|
+
disabled: boolean;
|
|
62
|
+
errorMessages: string | string[];
|
|
63
|
+
successMessages: string | string[];
|
|
64
|
+
hint: string;
|
|
65
|
+
hideDetails: boolean;
|
|
66
|
+
dense: boolean;
|
|
67
|
+
maxDate: Date | number;
|
|
68
|
+
minDate: Date | number;
|
|
69
|
+
allowEmpty: boolean;
|
|
70
|
+
accuracy: TimeAccuracy;
|
|
71
|
+
format: DateFormat;
|
|
72
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
73
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
74
|
+
export default _default;
|
|
75
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
76
|
+
new (): {
|
|
77
|
+
$slots: S;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { TimeAccuracy } from '../../consts/time-accuracy';
|
|
2
|
+
import { type TimePickerSelection } from '../../components/time-picker/RuiTimePicker.vue';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
accuracy: TimeAccuracy;
|
|
5
|
+
maxDate?: Date | number;
|
|
6
|
+
minDate?: Date | number;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_Slots = {
|
|
9
|
+
default: () => any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
12
|
+
'selectedDate': Date | undefined;
|
|
13
|
+
'selectedTime': Date | undefined;
|
|
14
|
+
'selectedHour': number | undefined;
|
|
15
|
+
'selectedMinute': number | undefined;
|
|
16
|
+
'selectedSecond': number | undefined;
|
|
17
|
+
'selectedMillisecond': number | undefined;
|
|
18
|
+
'timeSelection': TimePickerSelection;
|
|
19
|
+
'selectedTimezone': string | undefined;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
"set-now": () => any;
|
|
23
|
+
"update:selectedDate": (value: Date | undefined) => any;
|
|
24
|
+
"update:selectedTime": (value: Date | undefined) => any;
|
|
25
|
+
"update:selectedHour": (value: number | undefined) => any;
|
|
26
|
+
"update:selectedMinute": (value: number | undefined) => any;
|
|
27
|
+
"update:selectedSecond": (value: number | undefined) => any;
|
|
28
|
+
"update:selectedMillisecond": (value: number | undefined) => any;
|
|
29
|
+
"update:timeSelection": (value: TimePickerSelection) => any;
|
|
30
|
+
"update:selectedTimezone": (value: string | undefined) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
"onSet-now"?: (() => any) | undefined;
|
|
33
|
+
"onUpdate:selectedDate"?: ((value: Date | undefined) => any) | undefined;
|
|
34
|
+
"onUpdate:selectedTime"?: ((value: Date | undefined) => any) | undefined;
|
|
35
|
+
"onUpdate:selectedHour"?: ((value: number | undefined) => any) | undefined;
|
|
36
|
+
"onUpdate:selectedMinute"?: ((value: number | undefined) => any) | undefined;
|
|
37
|
+
"onUpdate:selectedSecond"?: ((value: number | undefined) => any) | undefined;
|
|
38
|
+
"onUpdate:selectedMillisecond"?: ((value: number | undefined) => any) | undefined;
|
|
39
|
+
"onUpdate:timeSelection"?: ((value: TimePickerSelection) => any) | undefined;
|
|
40
|
+
"onUpdate:selectedTimezone"?: ((value: string | undefined) => any) | undefined;
|
|
41
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
43
|
+
export default _default;
|
|
44
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
45
|
+
new (): {
|
|
46
|
+
$slots: S;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const timezones: string[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
export declare const DATE_TIME_SEGMENT_TYPES: readonly ["DD", "MM", "YYYY", "hh", "mm", "ss", "SSS"];
|
|
3
|
+
export type DateTimeSegmentType = typeof DATE_TIME_SEGMENT_TYPES[number];
|
|
4
|
+
export declare function isDateTimeSegmentType(value: string): value is DateTimeSegmentType;
|
|
5
|
+
export type SegmentData = Record<DateTimeSegmentType, Ref<number | undefined>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DateTimeSegmentType, SegmentData } from '../../components/date-time-picker/types';
|
|
2
|
+
import type { TimeAccuracy } from '../../consts/time-accuracy';
|
|
3
|
+
import type { Dayjs } from 'dayjs';
|
|
4
|
+
import type { Ref } from 'vue';
|
|
5
|
+
export declare function useInputHandler(data: SegmentData, currentValue: Ref<number | undefined>): {
|
|
6
|
+
getCurrent: (segment: DateTimeSegmentType) => number | undefined;
|
|
7
|
+
setValue: (segment: DateTimeSegmentType, value?: number) => void;
|
|
8
|
+
update: (date: Dayjs, accuracy: TimeAccuracy) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Dayjs } from 'dayjs';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
import { type DateTimeSegmentType } from '../../components/date-time-picker/types';
|
|
4
|
+
interface Segment {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
type: DateTimeSegmentType;
|
|
8
|
+
}
|
|
9
|
+
interface KeyboardHandlerOptions {
|
|
10
|
+
dateFormat: Ref<string>;
|
|
11
|
+
cursorPosition: Ref<number>;
|
|
12
|
+
currentValue: Ref<number | undefined>;
|
|
13
|
+
textInput: Ref<HTMLInputElement | undefined>;
|
|
14
|
+
setValue: (segment: DateTimeSegmentType, value?: number) => void;
|
|
15
|
+
getCurrent: (segment: DateTimeSegmentType) => number | undefined;
|
|
16
|
+
getDateTime: () => Dayjs;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
readonly: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare function useKeyboardHandler(options: KeyboardHandlerOptions): {
|
|
21
|
+
clear: (segmentType?: string) => void;
|
|
22
|
+
getCurrentSegment: (position?: number) => Segment | undefined;
|
|
23
|
+
handleClick: (event: MouseEvent) => void;
|
|
24
|
+
handleFocus: () => void;
|
|
25
|
+
handleInputSelection: (event: Event) => void;
|
|
26
|
+
handleKeyDown: (event: KeyboardEvent) => void;
|
|
27
|
+
setSegment: (segmentType: DateTimeSegmentType) => void;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TimeAccuracy } from '../../consts/time-accuracy';
|
|
2
|
+
export declare function guessTimezone(): string | undefined;
|
|
3
|
+
export declare function includeSeconds(accuracy: TimeAccuracy): boolean;
|
|
4
|
+
export declare function includeMilliseconds(accuracy: TimeAccuracy): boolean;
|