cosey 0.3.2 → 0.3.4

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,11 @@
1
+ export interface CardProps {
2
+ }
3
+ export interface CardSlots {
4
+ default?: (props: Record<string, never>) => any;
5
+ }
6
+ export interface CardEmits {
7
+ (e: 'click'): void;
8
+ }
9
+ export interface CardExpose {
10
+ method: () => void;
11
+ }
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,16 @@
1
+ import { type CardProps, type CardSlots } from './card';
2
+ type __VLS_Slots = CardSlots;
3
+ declare const __VLS_component: import("vue").DefineComponent<CardProps, {
4
+ method: () => void;
5
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
6
+ click: () => any;
7
+ }, string, import("vue").PublicProps, Readonly<CardProps> & Readonly<{
8
+ onClick?: (() => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
11
+ export default _default;
12
+ type __VLS_WithSlots<T, S> = T & {
13
+ new (): {
14
+ $slots: S;
15
+ };
16
+ };
@@ -0,0 +1,31 @@
1
+ import { defineComponent, createElementBlock, openBlock, normalizeClass, unref, renderSlot } from 'vue';
2
+ import stdin_default$1 from './style/index.js';
3
+ import { useComponentConfig } from '../config-provider/config-provider.js';
4
+
5
+ var stdin_default = /* @__PURE__ */defineComponent({
6
+ ...{
7
+ name: "Card"
8
+ },
9
+ __name: "card",
10
+ emits: ["click"],
11
+ setup(__props, {
12
+ expose: __expose
13
+ }) {
14
+ const props = __props;
15
+ const {
16
+ prefixCls
17
+ } = useComponentConfig("card", props);
18
+ const {
19
+ hashId
20
+ } = stdin_default$1(prefixCls);
21
+ __expose();
22
+ return (_ctx, _cache) => {
23
+ return openBlock(), createElementBlock("div", {
24
+ class: normalizeClass([unref(hashId), unref(prefixCls)])
25
+ }, [renderSlot(_ctx.$slots, "default")], 2
26
+ /* CLASS */);
27
+ };
28
+ }
29
+ });
30
+
31
+ export { stdin_default as default };
@@ -0,0 +1,34 @@
1
+ export * from './card';
2
+ declare const _Card: {
3
+ new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./card").CardProps> & Readonly<{
4
+ onClick?: (() => any) | undefined;
5
+ }>, {
6
+ method: () => void;
7
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
8
+ click: () => any;
9
+ }, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
10
+ P: {};
11
+ B: {};
12
+ D: {};
13
+ C: {};
14
+ M: {};
15
+ Defaults: {};
16
+ }, Readonly<import("./card").CardProps> & Readonly<{
17
+ onClick?: (() => any) | undefined;
18
+ }>, {
19
+ method: () => void;
20
+ }, {}, {}, {}, {}>;
21
+ __isFragment?: never;
22
+ __isTeleport?: never;
23
+ __isSuspense?: never;
24
+ } & import("vue").ComponentOptionsBase<Readonly<import("./card").CardProps> & Readonly<{
25
+ onClick?: (() => any) | undefined;
26
+ }>, {
27
+ method: () => void;
28
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
29
+ click: () => any;
30
+ }, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
31
+ $slots: import("./card").CardSlots;
32
+ }) & import("vue").Plugin;
33
+ export { _Card as Card };
34
+ export default _Card;
@@ -0,0 +1,7 @@
1
+ import { withInstall } from '../utils.js';
2
+ import stdin_default$1 from './card.vue.js';
3
+
4
+ const _Card = withInstall(stdin_default$1);
5
+ var stdin_default = _Card;
6
+
7
+ export { _Card as Card, stdin_default as default };
@@ -0,0 +1,4 @@
1
+ declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../theme/theme-context").ThemeManager) => {
2
+ hashId: import("vue").Ref<string, string>;
3
+ };
4
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { getSimpleStyleHook } from 'cosey/components';
2
+
3
+ var stdin_default = getSimpleStyleHook("Card", (token) => {
4
+ const { componentCls } = token;
5
+ return {
6
+ [`${componentCls}`]: {
7
+ backgroundColor: token.colorBgContainer,
8
+ paddingInline: token.sizeSM,
9
+ paddingBlock: token.size
10
+ }
11
+ };
12
+ });
13
+
14
+ export { stdin_default as default };
@@ -1,5 +1,6 @@
1
1
  import { AudioCard } from './audio-card';
2
2
  import { AudioViewer } from './audio-viewer';
3
+ import { Card } from './card';
3
4
  import { Close } from './close';
4
5
  import { Col } from './col';
5
6
  import { ConfigProvider } from './config-provider';
@@ -46,6 +47,7 @@ declare module 'vue' {
46
47
  interface GlobalComponents {
47
48
  CoAudioCard: typeof AudioCard;
48
49
  CoAudioViewer: typeof AudioViewer;
50
+ CoCard: typeof Card;
49
51
  CoClose: typeof Close;
50
52
  CoCol: typeof Col;
51
53
  CoConfigProvider: typeof ConfigProvider;
@@ -95,4 +97,4 @@ declare module 'vue' {
95
97
  CoVideoViewer: typeof VideoViewer;
96
98
  }
97
99
  }
98
- export { AudioCard, AudioViewer, Close, Col, ConfigProvider, Container, ContextMenu, ContextMenuItem, ContextSubMenu, Copy, DndSort, DndSortItem, Editor, Field, FileCard, Form, FormItem, FormDialog, FormDrawer, FormGroup, FormList, FormQuery, Highlight, HorizontalTree, Icon, IconifyIcon, ImageCard, LongText, Mask, MediaCard, MediaCardGroup, MediaViewer, NumberFormat, OnlyChild, OptionalWrapper, Panel, Row, ScrollView, SnugMenu, SnugMenuItem, SvgIcon, Table, TableAction, Toggle, Transition, TransitionGroup, Upload, VideoCard, VideoViewer, };
100
+ export { AudioCard, AudioViewer, Card, Close, Col, ConfigProvider, Container, ContextMenu, ContextMenuItem, ContextSubMenu, Copy, DndSort, DndSortItem, Editor, Field, FileCard, Form, FormItem, FormDialog, FormDrawer, FormGroup, FormList, FormQuery, Highlight, HorizontalTree, Icon, IconifyIcon, ImageCard, LongText, Mask, MediaCard, MediaCardGroup, MediaViewer, NumberFormat, OnlyChild, OptionalWrapper, Panel, Row, ScrollView, SnugMenu, SnugMenuItem, SvgIcon, Table, TableAction, Toggle, Transition, TransitionGroup, Upload, VideoCard, VideoViewer, };
@@ -1,5 +1,6 @@
1
1
  export { AudioCard } from './audio-card/index.js';
2
2
  export { AudioViewer } from './audio-viewer/index.js';
3
+ export { Card } from './card/index.js';
3
4
  export { Close } from './close/index.js';
4
5
  export { Col } from './col/index.js';
5
6
  export { ConfigProvider } from './config-provider/index.js';
@@ -1,11 +1,13 @@
1
1
  export * from './audio-card';
2
2
  export * from './audio-viewer';
3
+ export * from './card';
3
4
  export * from './close';
4
5
  export * from './col';
5
6
  export * from './config-provider';
6
7
  export * from './container';
7
8
  export * from './context-menu';
8
9
  export * from './copy';
10
+ export * from './cssinjs';
9
11
  export * from './dnd-sort';
10
12
  export * from './editor';
11
13
  export * from './field';
@@ -44,7 +46,6 @@ export * from './transition-group';
44
46
  export * from './upload';
45
47
  export * from './video-card';
46
48
  export * from './video-viewer';
47
- export * from './cssinjs';
48
49
  import { type App } from 'vue';
49
50
  import * as components from './components';
50
51
  declare const installer: {
@@ -1,5 +1,6 @@
1
1
  export { AudioCard } from './audio-card/index.js';
2
2
  export { AudioViewer } from './audio-viewer/index.js';
3
+ export { Card } from './card/index.js';
3
4
  export { Close } from './close/index.js';
4
5
  export { Col } from './col/index.js';
5
6
  export { ConfigProvider } from './config-provider/index.js';
@@ -49,6 +50,8 @@ export { defaultColProps } from './col/col.js';
49
50
  export { defaultConfigProvider, defaultPrefixCls, useComponentConfig, useConfig, useConfigProvide } from './config-provider/config-provider.js';
50
51
  export { containerContextKey } from './container/container.js';
51
52
  export { contextMenuContextSymbol } from './context-menu/context-menu.js';
53
+ export { default as Keyframes } from './cssinjs/Keyframes.js';
54
+ export { parseStyle } from './cssinjs/parser.js';
52
55
  export { dndSortContextSymbol } from './dnd-sort/dnd-sort.js';
53
56
  export { useDndSort } from './dnd-sort/useDndSort.js';
54
57
  export { useDndSortItem } from './dnd-sort/useDndSortItem.js';
@@ -99,8 +102,6 @@ export { defaultUploadProps } from './upload/upload.js';
99
102
  export { useUpload, useUploadProvide } from './upload-context.js';
100
103
  export { defaultVideoCardProps } from './video-card/video-card.js';
101
104
  export { defaultVideoViewerProps } from './video-viewer/video-viewer.js';
102
- export { default as Keyframes } from './cssinjs/Keyframes.js';
103
- export { parseStyle } from './cssinjs/parser.js';
104
105
 
105
106
  const installer = {
106
107
  install(app) {
@@ -15,6 +15,10 @@ export declare const tableExportProps: {
15
15
  filename: string;
16
16
  }>;
17
17
  };
18
+ footerCount: {
19
+ type: NumberConstructor;
20
+ default: number;
21
+ };
18
22
  width: {
19
23
  type: PropType<import("../..").FormDialogWidth>;
20
24
  default: string;
@@ -11,6 +11,10 @@ const tableExportExtraProps = {
11
11
  },
12
12
  config: {
13
13
  type: [Boolean, Object]
14
+ },
15
+ footerCount: {
16
+ type: Number,
17
+ default: 0
14
18
  }
15
19
  };
16
20
  const tableExportProps = {
@@ -13,6 +13,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
13
13
  filename: string;
14
14
  }>;
15
15
  };
16
+ footerCount: {
17
+ type: NumberConstructor;
18
+ default: number;
19
+ };
16
20
  width: {
17
21
  type: import("vue").PropType<import("../..").FormDialogWidth>;
18
22
  default: string;
@@ -184,6 +188,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
184
188
  filename: string;
185
189
  }>;
186
190
  };
191
+ footerCount: {
192
+ type: NumberConstructor;
193
+ default: number;
194
+ };
187
195
  width: {
188
196
  type: import("vue").PropType<import("../..").FormDialogWidth>;
189
197
  default: string;
@@ -369,5 +377,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
369
377
  alignCenter: boolean;
370
378
  fullscreen: boolean;
371
379
  ariaLevel: string;
380
+ footerCount: number;
372
381
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
373
382
  export default _default;
@@ -164,7 +164,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
164
164
  };
165
165
  };
166
166
  const onSubmit = async () => {
167
- await exportExcel(getScheme(), props.data);
167
+ await exportExcel(getScheme(), props.data, {
168
+ footerCount: props.footerCount
169
+ });
168
170
  ElMessage.success(t("co.common.exportSuccess"));
169
171
  };
170
172
  return (_ctx, _cache) => {
@@ -148,6 +148,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
148
148
  }
149
149
  return data;
150
150
  });
151
+ const footerCount = computed(() => tableDataWithSummary.value.length - tableData.value.length);
151
152
  const getFetchParams = () => {
152
153
  const params = {
153
154
  ...orderParams,
@@ -415,8 +416,9 @@ var stdin_default = /* @__PURE__ */defineComponent({
415
416
  title: unref(t)("co.table.exportData"),
416
417
  config: mergedToolbarConfig.value.export,
417
418
  columns: exportColumns.value,
418
- data: tableDataWithSummary.value
419
- }, null, 8, ["modelValue", "title", "config", "columns", "data"])])) : createCommentVNode("v-if", true), mergedToolbarConfig.value.fullScreen ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(_component_el_tooltip, {
419
+ data: tableDataWithSummary.value,
420
+ "footer-count": footerCount.value
421
+ }, null, 8, ["modelValue", "title", "config", "columns", "data", "footer-count"])])) : createCommentVNode("v-if", true), mergedToolbarConfig.value.fullScreen ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(_component_el_tooltip, {
420
422
  content: unref(isFullPage) ? unref(t)("co.table.exitFullScreen") : unref(t)("co.table.fullScreen"),
421
423
  placement: "top",
422
424
  "show-after": 200,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -5,11 +5,14 @@ import { type TableColumnProps } from '../../components/table/table-column/table
5
5
  * 只取最底层的列组成表头
6
6
  */
7
7
  export declare function flatColumns(columns: TableColumnProps[]): TableColumnProps[];
8
+ export interface ExportExcelOptions {
9
+ footerCount?: number;
10
+ }
8
11
  /**
9
12
  * 根据数据和配置,导出 excel 文件
10
13
  */
11
14
  declare function exportExcel(scheme: ExportExcelScheme, data: Record<string, any>[] | {
12
15
  [sheetName: string]: Record<string, any>[];
13
- }): Promise<void>;
16
+ }, options?: ExportExcelOptions): Promise<void>;
14
17
  export { bookFormats, exportExcel };
15
18
  export type { ExportBookType, ExportExcelScheme };
@@ -122,7 +122,8 @@ function columns2lastLevelAoa(columns) {
122
122
  })
123
123
  ];
124
124
  }
125
- async function exportExcel(scheme, data) {
125
+ async function exportExcel(scheme, data, options) {
126
+ const { footerCount = 0 } = options || {};
126
127
  const worksheets = scheme.worksheet ? [scheme.worksheet] : scheme.worksheets || [];
127
128
  const bookType = scheme.bookType || "csv";
128
129
  const filename = scheme.filename + getExtByBookType(bookType);
@@ -134,7 +135,7 @@ async function exportExcel(scheme, data) {
134
135
  let aoa = ooa.map(
135
136
  (obj, index) => fColumns.map((column) => {
136
137
  const value = obj[column.prop];
137
- return transform ? transform(obj, column, value, index) : value;
138
+ return transform && index < ooa.length - footerCount ? transform(obj, column, value, index) : value;
138
139
  })
139
140
  );
140
141
  let headAoa = [];