cosey 0.6.32 → 0.6.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.
- package/components/table/index.d.ts +9 -9
- package/components/table/table-column/table-column.d.ts +1 -0
- package/components/table/table.d.ts +3 -3
- package/components/table/table.js +1 -1
- package/components/table/table.vue.d.ts +5 -6
- package/components/table/table.vue.js +1 -1
- package/config/index.d.ts +2 -0
- package/hooks/useUpsert.d.ts +1 -1
- package/layout/layout-base/layout-base.vue.js +4 -2
- package/package.json +1 -1
- package/utils/excel/index.d.ts +2 -2
- package/utils/excel/index.js +5 -2
|
@@ -12,11 +12,11 @@ declare const _Table: {
|
|
|
12
12
|
default: boolean;
|
|
13
13
|
};
|
|
14
14
|
columns: {
|
|
15
|
-
type: import("vue").PropType<import("..").
|
|
15
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps[]>;
|
|
16
16
|
default: () => never[];
|
|
17
17
|
};
|
|
18
18
|
actionColumn: {
|
|
19
|
-
type: import("vue").PropType<import("..").
|
|
19
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps>;
|
|
20
20
|
};
|
|
21
21
|
pagination: {
|
|
22
22
|
type: import("vue").PropType<boolean | import("element-plus").PaginationProps>;
|
|
@@ -319,7 +319,7 @@ declare const _Table: {
|
|
|
319
319
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
320
320
|
tableLayout: "auto" | "fixed";
|
|
321
321
|
border: boolean;
|
|
322
|
-
columns: import("..").
|
|
322
|
+
columns: import("..").MayBeTableColumnProps[];
|
|
323
323
|
data: any[];
|
|
324
324
|
immediate: boolean;
|
|
325
325
|
className: string;
|
|
@@ -358,11 +358,11 @@ declare const _Table: {
|
|
|
358
358
|
default: boolean;
|
|
359
359
|
};
|
|
360
360
|
columns: {
|
|
361
|
-
type: import("vue").PropType<import("..").
|
|
361
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps[]>;
|
|
362
362
|
default: () => never[];
|
|
363
363
|
};
|
|
364
364
|
actionColumn: {
|
|
365
|
-
type: import("vue").PropType<import("..").
|
|
365
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps>;
|
|
366
366
|
};
|
|
367
367
|
pagination: {
|
|
368
368
|
type: import("vue").PropType<boolean | import("element-plus").PaginationProps>;
|
|
@@ -665,7 +665,7 @@ declare const _Table: {
|
|
|
665
665
|
}, {}, {}, {}, {
|
|
666
666
|
tableLayout: "auto" | "fixed";
|
|
667
667
|
border: boolean;
|
|
668
|
-
columns: import("..").
|
|
668
|
+
columns: import("..").MayBeTableColumnProps[];
|
|
669
669
|
data: any[];
|
|
670
670
|
immediate: boolean;
|
|
671
671
|
className: string;
|
|
@@ -701,11 +701,11 @@ declare const _Table: {
|
|
|
701
701
|
default: boolean;
|
|
702
702
|
};
|
|
703
703
|
columns: {
|
|
704
|
-
type: import("vue").PropType<import("..").
|
|
704
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps[]>;
|
|
705
705
|
default: () => never[];
|
|
706
706
|
};
|
|
707
707
|
actionColumn: {
|
|
708
|
-
type: import("vue").PropType<import("..").
|
|
708
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps>;
|
|
709
709
|
};
|
|
710
710
|
pagination: {
|
|
711
711
|
type: import("vue").PropType<boolean | import("element-plus").PaginationProps>;
|
|
@@ -866,7 +866,7 @@ declare const _Table: {
|
|
|
866
866
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
867
867
|
tableLayout: "auto" | "fixed";
|
|
868
868
|
border: boolean;
|
|
869
|
-
columns: import("..").
|
|
869
|
+
columns: import("..").MayBeTableColumnProps[];
|
|
870
870
|
data: any[];
|
|
871
871
|
immediate: boolean;
|
|
872
872
|
className: string;
|
|
@@ -32,6 +32,7 @@ export type TableColumnProps<T = any> = Partial<Omit<ExtractPropTypes<typeof elT
|
|
|
32
32
|
tooltip?: string;
|
|
33
33
|
format?: (cellValue: any, row: any, column: TableColumnCtx<any>, index: number) => VNode | string;
|
|
34
34
|
};
|
|
35
|
+
export type MayBeTableColumnProps = TableColumnProps | null | undefined | boolean;
|
|
35
36
|
export declare const tableColumnProps: {
|
|
36
37
|
slots: {
|
|
37
38
|
type: PropType<TableColumnProps["slots"]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TableColumnCtx, type PaginationProps } from 'element-plus';
|
|
2
2
|
import { type PropType, type ExtractPropTypes, MaybeRef } from 'vue';
|
|
3
|
-
import { type
|
|
3
|
+
import { type MayBeTableColumnProps } from './table-column/table-column';
|
|
4
4
|
import { TableQueryExpose, type TableQueryProps } from './table-query/table-query';
|
|
5
5
|
import { TableStatisticsColumn } from './table-stats/table-stats';
|
|
6
6
|
export interface ToolbarConfig {
|
|
@@ -25,11 +25,11 @@ export declare const tableProps: {
|
|
|
25
25
|
default: boolean;
|
|
26
26
|
};
|
|
27
27
|
columns: {
|
|
28
|
-
type: PropType<
|
|
28
|
+
type: PropType<MayBeTableColumnProps[]>;
|
|
29
29
|
default: () => never[];
|
|
30
30
|
};
|
|
31
31
|
actionColumn: {
|
|
32
|
-
type: PropType<
|
|
32
|
+
type: PropType<MayBeTableColumnProps>;
|
|
33
33
|
};
|
|
34
34
|
pagination: {
|
|
35
35
|
type: PropType<boolean | PaginationProps>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type PaginationProps, type TableColumnCtx } from 'element-plus';
|
|
2
2
|
import { type TableSlots, type TableExpose, type ToolbarConfig } from './table';
|
|
3
|
-
import { type TableColumnProps } from './table-column/table-column';
|
|
4
3
|
type __VLS_Slots = TableSlots;
|
|
5
4
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
5
|
api: {
|
|
@@ -11,11 +10,11 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
11
10
|
default: boolean;
|
|
12
11
|
};
|
|
13
12
|
columns: {
|
|
14
|
-
type: import("vue").PropType<
|
|
13
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps[]>;
|
|
15
14
|
default: () => never[];
|
|
16
15
|
};
|
|
17
16
|
actionColumn: {
|
|
18
|
-
type: import("vue").PropType<
|
|
17
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps>;
|
|
19
18
|
};
|
|
20
19
|
pagination: {
|
|
21
20
|
type: import("vue").PropType<boolean | PaginationProps>;
|
|
@@ -182,11 +181,11 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
182
181
|
default: boolean;
|
|
183
182
|
};
|
|
184
183
|
columns: {
|
|
185
|
-
type: import("vue").PropType<
|
|
184
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps[]>;
|
|
186
185
|
default: () => never[];
|
|
187
186
|
};
|
|
188
187
|
actionColumn: {
|
|
189
|
-
type: import("vue").PropType<
|
|
188
|
+
type: import("vue").PropType<import("..").MayBeTableColumnProps>;
|
|
190
189
|
};
|
|
191
190
|
pagination: {
|
|
192
191
|
type: import("vue").PropType<boolean | PaginationProps>;
|
|
@@ -308,7 +307,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
308
307
|
}>> & Readonly<{}>, {
|
|
309
308
|
tableLayout: "auto" | "fixed";
|
|
310
309
|
border: boolean;
|
|
311
|
-
columns:
|
|
310
|
+
columns: import("..").MayBeTableColumnProps[];
|
|
312
311
|
data: any[];
|
|
313
312
|
immediate: boolean;
|
|
314
313
|
className: string;
|
|
@@ -107,7 +107,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
107
107
|
});
|
|
108
108
|
const renderedColumns = ref([]);
|
|
109
109
|
const setRenderedColumns = () => {
|
|
110
|
-
renderedColumns.value = cloneDeep([...props.columns, props.actionColumn].filter(
|
|
110
|
+
renderedColumns.value = cloneDeep([...props.columns, props.actionColumn].filter(isObject));
|
|
111
111
|
};
|
|
112
112
|
const exportColumns = computed(() => {
|
|
113
113
|
return renderedColumns.value?.filter(column => {
|
package/config/index.d.ts
CHANGED
|
@@ -41,8 +41,10 @@ export interface LayoutComponents {
|
|
|
41
41
|
}
|
|
42
42
|
export interface LayoutSlots {
|
|
43
43
|
topbarRight?: () => VNodeChild;
|
|
44
|
+
topbarWidget?: () => VNodeChild;
|
|
44
45
|
authWidget?: () => VNodeChild;
|
|
45
46
|
userMenu?: () => VNodeChild;
|
|
47
|
+
afterToggle?: () => VNodeChild;
|
|
46
48
|
}
|
|
47
49
|
type FilterRouteHandler = (route: RouteRecordRaw) => RouteRecordRaw | void | boolean | undefined | null;
|
|
48
50
|
export type CoseyOptions = {
|
package/hooks/useUpsert.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface UseUpsertOptions<Model, Row = Model> {
|
|
|
18
18
|
onShow?: () => void;
|
|
19
19
|
onShown?: () => void;
|
|
20
20
|
onShownAdd?: (...args: any[]) => void;
|
|
21
|
-
onShownEdit?: (...args: any[]) => void;
|
|
21
|
+
onShownEdit?: (row: Row, ...args: any[]) => void;
|
|
22
22
|
detailsFetch?: (row: Row) => any;
|
|
23
23
|
beforeFill?: (row: Row) => any;
|
|
24
24
|
addFetch?: (...args: any[]) => any;
|
|
@@ -37,6 +37,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
37
37
|
const layoutStore = useLayoutStore();
|
|
38
38
|
const slotsConfig = useGlobalConfig().slots;
|
|
39
39
|
const TopbarRight = defineTemplate(() => slotsConfig.topbarRight?.());
|
|
40
|
+
const TopbarWidget = defineTemplate(() => slotsConfig.topbarWidget?.());
|
|
41
|
+
const AfterToggle = defineTemplate(() => slotsConfig.afterToggle?.());
|
|
40
42
|
return (_ctx, _cache) => {
|
|
41
43
|
return openBlock(), createElementBlock("div", {
|
|
42
44
|
class: normalizeClass([unref(hashId), unref(prefixCls)])
|
|
@@ -60,7 +62,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
60
62
|
"is-horizontal": ""
|
|
61
63
|
})) : createCommentVNode("v-if", true), unref(layoutStore).isMobile || unref(layoutStore).isVertical || unref(layoutStore).isBiserial ? (openBlock(), createBlock(unref(stdin_default$d), {
|
|
62
64
|
key: 1
|
|
63
|
-
})) : createCommentVNode("v-if", true), !unref(layoutStore).isMobile && (unref(layoutStore).isVertical || unref(layoutStore).isBiserial) ? (openBlock(), createBlock(unref(stdin_default$e), {
|
|
65
|
+
})) : createCommentVNode("v-if", true), (openBlock(), createBlock(resolveDynamicComponent(unref(AfterToggle)))), !unref(layoutStore).isMobile && (unref(layoutStore).isVertical || unref(layoutStore).isBiserial) ? (openBlock(), createBlock(unref(stdin_default$e), {
|
|
64
66
|
key: 2
|
|
65
67
|
})) : createCommentVNode("v-if", true), !unref(layoutStore).isMobile && (unref(layoutStore).isHorizontalVertical || unref(layoutStore).isHorizontalBiserial) ? (openBlock(), createBlock(unref(stdin_default$f), {
|
|
66
68
|
key: 3
|
|
@@ -71,7 +73,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
71
73
|
"flex": "1"
|
|
72
74
|
}
|
|
73
75
|
})) : createCommentVNode("v-if", true)]),
|
|
74
|
-
right: withCtx(() => [createVNode(unref(stdin_default$9)), (openBlock(), createBlock(resolveDynamicComponent(unref(
|
|
76
|
+
right: withCtx(() => [createVNode(unref(stdin_default$9)), (openBlock(), createBlock(resolveDynamicComponent(unref(TopbarWidget)))), createVNode(unref(stdin_default$a)), createVNode(unref(stdin_default$b)), (openBlock(), createBlock(resolveDynamicComponent(unref(TopbarRight))))]),
|
|
75
77
|
_: 1
|
|
76
78
|
/* STABLE */
|
|
77
79
|
}), createVNode(unref(stdin_default$h))]),
|
package/package.json
CHANGED
package/utils/excel/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { bookFormats } from './bookFormats';
|
|
2
2
|
import type { ExportBookType, ExportExcelScheme } from './type';
|
|
3
|
-
import { type TableColumnProps } from '../../components/table/table-column/table-column';
|
|
3
|
+
import { type MayBeTableColumnProps, type TableColumnProps } from '../../components/table/table-column/table-column';
|
|
4
4
|
/**
|
|
5
5
|
* 只取最底层的列组成表头
|
|
6
6
|
*/
|
|
7
|
-
export declare function flatColumns(columns:
|
|
7
|
+
export declare function flatColumns(columns: MayBeTableColumnProps[]): TableColumnProps[];
|
|
8
8
|
export interface ExportExcelOptions {
|
|
9
9
|
footerCount?: number;
|
|
10
10
|
}
|
package/utils/excel/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { wb2xlsx } from './xlsx.js';
|
|
|
7
7
|
import { wb2xml } from './xml.js';
|
|
8
8
|
import { wb2csv } from './csv.js';
|
|
9
9
|
import { wb2txt } from './txt.js';
|
|
10
|
+
import { isObject } from '../is.js';
|
|
10
11
|
|
|
11
12
|
function downloadByUrl(url, filename) {
|
|
12
13
|
const link = document.createElement("a");
|
|
@@ -59,8 +60,10 @@ async function writeFile(wb, bookType) {
|
|
|
59
60
|
}
|
|
60
61
|
function flatColumns(columns) {
|
|
61
62
|
return columns.reduce((result, column) => {
|
|
62
|
-
return result.concat(
|
|
63
|
-
|
|
63
|
+
return result.concat(
|
|
64
|
+
isObject(column) && Array.isArray(column.columns) ? flatColumns(column.columns) : column
|
|
65
|
+
);
|
|
66
|
+
}, []).filter(isObject);
|
|
64
67
|
}
|
|
65
68
|
function columns2aoa(columns) {
|
|
66
69
|
let aoa = [];
|