@hbdlzy/ui-core 0.1.3 → 0.1.5

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 (82) hide show
  1. package/README.md +7 -0
  2. package/components.manifest.json +10 -0
  3. package/dist/components/BaseCard/BaseCard.types.d.ts +36 -36
  4. package/dist/components/BaseCard/BaseCard.vue.d.ts +122 -122
  5. package/dist/components/BaseCard/index.d.ts +3 -3
  6. package/dist/components/BaseEChart/BaseEChart.types.d.ts +26 -26
  7. package/dist/components/BaseEChart/BaseEChart.vue.d.ts +66 -66
  8. package/dist/components/BaseEChart/index.d.ts +3 -3
  9. package/dist/components/BaseExportButton/BaseExportButton.types.d.ts +21 -21
  10. package/dist/components/BaseExportButton/BaseExportButton.utils.d.ts +4 -4
  11. package/dist/components/BaseExportButton/BaseExportButton.vue.d.ts +128 -128
  12. package/dist/components/BaseExportButton/index.d.ts +5 -5
  13. package/dist/components/BaseTable/BaseTable.types.d.ts +163 -163
  14. package/dist/components/BaseTable/BaseTable.vue.d.ts +157 -157
  15. package/dist/components/BaseTable/index.d.ts +3 -3
  16. package/dist/components/OutlinedCascader/OutlinedCascader.types.d.ts +25 -25
  17. package/dist/components/OutlinedCascader/OutlinedCascader.vue.d.ts +85 -85
  18. package/dist/components/OutlinedCascader/index.d.ts +3 -3
  19. package/dist/components/OutlinedDatePicker/OutlinedDatePicker.types.d.ts +27 -27
  20. package/dist/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +88 -88
  21. package/dist/components/OutlinedDatePicker/index.d.ts +3 -3
  22. package/dist/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.d.ts +26 -26
  23. package/dist/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue.d.ts +97 -97
  24. package/dist/components/OutlinedDateTimePicker/index.d.ts +3 -3
  25. package/dist/components/OutlinedInput/OutlinedInput.types.d.ts +29 -29
  26. package/dist/components/OutlinedInput/OutlinedInput.vue.d.ts +97 -97
  27. package/dist/components/OutlinedInput/index.d.ts +3 -3
  28. package/dist/components/OutlinedSelect/OutlinedSelect.types.d.ts +38 -38
  29. package/dist/components/OutlinedSelect/OutlinedSelect.vue.d.ts +116 -116
  30. package/dist/components/OutlinedSelect/index.d.ts +3 -3
  31. package/dist/components/OutlinedTimePicker/OutlinedTimePicker.types.d.ts +28 -28
  32. package/dist/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +94 -94
  33. package/dist/components/OutlinedTimePicker/index.d.ts +3 -3
  34. package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.types.d.ts +46 -46
  35. package/dist/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +137 -137
  36. package/dist/components/OutlinedTreeSelect/index.d.ts +3 -3
  37. package/dist/echarts/index.d.ts +9 -9
  38. package/dist/excel/exportExcel.d.ts +18 -18
  39. package/dist/index.cjs +42 -1
  40. package/dist/index.d.ts +27 -26
  41. package/dist/index.js +169 -1
  42. package/dist/ripple/index.d.ts +2 -0
  43. package/package.json +6 -2
  44. package/src/index.ts +5 -0
  45. package/src/ripple/index.ts +213 -0
  46. package/src/components/BaseCard/BaseCard.types.d.ts +0 -36
  47. package/src/components/BaseCard/BaseCard.vue.d.ts +0 -122
  48. package/src/components/BaseCard/index.d.ts +0 -3
  49. package/src/components/BaseEChart/BaseEChart.types.d.ts +0 -26
  50. package/src/components/BaseEChart/BaseEChart.vue.d.ts +0 -66
  51. package/src/components/BaseEChart/index.d.ts +0 -3
  52. package/src/components/BaseExportButton/BaseExportButton.types.d.ts +0 -21
  53. package/src/components/BaseExportButton/BaseExportButton.utils.d.ts +0 -4
  54. package/src/components/BaseExportButton/BaseExportButton.vue.d.ts +0 -128
  55. package/src/components/BaseExportButton/index.d.ts +0 -5
  56. package/src/components/BaseTable/BaseTable.types.d.ts +0 -163
  57. package/src/components/BaseTable/BaseTable.vue.d.ts +0 -157
  58. package/src/components/BaseTable/index.d.ts +0 -3
  59. package/src/components/OutlinedCascader/OutlinedCascader.types.d.ts +0 -25
  60. package/src/components/OutlinedCascader/OutlinedCascader.vue.d.ts +0 -85
  61. package/src/components/OutlinedCascader/index.d.ts +0 -3
  62. package/src/components/OutlinedDatePicker/OutlinedDatePicker.types.d.ts +0 -27
  63. package/src/components/OutlinedDatePicker/OutlinedDatePicker.vue.d.ts +0 -88
  64. package/src/components/OutlinedDatePicker/index.d.ts +0 -3
  65. package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.types.d.ts +0 -26
  66. package/src/components/OutlinedDateTimePicker/OutlinedDateTimePicker.vue.d.ts +0 -97
  67. package/src/components/OutlinedDateTimePicker/index.d.ts +0 -3
  68. package/src/components/OutlinedInput/OutlinedInput.types.d.ts +0 -29
  69. package/src/components/OutlinedInput/OutlinedInput.vue.d.ts +0 -97
  70. package/src/components/OutlinedInput/index.d.ts +0 -3
  71. package/src/components/OutlinedSelect/OutlinedSelect.types.d.ts +0 -38
  72. package/src/components/OutlinedSelect/OutlinedSelect.vue.d.ts +0 -116
  73. package/src/components/OutlinedSelect/index.d.ts +0 -3
  74. package/src/components/OutlinedTimePicker/OutlinedTimePicker.types.d.ts +0 -28
  75. package/src/components/OutlinedTimePicker/OutlinedTimePicker.vue.d.ts +0 -94
  76. package/src/components/OutlinedTimePicker/index.d.ts +0 -3
  77. package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.types.d.ts +0 -46
  78. package/src/components/OutlinedTreeSelect/OutlinedTreeSelect.vue.d.ts +0 -137
  79. package/src/components/OutlinedTreeSelect/index.d.ts +0 -3
  80. package/src/echarts/index.d.ts +0 -9
  81. package/src/excel/exportExcel.d.ts +0 -18
  82. package/src/index.d.ts +0 -26
@@ -1,128 +1,128 @@
1
- import type { PropType } from 'vue';
2
- import { type ExcelExportOptions } from '../../excel/exportExcel';
3
- import type { ExportBeforeHandler, ExportRequestHandler, ExportSuccessPayload } from './BaseExportButton.types';
4
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
- label: {
6
- type: StringConstructor;
7
- default: string;
8
- };
9
- type: {
10
- type: PropType<"" | "info" | "primary" | "success" | "warning" | "danger">;
11
- default: string;
12
- };
13
- size: {
14
- type: PropType<"default" | "small" | "large">;
15
- default: string;
16
- };
17
- plain: {
18
- type: BooleanConstructor;
19
- default: boolean;
20
- };
21
- link: {
22
- type: BooleanConstructor;
23
- default: boolean;
24
- };
25
- text: {
26
- type: BooleanConstructor;
27
- default: boolean;
28
- };
29
- disabled: {
30
- type: BooleanConstructor;
31
- default: boolean;
32
- };
33
- fileName: {
34
- type: StringConstructor;
35
- default: string;
36
- };
37
- excelOptions: PropType<ExcelExportOptions<Record<string, any>>>;
38
- requestHandler: PropType<ExportRequestHandler>;
39
- beforeExport: PropType<ExportBeforeHandler>;
40
- successMessage: {
41
- type: StringConstructor;
42
- default: string;
43
- };
44
- errorMessage: {
45
- type: StringConstructor;
46
- default: string;
47
- };
48
- autoMessage: {
49
- type: BooleanConstructor;
50
- default: boolean;
51
- };
52
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
53
- start: () => void;
54
- success: (payload: ExportSuccessPayload) => void;
55
- error: (error: unknown) => void;
56
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
57
- label: {
58
- type: StringConstructor;
59
- default: string;
60
- };
61
- type: {
62
- type: PropType<"" | "info" | "primary" | "success" | "warning" | "danger">;
63
- default: string;
64
- };
65
- size: {
66
- type: PropType<"default" | "small" | "large">;
67
- default: string;
68
- };
69
- plain: {
70
- type: BooleanConstructor;
71
- default: boolean;
72
- };
73
- link: {
74
- type: BooleanConstructor;
75
- default: boolean;
76
- };
77
- text: {
78
- type: BooleanConstructor;
79
- default: boolean;
80
- };
81
- disabled: {
82
- type: BooleanConstructor;
83
- default: boolean;
84
- };
85
- fileName: {
86
- type: StringConstructor;
87
- default: string;
88
- };
89
- excelOptions: PropType<ExcelExportOptions<Record<string, any>>>;
90
- requestHandler: PropType<ExportRequestHandler>;
91
- beforeExport: PropType<ExportBeforeHandler>;
92
- successMessage: {
93
- type: StringConstructor;
94
- default: string;
95
- };
96
- errorMessage: {
97
- type: StringConstructor;
98
- default: string;
99
- };
100
- autoMessage: {
101
- type: BooleanConstructor;
102
- default: boolean;
103
- };
104
- }>> & Readonly<{
105
- onError?: ((error: unknown) => any) | undefined;
106
- onSuccess?: ((payload: ExportSuccessPayload) => any) | undefined;
107
- onStart?: (() => any) | undefined;
108
- }>, {
109
- type: "" | "info" | "primary" | "success" | "warning" | "danger";
110
- label: string;
111
- link: boolean;
112
- text: boolean;
113
- disabled: boolean;
114
- fileName: string;
115
- size: "default" | "small" | "large";
116
- plain: boolean;
117
- successMessage: string;
118
- errorMessage: string;
119
- autoMessage: boolean;
120
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
121
- default?(_: {}): any;
122
- }>;
123
- export default _default;
124
- type __VLS_WithTemplateSlots<T, S> = T & {
125
- new (): {
126
- $slots: S;
127
- };
128
- };
1
+ import type { PropType } from 'vue';
2
+ import { type ExcelExportOptions } from '../../excel/exportExcel';
3
+ import type { ExportBeforeHandler, ExportRequestHandler, ExportSuccessPayload } from './BaseExportButton.types';
4
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
5
+ label: {
6
+ type: StringConstructor;
7
+ default: string;
8
+ };
9
+ type: {
10
+ type: PropType<"" | "info" | "primary" | "success" | "warning" | "danger">;
11
+ default: string;
12
+ };
13
+ size: {
14
+ type: PropType<"default" | "small" | "large">;
15
+ default: string;
16
+ };
17
+ plain: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
21
+ link: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ text: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ disabled: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ fileName: {
34
+ type: StringConstructor;
35
+ default: string;
36
+ };
37
+ excelOptions: PropType<ExcelExportOptions<Record<string, any>>>;
38
+ requestHandler: PropType<ExportRequestHandler>;
39
+ beforeExport: PropType<ExportBeforeHandler>;
40
+ successMessage: {
41
+ type: StringConstructor;
42
+ default: string;
43
+ };
44
+ errorMessage: {
45
+ type: StringConstructor;
46
+ default: string;
47
+ };
48
+ autoMessage: {
49
+ type: BooleanConstructor;
50
+ default: boolean;
51
+ };
52
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
53
+ start: () => void;
54
+ success: (payload: ExportSuccessPayload) => void;
55
+ error: (error: unknown) => void;
56
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
57
+ label: {
58
+ type: StringConstructor;
59
+ default: string;
60
+ };
61
+ type: {
62
+ type: PropType<"" | "info" | "primary" | "success" | "warning" | "danger">;
63
+ default: string;
64
+ };
65
+ size: {
66
+ type: PropType<"default" | "small" | "large">;
67
+ default: string;
68
+ };
69
+ plain: {
70
+ type: BooleanConstructor;
71
+ default: boolean;
72
+ };
73
+ link: {
74
+ type: BooleanConstructor;
75
+ default: boolean;
76
+ };
77
+ text: {
78
+ type: BooleanConstructor;
79
+ default: boolean;
80
+ };
81
+ disabled: {
82
+ type: BooleanConstructor;
83
+ default: boolean;
84
+ };
85
+ fileName: {
86
+ type: StringConstructor;
87
+ default: string;
88
+ };
89
+ excelOptions: PropType<ExcelExportOptions<Record<string, any>>>;
90
+ requestHandler: PropType<ExportRequestHandler>;
91
+ beforeExport: PropType<ExportBeforeHandler>;
92
+ successMessage: {
93
+ type: StringConstructor;
94
+ default: string;
95
+ };
96
+ errorMessage: {
97
+ type: StringConstructor;
98
+ default: string;
99
+ };
100
+ autoMessage: {
101
+ type: BooleanConstructor;
102
+ default: boolean;
103
+ };
104
+ }>> & Readonly<{
105
+ onError?: ((error: unknown) => any) | undefined;
106
+ onSuccess?: ((payload: ExportSuccessPayload) => any) | undefined;
107
+ onStart?: (() => any) | undefined;
108
+ }>, {
109
+ type: "" | "info" | "primary" | "success" | "warning" | "danger";
110
+ label: string;
111
+ link: boolean;
112
+ text: boolean;
113
+ disabled: boolean;
114
+ fileName: string;
115
+ size: "default" | "small" | "large";
116
+ plain: boolean;
117
+ successMessage: string;
118
+ errorMessage: string;
119
+ autoMessage: boolean;
120
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
121
+ default?(_: {}): any;
122
+ }>;
123
+ export default _default;
124
+ type __VLS_WithTemplateSlots<T, S> = T & {
125
+ new (): {
126
+ $slots: S;
127
+ };
128
+ };
@@ -1,5 +1,5 @@
1
- import BaseExportButton from './BaseExportButton.vue';
2
- export { BaseExportButton };
3
- export { downloadExportResponse, extractFileNameFromDisposition, normalizeExportFileName } from './BaseExportButton.utils';
4
- export type { BaseExportExcelConfig, BaseExportRequestConfig, ExportBeforeHandler, ExportMode, ExportRequestHandler, ExportResponseHeaders, ExportResponseLike, ExportSuccessPayload } from './BaseExportButton.types';
5
- export default BaseExportButton;
1
+ import BaseExportButton from './BaseExportButton.vue';
2
+ export { BaseExportButton };
3
+ export { downloadExportResponse, extractFileNameFromDisposition, normalizeExportFileName } from './BaseExportButton.utils';
4
+ export type { BaseExportExcelConfig, BaseExportRequestConfig, ExportBeforeHandler, ExportMode, ExportRequestHandler, ExportResponseHeaders, ExportResponseLike, ExportSuccessPayload } from './BaseExportButton.types';
5
+ export default BaseExportButton;
@@ -1,163 +1,163 @@
1
- export type BaseTableCssValue = string | number;
2
- export type BaseTableAlign = 'left' | 'center' | 'right';
3
- export type BaseTableColumnKind = 'text' | 'link' | 'actions' | 'image' | 'tag' | 'html' | 'input';
4
- export type BaseTableSortOrder = 'ascending' | 'descending' | null;
5
- export type BaseTableSortDirection = string | null;
6
- export interface BaseTableHeaderSearchConfig {
7
- paramKey?: string;
8
- placeholder?: string;
9
- width?: BaseTableCssValue;
10
- searchText?: string;
11
- resetText?: string;
12
- }
13
- export interface BaseTableOption {
14
- label: string;
15
- value: string | number | boolean;
16
- tagType?: '' | 'success' | 'warning' | 'info' | 'danger' | 'primary';
17
- color?: string;
18
- }
19
- export interface BaseTableAction<Row = Record<string, any>> {
20
- label: string;
21
- type: string;
22
- buttonType?: '' | 'primary' | 'success' | 'warning' | 'info' | 'danger';
23
- disabled?: boolean | ((row: Row) => boolean);
24
- visible?: boolean | ((row: Row) => boolean);
25
- }
26
- export interface BaseTableColumn<Row = Record<string, any>> {
27
- label: string;
28
- prop?: keyof Row | string;
29
- kind?: BaseTableColumnKind;
30
- type?: string;
31
- width?: BaseTableCssValue;
32
- minWidth?: BaseTableCssValue;
33
- align?: BaseTableAlign;
34
- headerAlign?: BaseTableAlign;
35
- fixed?: boolean | 'left' | 'right';
36
- sortable?: boolean | 'custom';
37
- sortField?: string;
38
- headerSearch?: boolean | BaseTableHeaderSearchConfig;
39
- showOverflowTooltip?: boolean;
40
- className?: string;
41
- headerClassName?: string;
42
- actions?: BaseTableAction<Row>[];
43
- clickable?: boolean;
44
- options?: BaseTableOption[];
45
- optionValueKey?: string;
46
- optionLabelKey?: string;
47
- optionTagTypeKey?: string;
48
- emptyText?: string;
49
- inputType?: string;
50
- imageFit?: '' | 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
51
- imageWidth?: BaseTableCssValue;
52
- imageHeight?: BaseTableCssValue;
53
- slotName?: string;
54
- headerSlotName?: string;
55
- formatter?: (row: Row, column: BaseTableColumn<Row>) => unknown;
56
- html?: (row: Row, column: BaseTableColumn<Row>) => string;
57
- clickHandler?: (row: Row, column: BaseTableColumn<Row>) => void;
58
- inputHandler?: (value: string, row: Row, column: BaseTableColumn<Row>) => void;
59
- }
60
- export interface BaseTablePagination {
61
- currentPage: number;
62
- pageSize: number;
63
- total: number;
64
- pageSizes: number[];
65
- }
66
- export interface BaseTableRequestParams {
67
- currentPage: number;
68
- pageSize: number;
69
- [key: string]: unknown;
70
- }
71
- export interface BaseTableSortState {
72
- prop?: string;
73
- order: BaseTableSortOrder;
74
- }
75
- export interface BaseTableSortOrderMap {
76
- ascending: string;
77
- descending: string;
78
- }
79
- export interface BaseTableRequestResult<Row = Record<string, any>> {
80
- records?: Row[];
81
- list?: Row[];
82
- items?: Row[];
83
- total?: number;
84
- data?: {
85
- records?: Row[];
86
- list?: Row[];
87
- items?: Row[];
88
- total?: number;
89
- };
90
- }
91
- export interface BaseTableNormalizedResult<Row = Record<string, any>> {
92
- rows?: Row[];
93
- total?: number;
94
- }
95
- export type BaseTableRequestHandler<Row = Record<string, any>> = (params: BaseTableRequestParams) => Promise<BaseTableRequestResult<Row> | Row[]>;
96
- export type BaseTableResultAdapter<Row = Record<string, any>> = (result: unknown, params: BaseTableRequestParams) => BaseTableNormalizedResult<Row>;
97
- export interface BaseTableProps<Row = Record<string, any>> {
98
- columns: BaseTableColumn<Row>[];
99
- data?: Row[];
100
- request?: BaseTableRequestHandler<Row>;
101
- requestParams?: Record<string, unknown>;
102
- resultAdapter?: BaseTableResultAdapter<Row>;
103
- autoLoad?: boolean;
104
- reloadOnParamsChange?: boolean;
105
- reloadOnSortChange?: boolean;
106
- rowKey?: string;
107
- height?: BaseTableCssValue;
108
- border?: boolean;
109
- stripe?: boolean;
110
- showToolbar?: boolean;
111
- showPagination?: boolean;
112
- hasSelection?: boolean;
113
- hasIndex?: boolean;
114
- indexLabel?: string;
115
- indexWidth?: BaseTableCssValue;
116
- selectionWidth?: BaseTableCssValue;
117
- rowSelectable?: (row: Row, index: number) => boolean;
118
- pagination?: Partial<BaseTablePagination>;
119
- currentPageKey?: string;
120
- pageSizeKey?: string;
121
- defaultSort?: BaseTableSortState;
122
- sortFieldKey?: string;
123
- sortOrderKey?: string;
124
- sortOrderMap?: BaseTableSortOrderMap;
125
- sortMapper?: (payload: BaseTableSortPayload<Row>) => Record<string, unknown> | void;
126
- emptyText?: string;
127
- loadingText?: string;
128
- }
129
- export interface BaseTableSortPayload<Row = Record<string, any>> {
130
- column: BaseTableColumn<Row> | undefined;
131
- prop?: string;
132
- order: BaseTableSortOrder;
133
- field?: string;
134
- direction: BaseTableSortDirection;
135
- }
136
- export interface BaseTableRowActionPayload<Row = Record<string, any>> {
137
- row: Row;
138
- action: BaseTableAction<Row>;
139
- column: BaseTableColumn<Row>;
140
- }
141
- export interface BaseTableCellPayload<Row = Record<string, any>> {
142
- row: Row;
143
- column: BaseTableColumn<Row>;
144
- value: unknown;
145
- }
146
- export interface BaseTableLoadedPayload<Row = Record<string, any>> {
147
- rows: Row[];
148
- total: number;
149
- params: BaseTableRequestParams;
150
- }
151
- export interface BaseTableExpose<Row = Record<string, any>> {
152
- load: (data?: Row[]) => Promise<void>;
153
- refresh: () => Promise<void>;
154
- setData: (data: Row[]) => void;
155
- resetPage: () => Promise<void>;
156
- setHeaderSearchValue: (key: string, value: string, shouldReload?: boolean) => Promise<void>;
157
- resetHeaderSearch: (key?: string) => Promise<void>;
158
- getHeaderSearchValues: () => Record<string, string>;
159
- clearSelection: () => void;
160
- toggleRowSelection: (row: Row, selected?: boolean) => void;
161
- getSelectionRows: () => Row[];
162
- getRows: () => Row[];
163
- }
1
+ export type BaseTableCssValue = string | number;
2
+ export type BaseTableAlign = 'left' | 'center' | 'right';
3
+ export type BaseTableColumnKind = 'text' | 'link' | 'actions' | 'image' | 'tag' | 'html' | 'input';
4
+ export type BaseTableSortOrder = 'ascending' | 'descending' | null;
5
+ export type BaseTableSortDirection = string | null;
6
+ export interface BaseTableHeaderSearchConfig {
7
+ paramKey?: string;
8
+ placeholder?: string;
9
+ width?: BaseTableCssValue;
10
+ searchText?: string;
11
+ resetText?: string;
12
+ }
13
+ export interface BaseTableOption {
14
+ label: string;
15
+ value: string | number | boolean;
16
+ tagType?: '' | 'success' | 'warning' | 'info' | 'danger' | 'primary';
17
+ color?: string;
18
+ }
19
+ export interface BaseTableAction<Row = Record<string, any>> {
20
+ label: string;
21
+ type: string;
22
+ buttonType?: '' | 'primary' | 'success' | 'warning' | 'info' | 'danger';
23
+ disabled?: boolean | ((row: Row) => boolean);
24
+ visible?: boolean | ((row: Row) => boolean);
25
+ }
26
+ export interface BaseTableColumn<Row = Record<string, any>> {
27
+ label: string;
28
+ prop?: keyof Row | string;
29
+ kind?: BaseTableColumnKind;
30
+ type?: string;
31
+ width?: BaseTableCssValue;
32
+ minWidth?: BaseTableCssValue;
33
+ align?: BaseTableAlign;
34
+ headerAlign?: BaseTableAlign;
35
+ fixed?: boolean | 'left' | 'right';
36
+ sortable?: boolean | 'custom';
37
+ sortField?: string;
38
+ headerSearch?: boolean | BaseTableHeaderSearchConfig;
39
+ showOverflowTooltip?: boolean;
40
+ className?: string;
41
+ headerClassName?: string;
42
+ actions?: BaseTableAction<Row>[];
43
+ clickable?: boolean;
44
+ options?: BaseTableOption[];
45
+ optionValueKey?: string;
46
+ optionLabelKey?: string;
47
+ optionTagTypeKey?: string;
48
+ emptyText?: string;
49
+ inputType?: string;
50
+ imageFit?: '' | 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
51
+ imageWidth?: BaseTableCssValue;
52
+ imageHeight?: BaseTableCssValue;
53
+ slotName?: string;
54
+ headerSlotName?: string;
55
+ formatter?: (row: Row, column: BaseTableColumn<Row>) => unknown;
56
+ html?: (row: Row, column: BaseTableColumn<Row>) => string;
57
+ clickHandler?: (row: Row, column: BaseTableColumn<Row>) => void;
58
+ inputHandler?: (value: string, row: Row, column: BaseTableColumn<Row>) => void;
59
+ }
60
+ export interface BaseTablePagination {
61
+ currentPage: number;
62
+ pageSize: number;
63
+ total: number;
64
+ pageSizes: number[];
65
+ }
66
+ export interface BaseTableRequestParams {
67
+ currentPage: number;
68
+ pageSize: number;
69
+ [key: string]: unknown;
70
+ }
71
+ export interface BaseTableSortState {
72
+ prop?: string;
73
+ order: BaseTableSortOrder;
74
+ }
75
+ export interface BaseTableSortOrderMap {
76
+ ascending: string;
77
+ descending: string;
78
+ }
79
+ export interface BaseTableRequestResult<Row = Record<string, any>> {
80
+ records?: Row[];
81
+ list?: Row[];
82
+ items?: Row[];
83
+ total?: number;
84
+ data?: {
85
+ records?: Row[];
86
+ list?: Row[];
87
+ items?: Row[];
88
+ total?: number;
89
+ };
90
+ }
91
+ export interface BaseTableNormalizedResult<Row = Record<string, any>> {
92
+ rows?: Row[];
93
+ total?: number;
94
+ }
95
+ export type BaseTableRequestHandler<Row = Record<string, any>> = (params: BaseTableRequestParams) => Promise<BaseTableRequestResult<Row> | Row[]>;
96
+ export type BaseTableResultAdapter<Row = Record<string, any>> = (result: unknown, params: BaseTableRequestParams) => BaseTableNormalizedResult<Row>;
97
+ export interface BaseTableProps<Row = Record<string, any>> {
98
+ columns: BaseTableColumn<Row>[];
99
+ data?: Row[];
100
+ request?: BaseTableRequestHandler<Row>;
101
+ requestParams?: Record<string, unknown>;
102
+ resultAdapter?: BaseTableResultAdapter<Row>;
103
+ autoLoad?: boolean;
104
+ reloadOnParamsChange?: boolean;
105
+ reloadOnSortChange?: boolean;
106
+ rowKey?: string;
107
+ height?: BaseTableCssValue;
108
+ border?: boolean;
109
+ stripe?: boolean;
110
+ showToolbar?: boolean;
111
+ showPagination?: boolean;
112
+ hasSelection?: boolean;
113
+ hasIndex?: boolean;
114
+ indexLabel?: string;
115
+ indexWidth?: BaseTableCssValue;
116
+ selectionWidth?: BaseTableCssValue;
117
+ rowSelectable?: (row: Row, index: number) => boolean;
118
+ pagination?: Partial<BaseTablePagination>;
119
+ currentPageKey?: string;
120
+ pageSizeKey?: string;
121
+ defaultSort?: BaseTableSortState;
122
+ sortFieldKey?: string;
123
+ sortOrderKey?: string;
124
+ sortOrderMap?: BaseTableSortOrderMap;
125
+ sortMapper?: (payload: BaseTableSortPayload<Row>) => Record<string, unknown> | void;
126
+ emptyText?: string;
127
+ loadingText?: string;
128
+ }
129
+ export interface BaseTableSortPayload<Row = Record<string, any>> {
130
+ column: BaseTableColumn<Row> | undefined;
131
+ prop?: string;
132
+ order: BaseTableSortOrder;
133
+ field?: string;
134
+ direction: BaseTableSortDirection;
135
+ }
136
+ export interface BaseTableRowActionPayload<Row = Record<string, any>> {
137
+ row: Row;
138
+ action: BaseTableAction<Row>;
139
+ column: BaseTableColumn<Row>;
140
+ }
141
+ export interface BaseTableCellPayload<Row = Record<string, any>> {
142
+ row: Row;
143
+ column: BaseTableColumn<Row>;
144
+ value: unknown;
145
+ }
146
+ export interface BaseTableLoadedPayload<Row = Record<string, any>> {
147
+ rows: Row[];
148
+ total: number;
149
+ params: BaseTableRequestParams;
150
+ }
151
+ export interface BaseTableExpose<Row = Record<string, any>> {
152
+ load: (data?: Row[]) => Promise<void>;
153
+ refresh: () => Promise<void>;
154
+ setData: (data: Row[]) => void;
155
+ resetPage: () => Promise<void>;
156
+ setHeaderSearchValue: (key: string, value: string, shouldReload?: boolean) => Promise<void>;
157
+ resetHeaderSearch: (key?: string) => Promise<void>;
158
+ getHeaderSearchValues: () => Record<string, string>;
159
+ clearSelection: () => void;
160
+ toggleRowSelection: (row: Row, selected?: boolean) => void;
161
+ getSelectionRows: () => Row[];
162
+ getRows: () => Row[];
163
+ }