cosey 0.5.1 → 0.5.3
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/context-menu/context-menu-item.d.ts +1 -1
- package/components/context-menu/context-menu-item.js +1 -1
- package/components/context-menu/context-menu.js +4 -3
- package/components/context-menu/index.d.ts +3 -3
- package/components/form-list/form-list.api.d.ts +1 -1
- package/components/form-list/form-list.vue.js +98 -0
- package/components/only-child/index.d.ts +5 -15
- package/components/only-child/only-child.d.ts +1 -5
- package/components/only-child/only-child.js +0 -3
- package/components/remote-select/remote-select.js +4 -1
- package/package.json +1 -1
- package/utils/index.js +1 -1
- package/utils/vue.d.ts +8 -0
- package/utils/vue.js +9 -1
|
@@ -12,7 +12,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
12
12
|
title: {
|
|
13
13
|
type: StringConstructor;
|
|
14
14
|
};
|
|
15
|
-
}>, import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
16
|
click: (event: MouseEvent) => boolean;
|
|
17
17
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
18
|
command: {};
|
|
@@ -51,7 +51,7 @@ var stdin_default = defineComponent({
|
|
|
51
51
|
const onLeave = () => {
|
|
52
52
|
leave();
|
|
53
53
|
};
|
|
54
|
-
return createVNode(Fragment, null, [props.divided && createVNode(stdin_default$1, null, null), createVNode(stdin_default$2, mergeProps(attrs, {
|
|
54
|
+
return () => createVNode(Fragment, null, [props.divided && createVNode(stdin_default$1, null, null), createVNode(stdin_default$2, mergeProps(attrs, {
|
|
55
55
|
"icon": props.icon,
|
|
56
56
|
"with-icon": withIcon.value,
|
|
57
57
|
"title": props.title,
|
|
@@ -94,6 +94,7 @@ var stdin_default = defineComponent({
|
|
|
94
94
|
close();
|
|
95
95
|
};
|
|
96
96
|
const onContextMenu = event => {
|
|
97
|
+
console.log("onContextMenu");
|
|
97
98
|
if (props.disabled) {
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
@@ -119,13 +120,13 @@ var stdin_default = defineComponent({
|
|
|
119
120
|
return () => {
|
|
120
121
|
let _slot;
|
|
121
122
|
return createVNode(Fragment, null, [slots.reference && createVNode(_OnlyChild, {
|
|
122
|
-
|
|
123
|
+
onContextmenu: onContextMenu
|
|
123
124
|
}, _isSlot(_slot = slots.reference({})) ? _slot : {
|
|
124
125
|
default: () => [_slot]
|
|
125
126
|
}), createVNode(Transition, {
|
|
126
127
|
"name": "co-fade-out"
|
|
127
128
|
}, {
|
|
128
|
-
default: () => [visible.value
|
|
129
|
+
default: () => [visible.value ? createVNode(Teleport, {
|
|
129
130
|
"to": "body"
|
|
130
131
|
}, {
|
|
131
132
|
default: () => [createVNode("div", null, [createVNode("div", {
|
|
@@ -143,7 +144,7 @@ var stdin_default = defineComponent({
|
|
|
143
144
|
"style": menuStyle.value,
|
|
144
145
|
"onContextmenu": onMenuContextMenu
|
|
145
146
|
}, [slots.default?.({})]), [[resolveDirective("bind"), "$attrs"]])])]
|
|
146
|
-
})]
|
|
147
|
+
}) : null]
|
|
147
148
|
})]);
|
|
148
149
|
};
|
|
149
150
|
}
|
|
@@ -18,7 +18,7 @@ declare const _ContextMenuItem: {
|
|
|
18
18
|
};
|
|
19
19
|
}>> & Readonly<{
|
|
20
20
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
21
|
-
}>, import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
22
|
click: (event: MouseEvent) => boolean;
|
|
23
23
|
}, import("vue").PublicProps, {
|
|
24
24
|
disabled: boolean;
|
|
@@ -46,7 +46,7 @@ declare const _ContextMenuItem: {
|
|
|
46
46
|
};
|
|
47
47
|
}>> & Readonly<{
|
|
48
48
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
49
|
-
}>, import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
49
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, {
|
|
50
50
|
disabled: boolean;
|
|
51
51
|
divided: boolean;
|
|
52
52
|
}>;
|
|
@@ -69,7 +69,7 @@ declare const _ContextMenuItem: {
|
|
|
69
69
|
};
|
|
70
70
|
}>> & Readonly<{
|
|
71
71
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
72
|
-
}>, import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
72
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
73
73
|
click: (event: MouseEvent) => boolean;
|
|
74
74
|
}, string, {
|
|
75
75
|
disabled: boolean;
|
|
@@ -137,7 +137,7 @@ export declare const formListProps: {
|
|
|
137
137
|
__epPropKey: true;
|
|
138
138
|
};
|
|
139
139
|
};
|
|
140
|
-
export interface FormListProps<T = FormListRow> extends
|
|
140
|
+
export interface FormListProps<T = FormListRow> extends Omit<FormItemProps<'input'>, 'modelValue'> {
|
|
141
141
|
defaultValue?: T;
|
|
142
142
|
modelValue?: T[];
|
|
143
143
|
min?: number;
|
|
@@ -57,6 +57,104 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
57
57
|
draggable: {
|
|
58
58
|
type: Boolean,
|
|
59
59
|
required: false
|
|
60
|
+
},
|
|
61
|
+
fieldType: {
|
|
62
|
+
type: String,
|
|
63
|
+
required: false
|
|
64
|
+
},
|
|
65
|
+
fieldProps: {
|
|
66
|
+
type: null,
|
|
67
|
+
required: false
|
|
68
|
+
},
|
|
69
|
+
fieldSlots: {
|
|
70
|
+
type: null,
|
|
71
|
+
required: false
|
|
72
|
+
},
|
|
73
|
+
fieldRef: {
|
|
74
|
+
type: Function,
|
|
75
|
+
required: false
|
|
76
|
+
},
|
|
77
|
+
width: {
|
|
78
|
+
type: [Number, String, Object],
|
|
79
|
+
required: false
|
|
80
|
+
},
|
|
81
|
+
placeholder: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: false
|
|
84
|
+
},
|
|
85
|
+
disabled: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
required: false
|
|
88
|
+
},
|
|
89
|
+
readonly: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
required: false
|
|
92
|
+
},
|
|
93
|
+
colProps: {
|
|
94
|
+
type: void 0,
|
|
95
|
+
required: false
|
|
96
|
+
},
|
|
97
|
+
internalIndex: {
|
|
98
|
+
type: Number,
|
|
99
|
+
required: false
|
|
100
|
+
},
|
|
101
|
+
tooltip: {
|
|
102
|
+
type: [Object, String, Number, Boolean, null, Array],
|
|
103
|
+
required: false,
|
|
104
|
+
skipCheck: true
|
|
105
|
+
},
|
|
106
|
+
extra: {
|
|
107
|
+
type: [Object, String, Number, Boolean, null, Array],
|
|
108
|
+
required: false,
|
|
109
|
+
skipCheck: true
|
|
110
|
+
},
|
|
111
|
+
label: {
|
|
112
|
+
type: String,
|
|
113
|
+
required: false
|
|
114
|
+
},
|
|
115
|
+
labelWidth: {
|
|
116
|
+
type: null,
|
|
117
|
+
required: false
|
|
118
|
+
},
|
|
119
|
+
labelPosition: {
|
|
120
|
+
type: String,
|
|
121
|
+
required: false
|
|
122
|
+
},
|
|
123
|
+
prop: {
|
|
124
|
+
type: null,
|
|
125
|
+
required: false
|
|
126
|
+
},
|
|
127
|
+
required: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
required: false
|
|
130
|
+
},
|
|
131
|
+
rules: {
|
|
132
|
+
type: null,
|
|
133
|
+
required: false
|
|
134
|
+
},
|
|
135
|
+
error: {
|
|
136
|
+
type: String,
|
|
137
|
+
required: false
|
|
138
|
+
},
|
|
139
|
+
validateStatus: {
|
|
140
|
+
type: null,
|
|
141
|
+
required: false
|
|
142
|
+
},
|
|
143
|
+
for: {
|
|
144
|
+
type: String,
|
|
145
|
+
required: false
|
|
146
|
+
},
|
|
147
|
+
inlineMessage: {
|
|
148
|
+
type: null,
|
|
149
|
+
required: false
|
|
150
|
+
},
|
|
151
|
+
showMessage: {
|
|
152
|
+
type: Boolean,
|
|
153
|
+
required: false
|
|
154
|
+
},
|
|
155
|
+
size: {
|
|
156
|
+
type: null,
|
|
157
|
+
required: false
|
|
60
158
|
}
|
|
61
159
|
},
|
|
62
160
|
emits: ["update:modelValue"],
|
|
@@ -1,31 +1,21 @@
|
|
|
1
1
|
declare const _OnlyChild: {
|
|
2
|
-
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{
|
|
3
|
-
onContextmenu?: ((event: MouseEvent) => any) | undefined;
|
|
4
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
2
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<{}> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
5
3
|
[key: string]: any;
|
|
6
|
-
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
-
contextmenu: (event: MouseEvent) => MouseEvent;
|
|
8
|
-
}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
4
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
9
5
|
P: {};
|
|
10
6
|
B: {};
|
|
11
7
|
D: {};
|
|
12
8
|
C: {};
|
|
13
9
|
M: {};
|
|
14
10
|
Defaults: {};
|
|
15
|
-
}, Readonly<{}> & Readonly<{
|
|
16
|
-
onContextmenu?: ((event: MouseEvent) => any) | undefined;
|
|
17
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
11
|
+
}, Readonly<{}> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
18
12
|
[key: string]: any;
|
|
19
13
|
}> | null, {}, {}, {}, {}>;
|
|
20
14
|
__isFragment?: never;
|
|
21
15
|
__isTeleport?: never;
|
|
22
16
|
__isSuspense?: never;
|
|
23
|
-
} & import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{
|
|
24
|
-
onContextmenu?: ((event: MouseEvent) => any) | undefined;
|
|
25
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
17
|
+
} & import("vue").ComponentOptionsBase<Readonly<{}> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
26
18
|
[key: string]: any;
|
|
27
|
-
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
-
contextmenu: (event: MouseEvent) => MouseEvent;
|
|
29
|
-
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
|
|
19
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & import("vue").Plugin;
|
|
30
20
|
export { _OnlyChild as OnlyChild };
|
|
31
21
|
export default _OnlyChild;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { type VNode } from 'vue';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
3
3
|
[key: string]: any;
|
|
4
|
-
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
-
contextmenu: (event: MouseEvent) => MouseEvent;
|
|
6
|
-
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
7
|
-
onContextmenu?: ((event: MouseEvent) => any) | undefined;
|
|
8
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
9
5
|
export default _default;
|
|
@@ -10,11 +10,13 @@ import { useComponentConfig, useConfig } from '../config-provider/config-provide
|
|
|
10
10
|
import { useFetch } from '../../hooks/useFetch.js';
|
|
11
11
|
import { createLoading, filterEmptyFormValue } from '../../utils/components.js';
|
|
12
12
|
import { uniqid } from '../../utils/string.js';
|
|
13
|
+
import { bulkBindEvents } from '../../utils/vue.js';
|
|
13
14
|
import { isObject, isFunction } from '../../utils/is.js';
|
|
14
15
|
import { useProps } from '../../hooks/useProps.js';
|
|
15
16
|
|
|
16
17
|
var stdin_default = defineComponent({
|
|
17
18
|
name: "CoRemoteSelect",
|
|
19
|
+
inheritAttrs: false,
|
|
18
20
|
props: remoteSelectProps,
|
|
19
21
|
slots: remoteSelectSlots,
|
|
20
22
|
emits: remoteSelectEmits,
|
|
@@ -123,8 +125,9 @@ var stdin_default = defineComponent({
|
|
|
123
125
|
getKey
|
|
124
126
|
} = useProps(props);
|
|
125
127
|
const popperId = uniqid();
|
|
128
|
+
const events = bulkBindEvents(remoteSelectEmits, emit);
|
|
126
129
|
return () => {
|
|
127
|
-
return createVNode(ElSelect, mergeProps(attrs, props, {
|
|
130
|
+
return createVNode(ElSelect, mergeProps(attrs, props, events, {
|
|
128
131
|
"class": `${hashId.value} ${prefixCls.value}`,
|
|
129
132
|
"popper-class": `${hashId.value} ${prefixCls.value}-popper ${popperId}`,
|
|
130
133
|
"onVisible-change": onVisibleChange
|
package/package.json
CHANGED
package/utils/index.js
CHANGED
|
@@ -11,7 +11,7 @@ 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
13
|
export { uniqid, uuid } from './string.js';
|
|
14
|
-
export { Scope, addNullablePlaceholder, createMergedExpose, defineTemplate, getVNodeText } from './vue.js';
|
|
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';
|
|
17
17
|
export { sleep } from './sleep.js';
|
package/utils/vue.d.ts
CHANGED
|
@@ -25,3 +25,11 @@ export declare function addNullablePlaceholder<T = unknown>(value: T, converter?
|
|
|
25
25
|
* 获取 VNode 中的文本
|
|
26
26
|
*/
|
|
27
27
|
export declare function getVNodeText(vnode: unknown): string;
|
|
28
|
+
/**
|
|
29
|
+
* 批量绑定事件
|
|
30
|
+
*
|
|
31
|
+
* 用于高级组件中,因声明了事件使 attrs 不包含事件而未能绑定事件的场景。
|
|
32
|
+
*/
|
|
33
|
+
export declare function bulkBindEvents(emits: Record<string, any>, emit: (...args: any[]) => any): {
|
|
34
|
+
[k: string]: (...args: any[]) => any;
|
|
35
|
+
};
|
package/utils/vue.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
2
|
import { isObject, isPlainObject, isFunction } from './is.js';
|
|
3
|
+
import { upperFirst } from 'lodash-es';
|
|
3
4
|
|
|
4
5
|
function defineTemplate(callback) {
|
|
5
6
|
return {
|
|
@@ -56,5 +57,12 @@ function getVNodeText(vnode) {
|
|
|
56
57
|
}
|
|
57
58
|
return "";
|
|
58
59
|
}
|
|
60
|
+
function bulkBindEvents(emits, emit) {
|
|
61
|
+
return Object.fromEntries(
|
|
62
|
+
Object.keys(emits).map((name) => {
|
|
63
|
+
return [`on${upperFirst(name)}`, (...args) => emit(name, ...args)];
|
|
64
|
+
})
|
|
65
|
+
);
|
|
66
|
+
}
|
|
59
67
|
|
|
60
|
-
export { Scope, addNullablePlaceholder, createMergedExpose, defineTemplate, getVNodeText };
|
|
68
|
+
export { Scope, addNullablePlaceholder, bulkBindEvents, createMergedExpose, defineTemplate, getVNodeText };
|