@xn-lib/component 0.1.35 → 0.1.40

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.
@@ -12,7 +12,8 @@ import XnTextRuleConfig from './text-rule-config';
12
12
  import XnFormList from './form-list/index';
13
13
  import XnTable from './table/index';
14
14
  import XnModal from './modal/index';
15
- export { XnCascader, XnTag, XnTransfer, XnVirtualList, XnEllipsis, XnEditableText, XnEditableTextarea, XnTimeRangePicker, XnTextRuleConfig, XnFormList, XnTable, XnModal };
15
+ import XnSelectInput from './select-input/index';
16
+ export { XnCascader, XnTag, XnTransfer, XnVirtualList, XnEllipsis, XnEditableText, XnEditableTextarea, XnTimeRangePicker, XnTextRuleConfig, XnFormList, XnTable, XnModal, XnSelectInput };
16
17
  export declare const components: Record<string, Component>;
17
18
  export type { CascaderProps } from './cascader/props';
18
19
  export type { TagProps } from './tag/props';
@@ -22,6 +23,8 @@ export type { EditableTextareaProps } from './editable-textarea/props';
22
23
  export type { TimeRangePickerProps, TimeRangeValue, TimeRange } from './time-range-picker/props';
23
24
  export type { TextRuleConfigProps } from './text-rule-config/props';
24
25
  export type { FormListProps, FormListRow, FormListDefaultRow } from './form-list/props';
26
+ export type { SelectInputProps } from './select-input/props';
27
+ export type { SelectInputValue, SelectInputInst } from './types/select-input';
25
28
  export { useFormList, useFormListActions, useFormListLayout, useFormListRowForms, useFormListUidSync, generateUid, cssLength, getFormListRowKey, ensureRowUids, stripUidRow } from './form-list/index';
26
29
  export type { FormListExpose, FormListSubmitRow, RowKeyOptions, UseFormListOptions, UseFormListReturn } from './form-list/index';
27
30
  export * from './types';
@@ -0,0 +1,4 @@
1
+ import type { Plugin } from 'vue';
2
+ import SelectInputComponent from './index.vue';
3
+ declare const SelectInput: typeof SelectInputComponent & Plugin;
4
+ export default SelectInput;
@@ -0,0 +1,59 @@
1
+ import type { SelectInputValue } from '../types/select-input';
2
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ readonly modelValue: {
4
+ readonly type: import("vue").PropType<import("./props").SelectInputValue>;
5
+ readonly default: () => {
6
+ input: string;
7
+ select: string;
8
+ };
9
+ };
10
+ readonly options: {
11
+ readonly type: import("vue").PropType<any[]>;
12
+ readonly default: () => never[];
13
+ };
14
+ readonly stripWhitespace: {
15
+ readonly type: BooleanConstructor;
16
+ readonly default: false;
17
+ };
18
+ readonly placeholder: {
19
+ readonly type: StringConstructor;
20
+ readonly default: undefined;
21
+ };
22
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
+ input: (val: SelectInputValue) => any;
24
+ search: (val: SelectInputValue) => any;
25
+ "update:modelValue": (val: SelectInputValue) => any;
26
+ change: (val: SelectInputValue) => any;
27
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
28
+ readonly modelValue: {
29
+ readonly type: import("vue").PropType<import("./props").SelectInputValue>;
30
+ readonly default: () => {
31
+ input: string;
32
+ select: string;
33
+ };
34
+ };
35
+ readonly options: {
36
+ readonly type: import("vue").PropType<any[]>;
37
+ readonly default: () => never[];
38
+ };
39
+ readonly stripWhitespace: {
40
+ readonly type: BooleanConstructor;
41
+ readonly default: false;
42
+ };
43
+ readonly placeholder: {
44
+ readonly type: StringConstructor;
45
+ readonly default: undefined;
46
+ };
47
+ }>> & Readonly<{
48
+ onInput?: ((val: SelectInputValue) => any) | undefined;
49
+ onSearch?: ((val: SelectInputValue) => any) | undefined;
50
+ "onUpdate:modelValue"?: ((val: SelectInputValue) => any) | undefined;
51
+ onChange?: ((val: SelectInputValue) => any) | undefined;
52
+ }>, {
53
+ readonly modelValue: import("./props").SelectInputValue;
54
+ readonly placeholder: string;
55
+ readonly options: any[];
56
+ readonly stripWhitespace: boolean;
57
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
58
+ declare const _default: typeof __VLS_export;
59
+ export default _default;
@@ -0,0 +1,31 @@
1
+ import type { PropType, ExtractPropTypes } from 'vue';
2
+ export interface SelectInputValue {
3
+ input: string;
4
+ select: string;
5
+ }
6
+ export declare const selectInputProps: {
7
+ /** 绑定值 */
8
+ readonly modelValue: {
9
+ readonly type: PropType<SelectInputValue>;
10
+ readonly default: () => {
11
+ input: string;
12
+ select: string;
13
+ };
14
+ };
15
+ /** 选择框选项 */
16
+ readonly options: {
17
+ readonly type: PropType<any[]>;
18
+ readonly default: () => never[];
19
+ };
20
+ /** 是否移除输入框值中的空格,默认 false */
21
+ readonly stripWhitespace: {
22
+ readonly type: BooleanConstructor;
23
+ readonly default: false;
24
+ };
25
+ /** 输入框占位符 */
26
+ readonly placeholder: {
27
+ readonly type: StringConstructor;
28
+ readonly default: undefined;
29
+ };
30
+ };
31
+ export type SelectInputProps = Readonly<ExtractPropTypes<typeof selectInputProps>>;
@@ -0,0 +1,10 @@
1
+ import { Option } from "../types";
2
+ /**
3
+ * 计算选择框宽度
4
+ * @param options 选择框选项
5
+ * @param paddingWidth 选项 padding 宽度
6
+ * @returns 选择框宽度
7
+ * */
8
+ export declare function useCalcSelectWidth(options: Option[], paddingWidth?: number): {
9
+ maxWidth: import("vue").Ref<number, number>;
10
+ };
@@ -1,2 +1,12 @@
1
1
  export { useTableProvider, useTableStore } from './store';
2
2
  export type { TableStore } from './store';
3
+ export { useSelection } from './useSelection';
4
+ export { usePagination } from './usePagination';
5
+ export { useSearch } from './useSearch';
6
+ export { useColumns } from './useColumns';
7
+ export { useRequest } from './useRequest';
8
+ export { useFilter } from './useFilter';
9
+ export { useModal } from './useModal';
10
+ export { useAutoHeight } from './useAutoHeight';
11
+ export { useSelectionSync } from './useSelectionSync';
12
+ export { useModalHandlers } from './useModalHandlers';
@@ -1,19 +1,54 @@
1
- import type { TableColumn, SelectionConfig, PaginationConfig } from '../../types';
1
+ import type { SelectionConfig } from '../../types';
2
2
  import type { TableProps } from '../props';
3
- import { CheckboxValueType } from 'element-plus';
4
3
  declare const tableStore: {
5
4
  provider: (props: TableProps) => {
6
5
  selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
7
6
  selectedRows: import("vue").ShallowRef<any[], any[]>;
7
+ hasSelection: import("vue").ComputedRef<boolean>;
8
+ selectionConfig: import("vue").ComputedRef<SelectionConfig>;
9
+ selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
10
+ selectionType: import("vue").ComputedRef<any>;
11
+ singleSelectedKey: import("vue").ComputedRef<any>;
12
+ getKeyValue: (row: any) => any;
13
+ getRowKey: (row: any) => any;
14
+ toggleSelection: (row: any, _getRowKey: (row: any) => any) => void;
15
+ setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
16
+ clearSelection: () => void;
17
+ handleSelectionChange: (selection: any[]) => void;
18
+ handleSelectAll: (selection: any[]) => void;
19
+ getSelectedKeys: () => any[];
20
+ getSelectedRows: () => any[];
21
+ isSingleSelected: (row: any) => boolean;
22
+ handleSingleSelect: (row: any, selected: any) => void;
8
23
  currentPage: import("vue").Ref<number, number>;
9
24
  pageSize: import("vue").Ref<number, number>;
25
+ paginationConfig: import("vue").ComputedRef<import("../../types").PaginationConfig>;
26
+ paginationEnabled: import("vue").ComputedRef<boolean>;
27
+ pageSizeOptions: import("vue").ComputedRef<number[]>;
28
+ setCurrentPage: (page: number) => void;
29
+ setPageSize: (size: number) => void;
10
30
  searchParams: import("vue").Ref<Record<string, any>, Record<string, any>>;
31
+ visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
32
+ updateSearchParam: (key: string, value: any) => void;
33
+ setSearchFields: (fields: Record<string, any>) => void;
34
+ resetSearch: () => void;
35
+ getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
11
36
  visibleColumns: import("vue").Ref<string[], string[]>;
12
- rawColumns: import("vue").ShallowRef<TableColumn[], TableColumn[]>;
13
- filteredData: import("vue").Ref<any[], any[]>;
37
+ rawColumns: import("vue").ShallowRef<import("../../types").TableColumn[], import("../../types").TableColumn[]>;
38
+ visibleColumnList: import("vue").ComputedRef<import("../../types").TableColumn[]>;
39
+ setVisibleColumns: (columns: string[]) => void;
40
+ toggleColumn: (key: string) => void;
41
+ isRequestMode: import("vue").ComputedRef<boolean>;
42
+ autoLoad: import("vue").ComputedRef<boolean>;
43
+ autoRequest: import("vue").ComputedRef<boolean>;
14
44
  requestData: import("vue").Ref<any[], any[]>;
15
45
  requestTotal: import("vue").Ref<number, number>;
16
46
  requestLoading: import("vue").Ref<boolean, boolean>;
47
+ loading: import("vue").ComputedRef<boolean>;
48
+ load: (emit?: (name: string, data: any) => void) => Promise<void>;
49
+ filteredData: import("vue").Ref<any[], any[]>;
50
+ handleFilter: () => void;
51
+ resetFilter: () => void;
17
52
  modalMap: import("vue").Ref<Map<string, {
18
53
  visible: boolean;
19
54
  data?: any;
@@ -30,20 +65,13 @@ declare const tableStore: {
30
65
  visible: boolean;
31
66
  data?: any;
32
67
  }>, keyof Map<any, any>>)>;
33
- hasSelection: import("vue").ComputedRef<boolean>;
34
- selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
35
- selectionType: import("vue").ComputedRef<any>;
36
- selectionConfig: import("vue").ComputedRef<SelectionConfig>;
37
- singleSelectedKey: import("vue").ComputedRef<any>;
38
- paginationEnabled: import("vue").ComputedRef<boolean>;
39
- paginationConfig: import("vue").ComputedRef<PaginationConfig>;
40
- pageSizeOptions: import("vue").ComputedRef<number[]>;
41
- visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
42
- visibleColumnList: import("vue").ComputedRef<TableColumn[]>;
43
- isRequestMode: import("vue").ComputedRef<boolean>;
44
- autoLoad: import("vue").ComputedRef<boolean>;
45
- autoRequest: import("vue").ComputedRef<boolean>;
46
- loading: import("vue").ComputedRef<boolean>;
68
+ getModal: (key: string) => {
69
+ visible: boolean;
70
+ data?: any;
71
+ } | undefined;
72
+ openModal: (key: string, data?: any) => void;
73
+ closeModal: (key: string) => void;
74
+ closeAllModals: () => void;
47
75
  autoTotal: import("vue").ComputedRef<number>;
48
76
  displayData: import("vue").ComputedRef<any[]>;
49
77
  tableConfig: import("vue").ComputedRef<{
@@ -66,52 +94,59 @@ declare const tableStore: {
66
94
  left: import("../../types").ToolbarButton[];
67
95
  right: import("../../types").ToolbarButton[];
68
96
  }>;
69
- toggleSelection: (row: any, getRowKey: (row: any) => any) => void;
70
- setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
71
- clearSelection: () => void;
72
- setCurrentPage: (page: number) => void;
73
- setPageSize: (size: number) => void;
74
- updateSearchParam: (key: string, value: any) => void;
75
- setSearchFields: (fields: Record<string, any>) => void;
76
- resetSearch: () => void;
77
- getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
78
- setVisibleColumns: (columns: string[]) => void;
79
- toggleColumn: (key: string) => void;
80
97
  init: (config: {
81
- columns: TableColumn[];
98
+ columns: any[];
82
99
  selectionConfig?: boolean | SelectionConfig;
83
100
  }) => void;
84
- getRowKey: (row: any) => any;
101
+ };
102
+ useStore: () => {
103
+ selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
104
+ selectedRows: import("vue").ShallowRef<any[], any[]>;
105
+ hasSelection: import("vue").ComputedRef<boolean>;
106
+ selectionConfig: import("vue").ComputedRef<SelectionConfig>;
107
+ selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
108
+ selectionType: import("vue").ComputedRef<any>;
109
+ singleSelectedKey: import("vue").ComputedRef<any>;
85
110
  getKeyValue: (row: any) => any;
111
+ getRowKey: (row: any) => any;
112
+ toggleSelection: (row: any, _getRowKey: (row: any) => any) => void;
113
+ setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
114
+ clearSelection: () => void;
86
115
  handleSelectionChange: (selection: any[]) => void;
87
116
  handleSelectAll: (selection: any[]) => void;
88
117
  getSelectedKeys: () => any[];
89
118
  getSelectedRows: () => any[];
90
119
  isSingleSelected: (row: any) => boolean;
91
- handleSingleSelect: (row: any, selected: CheckboxValueType) => void;
92
- handleFilter: () => void;
93
- resetFilter: () => void;
94
- load: (emit?: (name: string, data: any) => void) => Promise<void>;
95
- openModal: (key: string, data?: any) => void;
96
- closeModal: (key: string) => void;
97
- closeAllModals: () => void;
98
- getModal: (key: string) => {
99
- visible: boolean;
100
- data?: any;
101
- } | undefined;
102
- };
103
- useStore: () => {
104
- selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
105
- selectedRows: import("vue").ShallowRef<any[], any[]>;
120
+ handleSingleSelect: (row: any, selected: any) => void;
106
121
  currentPage: import("vue").Ref<number, number>;
107
122
  pageSize: import("vue").Ref<number, number>;
123
+ paginationConfig: import("vue").ComputedRef<import("../../types").PaginationConfig>;
124
+ paginationEnabled: import("vue").ComputedRef<boolean>;
125
+ pageSizeOptions: import("vue").ComputedRef<number[]>;
126
+ setCurrentPage: (page: number) => void;
127
+ setPageSize: (size: number) => void;
108
128
  searchParams: import("vue").Ref<Record<string, any>, Record<string, any>>;
129
+ visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
130
+ updateSearchParam: (key: string, value: any) => void;
131
+ setSearchFields: (fields: Record<string, any>) => void;
132
+ resetSearch: () => void;
133
+ getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
109
134
  visibleColumns: import("vue").Ref<string[], string[]>;
110
- rawColumns: import("vue").ShallowRef<TableColumn[], TableColumn[]>;
111
- filteredData: import("vue").Ref<any[], any[]>;
135
+ rawColumns: import("vue").ShallowRef<import("../../types").TableColumn[], import("../../types").TableColumn[]>;
136
+ visibleColumnList: import("vue").ComputedRef<import("../../types").TableColumn[]>;
137
+ setVisibleColumns: (columns: string[]) => void;
138
+ toggleColumn: (key: string) => void;
139
+ isRequestMode: import("vue").ComputedRef<boolean>;
140
+ autoLoad: import("vue").ComputedRef<boolean>;
141
+ autoRequest: import("vue").ComputedRef<boolean>;
112
142
  requestData: import("vue").Ref<any[], any[]>;
113
143
  requestTotal: import("vue").Ref<number, number>;
114
144
  requestLoading: import("vue").Ref<boolean, boolean>;
145
+ loading: import("vue").ComputedRef<boolean>;
146
+ load: (emit?: (name: string, data: any) => void) => Promise<void>;
147
+ filteredData: import("vue").Ref<any[], any[]>;
148
+ handleFilter: () => void;
149
+ resetFilter: () => void;
115
150
  modalMap: import("vue").Ref<Map<string, {
116
151
  visible: boolean;
117
152
  data?: any;
@@ -128,20 +163,13 @@ declare const tableStore: {
128
163
  visible: boolean;
129
164
  data?: any;
130
165
  }>, keyof Map<any, any>>)>;
131
- hasSelection: import("vue").ComputedRef<boolean>;
132
- selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
133
- selectionType: import("vue").ComputedRef<any>;
134
- selectionConfig: import("vue").ComputedRef<SelectionConfig>;
135
- singleSelectedKey: import("vue").ComputedRef<any>;
136
- paginationEnabled: import("vue").ComputedRef<boolean>;
137
- paginationConfig: import("vue").ComputedRef<PaginationConfig>;
138
- pageSizeOptions: import("vue").ComputedRef<number[]>;
139
- visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
140
- visibleColumnList: import("vue").ComputedRef<TableColumn[]>;
141
- isRequestMode: import("vue").ComputedRef<boolean>;
142
- autoLoad: import("vue").ComputedRef<boolean>;
143
- autoRequest: import("vue").ComputedRef<boolean>;
144
- loading: import("vue").ComputedRef<boolean>;
166
+ getModal: (key: string) => {
167
+ visible: boolean;
168
+ data?: any;
169
+ } | undefined;
170
+ openModal: (key: string, data?: any) => void;
171
+ closeModal: (key: string) => void;
172
+ closeAllModals: () => void;
145
173
  autoTotal: import("vue").ComputedRef<number>;
146
174
  displayData: import("vue").ComputedRef<any[]>;
147
175
  tableConfig: import("vue").ComputedRef<{
@@ -164,53 +192,60 @@ declare const tableStore: {
164
192
  left: import("../../types").ToolbarButton[];
165
193
  right: import("../../types").ToolbarButton[];
166
194
  }>;
167
- toggleSelection: (row: any, getRowKey: (row: any) => any) => void;
168
- setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
169
- clearSelection: () => void;
170
- setCurrentPage: (page: number) => void;
171
- setPageSize: (size: number) => void;
172
- updateSearchParam: (key: string, value: any) => void;
173
- setSearchFields: (fields: Record<string, any>) => void;
174
- resetSearch: () => void;
175
- getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
176
- setVisibleColumns: (columns: string[]) => void;
177
- toggleColumn: (key: string) => void;
178
195
  init: (config: {
179
- columns: TableColumn[];
196
+ columns: any[];
180
197
  selectionConfig?: boolean | SelectionConfig;
181
198
  }) => void;
182
- getRowKey: (row: any) => any;
183
- getKeyValue: (row: any) => any;
184
- handleSelectionChange: (selection: any[]) => void;
185
- handleSelectAll: (selection: any[]) => void;
186
- getSelectedKeys: () => any[];
187
- getSelectedRows: () => any[];
188
- isSingleSelected: (row: any) => boolean;
189
- handleSingleSelect: (row: any, selected: CheckboxValueType) => void;
190
- handleFilter: () => void;
191
- resetFilter: () => void;
192
- load: (emit?: (name: string, data: any) => void) => Promise<void>;
193
- openModal: (key: string, data?: any) => void;
194
- closeModal: (key: string) => void;
195
- closeAllModals: () => void;
196
- getModal: (key: string) => {
197
- visible: boolean;
198
- data?: any;
199
- } | undefined;
200
199
  };
201
200
  };
202
201
  export declare const useTableProvider: (props: TableProps) => {
203
202
  selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
204
203
  selectedRows: import("vue").ShallowRef<any[], any[]>;
204
+ hasSelection: import("vue").ComputedRef<boolean>;
205
+ selectionConfig: import("vue").ComputedRef<SelectionConfig>;
206
+ selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
207
+ selectionType: import("vue").ComputedRef<any>;
208
+ singleSelectedKey: import("vue").ComputedRef<any>;
209
+ getKeyValue: (row: any) => any;
210
+ getRowKey: (row: any) => any;
211
+ toggleSelection: (row: any, _getRowKey: (row: any) => any) => void;
212
+ setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
213
+ clearSelection: () => void;
214
+ handleSelectionChange: (selection: any[]) => void;
215
+ handleSelectAll: (selection: any[]) => void;
216
+ getSelectedKeys: () => any[];
217
+ getSelectedRows: () => any[];
218
+ isSingleSelected: (row: any) => boolean;
219
+ handleSingleSelect: (row: any, selected: any) => void;
205
220
  currentPage: import("vue").Ref<number, number>;
206
221
  pageSize: import("vue").Ref<number, number>;
222
+ paginationConfig: import("vue").ComputedRef<import("../../types").PaginationConfig>;
223
+ paginationEnabled: import("vue").ComputedRef<boolean>;
224
+ pageSizeOptions: import("vue").ComputedRef<number[]>;
225
+ setCurrentPage: (page: number) => void;
226
+ setPageSize: (size: number) => void;
207
227
  searchParams: import("vue").Ref<Record<string, any>, Record<string, any>>;
228
+ visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
229
+ updateSearchParam: (key: string, value: any) => void;
230
+ setSearchFields: (fields: Record<string, any>) => void;
231
+ resetSearch: () => void;
232
+ getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
208
233
  visibleColumns: import("vue").Ref<string[], string[]>;
209
- rawColumns: import("vue").ShallowRef<TableColumn[], TableColumn[]>;
210
- filteredData: import("vue").Ref<any[], any[]>;
234
+ rawColumns: import("vue").ShallowRef<import("../../types").TableColumn[], import("../../types").TableColumn[]>;
235
+ visibleColumnList: import("vue").ComputedRef<import("../../types").TableColumn[]>;
236
+ setVisibleColumns: (columns: string[]) => void;
237
+ toggleColumn: (key: string) => void;
238
+ isRequestMode: import("vue").ComputedRef<boolean>;
239
+ autoLoad: import("vue").ComputedRef<boolean>;
240
+ autoRequest: import("vue").ComputedRef<boolean>;
211
241
  requestData: import("vue").Ref<any[], any[]>;
212
242
  requestTotal: import("vue").Ref<number, number>;
213
243
  requestLoading: import("vue").Ref<boolean, boolean>;
244
+ loading: import("vue").ComputedRef<boolean>;
245
+ load: (emit?: (name: string, data: any) => void) => Promise<void>;
246
+ filteredData: import("vue").Ref<any[], any[]>;
247
+ handleFilter: () => void;
248
+ resetFilter: () => void;
214
249
  modalMap: import("vue").Ref<Map<string, {
215
250
  visible: boolean;
216
251
  data?: any;
@@ -227,20 +262,13 @@ export declare const useTableProvider: (props: TableProps) => {
227
262
  visible: boolean;
228
263
  data?: any;
229
264
  }>, keyof Map<any, any>>)>;
230
- hasSelection: import("vue").ComputedRef<boolean>;
231
- selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
232
- selectionType: import("vue").ComputedRef<any>;
233
- selectionConfig: import("vue").ComputedRef<SelectionConfig>;
234
- singleSelectedKey: import("vue").ComputedRef<any>;
235
- paginationEnabled: import("vue").ComputedRef<boolean>;
236
- paginationConfig: import("vue").ComputedRef<PaginationConfig>;
237
- pageSizeOptions: import("vue").ComputedRef<number[]>;
238
- visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
239
- visibleColumnList: import("vue").ComputedRef<TableColumn[]>;
240
- isRequestMode: import("vue").ComputedRef<boolean>;
241
- autoLoad: import("vue").ComputedRef<boolean>;
242
- autoRequest: import("vue").ComputedRef<boolean>;
243
- loading: import("vue").ComputedRef<boolean>;
265
+ getModal: (key: string) => {
266
+ visible: boolean;
267
+ data?: any;
268
+ } | undefined;
269
+ openModal: (key: string, data?: any) => void;
270
+ closeModal: (key: string) => void;
271
+ closeAllModals: () => void;
244
272
  autoTotal: import("vue").ComputedRef<number>;
245
273
  displayData: import("vue").ComputedRef<any[]>;
246
274
  tableConfig: import("vue").ComputedRef<{
@@ -263,52 +291,59 @@ export declare const useTableProvider: (props: TableProps) => {
263
291
  left: import("../../types").ToolbarButton[];
264
292
  right: import("../../types").ToolbarButton[];
265
293
  }>;
266
- toggleSelection: (row: any, getRowKey: (row: any) => any) => void;
267
- setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
268
- clearSelection: () => void;
269
- setCurrentPage: (page: number) => void;
270
- setPageSize: (size: number) => void;
271
- updateSearchParam: (key: string, value: any) => void;
272
- setSearchFields: (fields: Record<string, any>) => void;
273
- resetSearch: () => void;
274
- getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
275
- setVisibleColumns: (columns: string[]) => void;
276
- toggleColumn: (key: string) => void;
277
294
  init: (config: {
278
- columns: TableColumn[];
295
+ columns: any[];
279
296
  selectionConfig?: boolean | SelectionConfig;
280
297
  }) => void;
281
- getRowKey: (row: any) => any;
298
+ };
299
+ export declare const useTableStore: () => {
300
+ selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
301
+ selectedRows: import("vue").ShallowRef<any[], any[]>;
302
+ hasSelection: import("vue").ComputedRef<boolean>;
303
+ selectionConfig: import("vue").ComputedRef<SelectionConfig>;
304
+ selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
305
+ selectionType: import("vue").ComputedRef<any>;
306
+ singleSelectedKey: import("vue").ComputedRef<any>;
282
307
  getKeyValue: (row: any) => any;
308
+ getRowKey: (row: any) => any;
309
+ toggleSelection: (row: any, _getRowKey: (row: any) => any) => void;
310
+ setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
311
+ clearSelection: () => void;
283
312
  handleSelectionChange: (selection: any[]) => void;
284
313
  handleSelectAll: (selection: any[]) => void;
285
314
  getSelectedKeys: () => any[];
286
315
  getSelectedRows: () => any[];
287
316
  isSingleSelected: (row: any) => boolean;
288
- handleSingleSelect: (row: any, selected: CheckboxValueType) => void;
289
- handleFilter: () => void;
290
- resetFilter: () => void;
291
- load: (emit?: (name: string, data: any) => void) => Promise<void>;
292
- openModal: (key: string, data?: any) => void;
293
- closeModal: (key: string) => void;
294
- closeAllModals: () => void;
295
- getModal: (key: string) => {
296
- visible: boolean;
297
- data?: any;
298
- } | undefined;
299
- };
300
- export declare const useTableStore: () => {
301
- selectedKeys: import("vue").ShallowRef<Set<any>, Set<any>>;
302
- selectedRows: import("vue").ShallowRef<any[], any[]>;
317
+ handleSingleSelect: (row: any, selected: any) => void;
303
318
  currentPage: import("vue").Ref<number, number>;
304
319
  pageSize: import("vue").Ref<number, number>;
320
+ paginationConfig: import("vue").ComputedRef<import("../../types").PaginationConfig>;
321
+ paginationEnabled: import("vue").ComputedRef<boolean>;
322
+ pageSizeOptions: import("vue").ComputedRef<number[]>;
323
+ setCurrentPage: (page: number) => void;
324
+ setPageSize: (size: number) => void;
305
325
  searchParams: import("vue").Ref<Record<string, any>, Record<string, any>>;
326
+ visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
327
+ updateSearchParam: (key: string, value: any) => void;
328
+ setSearchFields: (fields: Record<string, any>) => void;
329
+ resetSearch: () => void;
330
+ getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
306
331
  visibleColumns: import("vue").Ref<string[], string[]>;
307
- rawColumns: import("vue").ShallowRef<TableColumn[], TableColumn[]>;
308
- filteredData: import("vue").Ref<any[], any[]>;
332
+ rawColumns: import("vue").ShallowRef<import("../../types").TableColumn[], import("../../types").TableColumn[]>;
333
+ visibleColumnList: import("vue").ComputedRef<import("../../types").TableColumn[]>;
334
+ setVisibleColumns: (columns: string[]) => void;
335
+ toggleColumn: (key: string) => void;
336
+ isRequestMode: import("vue").ComputedRef<boolean>;
337
+ autoLoad: import("vue").ComputedRef<boolean>;
338
+ autoRequest: import("vue").ComputedRef<boolean>;
309
339
  requestData: import("vue").Ref<any[], any[]>;
310
340
  requestTotal: import("vue").Ref<number, number>;
311
341
  requestLoading: import("vue").Ref<boolean, boolean>;
342
+ loading: import("vue").ComputedRef<boolean>;
343
+ load: (emit?: (name: string, data: any) => void) => Promise<void>;
344
+ filteredData: import("vue").Ref<any[], any[]>;
345
+ handleFilter: () => void;
346
+ resetFilter: () => void;
312
347
  modalMap: import("vue").Ref<Map<string, {
313
348
  visible: boolean;
314
349
  data?: any;
@@ -325,20 +360,13 @@ export declare const useTableStore: () => {
325
360
  visible: boolean;
326
361
  data?: any;
327
362
  }>, keyof Map<any, any>>)>;
328
- hasSelection: import("vue").ComputedRef<boolean>;
329
- selectionEnabled: import("vue").ComputedRef<boolean | undefined>;
330
- selectionType: import("vue").ComputedRef<any>;
331
- selectionConfig: import("vue").ComputedRef<SelectionConfig>;
332
- singleSelectedKey: import("vue").ComputedRef<any>;
333
- paginationEnabled: import("vue").ComputedRef<boolean>;
334
- paginationConfig: import("vue").ComputedRef<PaginationConfig>;
335
- pageSizeOptions: import("vue").ComputedRef<number[]>;
336
- visibleSearchConfig: import("vue").ComputedRef<import("../../types").SearchConfig[]>;
337
- visibleColumnList: import("vue").ComputedRef<TableColumn[]>;
338
- isRequestMode: import("vue").ComputedRef<boolean>;
339
- autoLoad: import("vue").ComputedRef<boolean>;
340
- autoRequest: import("vue").ComputedRef<boolean>;
341
- loading: import("vue").ComputedRef<boolean>;
363
+ getModal: (key: string) => {
364
+ visible: boolean;
365
+ data?: any;
366
+ } | undefined;
367
+ openModal: (key: string, data?: any) => void;
368
+ closeModal: (key: string) => void;
369
+ closeAllModals: () => void;
342
370
  autoTotal: import("vue").ComputedRef<number>;
343
371
  displayData: import("vue").ComputedRef<any[]>;
344
372
  tableConfig: import("vue").ComputedRef<{
@@ -361,39 +389,10 @@ export declare const useTableStore: () => {
361
389
  left: import("../../types").ToolbarButton[];
362
390
  right: import("../../types").ToolbarButton[];
363
391
  }>;
364
- toggleSelection: (row: any, getRowKey: (row: any) => any) => void;
365
- setSelection: (keys: any[], rows?: any[], append?: boolean) => void;
366
- clearSelection: () => void;
367
- setCurrentPage: (page: number) => void;
368
- setPageSize: (size: number) => void;
369
- updateSearchParam: (key: string, value: any) => void;
370
- setSearchFields: (fields: Record<string, any>) => void;
371
- resetSearch: () => void;
372
- getSearchParams: (ignoreEmpty?: boolean) => Record<string, any>;
373
- setVisibleColumns: (columns: string[]) => void;
374
- toggleColumn: (key: string) => void;
375
392
  init: (config: {
376
- columns: TableColumn[];
393
+ columns: any[];
377
394
  selectionConfig?: boolean | SelectionConfig;
378
395
  }) => void;
379
- getRowKey: (row: any) => any;
380
- getKeyValue: (row: any) => any;
381
- handleSelectionChange: (selection: any[]) => void;
382
- handleSelectAll: (selection: any[]) => void;
383
- getSelectedKeys: () => any[];
384
- getSelectedRows: () => any[];
385
- isSingleSelected: (row: any) => boolean;
386
- handleSingleSelect: (row: any, selected: CheckboxValueType) => void;
387
- handleFilter: () => void;
388
- resetFilter: () => void;
389
- load: (emit?: (name: string, data: any) => void) => Promise<void>;
390
- openModal: (key: string, data?: any) => void;
391
- closeModal: (key: string) => void;
392
- closeAllModals: () => void;
393
- getModal: (key: string) => {
394
- visible: boolean;
395
- data?: any;
396
- } | undefined;
397
396
  };
398
397
  export type TableStore = ReturnType<typeof tableStore.useStore>;
399
398
  export {};
@@ -0,0 +1,6 @@
1
+ import type { Ref } from 'vue';
2
+ export declare function useAutoHeight(containerRef: Ref<HTMLElement | undefined>, height: Ref<number | string | undefined>): {
3
+ isAutoHeight: import("vue").ComputedRef<boolean>;
4
+ computedTableHeight: Ref<number | undefined, number | undefined>;
5
+ resolvedHeight: import("vue").ComputedRef<string | number | undefined>;
6
+ };
@@ -0,0 +1,11 @@
1
+ import type { TableColumn } from '../../types';
2
+ export declare function useColumns(props: {
3
+ columns: TableColumn[];
4
+ }): {
5
+ visibleColumns: import("vue").Ref<string[], string[]>;
6
+ rawColumns: import("vue").ShallowRef<TableColumn[], TableColumn[]>;
7
+ visibleColumnList: import("vue").ComputedRef<TableColumn[]>;
8
+ columnsRef: import("vue").ComputedRef<TableColumn[]>;
9
+ setVisibleColumns: (columns: string[]) => void;
10
+ toggleColumn: (key: string) => void;
11
+ };