cosey 0.10.23 → 0.10.24

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.
@@ -107,7 +107,7 @@ export { defaultTableConfig, elSlotsName, omittedTableProps, tableEmitEvents, ta
107
107
  export { tableColumnProps } from './table/table-column/table-column.api.js';
108
108
  export { createScheme, omittedTableQueryProps, tableQueryEmits, tableQueryExposeKeys, tableQueryProps, tableQuerySlots } from './table/table-query/table-query.api.js';
109
109
  export { useTable } from './table/useTable.js';
110
- export { tableActionProps } from './table-action/table-action.api.js';
110
+ export { defaultTableActionProps, tableActionProps } from './table-action/table-action.api.js';
111
111
  export { StyleCache, StyleProvider } from './theme/StyleContext.js';
112
112
  export { default as compactAlgorithm } from './theme/themes/compact/index.js';
113
113
  export { default as darkAlgorithm } from './theme/themes/dark/index.js';
@@ -5,8 +5,13 @@ declare const _TableAction: {
5
5
  type: import("vue").PropType<(boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[][]>;
6
6
  default: () => never[];
7
7
  };
8
+ divider: {
9
+ type: BooleanConstructor;
10
+ default: undefined;
11
+ };
8
12
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
9
13
  actions: (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[][];
14
+ divider: boolean;
10
15
  }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
11
16
  P: {};
12
17
  B: {};
@@ -19,8 +24,13 @@ declare const _TableAction: {
19
24
  type: import("vue").PropType<(boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[][]>;
20
25
  default: () => never[];
21
26
  };
27
+ divider: {
28
+ type: BooleanConstructor;
29
+ default: undefined;
30
+ };
22
31
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
23
32
  actions: (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[][];
33
+ divider: boolean;
24
34
  }>;
25
35
  __isFragment?: never;
26
36
  __isTeleport?: never;
@@ -30,8 +40,13 @@ declare const _TableAction: {
30
40
  type: import("vue").PropType<(boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[][]>;
31
41
  default: () => never[];
32
42
  };
43
+ divider: {
44
+ type: BooleanConstructor;
45
+ default: undefined;
46
+ };
33
47
  }>> & Readonly<{}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
34
48
  actions: (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | (boolean | import("./item.api").TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[][];
49
+ divider: boolean;
35
50
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
36
51
  export { _TableAction as TableAction };
37
52
  export default _TableAction;
@@ -1,6 +1,6 @@
1
1
  import { withInstall } from '../utils.js';
2
2
  import stdin_default$1 from './table-action.js';
3
- export { tableActionProps } from './table-action.api.js';
3
+ export { defaultTableActionProps, tableActionProps } from './table-action.api.js';
4
4
 
5
5
  const _TableAction = withInstall(stdin_default$1);
6
6
  var stdin_default = _TableAction;
@@ -1,5 +1,12 @@
1
- import { type ButtonProps, popconfirmProps } from 'element-plus';
2
- import { type PropType, type ExtractPropTypes } from 'vue';
1
+ import { type ButtonProps, dropdownItemProps, popconfirmProps } from 'element-plus';
2
+ import { type PropType, type ExtractPropTypes, type VNodeChild, ExtractPublicPropTypes } from 'vue';
3
+ export type TableActionDropdownItem = Omit<ExtractPublicPropTypes<typeof dropdownItemProps>, 'icon'> & {
4
+ visible?: boolean;
5
+ label?: VNodeChild;
6
+ icon?: string;
7
+ appendIcon?: string;
8
+ onClick?: (event: MouseEvent) => void;
9
+ };
3
10
  export interface TableActionItemProps extends Partial<ButtonProps> {
4
11
  label?: string;
5
12
  popconfirm?: Partial<ExtractPropTypes<typeof popconfirmProps>> & {
@@ -10,6 +17,8 @@ export interface TableActionItemProps extends Partial<ButtonProps> {
10
17
  hidden?: boolean;
11
18
  visible?: boolean;
12
19
  icon?: string;
20
+ appendIcon?: string;
21
+ dropdown?: TableActionDropdownItem[];
13
22
  }
14
23
  export declare const defaultTableActionItemProps: TableActionItemProps;
15
24
  export declare const tableActionItemProps: {
@@ -1,8 +1,6 @@
1
1
  const defaultTableActionItemProps = {
2
2
  link: true,
3
- type: "primary",
4
- hidden: false,
5
- visible: true
3
+ type: "primary"
6
4
  };
7
5
  const tableActionItemProps = {
8
6
  props: {
@@ -3,7 +3,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
3
3
  props: {
4
4
  type: import("vue").PropType<TableActionItemProps>;
5
5
  };
6
- }>, () => import("vue/jsx-runtime").JSX.Element | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
6
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
7
7
  props: {
8
8
  type: import("vue").PropType<TableActionItemProps>;
9
9
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, unref, ref, createVNode, Fragment, mergeProps, isVNode } from 'vue';
2
2
  import { omit } from 'lodash-es';
3
- import { ElPopconfirm, ElButton } from 'element-plus';
3
+ import { ElPopconfirm, ElButton, ElDropdown, ElDropdownMenu, ElDropdownItem } from 'element-plus';
4
4
  import { tableActionItemProps, defaultTableActionItemProps } from './item.api.js';
5
5
  import stdin_default$1 from '../icon/icon.js';
6
6
  import { useToken } from '../theme/util/useToken.js';
@@ -32,12 +32,9 @@ var stdin_default = defineComponent({
32
32
  };
33
33
  });
34
34
  const buttonProps = computed(() => {
35
- return omit(unref(mergedProps), ["icon", "visible", "hidden", "popconfirm", "label"]);
35
+ return omit(unref(mergedProps), ["icon", "appendIcon", "visible", "hidden", "popconfirm", "label", "dropdown"]);
36
36
  });
37
37
  const loading = ref(false);
38
- const mergedVisible = computed(() => {
39
- return unref(mergedProps).hidden ? false : unref(mergedProps).visible;
40
- });
41
38
  const onConfirm = async (e, confirm) => {
42
39
  loading.value = true;
43
40
  try {
@@ -50,20 +47,27 @@ var stdin_default = defineComponent({
50
47
  const onCancel = (e, cancel) => {
51
48
  cancel(e);
52
49
  };
50
+ const renderButton = () => {
51
+ return createVNode(ElButton, mergeProps(buttonProps.value, {
52
+ "style": "margin: 0"
53
+ }), {
54
+ default: () => [unref(mergedProps).icon && createVNode(stdin_default$1, {
55
+ "name": unref(mergedProps).icon,
56
+ "style": {
57
+ marginInlineEnd: token.value.marginXXS + "px"
58
+ }
59
+ }, null), unref(mergedProps).label, unref(mergedProps).appendIcon && createVNode(stdin_default$1, {
60
+ "name": unref(mergedProps).appendIcon,
61
+ "style": {
62
+ marginInlineStart: token.value.marginXXS + "px"
63
+ }
64
+ }, null)]
65
+ });
66
+ };
53
67
  return () => {
54
- if (!mergedVisible.value) return;
55
68
  if (unref(mergedProps).popconfirm) {
56
69
  return createVNode(ElPopconfirm, unref(mergedProps).popconfirm, {
57
- reference: () => createVNode(ElButton, mergeProps(buttonProps.value, {
58
- "style": "margin: 0"
59
- }), {
60
- default: () => [unref(mergedProps).icon && createVNode(stdin_default$1, {
61
- "name": unref(mergedProps).icon,
62
- "style": {
63
- marginInlineEnd: token.value.marginXXS + "px"
64
- }
65
- }, null), unref(mergedProps).label]
66
- }),
70
+ reference: () => renderButton(),
67
71
  actions: ({
68
72
  confirm,
69
73
  cancel
@@ -85,16 +89,39 @@ var stdin_default = defineComponent({
85
89
  }
86
90
  });
87
91
  }
88
- return createVNode(ElButton, mergeProps(buttonProps.value, {
89
- "style": "margin: 0"
90
- }), {
91
- default: () => [unref(mergedProps).icon && createVNode(stdin_default$1, {
92
- "name": unref(mergedProps).icon,
93
- "style": {
94
- marginInlineEnd: token.value.marginXXS + "px"
95
- }
96
- }, null), unref(mergedProps).label]
97
- });
92
+ if (unref(mergedProps).dropdown && unref(mergedProps).dropdown.length > 0) {
93
+ return createVNode(ElDropdown, {
94
+ "trigger": "click"
95
+ }, {
96
+ default: () => renderButton(),
97
+ dropdown: () => createVNode(ElDropdownMenu, null, {
98
+ default: () => [unref(mergedProps).dropdown?.filter(item => item.visible ?? true).map(({
99
+ label,
100
+ icon,
101
+ appendIcon,
102
+ onClick,
103
+ ...rest
104
+ }) => {
105
+ return createVNode(ElDropdownItem, mergeProps(omit(rest, ["visible", "onClick"]), {
106
+ "onClick": onClick
107
+ }), {
108
+ default: () => [icon && createVNode(stdin_default$1, {
109
+ "name": icon,
110
+ "style": {
111
+ marginInlineEnd: token.value.marginXXS + "px"
112
+ }
113
+ }, null), label, appendIcon && createVNode(stdin_default$1, {
114
+ "name": appendIcon,
115
+ "style": {
116
+ marginInlineStart: token.value.marginXXS + "px"
117
+ }
118
+ }, null)]
119
+ });
120
+ })]
121
+ })
122
+ });
123
+ }
124
+ return renderButton();
98
125
  };
99
126
  }
100
127
  });
@@ -1,4 +1,4 @@
1
- import { type ExtractPropTypes, type PropType } from 'vue';
1
+ import { type ExtractPublicPropTypes, type PropType } from 'vue';
2
2
  import { type TableActionItemProps } from './item.api';
3
3
  type TableActionItemAtom = TableActionItemProps | null | undefined | boolean | TableActionItemAtom[];
4
4
  export declare const tableActionProps: {
@@ -6,9 +6,15 @@ export declare const tableActionProps: {
6
6
  type: PropType<TableActionItemAtom[] | TableActionItemAtom[][]>;
7
7
  default: () => never[];
8
8
  };
9
+ divider: {
10
+ type: BooleanConstructor;
11
+ default: undefined;
12
+ };
9
13
  };
10
- export type TableActionProps = ExtractPropTypes<typeof tableActionProps>;
14
+ export type TableActionProps = ExtractPublicPropTypes<typeof tableActionProps>;
11
15
  export interface TableActionConfig {
12
16
  itemProps?: TableActionItemProps;
17
+ divider?: boolean;
13
18
  }
19
+ export declare const defaultTableActionProps: TableActionProps;
14
20
  export {};
@@ -2,7 +2,14 @@ const tableActionProps = {
2
2
  actions: {
3
3
  type: Array,
4
4
  default: () => []
5
+ },
6
+ divider: {
7
+ type: Boolean,
8
+ default: void 0
5
9
  }
6
10
  };
11
+ const defaultTableActionProps = {
12
+ divider: true
13
+ };
7
14
 
8
- export { tableActionProps };
15
+ export { defaultTableActionProps, tableActionProps };
@@ -4,12 +4,21 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
4
4
  type: import("vue").PropType<(boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[][]>;
5
5
  default: () => never[];
6
6
  };
7
+ divider: {
8
+ type: BooleanConstructor;
9
+ default: undefined;
10
+ };
7
11
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
8
12
  actions: {
9
13
  type: import("vue").PropType<(boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[][]>;
10
14
  default: () => never[];
11
15
  };
16
+ divider: {
17
+ type: BooleanConstructor;
18
+ default: undefined;
19
+ };
12
20
  }>> & Readonly<{}>, {
13
21
  actions: (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | (boolean | TableActionItemProps | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[][];
22
+ divider: boolean;
14
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
15
24
  export default _default;
@@ -1,8 +1,10 @@
1
- import { defineComponent, computed, createVNode } from 'vue';
2
- import { tableActionProps } from './table-action.api.js';
1
+ import { defineComponent, computed, unref, createVNode, Fragment } from 'vue';
2
+ import { tableActionProps, defaultTableActionProps } from './table-action.api.js';
3
3
  import stdin_default$2 from './item.js';
4
4
  import stdin_default$1 from './table-action.style.js';
5
- import { useComponentConfig } from '../config-provider/config-provider.api.js';
5
+ import { ElDivider } from 'element-plus';
6
+ import { defaults } from 'lodash-es';
7
+ import { useComponentConfig, useConfig } from '../config-provider/config-provider.api.js';
6
8
  import { isObject } from '../../utils/is.js';
7
9
 
8
10
  var stdin_default = defineComponent({
@@ -19,18 +21,28 @@ var stdin_default = defineComponent({
19
21
  const {
20
22
  hashId
21
23
  } = stdin_default$1(prefixCls);
24
+ const {
25
+ tableAction: tableActionConfig
26
+ } = useConfig();
27
+ const mergeProps = computed(() => {
28
+ return defaults({}, props, unref(tableActionConfig), defaultTableActionProps);
29
+ });
22
30
  return () => {
23
31
  return createVNode("div", {
24
32
  "class": [hashId.value, prefixCls.value]
25
33
  }, [dyadicActions.value.map((actions, rowIndex) => {
26
34
  return createVNode("div", {
27
35
  "key": rowIndex,
28
- "class": `${prefixCls.value}-row`
29
- }, [actions.filter(isObject).map((action, actionIndex) => {
30
- return createVNode(stdin_default$2, {
36
+ "class": [`${prefixCls.value}-row`, {
37
+ "is-divider": mergeProps.value.divider
38
+ }]
39
+ }, [actions.filter(item => isObject(item) && (item.hidden ? false : item.visible ?? true)).map((action, actionIndex, arr) => {
40
+ return createVNode(Fragment, null, [createVNode(stdin_default$2, {
31
41
  "key": actionIndex,
32
42
  "props": action
33
- }, null);
43
+ }, null), mergeProps.value.divider && actionIndex !== arr.length - 1 && createVNode(ElDivider, {
44
+ "direction": "vertical"
45
+ }, null)]);
34
46
  })]);
35
47
  })]);
36
48
  };
@@ -10,8 +10,12 @@ var stdin_default = getSimpleStyleHook("CoTableAction", (token) => {
10
10
  [`${componentCls}-row`]: {
11
11
  display: "flex",
12
12
  flexWrap: "wrap",
13
- columnGap: token.sizeXXS,
14
- rowGap: token.sizeXXS
13
+ alignItems: "center",
14
+ columnGap: token.sizeXS,
15
+ rowGap: token.sizeXXS,
16
+ "&.is-divider": {
17
+ columnGap: 0
18
+ }
15
19
  }
16
20
  }
17
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.10.23",
3
+ "version": "0.10.24",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",