cosey 0.2.18 → 0.2.20

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.
@@ -76,7 +76,9 @@ export { defaultBreakpoints, defaultRowProps, generateAlgorithms, rowColumns, ro
76
76
  export { snugMenuContextSymbol } from './snug-menu/snug-menu.js';
77
77
  export { getFocusVisibleStyle, getLineClampStyle, getTruncateStyle } from './style/mixins.js';
78
78
  export { contrarotation, rotation, rotation45, spinner } from './style/animation.js';
79
- export { defaultTableConfig, elSlotsName, omittedTableProps, tableExposeKeys, tableProps } from './table/table.js';
79
+ export { defaultTableConfig, elSlotsName, omittedTableProps, tableEmitEvents, tableEmitOnEvents, tableEmitOnProps, tableExposeKeys, tableProps } from './table/table.js';
80
+ export { tableColumnProps } from './table/table-column/table-column.js';
81
+ export { createScheme, omittedTableQueryProps, tableQueryExposeKeys, tableQueryProps } from './table/table-query/table-query.js';
80
82
  export { useTable } from './table/useTable.js';
81
83
  export { defaultTableActionProps } from './table-action/table-action.js';
82
84
  export { StyleCache, StyleProvider } from './theme/StyleContext.js';
@@ -1,4 +1,6 @@
1
1
  export * from './table';
2
+ export * from './table-column/table-column';
3
+ export * from './table-query/table-query';
2
4
  export * from './useTable';
3
5
  declare const _Table: {
4
6
  new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
@@ -10,11 +12,11 @@ declare const _Table: {
10
12
  default: boolean;
11
13
  };
12
14
  columns: {
13
- type: import("vue").PropType<import("./table-column/table-column").TableColumnProps[]>;
15
+ type: import("vue").PropType<import(".").TableColumnProps[]>;
14
16
  default: () => never[];
15
17
  };
16
18
  actionColumn: {
17
- type: import("vue").PropType<import("./table-column/table-column").TableColumnProps>;
19
+ type: import("vue").PropType<import(".").TableColumnProps>;
18
20
  };
19
21
  pagination: {
20
22
  type: import("vue").PropType<boolean | import("element-plus").PaginationProps>;
@@ -262,26 +264,7 @@ declare const _Table: {
262
264
  default: boolean;
263
265
  };
264
266
  preserveExpandedContent: BooleanConstructor;
265
- }>> & Readonly<{
266
- "onSelect-all"?: ((...args: any[]) => any) | undefined;
267
- onSelect?: ((...args: any[]) => any) | undefined;
268
- "onCurrent-change"?: ((...args: any[]) => any) | undefined;
269
- "onExpand-change"?: ((...args: any[]) => any) | undefined;
270
- "onSelection-change"?: ((...args: any[]) => any) | undefined;
271
- "onCell-mouse-enter"?: ((...args: any[]) => any) | undefined;
272
- "onCell-mouse-leave"?: ((...args: any[]) => any) | undefined;
273
- "onCell-contextmenu"?: ((...args: any[]) => any) | undefined;
274
- "onCell-click"?: ((...args: any[]) => any) | undefined;
275
- "onCell-dblclick"?: ((...args: any[]) => any) | undefined;
276
- "onRow-click"?: ((...args: any[]) => any) | undefined;
277
- "onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
278
- "onRow-dblclick"?: ((...args: any[]) => any) | undefined;
279
- "onHeader-click"?: ((...args: any[]) => any) | undefined;
280
- "onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
281
- "onSort-change"?: ((...args: any[]) => any) | undefined;
282
- "onFilter-change"?: ((...args: any[]) => any) | undefined;
283
- "onHeader-dragend"?: ((...args: any[]) => any) | undefined;
284
- }>, {
267
+ }>> & Readonly<{}>, {
285
268
  reload: () => void;
286
269
  expandAll: () => void;
287
270
  collapseAll: () => void;
@@ -312,29 +295,10 @@ declare const _Table: {
312
295
  setScrollLeft: (left?: number) => void;
313
296
  columns: import("element-plus").TableColumnCtx<any>[];
314
297
  updateKeyChildren: (key: string, data: any[]) => void;
315
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
316
- "select-all": (...args: any[]) => any;
317
- select: (...args: any[]) => any;
318
- "current-change": (...args: any[]) => any;
319
- "expand-change": (...args: any[]) => any;
320
- "selection-change": (...args: any[]) => any;
321
- "cell-mouse-enter": (...args: any[]) => any;
322
- "cell-mouse-leave": (...args: any[]) => any;
323
- "cell-contextmenu": (...args: any[]) => any;
324
- "cell-click": (...args: any[]) => any;
325
- "cell-dblclick": (...args: any[]) => any;
326
- "row-click": (...args: any[]) => any;
327
- "row-contextmenu": (...args: any[]) => any;
328
- "row-dblclick": (...args: any[]) => any;
329
- "header-click": (...args: any[]) => any;
330
- "header-contextmenu": (...args: any[]) => any;
331
- "sort-change": (...args: any[]) => any;
332
- "filter-change": (...args: any[]) => any;
333
- "header-dragend": (...args: any[]) => any;
334
- }, import("vue").PublicProps, {
298
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
335
299
  tableLayout: "auto" | "fixed";
336
300
  border: boolean;
337
- columns: import("./table-column/table-column").TableColumnProps[];
301
+ columns: import(".").TableColumnProps[];
338
302
  data: any[];
339
303
  immediate: boolean;
340
304
  className: string;
@@ -371,11 +335,11 @@ declare const _Table: {
371
335
  default: boolean;
372
336
  };
373
337
  columns: {
374
- type: import("vue").PropType<import("./table-column/table-column").TableColumnProps[]>;
338
+ type: import("vue").PropType<import(".").TableColumnProps[]>;
375
339
  default: () => never[];
376
340
  };
377
341
  actionColumn: {
378
- type: import("vue").PropType<import("./table-column/table-column").TableColumnProps>;
342
+ type: import("vue").PropType<import(".").TableColumnProps>;
379
343
  };
380
344
  pagination: {
381
345
  type: import("vue").PropType<boolean | import("element-plus").PaginationProps>;
@@ -623,26 +587,7 @@ declare const _Table: {
623
587
  default: boolean;
624
588
  };
625
589
  preserveExpandedContent: BooleanConstructor;
626
- }>> & Readonly<{
627
- "onSelect-all"?: ((...args: any[]) => any) | undefined;
628
- onSelect?: ((...args: any[]) => any) | undefined;
629
- "onCurrent-change"?: ((...args: any[]) => any) | undefined;
630
- "onExpand-change"?: ((...args: any[]) => any) | undefined;
631
- "onSelection-change"?: ((...args: any[]) => any) | undefined;
632
- "onCell-mouse-enter"?: ((...args: any[]) => any) | undefined;
633
- "onCell-mouse-leave"?: ((...args: any[]) => any) | undefined;
634
- "onCell-contextmenu"?: ((...args: any[]) => any) | undefined;
635
- "onCell-click"?: ((...args: any[]) => any) | undefined;
636
- "onCell-dblclick"?: ((...args: any[]) => any) | undefined;
637
- "onRow-click"?: ((...args: any[]) => any) | undefined;
638
- "onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
639
- "onRow-dblclick"?: ((...args: any[]) => any) | undefined;
640
- "onHeader-click"?: ((...args: any[]) => any) | undefined;
641
- "onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
642
- "onSort-change"?: ((...args: any[]) => any) | undefined;
643
- "onFilter-change"?: ((...args: any[]) => any) | undefined;
644
- "onHeader-dragend"?: ((...args: any[]) => any) | undefined;
645
- }>, {
590
+ }>> & Readonly<{}>, {
646
591
  reload: () => void;
647
592
  expandAll: () => void;
648
593
  collapseAll: () => void;
@@ -676,7 +621,7 @@ declare const _Table: {
676
621
  }, {}, {}, {}, {
677
622
  tableLayout: "auto" | "fixed";
678
623
  border: boolean;
679
- columns: import("./table-column/table-column").TableColumnProps[];
624
+ columns: import(".").TableColumnProps[];
680
625
  data: any[];
681
626
  immediate: boolean;
682
627
  className: string;
@@ -710,11 +655,11 @@ declare const _Table: {
710
655
  default: boolean;
711
656
  };
712
657
  columns: {
713
- type: import("vue").PropType<import("./table-column/table-column").TableColumnProps[]>;
658
+ type: import("vue").PropType<import(".").TableColumnProps[]>;
714
659
  default: () => never[];
715
660
  };
716
661
  actionColumn: {
717
- type: import("vue").PropType<import("./table-column/table-column").TableColumnProps>;
662
+ type: import("vue").PropType<import(".").TableColumnProps>;
718
663
  };
719
664
  pagination: {
720
665
  type: import("vue").PropType<boolean | import("element-plus").PaginationProps>;
@@ -724,7 +669,7 @@ declare const _Table: {
724
669
  type: import("vue").PropType<(expose: import("./table").TableExpose) => void>;
725
670
  };
726
671
  formProps: {
727
- type: import("vue").PropType<import("./table-query/table-query").TableQueryProps>;
672
+ type: import("vue").PropType<import(".").TableQueryProps>;
728
673
  };
729
674
  beforeFetch: {
730
675
  type: import("vue").PropType<(params: Record<string, any>) => any>;
@@ -823,26 +768,7 @@ declare const _Table: {
823
768
  default: boolean;
824
769
  };
825
770
  preserveExpandedContent: BooleanConstructor;
826
- }>> & Readonly<{
827
- "onSelect-all"?: ((...args: any[]) => any) | undefined;
828
- onSelect?: ((...args: any[]) => any) | undefined;
829
- "onCurrent-change"?: ((...args: any[]) => any) | undefined;
830
- "onExpand-change"?: ((...args: any[]) => any) | undefined;
831
- "onSelection-change"?: ((...args: any[]) => any) | undefined;
832
- "onCell-mouse-enter"?: ((...args: any[]) => any) | undefined;
833
- "onCell-mouse-leave"?: ((...args: any[]) => any) | undefined;
834
- "onCell-contextmenu"?: ((...args: any[]) => any) | undefined;
835
- "onCell-click"?: ((...args: any[]) => any) | undefined;
836
- "onCell-dblclick"?: ((...args: any[]) => any) | undefined;
837
- "onRow-click"?: ((...args: any[]) => any) | undefined;
838
- "onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
839
- "onRow-dblclick"?: ((...args: any[]) => any) | undefined;
840
- "onHeader-click"?: ((...args: any[]) => any) | undefined;
841
- "onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
842
- "onSort-change"?: ((...args: any[]) => any) | undefined;
843
- "onFilter-change"?: ((...args: any[]) => any) | undefined;
844
- "onHeader-dragend"?: ((...args: any[]) => any) | undefined;
845
- }>, {
771
+ }>> & Readonly<{}>, {
846
772
  reload: () => void;
847
773
  expandAll: () => void;
848
774
  collapseAll: () => void;
@@ -873,29 +799,10 @@ declare const _Table: {
873
799
  setScrollLeft: (left?: number) => void;
874
800
  columns: import("element-plus").TableColumnCtx<any>[];
875
801
  updateKeyChildren: (key: string, data: any[]) => void;
876
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
877
- "select-all": (...args: any[]) => any;
878
- select: (...args: any[]) => any;
879
- "current-change": (...args: any[]) => any;
880
- "expand-change": (...args: any[]) => any;
881
- "selection-change": (...args: any[]) => any;
882
- "cell-mouse-enter": (...args: any[]) => any;
883
- "cell-mouse-leave": (...args: any[]) => any;
884
- "cell-contextmenu": (...args: any[]) => any;
885
- "cell-click": (...args: any[]) => any;
886
- "cell-dblclick": (...args: any[]) => any;
887
- "row-click": (...args: any[]) => any;
888
- "row-contextmenu": (...args: any[]) => any;
889
- "row-dblclick": (...args: any[]) => any;
890
- "header-click": (...args: any[]) => any;
891
- "header-contextmenu": (...args: any[]) => any;
892
- "sort-change": (...args: any[]) => any;
893
- "filter-change": (...args: any[]) => any;
894
- "header-dragend": (...args: any[]) => any;
895
- }, string, {
802
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
896
803
  tableLayout: "auto" | "fixed";
897
804
  border: boolean;
898
- columns: import("./table-column/table-column").TableColumnProps[];
805
+ columns: import(".").TableColumnProps[];
899
806
  data: any[];
900
807
  immediate: boolean;
901
808
  className: string;
@@ -1,6 +1,8 @@
1
1
  import { withInstall } from '../utils.js';
2
2
  import stdin_default$1 from './table.vue.js';
3
- export { defaultTableConfig, elSlotsName, omittedTableProps, tableExposeKeys, tableProps } from './table.js';
3
+ export { defaultTableConfig, elSlotsName, omittedTableProps, tableEmitEvents, tableEmitOnEvents, tableEmitOnProps, tableExposeKeys, tableProps } from './table.js';
4
+ export { tableColumnProps } from './table-column/table-column.js';
5
+ export { createScheme, omittedTableQueryProps, tableQueryExposeKeys, tableQueryProps } from './table-query/table-query.js';
4
6
  export { useTable } from './useTable.js';
5
7
 
6
8
  const _Table = withInstall(stdin_default$1);
@@ -10,6 +10,11 @@ export interface ToolbarConfig {
10
10
  fullScreen?: boolean;
11
11
  setting?: boolean;
12
12
  }
13
+ export declare const tableEmitEvents: string[];
14
+ export declare const tableEmitOnEvents: string[][];
15
+ export declare const tableEmitOnProps: Record<string, {
16
+ type: (...args: any[]) => any;
17
+ }>;
13
18
  export declare const tableProps: {
14
19
  api: {
15
20
  type: PropType<(...args: any[]) => Promise<any>>;
@@ -143,8 +148,6 @@ export interface TableSlots {
143
148
  'toolbar-right'?: (props: Record<string, never>) => any;
144
149
  }
145
150
  export declare const elSlotsName: readonly ["default", "append", "empty"];
146
- type TableEmitEvents = 'select-all' | 'expand-change' | 'current-change' | 'select' | 'selection-change' | 'cell-mouse-enter' | 'cell-mouse-leave' | 'cell-contextmenu' | 'cell-click' | 'cell-dblclick' | 'row-click' | 'row-contextmenu' | 'row-dblclick' | 'header-click' | 'header-contextmenu' | 'sort-change' | 'filter-change' | 'header-dragend';
147
- export type TableEmits = (event: TableEmitEvents, ...args: any[]) => void;
148
151
  export interface TableCustomExpose {
149
152
  reload: () => void;
150
153
  expandAll: () => void;
@@ -224,4 +227,3 @@ export interface TableConfig {
224
227
  };
225
228
  pagination?: Partial<PaginationProps>;
226
229
  }
227
- export {};
@@ -1,7 +1,40 @@
1
1
  import elTableProps from 'element-plus/es/components/table/src/table/defaults.mjs';
2
- import { omit } from 'lodash-es';
2
+ import { upperFirst, camelCase, omit } from 'lodash-es';
3
3
  import { tableQueryExposeKeys } from './table-query/table-query.js';
4
4
 
5
+ const tableEmitEvents = [
6
+ "select-all",
7
+ "expand-change",
8
+ "current-change",
9
+ "select",
10
+ "selection-change",
11
+ "cell-mouse-enter",
12
+ "cell-mouse-leave",
13
+ "cell-contextmenu",
14
+ "cell-click",
15
+ "cell-dblclick",
16
+ "row-click",
17
+ "row-contextmenu",
18
+ "row-dblclick",
19
+ "header-click",
20
+ "header-contextmenu",
21
+ "sort-change",
22
+ "filter-change",
23
+ "header-dragend"
24
+ ];
25
+ const tableEmitOnEvents = tableEmitEvents.map((item) => [
26
+ item,
27
+ "on" + upperFirst(camelCase(item))
28
+ ]);
29
+ const tableEmitOnProps = tableEmitOnEvents.reduce(
30
+ (obj, [, onName]) => {
31
+ obj[onName] = {
32
+ type: Function
33
+ };
34
+ return obj;
35
+ },
36
+ {}
37
+ );
5
38
  const tableExtraProps = {
6
39
  api: {
7
40
  type: Function
@@ -115,4 +148,4 @@ const defaultTableConfig = {
115
148
  }
116
149
  };
117
150
 
118
- export { defaultTableConfig, elSlotsName, omittedTableProps, tableExposeKeys, tableProps };
151
+ export { defaultTableConfig, elSlotsName, omittedTableProps, tableEmitEvents, tableEmitOnEvents, tableEmitOnProps, tableExposeKeys, tableProps };
@@ -25,7 +25,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
25
25
  type: import("vue").PropType<(expose: TableExpose) => void>;
26
26
  };
27
27
  formProps: {
28
- type: import("vue").PropType<import("./table-query/table-query").TableQueryProps>;
28
+ type: import("vue").PropType<import(".").TableQueryProps>;
29
29
  };
30
30
  beforeFetch: {
31
31
  type: import("vue").PropType<(params: Record<string, any>) => any>;
@@ -155,26 +155,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
155
155
  setScrollLeft: (left?: number) => void;
156
156
  columns: import("element-plus").TableColumnCtx<any>[];
157
157
  updateKeyChildren: (key: string, data: any[]) => void;
158
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
159
- "select-all": (...args: any[]) => any;
160
- select: (...args: any[]) => any;
161
- "current-change": (...args: any[]) => any;
162
- "expand-change": (...args: any[]) => any;
163
- "selection-change": (...args: any[]) => any;
164
- "cell-mouse-enter": (...args: any[]) => any;
165
- "cell-mouse-leave": (...args: any[]) => any;
166
- "cell-contextmenu": (...args: any[]) => any;
167
- "cell-click": (...args: any[]) => any;
168
- "cell-dblclick": (...args: any[]) => any;
169
- "row-click": (...args: any[]) => any;
170
- "row-contextmenu": (...args: any[]) => any;
171
- "row-dblclick": (...args: any[]) => any;
172
- "header-click": (...args: any[]) => any;
173
- "header-contextmenu": (...args: any[]) => any;
174
- "sort-change": (...args: any[]) => any;
175
- "filter-change": (...args: any[]) => any;
176
- "header-dragend": (...args: any[]) => any;
177
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
158
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
178
159
  api: {
179
160
  type: import("vue").PropType<(...args: any[]) => Promise<any>>;
180
161
  };
@@ -197,7 +178,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
197
178
  type: import("vue").PropType<(expose: TableExpose) => void>;
198
179
  };
199
180
  formProps: {
200
- type: import("vue").PropType<import("./table-query/table-query").TableQueryProps>;
181
+ type: import("vue").PropType<import(".").TableQueryProps>;
201
182
  };
202
183
  beforeFetch: {
203
184
  type: import("vue").PropType<(params: Record<string, any>) => any>;
@@ -296,26 +277,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
296
277
  default: boolean;
297
278
  };
298
279
  preserveExpandedContent: BooleanConstructor;
299
- }>> & Readonly<{
300
- "onSelect-all"?: ((...args: any[]) => any) | undefined;
301
- onSelect?: ((...args: any[]) => any) | undefined;
302
- "onCurrent-change"?: ((...args: any[]) => any) | undefined;
303
- "onExpand-change"?: ((...args: any[]) => any) | undefined;
304
- "onSelection-change"?: ((...args: any[]) => any) | undefined;
305
- "onCell-mouse-enter"?: ((...args: any[]) => any) | undefined;
306
- "onCell-mouse-leave"?: ((...args: any[]) => any) | undefined;
307
- "onCell-contextmenu"?: ((...args: any[]) => any) | undefined;
308
- "onCell-click"?: ((...args: any[]) => any) | undefined;
309
- "onCell-dblclick"?: ((...args: any[]) => any) | undefined;
310
- "onRow-click"?: ((...args: any[]) => any) | undefined;
311
- "onRow-contextmenu"?: ((...args: any[]) => any) | undefined;
312
- "onRow-dblclick"?: ((...args: any[]) => any) | undefined;
313
- "onHeader-click"?: ((...args: any[]) => any) | undefined;
314
- "onHeader-contextmenu"?: ((...args: any[]) => any) | undefined;
315
- "onSort-change"?: ((...args: any[]) => any) | undefined;
316
- "onFilter-change"?: ((...args: any[]) => any) | undefined;
317
- "onHeader-dragend"?: ((...args: any[]) => any) | undefined;
318
- }>, {
280
+ }>> & Readonly<{}>, {
319
281
  tableLayout: "auto" | "fixed";
320
282
  border: boolean;
321
283
  columns: TableColumnProps[];
@@ -2,7 +2,7 @@ import { defineComponent, useSlots, unref, computed, ref, useTemplateRef, mergeP
2
2
  import { merge, cloneDeep, get } from 'lodash-es';
3
3
  import { reactiveComputed, reactiveOmit } from '@vueuse/core';
4
4
  import { useZIndex, ElButton } from 'element-plus';
5
- import { tableProps, defaultTableConfig, elSlotsName, omittedTableProps, tableExposeKeys } from './table.js';
5
+ import { tableEmitEvents, tableProps, tableEmitOnEvents, defaultTableConfig, elSlotsName, omittedTableProps, tableExposeKeys } from './table.js';
6
6
  import stdin_default$6 from './table-column/table-column.vue.js';
7
7
  import stdin_default$5 from './table-column-editor/table-column-editor.vue.js';
8
8
  import stdin_default$2 from './table-query/table-query.vue.js';
@@ -37,11 +37,20 @@ var stdin_default = /* @__PURE__ */defineComponent({
37
37
  },
38
38
  __name: "table",
39
39
  props: tableProps,
40
+ emits: tableEmitEvents,
40
41
  setup(__props, {
41
- expose: __expose
42
+ expose: __expose,
43
+ emit: __emit
42
44
  }) {
43
45
  const props = __props;
44
46
  const slots = useSlots();
47
+ const emit = __emit;
48
+ const eventObject = tableEmitOnEvents.reduce((obj, [name, onName]) => {
49
+ obj[onName] = (...args) => {
50
+ emit(name, ...args);
51
+ };
52
+ return obj;
53
+ }, {});
45
54
  const {
46
55
  t
47
56
  } = useLocale();
@@ -81,7 +90,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
81
90
  const elTableProps = computed(() => {
82
91
  return mergeProps(reactiveOmit(props, omittedTableProps), {
83
92
  onSortChange
84
- });
93
+ }, eventObject);
85
94
  });
86
95
  const containerStyle = computed(() => {
87
96
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.2.18",
3
+ "version": "0.2.20",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",