cosey 0.10.22 → 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.
- package/components/form-list/form-list.vue.js +2 -2
- package/components/index.js +1 -1
- package/components/remote-select/remote-select.js +2 -2
- package/components/table/table-column-editor/list.vue.js +2 -2
- package/components/table/table.vue.js +3 -3
- package/components/table-action/index.d.ts +15 -0
- package/components/table-action/index.js +1 -1
- package/components/table-action/item.api.d.ts +11 -2
- package/components/table-action/item.api.js +1 -3
- package/components/table-action/item.d.ts +1 -1
- package/components/table-action/item.js +53 -26
- package/components/table-action/table-action.api.d.ts +8 -2
- package/components/table-action/table-action.api.js +8 -1
- package/components/table-action/table-action.d.ts +9 -0
- package/components/table-action/table-action.js +19 -7
- package/components/table-action/table-action.style.js +6 -2
- package/components/upload/upload.js +3 -3
- package/hooks/useUpsert.js +2 -2
- package/package.json +1 -1
- package/router/utils.js +2 -2
- package/utils/index.js +1 -1
- package/utils/string.d.ts +1 -8
- package/utils/string.js +4 -6
|
@@ -14,7 +14,7 @@ import { arrayMove } from '../../utils/array.js';
|
|
|
14
14
|
import { getFormItemWidth } from '../form/useFormItemWidth.js';
|
|
15
15
|
import { useLocale } from '../../hooks/useLocale.js';
|
|
16
16
|
import { useComponentConfig } from '../config-provider/config-provider.api.js';
|
|
17
|
-
import {
|
|
17
|
+
import { auid } from '../../utils/string.js';
|
|
18
18
|
import { createMergedExpose, defineTemplate } from '../../utils/vue.js';
|
|
19
19
|
import { isString, isNumber } from '../../utils/is.js';
|
|
20
20
|
|
|
@@ -187,7 +187,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
187
187
|
props.modelValue.forEach(row => {
|
|
188
188
|
let key = mapRowKey.get(row);
|
|
189
189
|
if (!key) {
|
|
190
|
-
key =
|
|
190
|
+
key = auid();
|
|
191
191
|
}
|
|
192
192
|
newMapRowKey.set(row, key);
|
|
193
193
|
});
|
package/components/index.js
CHANGED
|
@@ -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';
|
|
@@ -9,10 +9,10 @@ import stdin_default$2 from '../table/table-query/table-query.js';
|
|
|
9
9
|
import { useComponentConfig, useConfig } from '../config-provider/config-provider.api.js';
|
|
10
10
|
import { useFetch } from '../../hooks/useFetch.js';
|
|
11
11
|
import { createLoading, filterEmptyFormValue } from '../../utils/components.js';
|
|
12
|
-
import { uniqid } from '../../utils/string.js';
|
|
13
12
|
import { bulkBindEvents } from '../../utils/vue.js';
|
|
14
13
|
import { isObject, isFunction } from '../../utils/is.js';
|
|
15
14
|
import { useProps } from '../../hooks/useProps.js';
|
|
15
|
+
import { auid } from '../../utils/string.js';
|
|
16
16
|
|
|
17
17
|
var stdin_default = defineComponent({
|
|
18
18
|
name: "CoRemoteSelect",
|
|
@@ -128,7 +128,7 @@ var stdin_default = defineComponent({
|
|
|
128
128
|
getValue,
|
|
129
129
|
getKey
|
|
130
130
|
} = useProps(props);
|
|
131
|
-
const popperId =
|
|
131
|
+
const popperId = auid();
|
|
132
132
|
const events = bulkBindEvents(remoteSelectEmits, emit);
|
|
133
133
|
const selectProps = computed(() => {
|
|
134
134
|
return omit(props, ["optionProps", "api", "pagination", "formProps", "transformParams", "keys", "immediate"]);
|
|
@@ -4,7 +4,7 @@ import { TransitionGroup as _TransitionGroup } from '../../transition-group/inde
|
|
|
4
4
|
import stdin_default$1 from './item.vue.js';
|
|
5
5
|
import { useDndSort } from '../../dnd-sort/useDndSort.js';
|
|
6
6
|
import { useComponentConfig } from '../../config-provider/config-provider.api.js';
|
|
7
|
-
import {
|
|
7
|
+
import { auid } from '../../../utils/string.js';
|
|
8
8
|
import { arrayMove } from '../../../utils/array.js';
|
|
9
9
|
|
|
10
10
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
@@ -33,7 +33,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
33
33
|
props.nodeList.forEach(node => {
|
|
34
34
|
let key = mapTargetKey.get(node);
|
|
35
35
|
if (!key) {
|
|
36
|
-
key =
|
|
36
|
+
key = auid();
|
|
37
37
|
}
|
|
38
38
|
newMapTargetKey.set(node, key);
|
|
39
39
|
});
|
|
@@ -16,7 +16,7 @@ import stdin_default$3 from './table-stats/table-stats.js';
|
|
|
16
16
|
import { flatColumns } from '../../utils/excel/index.js';
|
|
17
17
|
import { useFullPage } from '../../hooks/useFullPage.js';
|
|
18
18
|
import { useLocale } from '../../hooks/useLocale.js';
|
|
19
|
-
import {
|
|
19
|
+
import { auid } from '../../utils/string.js';
|
|
20
20
|
import { useComponentConfig, useConfig } from '../config-provider/config-provider.api.js';
|
|
21
21
|
import { addPxUnit } from '../../utils/css.js';
|
|
22
22
|
import { isNullish, isObject, isFunction } from '../../utils/is.js';
|
|
@@ -61,7 +61,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
61
61
|
const {
|
|
62
62
|
t
|
|
63
63
|
} = useLocale();
|
|
64
|
-
const tableId =
|
|
64
|
+
const tableId = auid();
|
|
65
65
|
const {
|
|
66
66
|
prefixCls
|
|
67
67
|
} = useComponentConfig("table");
|
|
@@ -550,7 +550,7 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
550
550
|
"show-summary": false,
|
|
551
551
|
"summary-method": void 0,
|
|
552
552
|
style: {
|
|
553
|
-
|
|
553
|
+
width: "100%"
|
|
554
554
|
},
|
|
555
555
|
height: "100%",
|
|
556
556
|
"max-height": "none"
|
|
@@ -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: {
|
|
@@ -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
|
|
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: () =>
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
|
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 =
|
|
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 {
|
|
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
|
-
|
|
30
|
-
|
|
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
|
-
|
|
14
|
-
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
columnGap: token.sizeXS,
|
|
15
|
+
rowGap: token.sizeXXS,
|
|
16
|
+
"&.is-divider": {
|
|
17
|
+
columnGap: 0
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
21
|
};
|
|
@@ -10,7 +10,7 @@ import { getFileType, chooseFiles } from '../../utils/file.js';
|
|
|
10
10
|
import { useLocale } from '../../hooks/useLocale.js';
|
|
11
11
|
import { useComponentConfig } from '../config-provider/config-provider.api.js';
|
|
12
12
|
import { debugWarn } from 'element-plus/es/utils/error.mjs';
|
|
13
|
-
import {
|
|
13
|
+
import { auid } from '../../utils/string.js';
|
|
14
14
|
import { getBasename } from '../../utils/path.js';
|
|
15
15
|
import { isString } from '../../utils/is.js';
|
|
16
16
|
import { isShallowEqual } from '../../utils/array.js';
|
|
@@ -65,7 +65,7 @@ var stdin_default = defineComponent({
|
|
|
65
65
|
size: 0,
|
|
66
66
|
url: item,
|
|
67
67
|
previewUrl: item instanceof File ? URL.createObjectURL(item) : item,
|
|
68
|
-
key:
|
|
68
|
+
key: auid(),
|
|
69
69
|
percent: 0,
|
|
70
70
|
status: "unready",
|
|
71
71
|
controller: null
|
|
@@ -101,7 +101,7 @@ var stdin_default = defineComponent({
|
|
|
101
101
|
size: rawFile.size,
|
|
102
102
|
url: "",
|
|
103
103
|
previewUrl: URL.createObjectURL(rawFile),
|
|
104
|
-
key:
|
|
104
|
+
key: auid(),
|
|
105
105
|
status: "ready",
|
|
106
106
|
percent: 0,
|
|
107
107
|
controller: null
|
package/hooks/useUpsert.js
CHANGED
|
@@ -3,7 +3,7 @@ import { cloneDeep, pick } from 'lodash-es';
|
|
|
3
3
|
import { ref, computed, unref, reactive, shallowRef, useTemplateRef, readonly, nextTick } from 'vue';
|
|
4
4
|
import { toRefs } from '@vueuse/core';
|
|
5
5
|
import { useLocale } from './useLocale.js';
|
|
6
|
-
import {
|
|
6
|
+
import { auid } from '../utils/string.js';
|
|
7
7
|
import { deepAssign } from '../utils/object.js';
|
|
8
8
|
|
|
9
9
|
const mapTypeTitle = {
|
|
@@ -50,7 +50,7 @@ function useUpsert(options) {
|
|
|
50
50
|
const row = shallowRef();
|
|
51
51
|
let addParams = [];
|
|
52
52
|
let editParams = [];
|
|
53
|
-
const formRefKey =
|
|
53
|
+
const formRefKey = auid();
|
|
54
54
|
const formRef = useTemplateRef(formRefKey);
|
|
55
55
|
const onSubmit = async () => {
|
|
56
56
|
let res;
|
package/package.json
CHANGED
package/router/utils.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { auid } from '../utils/string.js';
|
|
2
2
|
|
|
3
3
|
function defineRoute(route) {
|
|
4
4
|
function recur(route2, index = 0, parent) {
|
|
5
5
|
const meta = route2.meta || {};
|
|
6
6
|
const newRoute = {
|
|
7
7
|
...route2,
|
|
8
|
-
name: route2.name ||
|
|
8
|
+
name: route2.name || auid(),
|
|
9
9
|
meta: {
|
|
10
10
|
...meta,
|
|
11
11
|
closable: meta.closable ?? true,
|
package/utils/index.js
CHANGED
|
@@ -10,7 +10,7 @@ export { isBoolean, isEmpty, isFunction, isNullish, isNumber, isObject, isPlainO
|
|
|
10
10
|
export { minmax } from './number.js';
|
|
11
11
|
export { deepAssign, initObject, omitObject, omitUndefined, uniformAssign } from './object.js';
|
|
12
12
|
export { getBasename, getExtname } from './path.js';
|
|
13
|
-
export {
|
|
13
|
+
export { auid } from './string.js';
|
|
14
14
|
export { Scope, addNullablePlaceholder, bulkBindEvents, createMergedExpose, defineTemplate, getVNodeText } from './vue.js';
|
|
15
15
|
export { note, noteOnce, resetWarned, warning, warningOnce } from './warning.js';
|
|
16
16
|
export { findCSSNode, insertCSS, removeCSS, updateCSS, updateCSSByStyle } from './dynamicCSS.js';
|
package/utils/string.d.ts
CHANGED
package/utils/string.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function uniqid(prefix = "co-") {
|
|
5
|
-
return prefix + uuid();
|
|
1
|
+
let counter = 0;
|
|
2
|
+
function auid(prefix = "__co_") {
|
|
3
|
+
return prefix + (~~(Math.random() * 1e9)).toString(36) + "-" + (++counter).toString(36);
|
|
6
4
|
}
|
|
7
5
|
|
|
8
|
-
export {
|
|
6
|
+
export { auid };
|