cosey 0.4.51 → 0.4.53
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-group/form-group.d.ts +4 -2
- package/components/form-group/form-group.vue.d.ts +1 -0
- package/components/form-group/form-group.vue.js +51 -53
- package/components/form-group/index.d.ts +3 -0
- package/components/form-group/style/index.d.ts +4 -0
- package/components/form-group/style/index.js +43 -0
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export interface FormGroupProps extends Partial<SpaceProps
|
|
1
|
+
import { type SpaceProps } from 'element-plus';
|
|
2
|
+
export interface FormGroupProps extends Partial<Omit<SpaceProps, 'class' | 'style'>> {
|
|
3
3
|
title?: string;
|
|
4
|
+
borderStyle?: 'none' | 'solid' | 'dashed' | 'dotted';
|
|
5
|
+
position?: 'left' | 'right' | 'center';
|
|
4
6
|
collapsible?: boolean;
|
|
5
7
|
collapsed?: boolean;
|
|
6
8
|
}
|
|
@@ -5,6 +5,7 @@ declare const __VLS_component: import("vue").DefineComponent<FormGroupProps, {},
|
|
|
5
5
|
}, string, import("vue").PublicProps, Readonly<FormGroupProps> & Readonly<{
|
|
6
6
|
"onUpdate:collapsed"?: ((collapsed: boolean) => any) | undefined;
|
|
7
7
|
}>, {
|
|
8
|
+
position: "left" | "right" | "center";
|
|
8
9
|
readonly size: number | "" | "default" | "large" | "small" | [number, number];
|
|
9
10
|
readonly wrap: boolean;
|
|
10
11
|
readonly alignment: string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
import {
|
|
3
|
-
import stdin_default$
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent, ref, computed, watch, resolveComponent, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createCommentVNode, withDirectives, createElementVNode, createBlock, createTextVNode, toDisplayString, createVNode, mergeProps, withCtx, renderSlot, vShow } from 'vue';
|
|
2
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
3
|
+
import stdin_default$2 from '../icon/icon.vue.js';
|
|
4
|
+
import stdin_default$1 from './style/index.js';
|
|
5
|
+
import { useComponentConfig } from '../config-provider/config-provider.js';
|
|
5
6
|
|
|
6
7
|
var stdin_default = /* @__PURE__ */defineComponent({
|
|
7
8
|
...{
|
|
@@ -13,6 +14,15 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
13
14
|
type: String,
|
|
14
15
|
required: false
|
|
15
16
|
},
|
|
17
|
+
borderStyle: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
position: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: false,
|
|
24
|
+
default: "left"
|
|
25
|
+
},
|
|
16
26
|
collapsible: {
|
|
17
27
|
type: Boolean,
|
|
18
28
|
required: false
|
|
@@ -25,14 +35,6 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
25
35
|
type: String,
|
|
26
36
|
required: false
|
|
27
37
|
},
|
|
28
|
-
class: {
|
|
29
|
-
type: null,
|
|
30
|
-
required: false
|
|
31
|
-
},
|
|
32
|
-
style: {
|
|
33
|
-
type: null,
|
|
34
|
-
required: false
|
|
35
|
-
},
|
|
36
38
|
alignment: {
|
|
37
39
|
type: null,
|
|
38
40
|
required: false,
|
|
@@ -63,14 +65,6 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
63
65
|
type: null,
|
|
64
66
|
required: false,
|
|
65
67
|
default: () => [32, 0]
|
|
66
|
-
},
|
|
67
|
-
contentPosition: {
|
|
68
|
-
type: String,
|
|
69
|
-
required: false
|
|
70
|
-
},
|
|
71
|
-
borderStyle: {
|
|
72
|
-
type: null,
|
|
73
|
-
required: false
|
|
74
68
|
}
|
|
75
69
|
},
|
|
76
70
|
emits: ["update:collapsed"],
|
|
@@ -78,16 +72,17 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
78
72
|
emit: __emit
|
|
79
73
|
}) {
|
|
80
74
|
const props = __props;
|
|
75
|
+
console.log(props);
|
|
81
76
|
const emit = __emit;
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const spaceProps = reactiveOmit(props, dividerPropsKeys, ["title", "collapsible", "collapsed"]);
|
|
77
|
+
const {
|
|
78
|
+
prefixCls
|
|
79
|
+
} = useComponentConfig("form-group", props);
|
|
80
|
+
const {
|
|
81
|
+
hashId
|
|
82
|
+
} = stdin_default$1(prefixCls);
|
|
83
|
+
const spaceProps = reactiveOmit(props, ["title", "borderStyle", "position", "collapsible", "collapsed"]);
|
|
90
84
|
const innerCollapsed = ref(false);
|
|
85
|
+
const isBordered = computed(() => !!props.title);
|
|
91
86
|
watch(() => props.collapsed, () => {
|
|
92
87
|
innerCollapsed.value = !!props.collapsed;
|
|
93
88
|
}, {
|
|
@@ -100,31 +95,33 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
100
95
|
}
|
|
101
96
|
};
|
|
102
97
|
return (_ctx, _cache) => {
|
|
103
|
-
const _component_el_divider = resolveComponent("el-divider");
|
|
104
98
|
const _component_el_space = resolveComponent("el-space");
|
|
105
|
-
return openBlock(), createElementBlock("div",
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
99
|
+
return openBlock(), createElementBlock("div", {
|
|
100
|
+
class: normalizeClass([unref(hashId), unref(prefixCls), {
|
|
101
|
+
"is-bordered": isBordered.value,
|
|
102
|
+
"is-collapsed": innerCollapsed.value
|
|
103
|
+
}]),
|
|
104
|
+
style: normalizeStyle({
|
|
105
|
+
borderStyle: isBordered.value ? props.borderStyle : void 0
|
|
106
|
+
})
|
|
107
|
+
}, [_ctx.title ? (openBlock(), createElementBlock("div", {
|
|
108
|
+
key: 0,
|
|
109
|
+
class: normalizeClass([`${unref(prefixCls)}-title`, `is-${_ctx.position}`])
|
|
110
|
+
}, [createElementVNode("div", {
|
|
111
|
+
style: normalizeStyle({
|
|
112
|
+
display: "inline-flex",
|
|
113
|
+
alignItems: "center",
|
|
114
|
+
cursor: _ctx.collapsible ? "pointer" : ""
|
|
115
|
+
}),
|
|
116
|
+
onClick: handleToggle
|
|
117
|
+
}, [_ctx.collapsible ? (openBlock(), createBlock(stdin_default$2, {
|
|
118
|
+
key: 0,
|
|
119
|
+
name: innerCollapsed.value ? "co:caret-up" : "co:caret-down",
|
|
120
|
+
size: "xl"
|
|
121
|
+
}, null, 8, ["name"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(_ctx.title), 1
|
|
122
|
+
/* TEXT */)], 4
|
|
123
|
+
/* STYLE */)], 2
|
|
124
|
+
/* CLASS */)) : createCommentVNode("v-if", true), withDirectives(createVNode(_component_el_space, mergeProps(unref(spaceProps), {
|
|
128
125
|
style: {
|
|
129
126
|
display: "flex",
|
|
130
127
|
minWidth: 0
|
|
@@ -134,7 +131,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
|
|
|
134
131
|
_: 3
|
|
135
132
|
/* FORWARDED */
|
|
136
133
|
}, 16
|
|
137
|
-
/* FULL_PROPS */), [[vShow, !innerCollapsed.value]])]
|
|
134
|
+
/* FULL_PROPS */), [[vShow, !innerCollapsed.value]])], 6
|
|
135
|
+
/* CLASS, STYLE */);
|
|
138
136
|
};
|
|
139
137
|
}
|
|
140
138
|
});
|
|
@@ -5,6 +5,7 @@ declare const _FormGroup: {
|
|
|
5
5
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
6
6
|
"update:collapsed": (collapsed: boolean) => any;
|
|
7
7
|
}, import("vue").PublicProps, {
|
|
8
|
+
position: "left" | "right" | "center";
|
|
8
9
|
readonly size: number | "" | "default" | "large" | "small" | [number, number];
|
|
9
10
|
readonly wrap: boolean;
|
|
10
11
|
readonly alignment: string;
|
|
@@ -18,6 +19,7 @@ declare const _FormGroup: {
|
|
|
18
19
|
}, Readonly<import("./form-group").FormGroupProps> & Readonly<{
|
|
19
20
|
"onUpdate:collapsed"?: ((collapsed: boolean) => any) | undefined;
|
|
20
21
|
}>, {}, {}, {}, {}, {
|
|
22
|
+
position: "left" | "right" | "center";
|
|
21
23
|
readonly size: number | "" | "default" | "large" | "small" | [number, number];
|
|
22
24
|
readonly wrap: boolean;
|
|
23
25
|
readonly alignment: string;
|
|
@@ -30,6 +32,7 @@ declare const _FormGroup: {
|
|
|
30
32
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
31
33
|
"update:collapsed": (collapsed: boolean) => any;
|
|
32
34
|
}, string, {
|
|
35
|
+
position: "left" | "right" | "center";
|
|
33
36
|
readonly size: number | "" | "default" | "large" | "small" | [number, number];
|
|
34
37
|
readonly wrap: boolean;
|
|
35
38
|
readonly alignment: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { getSimpleStyleHook } from '../../theme/getSimpleStyleHook.js';
|
|
2
|
+
|
|
3
|
+
var stdin_default = getSimpleStyleHook("FromGroup", (token) => {
|
|
4
|
+
const { componentCls } = token;
|
|
5
|
+
return {
|
|
6
|
+
[componentCls]: {
|
|
7
|
+
"&.is-bordered": {
|
|
8
|
+
position: "relative",
|
|
9
|
+
marginBlock: token.marginLG,
|
|
10
|
+
padding: token.paddingMD,
|
|
11
|
+
paddingBlockStart: token.paddingLG,
|
|
12
|
+
border: `${token.lineWidth} ${token.lineType} ${token.colorBorder}`,
|
|
13
|
+
borderRadius: token.borderRadius,
|
|
14
|
+
"&.is-collapsed": {
|
|
15
|
+
paddingBlockEnd: 0
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
[`${componentCls}-title`]: {
|
|
19
|
+
position: "absolute",
|
|
20
|
+
top: 0,
|
|
21
|
+
paddingInline: token.paddingMD,
|
|
22
|
+
fontSize: token.fontSize,
|
|
23
|
+
fontWeight: token.fontWeightStrong,
|
|
24
|
+
color: token.colorTextBase,
|
|
25
|
+
backgroundColor: token.colorBgContainer,
|
|
26
|
+
"&.is-left": {
|
|
27
|
+
left: token.sizeMD,
|
|
28
|
+
transform: "translateY(-50%)"
|
|
29
|
+
},
|
|
30
|
+
"&.is-center": {
|
|
31
|
+
left: "50%",
|
|
32
|
+
transform: "translate(-50%) translateY(-50%)"
|
|
33
|
+
},
|
|
34
|
+
"&.is-right": {
|
|
35
|
+
right: token.sizeMD,
|
|
36
|
+
transform: "translateY(-50%)"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export { stdin_default as default };
|