@rotki/ui-library 0.9.0 → 0.10.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/components/chips/Chip.vue.d.ts +3 -0
- package/dist/components/forms/text-field/TextField.vue.d.ts +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.es.js +36 -34
- package/dist/components/tables/DataTable.vue.d.ts +107 -65
- package/dist/components/tables/TableHead.vue.d.ts +113 -0
- package/dist/composables/breakpoint.d.ts +1 -0
- package/dist/composables/defaults/table.d.ts +1 -0
- package/dist/composables/index.d.ts +1 -0
- package/dist/composables/index.es.js +84 -7
- package/dist/composables/sticky-header.d.ts +1 -1
- package/dist/icons/icons_1.d.ts +501 -0
- package/dist/icons/icons_1.es.js +2003 -0
- package/dist/icons/icons_2.d.ts +501 -0
- package/dist/icons/icons_2.es.js +2003 -0
- package/dist/icons/icons_3.d.ts +501 -0
- package/dist/icons/icons_3.es.js +2003 -0
- package/dist/icons/icons_4.d.ts +501 -0
- package/dist/icons/icons_4.es.js +2003 -0
- package/dist/icons/icons_5.d.ts +501 -0
- package/dist/icons/icons_5.es.js +2003 -0
- package/dist/icons/icons_6.d.ts +239 -0
- package/dist/icons/icons_6.es.js +955 -0
- package/dist/icons/index.d.ts +7 -0
- package/dist/icons/index.es.js +2746 -0
- package/dist/index-2kT4UFtO.js +7193 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +2761 -2614
- package/dist/style.css +1 -1
- package/dist/{index-W2poXQa4.js → theme-V5yenaDk.js} +20 -18
- package/package.json +43 -43
- package/dist/all-icons.d.ts +0 -2600
- package/dist/all-icons.es.js +0 -10395
- package/dist/index-XP-zcLsF.js +0 -6344
|
@@ -35,6 +35,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
35
35
|
};
|
|
36
36
|
tile: {
|
|
37
37
|
type: globalThis.PropType<boolean>;
|
|
38
|
+
default: boolean;
|
|
38
39
|
};
|
|
39
40
|
clickable: {
|
|
40
41
|
type: globalThis.PropType<boolean>;
|
|
@@ -78,6 +79,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
78
79
|
};
|
|
79
80
|
tile: {
|
|
80
81
|
type: globalThis.PropType<boolean>;
|
|
82
|
+
default: boolean;
|
|
81
83
|
};
|
|
82
84
|
clickable: {
|
|
83
85
|
type: globalThis.PropType<boolean>;
|
|
@@ -104,6 +106,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
104
106
|
size: "sm" | "md";
|
|
105
107
|
disabled: boolean;
|
|
106
108
|
textColor: string;
|
|
109
|
+
tile: boolean;
|
|
107
110
|
clickable: boolean;
|
|
108
111
|
closeable: boolean;
|
|
109
112
|
closeIcon: RuiIcons;
|
|
@@ -165,10 +165,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
165
165
|
};
|
|
166
166
|
}>> & {
|
|
167
167
|
onBlur?: ((event: Event) => any) | undefined;
|
|
168
|
+
onClear?: (() => any) | undefined;
|
|
168
169
|
"onUpdate:modelValue"?: ((modelValue: string) => any) | undefined;
|
|
169
170
|
"onFocus-input"?: ((event: Event) => any) | undefined;
|
|
170
171
|
onRemove?: ((value: unknown) => any) | undefined;
|
|
171
|
-
onClear?: (() => any) | undefined;
|
|
172
172
|
}, {
|
|
173
173
|
readonly: boolean;
|
|
174
174
|
variant: "default" | "outlined" | "filled";
|
|
@@ -19,7 +19,8 @@ import { type RadioProps as RadioProps, default as RuiRadio } from '../component
|
|
|
19
19
|
import { type Props as RevealableTextFieldProps, default as RuiRevealableTextField } from '../components/forms/revealable-text-field/RevealableTextField.vue';
|
|
20
20
|
import { type Props as LogoProps, default as RuiLogo } from '../components/logos/Logo.vue';
|
|
21
21
|
import { default as RuiSimpleSelect, type Props as SimpleSelectProps } from '../components/forms/select/SimpleSelect.vue';
|
|
22
|
-
import { type TableColumn as DataTableColumn, type
|
|
22
|
+
import { type TableColumn as DataTableColumn, type GroupKeys as DataTableGroupKeys, type SortColumn as DataTableSortColumn, type TableSortData as DataTableSortData } from '../components/tables/TableHead.vue';
|
|
23
|
+
import { type TableOptions as DataTableOptions, type Props as DataTableProps, default as RuiDataTable } from '../components/tables/DataTable.vue';
|
|
23
24
|
import { type Props as ExpandButtonProps, default as RuiTableRowExpander } from '../components/tables/ExpandButton.vue';
|
|
24
25
|
import { default as RuiTablePagination, type TablePaginationData, type Props as TablePaginationProps } from '../components/tables/TablePagination.vue';
|
|
25
26
|
import { type Props as CardProps, default as RuiCard } from '../components/cards/Card.vue';
|
|
@@ -29,4 +30,4 @@ import { default as RuiTab, type Props as TabProps } from '../components/tabs/ta
|
|
|
29
30
|
import { default as RuiTabItems, type Props as TabItemsProps } from '../components/tabs/tab-items/TabItems.vue';
|
|
30
31
|
import { default as RuiTabItem, type Props as TabItemProps } from '../components/tabs/tab-item/TabItem.vue';
|
|
31
32
|
import { default as RuiSkeletonLoader, type Props as SkeletonLoaderProps } from '../components/loaders/Skeleton.vue';
|
|
32
|
-
export { RuiAlert, RuiAutoComplete, RuiBadge, RuiButton, RuiButtonGroup, RuiCheckbox, RuiChip, RuiFooterStepper, RuiIcon, RuiLogo, RuiProgress, RuiRadio, RuiRadioGroup, RuiRevealableTextField, RuiStepper, RuiTextField, RuiTooltip, RuiDataTable, RuiSimpleSelect, RuiDialog, RuiCard, RuiCardHeader, RuiTabs, RuiTab, RuiTabItems, RuiTabItem, RuiTablePagination, RuiSkeletonLoader, RuiTextArea, RuiDivider, RuiTableRowExpander, AutoCompleteProps, ChipProps, TooltipProps, SimpleSelectProps, DataTableProps, DataTableColumn, DataTableSortColumn, DataTableOptions, TablePaginationData, DialogProps, ButtonProps, ButtonGroupProps, CardProps, CardHeaderProps, BadgeProps, AlertProps, CheckboxProps, ProgressProps, RadioGroupProps, RadioProps, LogoProps, StepperProps, TextFieldProps, IconProps, FooterStepperProps, TabsProps, TabProps, TabItemsProps, TabItemProps, TablePaginationProps, RevealableTextFieldProps, SkeletonLoaderProps, DividerProps, TextAreaProps, ExpandButtonProps, };
|
|
33
|
+
export { RuiAlert, RuiAutoComplete, RuiBadge, RuiButton, RuiButtonGroup, RuiCheckbox, RuiChip, RuiFooterStepper, RuiIcon, RuiLogo, RuiProgress, RuiRadio, RuiRadioGroup, RuiRevealableTextField, RuiStepper, RuiTextField, RuiTooltip, RuiDataTable, RuiSimpleSelect, RuiDialog, RuiCard, RuiCardHeader, RuiTabs, RuiTab, RuiTabItems, RuiTabItem, RuiTablePagination, RuiSkeletonLoader, RuiTextArea, RuiDivider, RuiTableRowExpander, AutoCompleteProps, ChipProps, TooltipProps, SimpleSelectProps, DataTableProps, DataTableColumn, DataTableSortColumn, DataTableOptions, TablePaginationData, DialogProps, ButtonProps, ButtonGroupProps, CardProps, CardHeaderProps, BadgeProps, AlertProps, CheckboxProps, ProgressProps, RadioGroupProps, RadioProps, LogoProps, StepperProps, TextFieldProps, IconProps, FooterStepperProps, TabsProps, TabProps, TabItemsProps, TabItemProps, TablePaginationProps, RevealableTextFieldProps, SkeletonLoaderProps, DividerProps, TextAreaProps, ExpandButtonProps, DataTableSortData, DataTableGroupKeys, };
|
|
@@ -1,41 +1,43 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as m, a as d, B as T, b, d as n, m as g, n as x, C, e as S, D as A, l as B, v as D, F, I, _ as c, P as h, R as k, f as v, g as P, k as f, t as E, h as G, p as L, r as j, q, s as w, E as H, o as _, u as y, i as z, j as J } from "../index-2kT4UFtO.js";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "@vueuse/shared";
|
|
4
|
-
import "../
|
|
5
|
-
import "../
|
|
4
|
+
import "../theme-V5yenaDk.js";
|
|
5
|
+
import "../icons/icons_1.es.js";
|
|
6
|
+
import "../icons/icons_2.es.js";
|
|
7
|
+
import "../icons/icons_5.es.js";
|
|
6
8
|
import "@vueuse/core";
|
|
7
9
|
import "../colors-ikihApJv.js";
|
|
8
10
|
import "vue-router";
|
|
9
11
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
12
|
+
m as RuiAlert,
|
|
13
|
+
d as RuiAutoComplete,
|
|
14
|
+
T as RuiBadge,
|
|
15
|
+
b as RuiButton,
|
|
16
|
+
n as RuiButtonGroup,
|
|
17
|
+
g as RuiCard,
|
|
18
|
+
x as RuiCardHeader,
|
|
19
|
+
C as RuiCheckbox,
|
|
20
|
+
S as RuiChip,
|
|
21
|
+
A as RuiDataTable,
|
|
22
|
+
B as RuiDialog,
|
|
23
|
+
D as RuiDivider,
|
|
24
|
+
F as RuiFooterStepper,
|
|
25
|
+
I as RuiIcon,
|
|
26
|
+
c as RuiLogo,
|
|
27
|
+
h as RuiProgress,
|
|
28
|
+
k as RuiRadio,
|
|
29
|
+
v as RuiRadioGroup,
|
|
30
|
+
P as RuiRevealableTextField,
|
|
31
|
+
f as RuiSimpleSelect,
|
|
32
|
+
E as RuiSkeletonLoader,
|
|
33
|
+
G as RuiStepper,
|
|
34
|
+
L as RuiTab,
|
|
35
|
+
j as RuiTabItem,
|
|
36
|
+
q as RuiTabItems,
|
|
37
|
+
w as RuiTablePagination,
|
|
38
|
+
H as RuiTableRowExpander,
|
|
39
|
+
_ as RuiTabs,
|
|
40
|
+
y as RuiTextArea,
|
|
41
|
+
z as RuiTextField,
|
|
42
|
+
J as RuiTooltip
|
|
41
43
|
};
|
|
@@ -1,55 +1,13 @@
|
|
|
1
1
|
import { type TablePaginationData } from './TablePagination.vue';
|
|
2
|
-
|
|
3
|
-
* Represents a sortable column name for a given type.
|
|
4
|
-
* The column name must be a key of the passed data object type.
|
|
5
|
-
* @template T - The type of the data in the column.
|
|
6
|
-
*/
|
|
7
|
-
export type SortableColumnName<T> = keyof T;
|
|
8
|
-
/**
|
|
9
|
-
* Represents the name of a column in a dataset.
|
|
10
|
-
*
|
|
11
|
-
* The `ColumnName` type can either be a `SortableColumnName` or a string.
|
|
12
|
-
*
|
|
13
|
-
* @typeparam T - The type of the dataset containing the column name.
|
|
14
|
-
*/
|
|
15
|
-
export type ColumnName<T> = SortableColumnName<T> | string;
|
|
16
|
-
export interface BaseTableColumn {
|
|
17
|
-
direction?: 'asc' | 'desc';
|
|
18
|
-
align?: 'start' | 'center' | 'end';
|
|
19
|
-
class?: string;
|
|
20
|
-
cellClass?: string;
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Represents a sortable table column.
|
|
25
|
-
* This is used to ensure that when using sortable with a true value,
|
|
26
|
-
* the key matches to an actual property of the object passed.
|
|
27
|
-
*
|
|
28
|
-
* @template T - The type of data in the table column.
|
|
29
|
-
*/
|
|
30
|
-
export interface SortableTableColumn<T> extends BaseTableColumn {
|
|
31
|
-
key: SortableColumnName<T>;
|
|
32
|
-
sortable: true;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* An interface representing a column in a table that cannot be sorted.
|
|
36
|
-
* This can be mapped to an actual property of the object or to a virtual column.
|
|
37
|
-
*
|
|
38
|
-
* @typeparam T - The type of data in the table.
|
|
39
|
-
*/
|
|
40
|
-
export interface NoneSortableTableColumn<T> extends BaseTableColumn {
|
|
41
|
-
key: string | SortableColumnName<T>;
|
|
42
|
-
sortable?: false;
|
|
43
|
-
}
|
|
44
|
-
export type TableColumn<T> = SortableTableColumn<T> | NoneSortableTableColumn<T>;
|
|
45
|
-
export interface SortColumn<T> {
|
|
46
|
-
column?: SortableColumnName<T>;
|
|
47
|
-
direction: 'asc' | 'desc';
|
|
48
|
-
}
|
|
2
|
+
import { type GroupData, type GroupKeys, type SortColumn, type TableColumn, type TableRowKeyData, type TableSortData } from './TableHead.vue';
|
|
49
3
|
export interface TableOptions<T> {
|
|
50
4
|
pagination?: TablePaginationData;
|
|
51
5
|
sort?: SortColumn<T> | SortColumn<T>[];
|
|
52
6
|
}
|
|
7
|
+
export type GroupedTableRow<T> = T & Partial<{
|
|
8
|
+
groupVal: string;
|
|
9
|
+
group: Partial<T>;
|
|
10
|
+
}>;
|
|
53
11
|
export interface Props<T, K extends keyof T> {
|
|
54
12
|
/**
|
|
55
13
|
* list of items for each row
|
|
@@ -92,7 +50,7 @@ export interface Props<T, K extends keyof T> {
|
|
|
92
50
|
* multi columns sort
|
|
93
51
|
* @example v-model:sort="[{ column: 'name', direction: 'asc' }]"
|
|
94
52
|
*/
|
|
95
|
-
sort?:
|
|
53
|
+
sort?: TableSortData<T>;
|
|
96
54
|
/**
|
|
97
55
|
* modifiers for specifying externally sorted tables
|
|
98
56
|
* use this when api controls sorting
|
|
@@ -111,7 +69,7 @@ export interface Props<T, K extends keyof T> {
|
|
|
111
69
|
/**
|
|
112
70
|
* attribute to use from column definitions to display column titles
|
|
113
71
|
*/
|
|
114
|
-
columnAttr?:
|
|
72
|
+
columnAttr?: keyof TableColumn<T>;
|
|
115
73
|
/**
|
|
116
74
|
* flag to show a more or less spacious table
|
|
117
75
|
*/
|
|
@@ -152,7 +110,7 @@ export interface Props<T, K extends keyof T> {
|
|
|
152
110
|
*/
|
|
153
111
|
singleExpand?: boolean;
|
|
154
112
|
/**
|
|
155
|
-
* make
|
|
113
|
+
* make table head stick to top on scroll
|
|
156
114
|
*/
|
|
157
115
|
stickyHeader?: boolean;
|
|
158
116
|
stickyOffset?: number;
|
|
@@ -161,6 +119,15 @@ export interface Props<T, K extends keyof T> {
|
|
|
161
119
|
* When true, changing the items per page setting in one table will affect other tables.
|
|
162
120
|
*/
|
|
163
121
|
globalItemsPerPage?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* model for grouping column/columns data
|
|
124
|
+
* single column grouping
|
|
125
|
+
* @example v-model:group="'name'"
|
|
126
|
+
* multi columns grouping
|
|
127
|
+
* @example v-model:group="['name', 'country']"
|
|
128
|
+
*/
|
|
129
|
+
group?: TableRowKeyData<T>;
|
|
130
|
+
collapsed?: T[];
|
|
164
131
|
}
|
|
165
132
|
declare const _default: <T extends object, IdType extends keyof T = keyof T>(__VLS_props: Props<T, IdType> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: Pick<{
|
|
166
133
|
props: Props<T, IdType>;
|
|
@@ -170,28 +137,53 @@ declare const _default: <T extends object, IdType extends keyof T = keyof T>(__V
|
|
|
170
137
|
column: TableColumn<T>;
|
|
171
138
|
}) => any>> & Partial<Record<string, (_: {
|
|
172
139
|
column: TableColumn<T>;
|
|
173
|
-
|
|
140
|
+
}) => any>> & Partial<Record<string, (_: {
|
|
141
|
+
column: TableColumn<T>;
|
|
142
|
+
row: GroupedTableRow<T>;
|
|
174
143
|
index: number;
|
|
175
144
|
}) => any>> & Partial<Record<string, (_: {
|
|
176
145
|
column: TableColumn<T>;
|
|
177
|
-
row: T;
|
|
178
146
|
index: number;
|
|
147
|
+
row: GroupedTableRow<T>;
|
|
179
148
|
}) => any>> & {
|
|
149
|
+
"body.prepend"?(_: {
|
|
150
|
+
colspan: number;
|
|
151
|
+
}): any;
|
|
152
|
+
"group.header"?(_: {
|
|
153
|
+
colspan: number;
|
|
154
|
+
row: GroupedTableRow<T>;
|
|
155
|
+
group: Partial<T> | undefined;
|
|
156
|
+
groupKey: string;
|
|
157
|
+
groupValue: string | undefined;
|
|
158
|
+
isOpen: boolean;
|
|
159
|
+
toggle: () => void;
|
|
160
|
+
}): any;
|
|
161
|
+
"group.header.content"?(_: {
|
|
162
|
+
row: GroupedTableRow<T>;
|
|
163
|
+
group: Partial<T> | undefined;
|
|
164
|
+
groupKey: string;
|
|
165
|
+
groupValue: string | undefined;
|
|
166
|
+
}): any;
|
|
180
167
|
"expanded-item"?(_: {
|
|
181
|
-
row: T
|
|
168
|
+
row: GroupedTableRow<T>;
|
|
182
169
|
index: number;
|
|
183
170
|
}): any;
|
|
184
171
|
"no-data"?(_: {}): any;
|
|
185
172
|
"empty-description"?(_: {}): any;
|
|
186
|
-
"body.append"?(_: {
|
|
173
|
+
"body.append"?(_: {
|
|
174
|
+
colspan: number;
|
|
175
|
+
}): any;
|
|
187
176
|
tfoot?(_: {}): any;
|
|
188
177
|
};
|
|
189
178
|
emit: {
|
|
190
179
|
(e: 'update:model-value', value?: T[IdType][] | undefined): void;
|
|
191
180
|
(e: 'update:expanded', value: T[]): void;
|
|
192
181
|
(e: 'update:pagination', value: TablePaginationData): void;
|
|
193
|
-
(e: 'update:sort', value?:
|
|
182
|
+
(e: 'update:sort', value?: TableSortData<T>): void;
|
|
194
183
|
(e: 'update:options', value: TableOptions<T>): void;
|
|
184
|
+
(e: 'update:group', value?: GroupKeys<T>): void;
|
|
185
|
+
(e: 'update:collapsed', value?: T[] | undefined): void;
|
|
186
|
+
(e: 'copy:group', value: GroupData<T>): void;
|
|
195
187
|
};
|
|
196
188
|
}, "attrs" | "emit" | "slots"> | undefined, __VLS_expose?: ((exposed: {}) => void) | undefined, __VLS_setup?: Promise<{
|
|
197
189
|
props: Props<T, IdType>;
|
|
@@ -201,28 +193,53 @@ declare const _default: <T extends object, IdType extends keyof T = keyof T>(__V
|
|
|
201
193
|
column: TableColumn<T>;
|
|
202
194
|
}) => any>> & Partial<Record<string, (_: {
|
|
203
195
|
column: TableColumn<T>;
|
|
204
|
-
|
|
196
|
+
}) => any>> & Partial<Record<string, (_: {
|
|
197
|
+
column: TableColumn<T>;
|
|
198
|
+
row: GroupedTableRow<T>;
|
|
205
199
|
index: number;
|
|
206
200
|
}) => any>> & Partial<Record<string, (_: {
|
|
207
201
|
column: TableColumn<T>;
|
|
208
|
-
row: T;
|
|
209
202
|
index: number;
|
|
203
|
+
row: GroupedTableRow<T>;
|
|
210
204
|
}) => any>> & {
|
|
205
|
+
"body.prepend"?(_: {
|
|
206
|
+
colspan: number;
|
|
207
|
+
}): any;
|
|
208
|
+
"group.header"?(_: {
|
|
209
|
+
colspan: number;
|
|
210
|
+
row: GroupedTableRow<T>;
|
|
211
|
+
group: Partial<T> | undefined;
|
|
212
|
+
groupKey: string;
|
|
213
|
+
groupValue: string | undefined;
|
|
214
|
+
isOpen: boolean;
|
|
215
|
+
toggle: () => void;
|
|
216
|
+
}): any;
|
|
217
|
+
"group.header.content"?(_: {
|
|
218
|
+
row: GroupedTableRow<T>;
|
|
219
|
+
group: Partial<T> | undefined;
|
|
220
|
+
groupKey: string;
|
|
221
|
+
groupValue: string | undefined;
|
|
222
|
+
}): any;
|
|
211
223
|
"expanded-item"?(_: {
|
|
212
|
-
row: T
|
|
224
|
+
row: GroupedTableRow<T>;
|
|
213
225
|
index: number;
|
|
214
226
|
}): any;
|
|
215
227
|
"no-data"?(_: {}): any;
|
|
216
228
|
"empty-description"?(_: {}): any;
|
|
217
|
-
"body.append"?(_: {
|
|
229
|
+
"body.append"?(_: {
|
|
230
|
+
colspan: number;
|
|
231
|
+
}): any;
|
|
218
232
|
tfoot?(_: {}): any;
|
|
219
233
|
};
|
|
220
234
|
emit: {
|
|
221
235
|
(e: 'update:model-value', value?: T[IdType][] | undefined): void;
|
|
222
236
|
(e: 'update:expanded', value: T[]): void;
|
|
223
237
|
(e: 'update:pagination', value: TablePaginationData): void;
|
|
224
|
-
(e: 'update:sort', value?:
|
|
238
|
+
(e: 'update:sort', value?: TableSortData<T>): void;
|
|
225
239
|
(e: 'update:options', value: TableOptions<T>): void;
|
|
240
|
+
(e: 'update:group', value?: GroupKeys<T>): void;
|
|
241
|
+
(e: 'update:collapsed', value?: T[] | undefined): void;
|
|
242
|
+
(e: 'copy:group', value: GroupData<T>): void;
|
|
226
243
|
};
|
|
227
244
|
}>) => globalThis.VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
228
245
|
[key: string]: any;
|
|
@@ -235,28 +252,53 @@ declare const _default: <T extends object, IdType extends keyof T = keyof T>(__V
|
|
|
235
252
|
column: TableColumn<T>;
|
|
236
253
|
}) => any>> & Partial<Record<string, (_: {
|
|
237
254
|
column: TableColumn<T>;
|
|
238
|
-
|
|
255
|
+
}) => any>> & Partial<Record<string, (_: {
|
|
256
|
+
column: TableColumn<T>;
|
|
257
|
+
row: GroupedTableRow<T>;
|
|
239
258
|
index: number;
|
|
240
259
|
}) => any>> & Partial<Record<string, (_: {
|
|
241
260
|
column: TableColumn<T>;
|
|
242
|
-
row: T;
|
|
243
261
|
index: number;
|
|
262
|
+
row: GroupedTableRow<T>;
|
|
244
263
|
}) => any>> & {
|
|
264
|
+
"body.prepend"?(_: {
|
|
265
|
+
colspan: number;
|
|
266
|
+
}): any;
|
|
267
|
+
"group.header"?(_: {
|
|
268
|
+
colspan: number;
|
|
269
|
+
row: GroupedTableRow<T>;
|
|
270
|
+
group: Partial<T> | undefined;
|
|
271
|
+
groupKey: string;
|
|
272
|
+
groupValue: string | undefined;
|
|
273
|
+
isOpen: boolean;
|
|
274
|
+
toggle: () => void;
|
|
275
|
+
}): any;
|
|
276
|
+
"group.header.content"?(_: {
|
|
277
|
+
row: GroupedTableRow<T>;
|
|
278
|
+
group: Partial<T> | undefined;
|
|
279
|
+
groupKey: string;
|
|
280
|
+
groupValue: string | undefined;
|
|
281
|
+
}): any;
|
|
245
282
|
"expanded-item"?(_: {
|
|
246
|
-
row: T
|
|
283
|
+
row: GroupedTableRow<T>;
|
|
247
284
|
index: number;
|
|
248
285
|
}): any;
|
|
249
286
|
"no-data"?(_: {}): any;
|
|
250
287
|
"empty-description"?(_: {}): any;
|
|
251
|
-
"body.append"?(_: {
|
|
288
|
+
"body.append"?(_: {
|
|
289
|
+
colspan: number;
|
|
290
|
+
}): any;
|
|
252
291
|
tfoot?(_: {}): any;
|
|
253
292
|
};
|
|
254
293
|
emit: {
|
|
255
294
|
(e: 'update:model-value', value?: T[IdType][] | undefined): void;
|
|
256
295
|
(e: 'update:expanded', value: T[]): void;
|
|
257
296
|
(e: 'update:pagination', value: TablePaginationData): void;
|
|
258
|
-
(e: 'update:sort', value?:
|
|
297
|
+
(e: 'update:sort', value?: TableSortData<T>): void;
|
|
259
298
|
(e: 'update:options', value: TableOptions<T>): void;
|
|
299
|
+
(e: 'update:group', value?: GroupKeys<T>): void;
|
|
300
|
+
(e: 'update:collapsed', value?: T[] | undefined): void;
|
|
301
|
+
(e: 'copy:group', value: GroupData<T>): void;
|
|
260
302
|
};
|
|
261
303
|
} | undefined;
|
|
262
304
|
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a sortable column name for a given type.
|
|
3
|
+
* The column name must be a key of the passed data object type.
|
|
4
|
+
* @template T - The type of the data in the column.
|
|
5
|
+
*/
|
|
6
|
+
export type TableRowKey<T> = keyof T;
|
|
7
|
+
export interface BaseTableColumn<T> {
|
|
8
|
+
key: TableRowKey<T> | string;
|
|
9
|
+
sortable?: boolean;
|
|
10
|
+
direction?: 'asc' | 'desc';
|
|
11
|
+
align?: 'start' | 'center' | 'end';
|
|
12
|
+
class?: string;
|
|
13
|
+
cellClass?: string;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Represents a sortable table column.
|
|
18
|
+
* This is used to ensure that when using sortable with a true value,
|
|
19
|
+
* the key matches to an actual property of the object passed.
|
|
20
|
+
*
|
|
21
|
+
* @template T - The type of data in the table column.
|
|
22
|
+
*/
|
|
23
|
+
export interface SortableTableColumn<T> extends BaseTableColumn<T> {
|
|
24
|
+
sortable: true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* An interface representing a column in a table that cannot be sorted.
|
|
28
|
+
* This can be mapped to an actual property of the object or to a virtual column.
|
|
29
|
+
*
|
|
30
|
+
* @typeparam T - The type of data in the table.
|
|
31
|
+
*/
|
|
32
|
+
export interface NoneSortableTableColumn<T> extends BaseTableColumn<T> {
|
|
33
|
+
sortable?: false;
|
|
34
|
+
}
|
|
35
|
+
export type TableColumn<T> = SortableTableColumn<T> | NoneSortableTableColumn<T>;
|
|
36
|
+
export interface SortColumn<T> {
|
|
37
|
+
column?: TableRowKey<T>;
|
|
38
|
+
direction: 'asc' | 'desc';
|
|
39
|
+
}
|
|
40
|
+
export type TableSortData<T> = SortColumn<T> | SortColumn<T>[] | undefined;
|
|
41
|
+
export type TableRowKeyData<T> = TableRowKey<T> | TableRowKey<T>[] | undefined;
|
|
42
|
+
export interface GroupData<T> {
|
|
43
|
+
key: string;
|
|
44
|
+
value?: Partial<T>;
|
|
45
|
+
}
|
|
46
|
+
export type GroupKey<T> = TableColumn<T>['key'];
|
|
47
|
+
export type GroupKeys<T> = GroupKey<T> | GroupKey<T>[] | undefined;
|
|
48
|
+
export interface Props<T> {
|
|
49
|
+
loading?: boolean;
|
|
50
|
+
stickyHeader?: boolean;
|
|
51
|
+
stick?: boolean;
|
|
52
|
+
selectable?: boolean;
|
|
53
|
+
disableCheckAll?: boolean;
|
|
54
|
+
noData?: boolean;
|
|
55
|
+
colspan?: number;
|
|
56
|
+
columns: TableColumn<T>[];
|
|
57
|
+
capitalizeHeaders?: boolean;
|
|
58
|
+
isAllSelected?: boolean;
|
|
59
|
+
indeterminate?: boolean;
|
|
60
|
+
dense?: boolean;
|
|
61
|
+
sortedMap: Partial<Record<TableRowKey<T>, SortColumn<T>>>;
|
|
62
|
+
sortData?: TableSortData<T>;
|
|
63
|
+
columnAttr: keyof TableColumn<T>;
|
|
64
|
+
dataId?: string;
|
|
65
|
+
}
|
|
66
|
+
declare const _default: <T extends object, K extends keyof T = keyof T>(__VLS_props: Props<T> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, __VLS_ctx?: Pick<{
|
|
67
|
+
props: Props<T>;
|
|
68
|
+
expose(exposed: {}): void;
|
|
69
|
+
attrs: any;
|
|
70
|
+
slots: Partial<Record<string, (_: {
|
|
71
|
+
column: TableColumn<T>;
|
|
72
|
+
}) => any>>;
|
|
73
|
+
emit: {
|
|
74
|
+
(e: 'select:all', value: boolean): void;
|
|
75
|
+
(e: 'sort', value: {
|
|
76
|
+
key: keyof T;
|
|
77
|
+
direction?: "desc" | "asc" | undefined;
|
|
78
|
+
}): void;
|
|
79
|
+
};
|
|
80
|
+
}, "attrs" | "emit" | "slots"> | undefined, __VLS_expose?: ((exposed: {}) => void) | undefined, __VLS_setup?: Promise<{
|
|
81
|
+
props: Props<T>;
|
|
82
|
+
expose(exposed: {}): void;
|
|
83
|
+
attrs: any;
|
|
84
|
+
slots: Partial<Record<string, (_: {
|
|
85
|
+
column: TableColumn<T>;
|
|
86
|
+
}) => any>>;
|
|
87
|
+
emit: {
|
|
88
|
+
(e: 'select:all', value: boolean): void;
|
|
89
|
+
(e: 'sort', value: {
|
|
90
|
+
key: keyof T;
|
|
91
|
+
direction?: "desc" | "asc" | undefined;
|
|
92
|
+
}): void;
|
|
93
|
+
};
|
|
94
|
+
}>) => globalThis.VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
95
|
+
[key: string]: any;
|
|
96
|
+
}> & {
|
|
97
|
+
__ctx?: {
|
|
98
|
+
props: Props<T>;
|
|
99
|
+
expose(exposed: {}): void;
|
|
100
|
+
attrs: any;
|
|
101
|
+
slots: Partial<Record<string, (_: {
|
|
102
|
+
column: TableColumn<T>;
|
|
103
|
+
}) => any>>;
|
|
104
|
+
emit: {
|
|
105
|
+
(e: 'select:all', value: boolean): void;
|
|
106
|
+
(e: 'sort', value: {
|
|
107
|
+
key: keyof T;
|
|
108
|
+
direction?: "desc" | "asc" | undefined;
|
|
109
|
+
}): void;
|
|
110
|
+
};
|
|
111
|
+
} | undefined;
|
|
112
|
+
};
|
|
113
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useBreakpoint: () => any;
|
|
@@ -3,6 +3,7 @@ import { type MaybeRef } from '@vueuse/shared';
|
|
|
3
3
|
export interface TableOptions {
|
|
4
4
|
itemsPerPage: Ref<number>;
|
|
5
5
|
globalItemsPerPage: MaybeRef<boolean>;
|
|
6
|
+
limits: MaybeRef<number[]>;
|
|
6
7
|
}
|
|
7
8
|
export declare const TableSymbol: InjectionKey<TableOptions>;
|
|
8
9
|
export declare const createTableDefaults: (options?: Partial<TableOptions>) => TableOptions;
|
|
@@ -1,10 +1,87 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
1
|
+
import { u as A, a as $ } from "../theme-V5yenaDk.js";
|
|
2
|
+
import { useWindowSize as m, breakpointsTailwind as d, useBreakpoints as w } from "@vueuse/core";
|
|
3
|
+
import { computed as _ } from "vue";
|
|
4
|
+
import { get as h } from "@vueuse/shared";
|
|
5
|
+
import "../icons/icons_1.es.js";
|
|
6
|
+
import "../icons/icons_2.es.js";
|
|
7
|
+
import "../icons/icons_5.es.js";
|
|
6
8
|
import "../colors-ikihApJv.js";
|
|
9
|
+
const C = /\d/, g = ["-", "_", "/", "."];
|
|
10
|
+
function E(e = "") {
|
|
11
|
+
if (!C.test(e))
|
|
12
|
+
return e !== e.toLowerCase();
|
|
13
|
+
}
|
|
14
|
+
function S(e, n) {
|
|
15
|
+
const o = n ?? g, r = [];
|
|
16
|
+
if (!e || typeof e != "string")
|
|
17
|
+
return r;
|
|
18
|
+
let t = "", i, p;
|
|
19
|
+
for (const c of e) {
|
|
20
|
+
const f = o.includes(c);
|
|
21
|
+
if (f === !0) {
|
|
22
|
+
r.push(t), t = "", i = void 0;
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const a = E(c);
|
|
26
|
+
if (p === !1) {
|
|
27
|
+
if (i === !1 && a === !0) {
|
|
28
|
+
r.push(t), t = c, i = a;
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (i === !0 && a === !1 && t.length > 1) {
|
|
32
|
+
const s = t.at(-1);
|
|
33
|
+
r.push(t.slice(0, Math.max(0, t.length - 1))), t = s + c, i = a;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
t += c, i = a, p = f;
|
|
38
|
+
}
|
|
39
|
+
return r.push(t), r;
|
|
40
|
+
}
|
|
41
|
+
function y(e) {
|
|
42
|
+
return e ? e[0].toUpperCase() + e.slice(1) : "";
|
|
43
|
+
}
|
|
44
|
+
function z(e) {
|
|
45
|
+
return e ? e[0].toLowerCase() + e.slice(1) : "";
|
|
46
|
+
}
|
|
47
|
+
function R(e, n) {
|
|
48
|
+
return e ? (Array.isArray(e) ? e : S(e)).map((o) => y(n != null && n.normalize ? o.toLowerCase() : o)).join("") : "";
|
|
49
|
+
}
|
|
50
|
+
function l(e, n) {
|
|
51
|
+
return z(R(e || "", n));
|
|
52
|
+
}
|
|
53
|
+
const B = () => {
|
|
54
|
+
const { width: e } = m(), n = {
|
|
55
|
+
xs: 0,
|
|
56
|
+
...d
|
|
57
|
+
}, o = w(n), r = Object.keys, t = r(n), i = t.map(
|
|
58
|
+
(s, u) => [
|
|
59
|
+
s,
|
|
60
|
+
u < t.length - 1 ? o.between(s, t[u + 1]) : o[s]
|
|
61
|
+
]
|
|
62
|
+
), p = i.map(([s, u]) => [
|
|
63
|
+
l(`is_${s}`),
|
|
64
|
+
u
|
|
65
|
+
]), c = t.map((s) => [
|
|
66
|
+
l(`is_${s}_and_up`),
|
|
67
|
+
o.greaterOrEqual(s)
|
|
68
|
+
]), f = t.map((s) => [
|
|
69
|
+
l(`is_${s}_and_down`),
|
|
70
|
+
o.smaller(s)
|
|
71
|
+
]), a = _(() => {
|
|
72
|
+
var s;
|
|
73
|
+
return ((s = i.find((u) => h(u[1]))) == null ? void 0 : s[0]) || "";
|
|
74
|
+
});
|
|
75
|
+
return {
|
|
76
|
+
...Object.fromEntries(p),
|
|
77
|
+
...Object.fromEntries(c),
|
|
78
|
+
...Object.fromEntries(f),
|
|
79
|
+
width: e,
|
|
80
|
+
name: a
|
|
81
|
+
};
|
|
82
|
+
};
|
|
7
83
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
84
|
+
B as useBreakpoint,
|
|
85
|
+
A as useIcons,
|
|
86
|
+
$ as useRotkiTheme
|
|
10
87
|
};
|
|
@@ -2,7 +2,7 @@ import { type Ref } from 'vue';
|
|
|
2
2
|
/**
|
|
3
3
|
* Setup sticky table header
|
|
4
4
|
*/
|
|
5
|
-
export declare const useStickyTableHeader: (offsetTop?: Ref<number>) => {
|
|
5
|
+
export declare const useStickyTableHeader: (offsetTop?: Ref<number>, sticky?: Ref<boolean>) => {
|
|
6
6
|
stick: Ref<boolean>;
|
|
7
7
|
table: Ref<HTMLTableElement | null>;
|
|
8
8
|
tableScroller: Ref<HTMLElement | null>;
|