cosey 0.4.50 → 0.4.52

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.
@@ -1,6 +1,8 @@
1
- import { type DividerProps, type SpaceProps } from 'element-plus';
2
- export interface FormGroupProps extends Partial<SpaceProps>, Partial<DividerProps> {
1
+ import { type SpaceProps } from 'element-plus';
2
+ export interface FormGroupProps extends Partial<SpaceProps> {
3
3
  title?: string;
4
+ borderStyle?: 'none' | 'solid' | 'dashed';
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, computed, ref, watch, resolveComponent, createElementBlock, openBlock, createBlock, createCommentVNode, withDirectives, normalizeProps, mergeProps, withCtx, createElementVNode, normalizeStyle, createTextVNode, toDisplayString, createVNode, unref, renderSlot, vShow } from 'vue';
2
- import { reactivePick, reactiveOmit } from '@vueuse/core';
3
- import stdin_default$1 from '../icon/icon.vue.js';
4
- import { omitUndefined } from '../../utils/object.js';
1
+ import { defineComponent, ref, watch, resolveComponent, createElementBlock, openBlock, normalizeClass, unref, createCommentVNode, withDirectives, createElementVNode, normalizeStyle, 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
@@ -63,14 +73,6 @@ var stdin_default = /* @__PURE__ */defineComponent({
63
73
  type: null,
64
74
  required: false,
65
75
  default: () => [32, 0]
66
- },
67
- contentPosition: {
68
- type: String,
69
- required: false
70
- },
71
- borderStyle: {
72
- type: null,
73
- required: false
74
76
  }
75
77
  },
76
78
  emits: ["update:collapsed"],
@@ -79,14 +81,13 @@ var stdin_default = /* @__PURE__ */defineComponent({
79
81
  }) {
80
82
  const props = __props;
81
83
  const emit = __emit;
82
- const dividerPropsKeys = ["direction", "borderStyle", "contentPosition"];
83
- const dividerProps = computed(() => {
84
- return {
85
- contentPosition: "left",
86
- ...omitUndefined(reactivePick(props, dividerPropsKeys))
87
- };
88
- });
89
- const spaceProps = reactiveOmit(props, dividerPropsKeys, ["title", "collapsible", "collapsed"]);
84
+ const {
85
+ prefixCls
86
+ } = useComponentConfig("form-group", props);
87
+ const {
88
+ hashId
89
+ } = stdin_default$1(prefixCls);
90
+ const spaceProps = reactiveOmit(props, ["title", "borderStyle", "position", "collapsible", "collapsed"]);
90
91
  const innerCollapsed = ref(false);
91
92
  watch(() => props.collapsed, () => {
92
93
  innerCollapsed.value = !!props.collapsed;
@@ -100,29 +101,30 @@ var stdin_default = /* @__PURE__ */defineComponent({
100
101
  }
101
102
  };
102
103
  return (_ctx, _cache) => {
103
- const _component_el_divider = resolveComponent("el-divider");
104
104
  const _component_el_space = resolveComponent("el-space");
105
- return openBlock(), createElementBlock("div", null, [_ctx.title ? (openBlock(), createBlock(_component_el_divider, normalizeProps(mergeProps({
106
- key: 0
107
- }, dividerProps.value)), {
108
- default: withCtx(() => [createElementVNode("div", {
109
- style: normalizeStyle({
110
- display: "inline-flex",
111
- alignItems: "center",
112
- cursor: _ctx.collapsible ? "pointer" : ""
113
- }),
114
- onClick: handleToggle
115
- }, [_ctx.collapsible ? (openBlock(), createBlock(stdin_default$1, {
116
- key: 0,
117
- name: innerCollapsed.value ? "co:caret-up" : "co:caret-down",
118
- size: "xl"
119
- }, null, 8, ["name"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(_ctx.title), 1
120
- /* TEXT */)], 4
121
- /* STYLE */)]),
122
- _: 1
123
- /* STABLE */
124
- }, 16
125
- /* FULL_PROPS */)) : createCommentVNode("v-if", true), withDirectives(createVNode(_component_el_space, mergeProps(unref(spaceProps), {
105
+ return openBlock(), createElementBlock("div", {
106
+ class: normalizeClass([unref(hashId), unref(prefixCls), {
107
+ "is-bordered": !!_ctx.title,
108
+ "is-collapsed": innerCollapsed.value
109
+ }])
110
+ }, [_ctx.title ? (openBlock(), createElementBlock("div", {
111
+ key: 0,
112
+ class: normalizeClass([`${unref(prefixCls)}-title`, `is-${_ctx.position}`])
113
+ }, [createElementVNode("div", {
114
+ style: normalizeStyle({
115
+ display: "inline-flex",
116
+ alignItems: "center",
117
+ cursor: _ctx.collapsible ? "pointer" : ""
118
+ }),
119
+ onClick: handleToggle
120
+ }, [_ctx.collapsible ? (openBlock(), createBlock(stdin_default$2, {
121
+ key: 0,
122
+ name: innerCollapsed.value ? "co:caret-up" : "co:caret-down",
123
+ size: "xl"
124
+ }, null, 8, ["name"])) : createCommentVNode("v-if", true), createTextVNode(" " + toDisplayString(_ctx.title), 1
125
+ /* TEXT */)], 4
126
+ /* STYLE */)], 2
127
+ /* CLASS */)) : createCommentVNode("v-if", true), withDirectives(createVNode(_component_el_space, mergeProps(unref(spaceProps), {
126
128
  style: {
127
129
  display: "flex",
128
130
  minWidth: 0
@@ -132,7 +134,8 @@ var stdin_default = /* @__PURE__ */defineComponent({
132
134
  _: 3
133
135
  /* FORWARDED */
134
136
  }, 16
135
- /* FULL_PROPS */), [[vShow, !innerCollapsed.value]])]);
137
+ /* FULL_PROPS */), [[vShow, !innerCollapsed.value]])], 2
138
+ /* CLASS */);
136
139
  };
137
140
  }
138
141
  });
@@ -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,4 @@
1
+ declare const _default: (_prefixCls?: import("vue").ComputedRef<string> | string, themeManager?: import("../../theme/theme-context").ThemeManager) => {
2
+ hashId: import("vue").Ref<string, string>;
3
+ };
4
+ export default _default;
@@ -0,0 +1,44 @@
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
+ marginBlockStart: token.marginSM,
10
+ paddingBlockStart: token.paddingLG,
11
+ paddingBlockEnd: token.paddingMD,
12
+ paddingInline: token.paddingMD,
13
+ border: `${token.lineWidth} ${token.lineType} ${token.colorBorder}`,
14
+ borderRadius: token.borderRadius,
15
+ "&.is-collapsed": {
16
+ paddingBlockEnd: 0
17
+ }
18
+ },
19
+ [`${componentCls}-title`]: {
20
+ position: "absolute",
21
+ top: 0,
22
+ paddingInline: token.paddingMD,
23
+ fontSize: token.fontSize,
24
+ fontWeight: token.fontWeightStrong,
25
+ color: token.colorTextBase,
26
+ backgroundColor: token.colorBgContainer,
27
+ "&.is-left": {
28
+ left: token.sizeMD,
29
+ transform: "translateY(-50%)"
30
+ },
31
+ "&.is-center": {
32
+ left: "50%",
33
+ transform: "translate(-50%) translateY(-50%)"
34
+ },
35
+ "&.is-right": {
36
+ right: token.sizeMD,
37
+ transform: "translateY(-50%)"
38
+ }
39
+ }
40
+ }
41
+ };
42
+ });
43
+
44
+ export { stdin_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.4.50",
3
+ "version": "0.4.52",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",