@adyen/bento-vue2 0.0.8 → 0.0.9
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/@types/components/button/button.vue.d.ts +1 -0
- package/dist/@types/components/data-grid/components/data-grid-columns.vue.d.ts +74 -0
- package/dist/@types/components/data-grid/components/index.d.ts +1 -0
- package/dist/@types/components/data-grid/composables/index.d.ts +4 -0
- package/dist/@types/components/data-grid/composables/useCalculateColumnWidth/useCalculateColumnWidth.d.ts +23 -4
- package/dist/@types/components/data-grid/composables/useResizer.d.ts +3 -12
- package/dist/@types/components/data-grid/composables/useSelector.d.ts +1 -1
- package/dist/@types/components/data-grid/composables/useSorter.d.ts +1 -1
- package/dist/@types/components/data-grid/data-grid.types.d.ts +10 -0
- package/dist/@types/components/data-grid/data-grid.vue.d.ts +12 -31
- package/dist/@types/utils/ts/debounce/debounce.d.ts +2 -0
- package/dist/@types/utils/ts/debounce/index.d.ts +1 -0
- package/dist/@types/utils/ts/hasSlot.d.ts +2 -0
- package/dist/@types/utils/ts/i18n.d.ts +5 -0
- package/dist/index.js +1321 -1243
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/@types/i18n/index.d.ts +0 -8
|
@@ -31,6 +31,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
31
31
|
[x: string]: boolean;
|
|
32
32
|
}>;
|
|
33
33
|
onClickButton: () => void;
|
|
34
|
+
hasSlot: (name: string) => boolean;
|
|
34
35
|
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, ("blur" | "click" | "focus" | "keydown.esc")[], string, Readonly<import("vue").ExtractPropTypes<{
|
|
35
36
|
disabled: {
|
|
36
37
|
type: BooleanConstructor;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { BentoColumn, BentoDatagridAllItemsSelectedState, BentoDatagridSortByColumn, BentoDatagridSortDirection } from '../data-grid.types';
|
|
3
|
+
import { BentoTypographyElement } from '@/components/typography';
|
|
4
|
+
declare const _default: import("vue").DefineComponent<{
|
|
5
|
+
columns: {
|
|
6
|
+
type: PropType<BentoColumn[]>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
hasResizableColumns: {
|
|
10
|
+
type: BooleanConstructor;
|
|
11
|
+
default: boolean;
|
|
12
|
+
};
|
|
13
|
+
allItemsSelectedState: {
|
|
14
|
+
type: PropType<BentoDatagridAllItemsSelectedState>;
|
|
15
|
+
default: any;
|
|
16
|
+
};
|
|
17
|
+
sortBy: {
|
|
18
|
+
type: PropType<BentoDatagridSortByColumn[]>;
|
|
19
|
+
default: () => any[];
|
|
20
|
+
};
|
|
21
|
+
gridColumnWidthStyle: {
|
|
22
|
+
type: ObjectConstructor;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
DATAGRID_SELECT_FIELD_NAME: string;
|
|
27
|
+
conditionalColumnClasses: (column: BentoColumn) => {
|
|
28
|
+
'b-data-grid-columns__column--sortable': boolean;
|
|
29
|
+
'b-data-grid-columns__column--padding-left-unset': boolean;
|
|
30
|
+
'b-data-grid-columns__column--padding-right-unset': boolean;
|
|
31
|
+
'b-data-grid-columns__column--numeric': boolean;
|
|
32
|
+
};
|
|
33
|
+
conditionalColumnSeperatorClasses: import("vue").ComputedRef<{
|
|
34
|
+
'b-data-grid-columns__column-seperator-container--is-resizeable': boolean;
|
|
35
|
+
}>;
|
|
36
|
+
allItemsSelectedCheckboxState: import("vue").Ref<{
|
|
37
|
+
allItemsSelected: boolean;
|
|
38
|
+
isIndeterminate: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
onAllRowSelect: (areAllItemsSelected: boolean) => void;
|
|
41
|
+
conditionalSortDirectionClasses: (field: string, direction: BentoDatagridSortDirection) => {
|
|
42
|
+
'b-data-grid-columns__column-sort-icon--sorted': boolean;
|
|
43
|
+
};
|
|
44
|
+
sortByColumnField: (field: string) => void;
|
|
45
|
+
startResize: (hasResizableColumns: boolean, field: string, event: MouseEvent) => void;
|
|
46
|
+
BentoDatagridSortDirection: typeof BentoDatagridSortDirection;
|
|
47
|
+
BentoTypographyElement: typeof BentoTypographyElement;
|
|
48
|
+
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, ("sort" | "column-resize" | "select-all-rows")[], string, Readonly<import("vue").ExtractPropTypes<{
|
|
49
|
+
columns: {
|
|
50
|
+
type: PropType<BentoColumn[]>;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
hasResizableColumns: {
|
|
54
|
+
type: BooleanConstructor;
|
|
55
|
+
default: boolean;
|
|
56
|
+
};
|
|
57
|
+
allItemsSelectedState: {
|
|
58
|
+
type: PropType<BentoDatagridAllItemsSelectedState>;
|
|
59
|
+
default: any;
|
|
60
|
+
};
|
|
61
|
+
sortBy: {
|
|
62
|
+
type: PropType<BentoDatagridSortByColumn[]>;
|
|
63
|
+
default: () => any[];
|
|
64
|
+
};
|
|
65
|
+
gridColumnWidthStyle: {
|
|
66
|
+
type: ObjectConstructor;
|
|
67
|
+
required: true;
|
|
68
|
+
};
|
|
69
|
+
}>>, {
|
|
70
|
+
hasResizableColumns: boolean;
|
|
71
|
+
allItemsSelectedState: BentoDatagridAllItemsSelectedState;
|
|
72
|
+
sortBy: BentoDatagridSortByColumn[];
|
|
73
|
+
}>;
|
|
74
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as BentoDataGridColumns } from './data-grid-columns.vue';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as useResizer } from './useResizer';
|
|
2
|
+
export { default as useCalculateColumnWidth, DATAGRID_SELECT_FIELD_NAME, } from './useCalculateColumnWidth/useCalculateColumnWidth';
|
|
3
|
+
export { useSorter } from './useSorter';
|
|
4
|
+
export { useSelector } from './useSelector';
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { BentoColumn } from '../../data-grid.types';
|
|
1
|
+
import { BentoColumn, BentoColumnWidthOverridesLookup } from '../../data-grid.types';
|
|
3
2
|
import { CalculateColumnWidthOptions } from './useCalculateColumnWidth.types';
|
|
3
|
+
import { MaybeRef } from '../../../../types';
|
|
4
4
|
export declare const DEFAULT_COLUMN_WIDTH = 100;
|
|
5
5
|
export declare const DEFAULT_COLUMN_MIN_WIDTH = 50;
|
|
6
6
|
export declare const DATAGRID_SELECT_FIELD_NAME = "b-select";
|
|
7
|
-
export declare const useCalculateColumnWidth: (newColumns: MaybeRef<BentoColumn[]>,
|
|
8
|
-
|
|
7
|
+
export declare const useCalculateColumnWidth: (newColumns: MaybeRef<BentoColumn[]>, bodyRef: MaybeRef<HTMLDivElement | undefined>, options?: CalculateColumnWidthOptions) => {
|
|
8
|
+
columnDefs: import("vue").ComputedRef<{
|
|
9
|
+
width: number;
|
|
10
|
+
field: string;
|
|
11
|
+
label: string;
|
|
12
|
+
minWidth?: number;
|
|
13
|
+
flex?: number;
|
|
14
|
+
sortable?: boolean;
|
|
15
|
+
numeric?: boolean;
|
|
16
|
+
padding?: {
|
|
17
|
+
left?: boolean;
|
|
18
|
+
right?: boolean;
|
|
19
|
+
};
|
|
20
|
+
overflow?: import("../../data-grid.types").BentoColumnOverflow;
|
|
21
|
+
}[]>;
|
|
22
|
+
gridColumnWidthStyle: import("vue").ComputedRef<{
|
|
23
|
+
gridTemplateColumns: string;
|
|
24
|
+
gridColumnEnd: number;
|
|
25
|
+
width: string;
|
|
26
|
+
}>;
|
|
27
|
+
onColumnWidthOverride: (newColumnWidthOverridesLookup: BentoColumnWidthOverridesLookup) => void;
|
|
9
28
|
};
|
|
10
29
|
export default useCalculateColumnWidth;
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { BentoColumn } from '../data-grid.types';
|
|
2
|
+
import { BentoColumn, BentoColumnWidthOverridesLookup } from '../data-grid.types';
|
|
3
3
|
export declare const useResizer: (columns: Ref<BentoColumn[]>, emit: (event: string, ...args: unknown[]) => void) => {
|
|
4
|
-
resizeData:
|
|
5
|
-
resizingColumnField: string;
|
|
6
|
-
offsetLeft: number;
|
|
7
|
-
stepPositionX: number;
|
|
8
|
-
resizedColumnsWidths: {
|
|
9
|
-
[k: string]: {
|
|
10
|
-
width: number;
|
|
11
|
-
minWidth: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
4
|
+
resizeData: Ref<BentoColumnWidthOverridesLookup>;
|
|
15
5
|
allColumnRefs: import("vue").ToRefs<{}>;
|
|
16
6
|
startResize: (hasResizableColumns: boolean, field: BentoColumn['field'], event: MouseEvent) => void;
|
|
17
7
|
};
|
|
8
|
+
export default useResizer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { BentoDatagridData, BentoDatagridDataItemId, BentoDatagridGetDataItemIdFn, BentoDatagridIsDataItemDisabledFn } from '../data-grid.types';
|
|
3
3
|
export declare const useSelector: (selection: Ref<BentoDatagridDataItemId[]>, emit: (event: string, emitedSelectedItems: BentoDatagridDataItemId[]) => void, data: Ref<BentoDatagridData>, getDataItemId: BentoDatagridGetDataItemIdFn, isDataItemDisabled: BentoDatagridIsDataItemDisabledFn) => {
|
|
4
|
-
onAllRowSelect: () => void;
|
|
4
|
+
onAllRowSelect: (allItemsSelected: boolean) => void;
|
|
5
5
|
onRowSelect: () => void;
|
|
6
6
|
allItemsSelectedState: {
|
|
7
7
|
allItemsSelected: boolean;
|
|
@@ -2,7 +2,7 @@ import { Ref } from 'vue';
|
|
|
2
2
|
import { BentoColumn, BentoDatagridSortByColumn, BentoDatagridSortDirection } from '../data-grid.types';
|
|
3
3
|
export declare const useSorter: (sortBy: Ref<BentoDatagridSortByColumn[]>, columns: Ref<BentoColumn[]>, emit: (event: string, updatedSortBy: BentoDatagridSortByColumn[]) => void) => {
|
|
4
4
|
conditionalSortDirectionClasses: (field: string, direction: BentoDatagridSortDirection) => {
|
|
5
|
-
'b-data-
|
|
5
|
+
'b-data-grid-columns__column-sort-icon--sorted': boolean;
|
|
6
6
|
};
|
|
7
7
|
sortByColumnField: (field: string) => void;
|
|
8
8
|
};
|
|
@@ -37,3 +37,13 @@ export type BentoDatagridDataItemId = string | number;
|
|
|
37
37
|
export type BentoDatagridGetDataItemIdFn = (item: BentoDatagridDataItem) => BentoDatagridDataItemId;
|
|
38
38
|
export type BentoDatagridIsDataItemDisabledFn = (item: BentoDatagridDataItem) => boolean;
|
|
39
39
|
export type BentoDatagridPaginationProps = InstanceType<typeof BentoPagination>['$props'];
|
|
40
|
+
export interface BentoColumnWidthOverridesLookup {
|
|
41
|
+
[field: string]: {
|
|
42
|
+
width: BentoColumn['width'];
|
|
43
|
+
minWidth: BentoColumn['minWidth'];
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface BentoDatagridAllItemsSelectedState {
|
|
47
|
+
allItemsSelected: boolean;
|
|
48
|
+
isIndeterminate: boolean;
|
|
49
|
+
}
|
|
@@ -116,7 +116,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
116
116
|
default: () => any[];
|
|
117
117
|
};
|
|
118
118
|
}, {
|
|
119
|
-
|
|
119
|
+
body: import("vue").Ref<HTMLDivElement>;
|
|
120
|
+
columnDefs: import("vue").ComputedRef<{
|
|
120
121
|
width: number;
|
|
121
122
|
field: string;
|
|
122
123
|
label: string;
|
|
@@ -140,12 +141,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
140
141
|
conditionalGridClasses: import("vue").ComputedRef<{
|
|
141
142
|
[x: string]: boolean;
|
|
142
143
|
}>;
|
|
143
|
-
conditionalColumnClasses: (column: BentoColumn) => {
|
|
144
|
-
'b-data-grid__column--sortable': boolean;
|
|
145
|
-
'b-data-grid__column--padding-left-unset': boolean;
|
|
146
|
-
'b-data-grid__column--padding-right-unset': boolean;
|
|
147
|
-
'b-data-grid__column--numeric': boolean;
|
|
148
|
-
};
|
|
149
144
|
conditionalRowClasses: (row: BentoDatagridDataItem) => {
|
|
150
145
|
'b-data-grid__row--disabled': boolean;
|
|
151
146
|
};
|
|
@@ -156,43 +151,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
156
151
|
'b-data-grid__cell--numeric': boolean;
|
|
157
152
|
'b-data-grid__cell--condensed': boolean;
|
|
158
153
|
};
|
|
159
|
-
conditionalColumnSeperatorClasses: import("vue").ComputedRef<{
|
|
160
|
-
'b-data-grid__column-seperator-container--is-resizeable': boolean;
|
|
161
|
-
}>;
|
|
162
154
|
conditionalPaginationClasses: import("vue").ComputedRef<{
|
|
163
155
|
'b-data-grid__pagination--padding-left-unset': boolean;
|
|
164
156
|
'b-data-grid__pagination--padding-right-unset': boolean;
|
|
165
157
|
}>;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
width: number;
|
|
173
|
-
minWidth: number;
|
|
174
|
-
};
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
startResize: (hasResizableColumns: boolean, field: string, event: MouseEvent) => void;
|
|
178
|
-
conditionalSortDirectionClasses: (field: string, direction: BentoDatagridSortDirection) => {
|
|
179
|
-
'b-data-grid__column-sort-icon--sorted': boolean;
|
|
180
|
-
};
|
|
181
|
-
sortByColumnField: (field: string) => void;
|
|
158
|
+
onColumnWidthOverride: (newColumnWidthOverridesLookup: import("./data-grid.types").BentoColumnWidthOverridesLookup) => void;
|
|
159
|
+
onColumnResized: (resizeEvent: {
|
|
160
|
+
field: string;
|
|
161
|
+
width: number;
|
|
162
|
+
}) => void;
|
|
163
|
+
onSort: (updatedSortBy: BentoDatagridSortByColumn[]) => void;
|
|
182
164
|
allItemsSelectedState: {
|
|
183
165
|
allItemsSelected: boolean;
|
|
184
166
|
isIndeterminate: boolean;
|
|
185
167
|
};
|
|
186
168
|
selectedItems: import("vue").Ref<BentoDatagridDataItemId[]>;
|
|
187
|
-
onAllRowSelect: () => void;
|
|
169
|
+
onAllRowSelect: (allItemsSelected: boolean) => void;
|
|
188
170
|
onRowSelect: () => void;
|
|
189
171
|
DATAGRID_SELECT_FIELD_NAME: string;
|
|
190
172
|
BentoDatagridSortDirection: typeof BentoDatagridSortDirection;
|
|
191
173
|
BentoTypographyElement: typeof BentoTypographyElement;
|
|
192
174
|
BentoTypographyVariant: typeof BentoTypographyVariant;
|
|
193
|
-
|
|
175
|
+
onPaginationNavigate: (page: number) => void;
|
|
194
176
|
onItemsPerPageChange: (itemsPerPage: number) => void;
|
|
195
|
-
body: any;
|
|
196
177
|
}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, ("sort" | "navigate" | "select" | "items-page" | "column-resize" | "update:filters")[], string, Readonly<import("vue").ExtractPropTypes<{
|
|
197
178
|
condensed: {
|
|
198
179
|
type: BooleanConstructor;
|
|
@@ -312,12 +293,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
312
293
|
loading: boolean;
|
|
313
294
|
condensed: boolean;
|
|
314
295
|
filters: import("../filter-bar").BentoFilterBarModel;
|
|
315
|
-
getDataItemId: BentoDatagridGetDataItemIdFn;
|
|
316
296
|
hasResizableColumns: boolean;
|
|
297
|
+
sortBy: BentoDatagridSortByColumn[];
|
|
298
|
+
getDataItemId: BentoDatagridGetDataItemIdFn;
|
|
317
299
|
isDataItemDisabled: BentoDatagridIsDataItemDisabledFn;
|
|
318
300
|
pagination: any;
|
|
319
301
|
selectable: boolean;
|
|
320
302
|
selection: BentoDatagridDataItemId[];
|
|
321
|
-
sortBy: BentoDatagridSortByColumn[];
|
|
322
303
|
}>;
|
|
323
304
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './debounce';
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { WritableComputedRef } from 'vue';
|
|
2
2
|
import VueI18n from 'vue-i18n';
|
|
3
|
+
export declare const defaultI18nOptions: {
|
|
4
|
+
locale: string;
|
|
5
|
+
fallbackLocale: string;
|
|
6
|
+
fallbackRoot: boolean;
|
|
7
|
+
};
|
|
3
8
|
export declare function createI18n(options?: VueI18n.I18nOptions): VueI18n;
|
|
4
9
|
export interface Composer {
|
|
5
10
|
locale: WritableComputedRef<string>;
|