@xn-lib/component 0.1.30 → 0.1.34

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.
@@ -0,0 +1,262 @@
1
+ import type { TableInst } from '../types';
2
+ declare var __VLS_24: string | undefined, __VLS_25: any, __VLS_27: {}, __VLS_37: {}, __VLS_55: `modal-${string}`, __VLS_56: {
3
+ data: any;
4
+ close: () => void;
5
+ confirm: () => Promise<void>;
6
+ };
7
+ type __VLS_Slots = {} & {
8
+ [K in NonNullable<typeof __VLS_24>]?: (props: typeof __VLS_25) => any;
9
+ } & {
10
+ [K in NonNullable<typeof __VLS_55>]?: (props: typeof __VLS_56) => any;
11
+ } & {
12
+ default?: (props: typeof __VLS_27) => any;
13
+ } & {
14
+ empty?: (props: typeof __VLS_37) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
17
+ readonly data: {
18
+ readonly type: import("vue").PropType<any[]>;
19
+ readonly default: () => never[];
20
+ };
21
+ readonly columns: {
22
+ readonly type: import("vue").PropType<import("../types").TableColumn[]>;
23
+ readonly default: () => never[];
24
+ };
25
+ readonly showPagination: {
26
+ readonly type: import("vue").PropType<boolean | import("../types").PaginationConfig>;
27
+ readonly default: true;
28
+ };
29
+ readonly pageSize: {
30
+ readonly type: NumberConstructor;
31
+ readonly default: 20;
32
+ };
33
+ readonly pageSizes: {
34
+ readonly type: import("vue").PropType<number[]>;
35
+ readonly default: () => number[];
36
+ };
37
+ readonly currentPage: {
38
+ readonly type: NumberConstructor;
39
+ readonly default: 1;
40
+ };
41
+ readonly total: {
42
+ readonly type: NumberConstructor;
43
+ readonly default: 0;
44
+ };
45
+ readonly selection: {
46
+ readonly type: import("vue").PropType<boolean | import("../types").SelectionConfig>;
47
+ readonly default: false;
48
+ };
49
+ readonly searchConfig: {
50
+ readonly type: import("vue").PropType<import("../types").SearchConfig[]>;
51
+ readonly default: () => never[];
52
+ };
53
+ readonly toolbar: {
54
+ readonly type: import("vue").PropType<import("../types").ToolbarConfig>;
55
+ readonly default: () => {
56
+ left: never[];
57
+ right: never[];
58
+ };
59
+ };
60
+ readonly tableConfig: {
61
+ readonly type: import("vue").PropType<import("../types").TableConfig>;
62
+ readonly default: () => {};
63
+ };
64
+ readonly request: {
65
+ readonly type: import("vue").PropType<import("../types").RequestConfig>;
66
+ readonly default: undefined;
67
+ };
68
+ readonly loading: {
69
+ readonly type: BooleanConstructor;
70
+ readonly default: false;
71
+ };
72
+ readonly selectedKeys: {
73
+ readonly type: import("vue").PropType<any[]>;
74
+ readonly default: undefined;
75
+ };
76
+ readonly selectedRows: {
77
+ readonly type: import("vue").PropType<any[]>;
78
+ readonly default: undefined;
79
+ };
80
+ readonly virtual: {
81
+ readonly type: BooleanConstructor;
82
+ readonly default: false;
83
+ };
84
+ readonly rowKey: {
85
+ readonly type: import("vue").PropType<string | ((row: any) => string | number)>;
86
+ readonly default: "id";
87
+ };
88
+ readonly height: {
89
+ readonly type: import("vue").PropType<number | string>;
90
+ readonly default: undefined;
91
+ };
92
+ readonly maxHeight: {
93
+ readonly type: import("vue").PropType<number | string>;
94
+ readonly default: undefined;
95
+ };
96
+ readonly showSearch: {
97
+ readonly type: BooleanConstructor;
98
+ readonly default: true;
99
+ };
100
+ readonly showToolbar: {
101
+ readonly type: BooleanConstructor;
102
+ readonly default: true;
103
+ };
104
+ readonly emptyText: {
105
+ readonly type: StringConstructor;
106
+ readonly default: "暂无数据";
107
+ };
108
+ readonly modals: {
109
+ readonly type: import("vue").PropType<import("../types").ModalConfig[]>;
110
+ readonly default: () => never[];
111
+ };
112
+ }>, TableInst, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
113
+ search: (params: Record<string, any>) => any;
114
+ reset: () => any;
115
+ "selection-change": (selection: any[]) => any;
116
+ "page-change": (page: number) => any;
117
+ "size-change": (size: number) => any;
118
+ "request-success": (data: any) => any;
119
+ "request-error": (error: any) => any;
120
+ "update:selectedKeys": (keys: any[]) => any;
121
+ "update:selectedRows": (rows: any[]) => any;
122
+ "modal-confirm": (key: string, data?: any) => any;
123
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
124
+ readonly data: {
125
+ readonly type: import("vue").PropType<any[]>;
126
+ readonly default: () => never[];
127
+ };
128
+ readonly columns: {
129
+ readonly type: import("vue").PropType<import("../types").TableColumn[]>;
130
+ readonly default: () => never[];
131
+ };
132
+ readonly showPagination: {
133
+ readonly type: import("vue").PropType<boolean | import("../types").PaginationConfig>;
134
+ readonly default: true;
135
+ };
136
+ readonly pageSize: {
137
+ readonly type: NumberConstructor;
138
+ readonly default: 20;
139
+ };
140
+ readonly pageSizes: {
141
+ readonly type: import("vue").PropType<number[]>;
142
+ readonly default: () => number[];
143
+ };
144
+ readonly currentPage: {
145
+ readonly type: NumberConstructor;
146
+ readonly default: 1;
147
+ };
148
+ readonly total: {
149
+ readonly type: NumberConstructor;
150
+ readonly default: 0;
151
+ };
152
+ readonly selection: {
153
+ readonly type: import("vue").PropType<boolean | import("../types").SelectionConfig>;
154
+ readonly default: false;
155
+ };
156
+ readonly searchConfig: {
157
+ readonly type: import("vue").PropType<import("../types").SearchConfig[]>;
158
+ readonly default: () => never[];
159
+ };
160
+ readonly toolbar: {
161
+ readonly type: import("vue").PropType<import("../types").ToolbarConfig>;
162
+ readonly default: () => {
163
+ left: never[];
164
+ right: never[];
165
+ };
166
+ };
167
+ readonly tableConfig: {
168
+ readonly type: import("vue").PropType<import("../types").TableConfig>;
169
+ readonly default: () => {};
170
+ };
171
+ readonly request: {
172
+ readonly type: import("vue").PropType<import("../types").RequestConfig>;
173
+ readonly default: undefined;
174
+ };
175
+ readonly loading: {
176
+ readonly type: BooleanConstructor;
177
+ readonly default: false;
178
+ };
179
+ readonly selectedKeys: {
180
+ readonly type: import("vue").PropType<any[]>;
181
+ readonly default: undefined;
182
+ };
183
+ readonly selectedRows: {
184
+ readonly type: import("vue").PropType<any[]>;
185
+ readonly default: undefined;
186
+ };
187
+ readonly virtual: {
188
+ readonly type: BooleanConstructor;
189
+ readonly default: false;
190
+ };
191
+ readonly rowKey: {
192
+ readonly type: import("vue").PropType<string | ((row: any) => string | number)>;
193
+ readonly default: "id";
194
+ };
195
+ readonly height: {
196
+ readonly type: import("vue").PropType<number | string>;
197
+ readonly default: undefined;
198
+ };
199
+ readonly maxHeight: {
200
+ readonly type: import("vue").PropType<number | string>;
201
+ readonly default: undefined;
202
+ };
203
+ readonly showSearch: {
204
+ readonly type: BooleanConstructor;
205
+ readonly default: true;
206
+ };
207
+ readonly showToolbar: {
208
+ readonly type: BooleanConstructor;
209
+ readonly default: true;
210
+ };
211
+ readonly emptyText: {
212
+ readonly type: StringConstructor;
213
+ readonly default: "暂无数据";
214
+ };
215
+ readonly modals: {
216
+ readonly type: import("vue").PropType<import("../types").ModalConfig[]>;
217
+ readonly default: () => never[];
218
+ };
219
+ }>> & Readonly<{
220
+ onSearch?: ((params: Record<string, any>) => any) | undefined;
221
+ onReset?: (() => any) | undefined;
222
+ "onSelection-change"?: ((selection: any[]) => any) | undefined;
223
+ "onPage-change"?: ((page: number) => any) | undefined;
224
+ "onSize-change"?: ((size: number) => any) | undefined;
225
+ "onRequest-success"?: ((data: any) => any) | undefined;
226
+ "onRequest-error"?: ((error: any) => any) | undefined;
227
+ "onUpdate:selectedKeys"?: ((keys: any[]) => any) | undefined;
228
+ "onUpdate:selectedRows"?: ((rows: any[]) => any) | undefined;
229
+ "onModal-confirm"?: ((key: string, data?: any) => any) | undefined;
230
+ }>, {
231
+ readonly data: any[];
232
+ readonly height: string | number;
233
+ readonly maxHeight: string | number;
234
+ readonly columns: import("../types").TableColumn[];
235
+ readonly loading: boolean;
236
+ readonly emptyText: string;
237
+ readonly virtual: boolean;
238
+ readonly rowKey: string | ((row: any) => string | number);
239
+ readonly selection: boolean | import("../types").SelectionConfig;
240
+ readonly toolbar: import("../types").ToolbarConfig;
241
+ readonly currentPage: number;
242
+ readonly pageSize: number;
243
+ readonly total: number;
244
+ readonly pageSizes: number[];
245
+ readonly showPagination: boolean | import("../types").PaginationConfig;
246
+ readonly searchConfig: import("../types").SearchConfig[];
247
+ readonly tableConfig: import("../types").TableConfig;
248
+ readonly request: import("../types").RequestConfig;
249
+ readonly selectedKeys: any[];
250
+ readonly selectedRows: any[];
251
+ readonly showSearch: boolean;
252
+ readonly showToolbar: boolean;
253
+ readonly modals: import("../types").ModalConfig[];
254
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
255
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
256
+ declare const _default: typeof __VLS_export;
257
+ export default _default;
258
+ type __VLS_WithSlots<T, S> = T & {
259
+ new (): {
260
+ $slots: S;
261
+ };
262
+ };
@@ -0,0 +1,100 @@
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
+ import type { TableColumn, PaginationConfig, SelectionConfig, SearchConfig, ToolbarConfig, TableConfig, RequestConfig, ModalConfig } from '../types';
3
+ export declare const tableProps: {
4
+ readonly data: {
5
+ readonly type: PropType<any[]>;
6
+ readonly default: () => never[];
7
+ };
8
+ readonly columns: {
9
+ readonly type: PropType<TableColumn[]>;
10
+ readonly default: () => never[];
11
+ };
12
+ readonly showPagination: {
13
+ readonly type: PropType<boolean | PaginationConfig>;
14
+ readonly default: true;
15
+ };
16
+ readonly pageSize: {
17
+ readonly type: NumberConstructor;
18
+ readonly default: 20;
19
+ };
20
+ readonly pageSizes: {
21
+ readonly type: PropType<number[]>;
22
+ readonly default: () => number[];
23
+ };
24
+ readonly currentPage: {
25
+ readonly type: NumberConstructor;
26
+ readonly default: 1;
27
+ };
28
+ readonly total: {
29
+ readonly type: NumberConstructor;
30
+ readonly default: 0;
31
+ };
32
+ readonly selection: {
33
+ readonly type: PropType<boolean | SelectionConfig>;
34
+ readonly default: false;
35
+ };
36
+ readonly searchConfig: {
37
+ readonly type: PropType<SearchConfig[]>;
38
+ readonly default: () => never[];
39
+ };
40
+ readonly toolbar: {
41
+ readonly type: PropType<ToolbarConfig>;
42
+ readonly default: () => {
43
+ left: never[];
44
+ right: never[];
45
+ };
46
+ };
47
+ readonly tableConfig: {
48
+ readonly type: PropType<TableConfig>;
49
+ readonly default: () => {};
50
+ };
51
+ readonly request: {
52
+ readonly type: PropType<RequestConfig>;
53
+ readonly default: undefined;
54
+ };
55
+ readonly loading: {
56
+ readonly type: BooleanConstructor;
57
+ readonly default: false;
58
+ };
59
+ readonly selectedKeys: {
60
+ readonly type: PropType<any[]>;
61
+ readonly default: undefined;
62
+ };
63
+ readonly selectedRows: {
64
+ readonly type: PropType<any[]>;
65
+ readonly default: undefined;
66
+ };
67
+ readonly virtual: {
68
+ readonly type: BooleanConstructor;
69
+ readonly default: false;
70
+ };
71
+ readonly rowKey: {
72
+ readonly type: PropType<string | ((row: any) => string | number)>;
73
+ readonly default: "id";
74
+ };
75
+ readonly height: {
76
+ readonly type: PropType<number | string>;
77
+ readonly default: undefined;
78
+ };
79
+ readonly maxHeight: {
80
+ readonly type: PropType<number | string>;
81
+ readonly default: undefined;
82
+ };
83
+ readonly showSearch: {
84
+ readonly type: BooleanConstructor;
85
+ readonly default: true;
86
+ };
87
+ readonly showToolbar: {
88
+ readonly type: BooleanConstructor;
89
+ readonly default: true;
90
+ };
91
+ readonly emptyText: {
92
+ readonly type: StringConstructor;
93
+ readonly default: "暂无数据";
94
+ };
95
+ readonly modals: {
96
+ readonly type: PropType<ModalConfig[]>;
97
+ readonly default: () => never[];
98
+ };
99
+ };
100
+ export type TableProps = ExtractPropTypes<typeof tableProps>;
@@ -10,6 +10,7 @@ export interface Selection {
10
10
  day: number;
11
11
  slot: number;
12
12
  }
13
+ export declare const defaultWeekLabels: string[];
13
14
  export declare const timeRangePickerProps: {
14
15
  readonly modelValue: {
15
16
  readonly type: PropType<TimeRangeValue>;
@@ -3,6 +3,6 @@ export interface TimeSlotRange {
3
3
  startSlot: number;
4
4
  endSlot: number;
5
5
  }
6
- export declare function formatTimeRanges(value: Record<number, number[]> | string, timeGranularity: number, weekLabels: string[], count: number): string[];
6
+ export declare function formatTimeRanges(value: Record<number, number[]> | string, count: number, timeGranularity?: number, weekLabels?: string[]): string[];
7
7
  export declare function stringToObject(value: string, count: number): Record<number, number[]>;
8
8
  export declare function objectToString(value: Record<number, number[]>, count: number): string;
@@ -3,6 +3,7 @@ export * from './tag';
3
3
  export * from './transfer';
4
4
  export * from './virtual-list';
5
5
  export * from './editable-textarea';
6
+ export * from './table';
6
7
  export type DefaultType = 'success' | 'info' | 'warning' | 'danger' | 'primary' | 'default';
7
8
  export type DefaultSize = 'small' | 'default' | 'large';
8
9
  export type Option = {