bitboss-ui 2.0.117 → 2.0.119
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/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +15 -3
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +29 -367
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +76 -89
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +75 -89
- package/dist/components/BbRows/BbRows.vue.d.ts +70 -85
- package/dist/components/BbSelect/BbSelect.vue.d.ts +1 -10
- package/dist/components/BbTable/BbTable.vue.d.ts +63 -91
- package/dist/components/BbTable/types.d.ts +46 -27
- package/dist/components/ListBox.vue.d.ts +40 -44
- package/dist/index100.js +91 -82
- package/dist/index101.js +7 -16
- package/dist/index111.js +235 -211
- package/dist/index119.js +2 -2
- package/dist/index121.js +5 -5
- package/dist/index123.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.js +1 -1
- package/dist/index129.js +1 -1
- package/dist/index13.js +2 -2
- package/dist/index133.js +2 -2
- package/dist/index15.js +5 -5
- package/dist/index17.js +3 -3
- package/dist/index19.js +8 -8
- package/dist/index207.js +124 -63
- package/dist/index208.js +7 -0
- package/dist/index209.js +125 -13
- package/dist/index21.js +16 -16
- package/dist/index210.js +15 -19
- package/dist/index211.js +16 -4
- package/dist/index212.js +19 -13
- package/dist/index213.js +15 -3
- package/dist/index214.js +2 -126
- package/dist/index215.js +2 -5
- package/dist/index216.js +40 -124
- package/dist/index217.js +13 -16
- package/dist/index218.js +19 -15
- package/dist/index219.js +6 -19
- package/dist/index220.js +15 -15
- package/dist/index221.js +65 -2
- package/dist/index223.js +12 -40
- package/dist/index224.js +5 -6
- package/dist/index225.js +2 -15
- package/dist/index226.js +369 -5
- package/dist/index227.js +4 -2
- package/dist/index228.js +17 -367
- package/dist/index229.js +27 -86
- package/dist/index23.js +19 -19
- package/dist/index230.js +5 -0
- package/dist/index231.js +8 -25
- package/dist/index232.js +250 -17
- package/dist/index233.js +50 -49
- package/dist/index234.js +44 -15
- package/dist/index235.js +5 -3
- package/dist/index236.js +60 -12
- package/dist/index237.js +86 -16
- package/dist/index239.js +25 -4
- package/dist/index240.js +17 -2
- package/dist/index241.js +50 -18
- package/dist/index242.js +15 -27
- package/dist/index243.js +12 -8
- package/dist/index244.js +16 -250
- package/dist/index245.js +2 -52
- package/dist/index246.js +4 -44
- package/dist/index247.js +2 -5
- package/dist/index248.js +3 -60
- package/dist/index249.js +7 -3
- package/dist/index25.js +7 -7
- package/dist/index250.js +3 -7
- package/dist/index251.js +106 -2
- package/dist/index253.js +100 -2
- package/dist/index255.js +17 -105
- package/dist/index256.js +14 -0
- package/dist/index257.js +197 -83
- package/dist/index258.js +4 -0
- package/dist/index259.js +2 -12
- package/dist/index262.js +3 -3
- package/dist/index266.js +3 -3
- package/dist/index269.js +280 -223
- package/dist/index27.js +1 -1
- package/dist/index270.js +6 -3
- package/dist/index271.js +4 -0
- package/dist/index272.js +2 -7
- package/dist/index273.js +2 -176
- package/dist/index274.js +2 -7
- package/dist/index275.js +2 -11
- package/dist/index276.js +2 -281
- package/dist/index277.js +125 -5
- package/dist/index278.js +431 -2
- package/dist/index279.js +176 -2
- package/dist/index280.js +2 -2
- package/dist/index281.js +3 -2
- package/dist/index283.js +7 -2
- package/dist/index284.js +21 -125
- package/dist/index286.js +7 -2
- package/dist/index287.js +11 -22
- package/dist/index288.js +438 -0
- package/dist/index289.js +127 -3
- package/dist/index29.js +2 -2
- package/dist/index290.js +197 -14
- package/dist/index291.js +4 -9
- package/dist/index293.js +3 -4
- package/dist/index294.js +15 -434
- package/dist/index295.js +8 -126
- package/dist/index296.js +2 -200
- package/dist/index298.js +2 -2
- package/dist/index299.js +1 -1
- package/dist/index300.js +1 -1
- package/dist/index301.js +1 -1
- package/dist/index302.js +21 -1
- package/dist/index304.js +91 -0
- package/dist/index306.js +218 -83
- package/dist/index307.js +1 -1
- package/dist/index308.js +1 -1
- package/dist/index309.js +2 -214
- package/dist/index31.js +2 -2
- package/dist/index311.js +5 -3
- package/dist/index312.js +67 -3
- package/dist/index313.js +3 -58
- package/dist/index314.js +3 -5
- package/dist/index315.js +56 -65
- package/dist/index316.js +4 -6
- package/dist/index317.js +7 -18
- package/dist/index318.js +7 -3
- package/dist/index319.js +1 -1
- package/dist/index320.js +1 -1
- package/dist/index321.js +4 -53
- package/dist/index322.js +28 -28
- package/dist/index323.js +53 -5
- package/dist/index324.js +3 -8
- package/dist/index325.js +6 -6
- package/dist/index326.js +18 -3
- package/dist/index328.js +1 -1
- package/dist/index33.js +8 -8
- package/dist/index331.js +1 -1
- package/dist/index35.js +4 -4
- package/dist/index37.js +176 -175
- package/dist/index39.js +4 -4
- package/dist/index41.js +2 -2
- package/dist/index43.js +8 -8
- package/dist/index45.js +8 -8
- package/dist/index47.js +2 -2
- package/dist/index49.js +2 -2
- package/dist/index53.js +1 -1
- package/dist/index55.js +1 -1
- package/dist/index57.js +2 -2
- package/dist/index61.js +1 -1
- package/dist/index75.js +35 -33
- package/dist/index77.js +54 -50
- package/dist/index81.js +1 -1
- package/dist/index84.js +4 -4
- package/dist/index86.js +1 -1
- package/dist/index88.js +3 -3
- package/dist/types/ColumnName.d.ts +4 -0
- package/dist/types/Option.d.ts +2 -2
- package/dist/types/PrefixWith.d.ts +1 -0
- package/package.json +1 -1
- package/dist/index222.js +0 -4
- package/dist/index238.js +0 -4
- package/dist/index252.js +0 -4
- package/dist/index254.js +0 -20
- package/dist/index282.js +0 -4
- package/dist/index285.js +0 -433
- package/dist/index303.js +0 -24
@@ -1,63 +1,58 @@
|
|
1
1
|
import { BaseColumn } from '../BbTable/types';
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
type __VLS_PublicProps = {
|
57
|
-
'unselected-items'?: any[];
|
58
|
-
'select-all'?: boolean;
|
59
|
-
} & typeof __VLS_typeProps;
|
60
|
-
declare function __VLS_template(): {
|
2
|
+
export type BbRowsColumn<T extends string, Item extends object> = BaseColumn<T, Item>;
|
3
|
+
declare const _default: <T extends string, Item extends object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
4
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
5
|
+
readonly "onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
6
|
+
readonly "onUpdate:unselectedItems"?: ((value: any[]) => any) | undefined;
|
7
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:unselectedItems"> & {
|
8
|
+
columns: BbRowsColumn<T, Item>[];
|
9
|
+
/**
|
10
|
+
* Defines an array of dependencies that will trigger actions in the component upon change.
|
11
|
+
*/
|
12
|
+
dependencies?: any[];
|
13
|
+
/**
|
14
|
+
* Timeout used to debounce response to changes to dependencies.
|
15
|
+
*/
|
16
|
+
depsDebounceTime?: number;
|
17
|
+
/**
|
18
|
+
* Disables the component
|
19
|
+
*/
|
20
|
+
disabled?: boolean;
|
21
|
+
items: any[] | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>) | ((prefill: boolean, modelValue?: any[]) => any[]);
|
22
|
+
itemValue?: string | ((item: any) => any);
|
23
|
+
/**
|
24
|
+
* Sets the component in a loading state, usually triggering some visual styles.
|
25
|
+
*/
|
26
|
+
loading?: boolean;
|
27
|
+
/**
|
28
|
+
* Maximum number of items that can be selected.
|
29
|
+
*/
|
30
|
+
max?: number;
|
31
|
+
/**
|
32
|
+
* Used by v-model. Can be any serializable type.
|
33
|
+
*/
|
34
|
+
modelValue?: any;
|
35
|
+
/**
|
36
|
+
* Allows the selection of multiple items.
|
37
|
+
*/
|
38
|
+
multiple?: boolean;
|
39
|
+
/**
|
40
|
+
* Defines whether the table is selectable.
|
41
|
+
* Can be a global boolean that affects all rows or a function
|
42
|
+
* that accepts an item and returns a boolean that only affects that item.
|
43
|
+
*/
|
44
|
+
selectable?: boolean | ((item: any) => boolean);
|
45
|
+
/**
|
46
|
+
* Defines whether the table allows the selection of all items.
|
47
|
+
*/
|
48
|
+
selectAll?: boolean;
|
49
|
+
/**
|
50
|
+
* Items that are not selected.
|
51
|
+
*/
|
52
|
+
unselectedItems?: any[];
|
53
|
+
}> & import('vue').PublicProps;
|
54
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
55
|
+
attrs: any;
|
61
56
|
slots: {
|
62
57
|
loading?(_: {
|
63
58
|
items: any[];
|
@@ -68,7 +63,11 @@ declare function __VLS_template(): {
|
|
68
63
|
default?(_: {
|
69
64
|
key: string;
|
70
65
|
checked: boolean | undefined;
|
71
|
-
columns: Record<string,
|
66
|
+
columns: Record<string, {
|
67
|
+
key: string;
|
68
|
+
label: string;
|
69
|
+
value: any;
|
70
|
+
}>;
|
72
71
|
disabled: boolean | undefined;
|
73
72
|
index: number;
|
74
73
|
item: any;
|
@@ -77,30 +76,16 @@ declare function __VLS_template(): {
|
|
77
76
|
value: any;
|
78
77
|
}): any;
|
79
78
|
};
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
84
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
85
|
-
"update:unselected-items": (args_0: unselected) => any;
|
86
|
-
} & {
|
87
|
-
"update:modelValue": (value: any) => any;
|
88
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
89
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
90
|
-
"onUpdate:unselected-items"?: ((args_0: unselected) => any) | undefined;
|
91
|
-
}>, {
|
92
|
-
dependencies: any[];
|
93
|
-
depsDebounceTime: number;
|
94
|
-
multiple: boolean;
|
95
|
-
modelValue: any;
|
96
|
-
items: any[] | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>) | ((prefill: boolean, modelValue?: any[]) => any[]);
|
97
|
-
max: number;
|
98
|
-
columns: BbRowsColumn[];
|
99
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
100
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
101
|
-
export default _default;
|
102
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
103
|
-
new (): {
|
104
|
-
$slots: S;
|
79
|
+
emit: {
|
80
|
+
(e: "update:modelValue", value: any): void;
|
81
|
+
(e: "update:unselectedItems", value: any[]): void;
|
105
82
|
};
|
83
|
+
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
84
|
+
[key: string]: any;
|
85
|
+
}> & {
|
86
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
106
87
|
};
|
88
|
+
export default _default;
|
89
|
+
type __VLS_PrettifyLocal<T> = {
|
90
|
+
[K in keyof T]: T[K];
|
91
|
+
} & {};
|
@@ -229,18 +229,12 @@ export type BbSelectSlots<T> = {
|
|
229
229
|
focused: boolean;
|
230
230
|
index: number;
|
231
231
|
hasErrors?: boolean;
|
232
|
-
item:
|
232
|
+
item: T;
|
233
233
|
loading: boolean;
|
234
234
|
selected: boolean;
|
235
235
|
text: string;
|
236
236
|
value: any;
|
237
237
|
}) => any;
|
238
|
-
'option:append'?: (props: {
|
239
|
-
item: T;
|
240
|
-
}) => any;
|
241
|
-
'option:prepend'?: (props: {
|
242
|
-
item: T;
|
243
|
-
}) => any;
|
244
238
|
'options:append'?: (props: object) => any;
|
245
239
|
'options:prepend'?: (props: object) => any;
|
246
240
|
prefix?: (props: object) => any;
|
@@ -250,9 +244,6 @@ export type BbSelectSlots<T> = {
|
|
250
244
|
'prepend-outer'?: (props: {
|
251
245
|
query: string;
|
252
246
|
}) => any;
|
253
|
-
spinner?: (props: {
|
254
|
-
loading: boolean;
|
255
|
-
}) => any;
|
256
247
|
suffix?: (props: object) => any;
|
257
248
|
};
|
258
249
|
declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
@@ -1,11 +1,19 @@
|
|
1
|
-
import { BbTableProps,
|
1
|
+
import { BbTableProps, BbTableEvents } from './types';
|
2
2
|
import { Classes } from '../../types/Classes';
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
import { ColumnName } from '../../types/ColumnName';
|
4
|
+
declare const _default: <T extends string, Item extends object = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
5
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
6
|
+
readonly "onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
7
|
+
readonly "onClick:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
|
8
|
+
readonly "onContextmenu:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
|
9
|
+
readonly "onDblclick:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
|
10
|
+
readonly "onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
11
|
+
readonly "onUpdate:unselectedItems"?: ((value: any[]) => any) | undefined;
|
12
|
+
readonly "onItem:selected"?: ((value: any) => any) | undefined;
|
13
|
+
readonly "onItem:unselected"?: ((value: any) => any) | undefined;
|
14
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:modelValue" | "onUpdate:unselectedItems" | "onClick:row" | "onContextmenu:row" | "onDblclick:row" | "onUpdate:selectAll" | "onItem:selected" | "onItem:unselected"> & BbTableProps<T, Item>> & import('vue').PublicProps;
|
15
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
16
|
+
attrs: any;
|
9
17
|
slots: Readonly<{
|
10
18
|
thead?: (props: object) => any;
|
11
19
|
tbody?: (props: object) => any;
|
@@ -18,32 +26,33 @@ declare function __VLS_template(): {
|
|
18
26
|
'header:actions'?: (props: {
|
19
27
|
text: string;
|
20
28
|
}) => any;
|
21
|
-
loading?: (props: {
|
22
|
-
items:
|
23
|
-
}) => any;
|
29
|
+
loading?: ((props: {
|
30
|
+
items: Item[];
|
31
|
+
}) => any) | undefined;
|
24
32
|
'no-data'?: (props: object) => any;
|
25
|
-
actions?: (props: {
|
26
|
-
item:
|
33
|
+
actions?: ((props: {
|
34
|
+
item: Item;
|
27
35
|
value: any;
|
28
|
-
}) => any;
|
29
|
-
select?: (props: {
|
30
|
-
item:
|
36
|
+
}) => any) | undefined;
|
37
|
+
select?: ((props: {
|
38
|
+
item: Item;
|
31
39
|
value: any;
|
32
40
|
checked: boolean;
|
33
41
|
disabled: boolean;
|
34
42
|
inputName: string;
|
35
43
|
readonly: boolean;
|
36
|
-
}) => any;
|
37
|
-
} & {
|
38
|
-
[
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
44
|
+
}) => any) | undefined;
|
45
|
+
} & { [K in ColumnName<T>]?: ((props: {
|
46
|
+
classes?: Classes[];
|
47
|
+
content?: any;
|
48
|
+
item: Item;
|
49
|
+
value?: any;
|
50
|
+
}) => any) | undefined; } & { [K_1 in `header:${ColumnName<T>}`]?: ((props: {
|
51
|
+
classes?: Classes[];
|
52
|
+
content?: any;
|
53
|
+
items?: Item[] | undefined;
|
54
|
+
label?: string;
|
55
|
+
}) => any) | undefined; }> & {
|
47
56
|
thead?: (props: object) => any;
|
48
57
|
tbody?: (props: object) => any;
|
49
58
|
tfoot?: (props: object) => any;
|
@@ -55,77 +64,40 @@ declare function __VLS_template(): {
|
|
55
64
|
'header:actions'?: (props: {
|
56
65
|
text: string;
|
57
66
|
}) => any;
|
58
|
-
loading?: (props: {
|
59
|
-
items:
|
60
|
-
}) => any;
|
67
|
+
loading?: ((props: {
|
68
|
+
items: Item[];
|
69
|
+
}) => any) | undefined;
|
61
70
|
'no-data'?: (props: object) => any;
|
62
|
-
actions?: (props: {
|
63
|
-
item:
|
71
|
+
actions?: ((props: {
|
72
|
+
item: Item;
|
64
73
|
value: any;
|
65
|
-
}) => any;
|
66
|
-
select?: (props: {
|
67
|
-
item:
|
74
|
+
}) => any) | undefined;
|
75
|
+
select?: ((props: {
|
76
|
+
item: Item;
|
68
77
|
value: any;
|
69
78
|
checked: boolean;
|
70
79
|
disabled: boolean;
|
71
80
|
inputName: string;
|
72
81
|
readonly: boolean;
|
73
|
-
}) => any;
|
74
|
-
} & {
|
75
|
-
[
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
82
|
+
}) => any) | undefined;
|
83
|
+
} & { [K in ColumnName<T>]?: ((props: {
|
84
|
+
classes?: Classes[];
|
85
|
+
content?: any;
|
86
|
+
item: Item;
|
87
|
+
value?: any;
|
88
|
+
}) => any) | undefined; } & { [K_1 in `header:${ColumnName<T>}`]?: ((props: {
|
89
|
+
classes?: Classes[];
|
90
|
+
content?: any;
|
91
|
+
items?: Item[] | undefined;
|
92
|
+
label?: string;
|
93
|
+
}) => any) | undefined; };
|
94
|
+
emit: BbTableEvents;
|
95
|
+
}>) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
96
|
+
[key: string]: any;
|
97
|
+
}> & {
|
98
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
88
99
|
};
|
89
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
90
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
91
|
-
"update:select-all": (args_0: select) => any;
|
92
|
-
} & {
|
93
|
-
"update:modelValue": (value: any) => any;
|
94
|
-
"click:row": (event: MouseEvent, item: any, selected: boolean) => any;
|
95
|
-
"contextmenu:row": (event: MouseEvent, item: any, selected: boolean) => any;
|
96
|
-
"dblclick:row": (event: MouseEvent, item: any, selected: boolean) => any;
|
97
|
-
"update:selectAll": (value: boolean) => any;
|
98
|
-
"item:selected": (value: any) => any;
|
99
|
-
"item:unselected": (value: any) => any;
|
100
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
101
|
-
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
102
|
-
"onClick:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
|
103
|
-
"onContextmenu:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
|
104
|
-
"onDblclick:row"?: ((event: MouseEvent, item: any, selected: boolean) => any) | undefined;
|
105
|
-
"onUpdate:selectAll"?: ((value: boolean) => any) | undefined;
|
106
|
-
"onItem:selected"?: ((value: any) => any) | undefined;
|
107
|
-
"onItem:unselected"?: ((value: any) => any) | undefined;
|
108
|
-
"onUpdate:select-all"?: ((args_0: select) => any) | undefined;
|
109
|
-
}>, {
|
110
|
-
dependencies: any[];
|
111
|
-
depsDebounceTime: number;
|
112
|
-
multiple: boolean;
|
113
|
-
modelValue: any;
|
114
|
-
items: any[] | ((prefill: boolean, modelValue?: any[]) => Promise<any[]>) | ((prefill: boolean, modelValue?: any[]) => any[]);
|
115
|
-
max: number;
|
116
|
-
align: "left" | "center" | "right";
|
117
|
-
columns: BbTableColumn[];
|
118
|
-
allowSelectAll: boolean;
|
119
|
-
fixedColumns: (number | {
|
120
|
-
index: number;
|
121
|
-
position: "left" | "right";
|
122
|
-
})[];
|
123
|
-
actionsText: string;
|
124
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
125
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
126
100
|
export default _default;
|
127
|
-
type
|
128
|
-
|
129
|
-
|
130
|
-
};
|
131
|
-
};
|
101
|
+
type __VLS_PrettifyLocal<T> = {
|
102
|
+
[K in keyof T]: T[K];
|
103
|
+
} & {};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Classes } from '../../types/Classes';
|
2
2
|
import { Option } from '../../types/Option';
|
3
3
|
import { InputHTMLAttributes } from 'vue';
|
4
|
-
export type BaseColumn = {
|
4
|
+
export type BaseColumn<T extends string, Item extends object> = {
|
5
5
|
/**
|
6
6
|
* When set to false the formatter will not run on nullish values.
|
7
7
|
* By default is true so you can create virtual columns with keys that do not
|
@@ -15,11 +15,11 @@ export type BaseColumn = {
|
|
15
15
|
* @param key Key of the column taken from the column definition.
|
16
16
|
* @param item Item of the row.
|
17
17
|
*/
|
18
|
-
formatter?: (content: any, key: string, item:
|
18
|
+
formatter?: (content: any, key: string, item: Item) => any;
|
19
19
|
/**
|
20
20
|
* Key identifying the column.
|
21
21
|
*/
|
22
|
-
key:
|
22
|
+
key: T;
|
23
23
|
/**
|
24
24
|
* Text used in the header for this column.
|
25
25
|
*/
|
@@ -32,26 +32,30 @@ export type BaseColumn = {
|
|
32
32
|
/**
|
33
33
|
* Type used to infer the bahaviour of a single column. You can either extract data or provide elements useful for styling.
|
34
34
|
*/
|
35
|
-
export type BbTableColumn = BaseColumn & {
|
35
|
+
export type BbTableColumn<T extends string = string, Item extends object = any> = BaseColumn<T, Item> & {
|
36
36
|
/**
|
37
37
|
* Text alignment of the column.
|
38
38
|
*/
|
39
39
|
align?: 'left' | 'right' | 'center';
|
40
|
+
/**
|
41
|
+
* Defines the sorting direction of the column.
|
42
|
+
*/
|
43
|
+
sorted?: 'asc' | 'desc';
|
40
44
|
/**
|
41
45
|
* Defines the classes to be passed to the `<td>` elements. Can also be a function for dynamic values.
|
42
46
|
*/
|
43
|
-
tdClass?: ColumnClasses
|
47
|
+
tdClass?: ColumnClasses<Item>;
|
44
48
|
/**
|
45
49
|
* Defines the classes to be passed to the `<th>`.
|
46
50
|
*/
|
47
51
|
thClass?: Classes;
|
48
52
|
};
|
49
|
-
export type BbTableProps = {
|
53
|
+
export type BbTableProps<T extends string, Item extends object> = {
|
50
54
|
/**
|
51
55
|
* Function that accepts the columns and the current item as
|
52
56
|
* arguments and returns a label to be used for accessibility purposes.
|
53
57
|
*/
|
54
|
-
accessibleLabel?: (columns: MappedCell[], item: any) => string;
|
58
|
+
accessibleLabel?: (columns: MappedCell<T>[], item: any) => string;
|
55
59
|
/**
|
56
60
|
* Displays the actions column.
|
57
61
|
*/
|
@@ -76,7 +80,7 @@ export type BbTableProps = {
|
|
76
80
|
* Array of definitions of how the columns should be rendered.
|
77
81
|
*
|
78
82
|
*/
|
79
|
-
columns: BbTableColumn[];
|
83
|
+
columns: BbTableColumn<T, Item>[];
|
80
84
|
/**
|
81
85
|
* Adds a CSS class that applies a compact style to the component.
|
82
86
|
*/
|
@@ -116,8 +120,8 @@ export type BbTableProps = {
|
|
116
120
|
* Boolean that sets the headers as sticky to the top of the table.
|
117
121
|
*/
|
118
122
|
fixedHeaders?: boolean;
|
119
|
-
items:
|
120
|
-
itemValue?: string | ((item:
|
123
|
+
items: Item[] | ((prefill: boolean, modelValue?: any[]) => Promise<Item[]>) | ((prefill: boolean, modelValue?: any[]) => Item[]);
|
124
|
+
itemValue?: string | ((item: Item) => any);
|
121
125
|
/**
|
122
126
|
* Text content of the legend.
|
123
127
|
*/
|
@@ -162,12 +166,16 @@ export type BbTableProps = {
|
|
162
166
|
* Sets the input in a readonly state.
|
163
167
|
*/
|
164
168
|
readonly?: boolean;
|
169
|
+
/**
|
170
|
+
* Defines whether the "Select all" checkbox is checked.
|
171
|
+
*/
|
172
|
+
selectAll?: boolean;
|
165
173
|
/**
|
166
174
|
* Defines whether the table is selectable.
|
167
175
|
* Can be a global boolean that affects all rows or a function
|
168
176
|
* that accepts an item and returns a boolean that only affects that item.
|
169
177
|
*/
|
170
|
-
selectable?: boolean | ((item:
|
178
|
+
selectable?: boolean | ((item: Item) => boolean);
|
171
179
|
/**
|
172
180
|
* Text of the label used by the "Select all" boolean.
|
173
181
|
*/
|
@@ -179,7 +187,7 @@ export type BbTableProps = {
|
|
179
187
|
/**
|
180
188
|
* Defines the classes to be passed to the `<td>` elements. Can also be a function for dynamic values.
|
181
189
|
*/
|
182
|
-
tdClass?: ColumnClasses
|
190
|
+
tdClass?: ColumnClasses<Item>;
|
183
191
|
/**
|
184
192
|
* Defines the classes to be passed to the `<th>`.
|
185
193
|
*/
|
@@ -188,18 +196,22 @@ export type BbTableProps = {
|
|
188
196
|
* Total number of items there is.
|
189
197
|
*/
|
190
198
|
totalItems?: number;
|
199
|
+
/**
|
200
|
+
* Items that are not selected.
|
201
|
+
*/
|
202
|
+
unselectedItems?: any[];
|
191
203
|
};
|
192
204
|
/**
|
193
205
|
* We allow table data classes to be a function so it can depend on the item
|
194
206
|
*/
|
195
|
-
export type ColumnClasses = Classes | ((content: any, key: string, item:
|
207
|
+
export type ColumnClasses<Item extends object> = Classes | ((content: any, key: string, item: Item) => Classes);
|
196
208
|
/**
|
197
209
|
* Projection that represents a row of cells with flags
|
198
210
|
* linked to the state of the item
|
199
211
|
*/
|
200
|
-
export type MappedItem = Option & {
|
212
|
+
export type MappedItem<T extends string> = Option & {
|
201
213
|
accessibleLabel: string;
|
202
|
-
cols: MappedCell[];
|
214
|
+
cols: MappedCell<T>[];
|
203
215
|
onRowClick: (event: MouseEvent) => void;
|
204
216
|
onRowContextMenu: (event: MouseEvent) => void;
|
205
217
|
onRowDblClick: (event: MouseEvent) => void;
|
@@ -208,23 +220,24 @@ export type MappedItem = Option & {
|
|
208
220
|
/**
|
209
221
|
* Projection that represnets a header
|
210
222
|
*/
|
211
|
-
export type MappedHeader = {
|
223
|
+
export type MappedHeader<DynamicHeaderSlots extends string> = {
|
212
224
|
align: HTMLTableCellElement['align'];
|
213
225
|
classes?: Classes[];
|
214
226
|
key: string;
|
215
227
|
label: string;
|
216
|
-
slotName:
|
228
|
+
slotName: DynamicHeaderSlots;
|
229
|
+
sortDirection?: 'ascending' | 'descending';
|
217
230
|
};
|
218
231
|
/**
|
219
232
|
* Projection that represents a cell of data.
|
220
233
|
*/
|
221
|
-
export type MappedCell = {
|
234
|
+
export type MappedCell<DynamicBodySlots extends string> = {
|
222
235
|
align: string;
|
223
236
|
classes: Classes[];
|
224
237
|
content: string;
|
225
238
|
key: string;
|
226
239
|
label: string;
|
227
|
-
slotName:
|
240
|
+
slotName: DynamicBodySlots;
|
228
241
|
};
|
229
242
|
export type BbTableEvents = {
|
230
243
|
(e: 'click:row', event: MouseEvent, item: any, selected: boolean): void;
|
@@ -232,10 +245,11 @@ export type BbTableEvents = {
|
|
232
245
|
(e: 'dblclick:row', event: MouseEvent, item: any, selected: boolean): void;
|
233
246
|
(e: 'update:modelValue', value: any): void;
|
234
247
|
(e: 'update:selectAll', value: boolean): void;
|
248
|
+
(e: 'update:unselectedItems', value: any[]): void;
|
235
249
|
(e: 'item:selected', value: any): void;
|
236
250
|
(e: 'item:unselected', value: any): void;
|
237
251
|
};
|
238
|
-
export type BbTableSlots = {
|
252
|
+
export type BbTableSlots<DynamicBodySlots extends string, DynamicHeaderSlots extends string, Item extends object> = {
|
239
253
|
thead?: (props: object) => any;
|
240
254
|
tbody?: (props: object) => any;
|
241
255
|
tfoot?: (props: object) => any;
|
@@ -248,15 +262,15 @@ export type BbTableSlots = {
|
|
248
262
|
text: string;
|
249
263
|
}) => any;
|
250
264
|
loading?: (props: {
|
251
|
-
items:
|
265
|
+
items: Item[];
|
252
266
|
}) => any;
|
253
267
|
'no-data'?: (props: object) => any;
|
254
268
|
actions?: (props: {
|
255
|
-
item:
|
269
|
+
item: Item;
|
256
270
|
value: any;
|
257
271
|
}) => any;
|
258
272
|
select?: (props: {
|
259
|
-
item:
|
273
|
+
item: Item;
|
260
274
|
value: any;
|
261
275
|
checked: boolean;
|
262
276
|
disabled: boolean;
|
@@ -264,12 +278,17 @@ export type BbTableSlots = {
|
|
264
278
|
readonly: boolean;
|
265
279
|
}) => any;
|
266
280
|
} & {
|
267
|
-
[
|
281
|
+
[K in DynamicBodySlots]?: (props: {
|
268
282
|
classes?: Classes[];
|
269
283
|
content?: any;
|
270
|
-
|
271
|
-
item: any;
|
272
|
-
label?: string;
|
284
|
+
item: Item;
|
273
285
|
value?: any;
|
274
286
|
}) => any;
|
287
|
+
} & {
|
288
|
+
[K in DynamicHeaderSlots]?: (props: {
|
289
|
+
classes?: Classes[];
|
290
|
+
content?: any;
|
291
|
+
items?: Item[];
|
292
|
+
label?: string;
|
293
|
+
}) => any;
|
275
294
|
};
|