@wyfex/ivue 0.2.0 → 0.4.0

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.
@@ -0,0 +1,65 @@
1
+ declare var __VLS_8: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_8) => any;
4
+ };
5
+ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
6
+ language: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ validator: (val: string) => boolean;
10
+ };
11
+ themeMode: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ validator: (val: string) => boolean;
15
+ };
16
+ tableExtraHeight: {
17
+ type: NumberConstructor;
18
+ default: number;
19
+ };
20
+ uploadConfig: {
21
+ type: import('vue').PropType<import('../../types').UploadConfig>;
22
+ default: () => {};
23
+ };
24
+ extConfig: {
25
+ type: import('vue').PropType<import('./types').ExtConfig>;
26
+ default: () => {};
27
+ };
28
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
29
+ language: {
30
+ type: StringConstructor;
31
+ default: string;
32
+ validator: (val: string) => boolean;
33
+ };
34
+ themeMode: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ validator: (val: string) => boolean;
38
+ };
39
+ tableExtraHeight: {
40
+ type: NumberConstructor;
41
+ default: number;
42
+ };
43
+ uploadConfig: {
44
+ type: import('vue').PropType<import('../../types').UploadConfig>;
45
+ default: () => {};
46
+ };
47
+ extConfig: {
48
+ type: import('vue').PropType<import('./types').ExtConfig>;
49
+ default: () => {};
50
+ };
51
+ }>> & Readonly<{}>, {
52
+ extConfig: import('./types').ExtConfig;
53
+ language: string;
54
+ themeMode: string;
55
+ tableExtraHeight: number;
56
+ uploadConfig: import('../../types').UploadConfig;
57
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
58
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
59
+ declare const _default: typeof __VLS_export;
60
+ export default _default;
61
+ type __VLS_WithSlots<T, S> = T & {
62
+ new (): {
63
+ $slots: S;
64
+ };
65
+ };
@@ -0,0 +1,28 @@
1
+ import { PropType } from 'vue';
2
+ import { UploadConfig } from '../../../types';
3
+ import { ExtConfig } from './types';
4
+ declare const _default: {
5
+ language: {
6
+ type: StringConstructor;
7
+ default: string;
8
+ validator: (val: string) => boolean;
9
+ };
10
+ themeMode: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ validator: (val: string) => boolean;
14
+ };
15
+ tableExtraHeight: {
16
+ type: NumberConstructor;
17
+ default: number;
18
+ };
19
+ uploadConfig: {
20
+ type: PropType<UploadConfig>;
21
+ default: () => {};
22
+ };
23
+ extConfig: {
24
+ type: PropType<ExtConfig>;
25
+ default: () => {};
26
+ };
27
+ };
28
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+ import { default as componentProps } from './props';
3
+ import { DictProps } from '../../../types';
4
+ import { LogType } from '../../../hooks/useLog';
5
+ export type Props = ExtractPropTypes<typeof componentProps>;
6
+ export interface Debug {
7
+ open: boolean;
8
+ type: LogType;
9
+ toJson: boolean;
10
+ }
11
+ export interface ExtConfig {
12
+ dictProps: DictProps;
13
+ debug: Debug;
14
+ }
@@ -0,0 +1,11 @@
1
+ import { ConfigColumn, Emits, Props } from './types';
2
+ import { GlobalConfig, RenderConfig } from '../../../types';
3
+ export declare const useElDescriptions: ({ props, emits, globalConfig }: {
4
+ props: Props;
5
+ emits: Emits;
6
+ globalConfig: GlobalConfig;
7
+ }) => {
8
+ processRenderContent: (item: ConfigColumn) => any;
9
+ processRenderStyle: (renderConfig: RenderConfig | boolean, item: ConfigColumn) => any;
10
+ processPlaceholder: (item: ConfigColumn) => string;
11
+ };
@@ -0,0 +1,114 @@
1
+ import { RenderConfig } from '../../../types';
2
+ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
3
+ configs: {
4
+ type: import('vue').PropType<import('./types').ConfigColumn[]>;
5
+ required: boolean;
6
+ };
7
+ formModel: {
8
+ type: import('vue').PropType<Record<string, any>>;
9
+ required: boolean;
10
+ };
11
+ useRender: {
12
+ type: import('vue').PropType<boolean | RenderConfig>;
13
+ default: boolean;
14
+ };
15
+ dictMap: {
16
+ type: import('vue').PropType<import('../../../types').DictMap>;
17
+ default: () => {};
18
+ };
19
+ dictProps: {
20
+ type: import('vue').PropType<import('../../../types').DictProps>;
21
+ default: () => {};
22
+ };
23
+ column: {
24
+ type: NumberConstructor;
25
+ default: number;
26
+ };
27
+ border: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ labelWidth: {
32
+ type: (StringConstructor | NumberConstructor)[];
33
+ default: string;
34
+ };
35
+ useTitleCenterWithBg: {
36
+ type: BooleanConstructor;
37
+ default: boolean;
38
+ };
39
+ labelClass: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ defaultClass: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
48
+ onDictKeys: (value?: string[] | undefined) => any;
49
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
50
+ configs: {
51
+ type: import('vue').PropType<import('./types').ConfigColumn[]>;
52
+ required: boolean;
53
+ };
54
+ formModel: {
55
+ type: import('vue').PropType<Record<string, any>>;
56
+ required: boolean;
57
+ };
58
+ useRender: {
59
+ type: import('vue').PropType<boolean | RenderConfig>;
60
+ default: boolean;
61
+ };
62
+ dictMap: {
63
+ type: import('vue').PropType<import('../../../types').DictMap>;
64
+ default: () => {};
65
+ };
66
+ dictProps: {
67
+ type: import('vue').PropType<import('../../../types').DictProps>;
68
+ default: () => {};
69
+ };
70
+ column: {
71
+ type: NumberConstructor;
72
+ default: number;
73
+ };
74
+ border: {
75
+ type: BooleanConstructor;
76
+ default: boolean;
77
+ };
78
+ labelWidth: {
79
+ type: (StringConstructor | NumberConstructor)[];
80
+ default: string;
81
+ };
82
+ useTitleCenterWithBg: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ labelClass: {
87
+ type: StringConstructor;
88
+ default: string;
89
+ };
90
+ defaultClass: {
91
+ type: StringConstructor;
92
+ default: string;
93
+ };
94
+ }>> & Readonly<{
95
+ onOnDictKeys?: ((value?: string[] | undefined) => any) | undefined;
96
+ }>, {
97
+ useRender: boolean | RenderConfig;
98
+ dictMap: import('../../../types').DictMap;
99
+ dictProps: import('../../../types').DictProps;
100
+ column: number;
101
+ border: boolean;
102
+ labelWidth: string | number;
103
+ useTitleCenterWithBg: boolean;
104
+ labelClass: string;
105
+ defaultClass: string;
106
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
107
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
108
+ declare const _default: typeof __VLS_export;
109
+ export default _default;
110
+ type __VLS_WithSlots<T, S> = T & {
111
+ new (): {
112
+ $slots: S;
113
+ };
114
+ };
@@ -0,0 +1,50 @@
1
+ import { PropType } from 'vue';
2
+ import { ConfigColumn } from './types';
3
+ import { DictMap, DictProps, RenderConfig } from '../../../types';
4
+ declare const _default: {
5
+ configs: {
6
+ type: PropType<ConfigColumn[]>;
7
+ required: boolean;
8
+ };
9
+ formModel: {
10
+ type: PropType<Record<string, any>>;
11
+ required: boolean;
12
+ };
13
+ useRender: {
14
+ type: PropType<boolean | RenderConfig>;
15
+ default: boolean;
16
+ };
17
+ dictMap: {
18
+ type: PropType<DictMap>;
19
+ default: () => {};
20
+ };
21
+ dictProps: {
22
+ type: PropType<DictProps>;
23
+ default: () => {};
24
+ };
25
+ column: {
26
+ type: NumberConstructor;
27
+ default: number;
28
+ };
29
+ border: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ labelWidth: {
34
+ type: (StringConstructor | NumberConstructor)[];
35
+ default: string;
36
+ };
37
+ useTitleCenterWithBg: {
38
+ type: BooleanConstructor;
39
+ default: boolean;
40
+ };
41
+ labelClass: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
45
+ defaultClass: {
46
+ type: StringConstructor;
47
+ default: string;
48
+ };
49
+ };
50
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { Component, ExtractPropTypes } from 'vue';
2
+ import { EditAttrs, RenderConfig, UseDict } from '../../../types';
3
+ import { default as componentProps } from './props';
4
+ export type Props = ExtractPropTypes<typeof componentProps>;
5
+ export interface Emits {
6
+ (e: 'onDictKeys', value?: string[]): void;
7
+ }
8
+ export interface ComponentConfig {
9
+ is: Component;
10
+ attrs?: EditAttrs;
11
+ }
12
+ export interface ConfigColumn {
13
+ label: string;
14
+ prop: string;
15
+ span?: number;
16
+ useDict?: boolean | string | UseDict;
17
+ defaultClass?: string;
18
+ slot?: boolean | string;
19
+ componentConfig?: ComponentConfig;
20
+ renderConfig?: RenderConfig;
21
+ }
@@ -1,2 +1,4 @@
1
1
  export { default as UseElButton } from './UseElButton/index.vue';
2
+ export { default as UseElConfigProvider } from './UseElConfigProvider/index.vue';
3
+ export { default as UseElDescriptions } from './UseElDescriptions/index.vue';
2
4
  export { default as UseRender } from './UseRender/index.vue';
@@ -0,0 +1 @@
1
+ var e={primary:`color:#1677ff;font-weight:bold;`,success:`color:#52c41a;font-weight:bold;`,warn:`color:#fa8c14;font-weight:bold;`,error:`color:#f5222d;font-weight:bold;`,block:`color:#4e5969;font-weight:bold;`,json:`color:#20b2aa;font-weight:bold;`},t={primary:`🔧`,success:`✅`,warn:`⚠️`,error:`❌`,block:`📦`,json:`📄`},n=`background:#000; padding:10px 8px;`,r=r=>{let i=(i,a,o,s)=>{let c=`${t[i]} [${r}]`;if(!s||o===void 0){console.log(`%c${c}%c ${a}`,e[i],``,o);return}let l=JSON.stringify(o,null,2);console.log(`%c${c}%c ${a}\n%c${l}`,e[i],``,n)};return{primary:(e,t,n)=>i(`primary`,e,t,n),success:(e,t,n)=>i(`success`,e,t,n),warn:(e,t,n)=>i(`warn`,e,t,n),error:(e,t,n)=>i(`error`,e,t,n),block:(i,a,o)=>{console.log(`%c- - - - - - - - - - - - - - - - - - - - - - -`,`color:#888`);let s=`${t.block} [${r}]`;if(!o||a===void 0)console.log(`%c${s}%c ${i}`,e.block,``,a);else{let t=JSON.stringify(a,null,2);console.log(`%c${s}%c ${i}\n%c${t}`,e.block,``,n)}console.log(`%c- - - - - - - - - - - - - - - - - - - - - - -`,`color:#888`)},json:(i,a)=>{let o=`${t.json} [${r}]`,s=JSON.stringify(a,null,2);console.log(`%c${o}%c ${i}\n%c${s}`,e.json,``,n)}}};export{r as useLog};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wyfex/ivue",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "万有前端 X 体系下基于 Vite8 + Vue3 + Typescript6 + ElementPlus2 构建的 iVue 组件库",
5
5
  "homepage": "https://wyfe.top/idocs/ivue",
6
6
  "type": "module",
@@ -53,7 +53,7 @@
53
53
  "@types/node": "^25.9.2",
54
54
  "@vitejs/plugin-vue": "^6.0.7",
55
55
  "@vue/tsconfig": "^0.9.1",
56
- "@wyfex/iutils": "file:D:/20260516/wyfex/wyfex-iutils/wyfex-iutils-0.20.0.tgz",
56
+ "@wyfex/iutils": "^0.30.0",
57
57
  "element-plus": "^2.14.1",
58
58
  "sass-embedded": "^1.100.0",
59
59
  "typescript": "~6.0.3",
@@ -63,6 +63,6 @@
63
63
  "vite": "^8.0.16",
64
64
  "vite-svg-loader": "^5.1.1",
65
65
  "vue": "^3.5.35",
66
- "vue-tsc": "^3.3.3"
66
+ "vue-tsc": "^3.3.4"
67
67
  }
68
68
  }
@@ -21,7 +21,8 @@ export interface Emits {
21
21
  */
22
22
  export interface ExtConfig {
23
23
  /**
24
- * 防抖配置项 仅作用于@debClick事件,无需防抖则设置delay为0或使用@click事件即可。
24
+ * 防抖配置项
25
+ * 仅作用于@debClick事件,无需防抖则设置delay为0或使用@click事件即可。
25
26
  */
26
27
  debounce?: {
27
28
  /**
@@ -39,7 +40,7 @@ export interface ExtConfig {
39
40
  confirm?: {
40
41
  /**
41
42
  * 二次确认数据 显式设置则开启二次确认
42
- * 可为String、Number、Object、Array,无需传递数据则显式设置为null即可
43
+ * 可为String、Number、Object、Array,无需传递数据则显式设置为null
43
44
  */
44
45
  data?: string | number | unknown
45
46
  /**
@@ -0,0 +1,9 @@
1
+ import type { ExtConfig } from './types'
2
+
3
+ /**
4
+ * 默认扩展配置
5
+ */
6
+ export default {
7
+ dictProps: { value: 'value', label: 'label', children: 'children' },
8
+ debug: { open: false, type: 'primary', toJson: false }
9
+ } satisfies ExtConfig
@@ -0,0 +1,46 @@
1
+ import type { PropType } from 'vue'
2
+ import type { UploadConfig } from '@/types'
3
+ import type { ExtConfig } from './types'
4
+
5
+ /**
6
+ * 组件props
7
+ */
8
+ export default {
9
+ /**
10
+ * 语言 默认zh,仅对ElementPlus组件有效
11
+ */
12
+ language: {
13
+ type: String,
14
+ default: 'zh',
15
+ validator: (val: string) => ['', 'zh', 'en'].includes(val)
16
+ },
17
+ /**
18
+ * 主题模式 默认light
19
+ */
20
+ themeMode: {
21
+ type: String,
22
+ default: 'light',
23
+ validator: (val: string) => ['light', 'dark', ''].includes(val)
24
+ },
25
+ /**
26
+ * 表格底部额外高度 默认20,此处配置同时作用于UseElTable和UseCrudTable组件
27
+ */
28
+ tableExtraHeight: {
29
+ type: Number,
30
+ default: 20
31
+ },
32
+ /**
33
+ * 上传配置 此处配置仅作用于UseElUpload组件
34
+ */
35
+ uploadConfig: {
36
+ type: Object as PropType<UploadConfig>,
37
+ default: () => ({})
38
+ },
39
+ /**
40
+ * 扩展配置 如【字典属性、调试】等
41
+ */
42
+ extConfig: {
43
+ type: Object as PropType<ExtConfig>,
44
+ default: () => ({})
45
+ }
46
+ }
@@ -0,0 +1,41 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import componentProps from './props'
3
+ import type { DictProps } from '@/types'
4
+ import type { LogType } from '@/hooks/useLog'
5
+
6
+ /**
7
+ * props类型
8
+ */
9
+ export type Props = ExtractPropTypes<typeof componentProps>
10
+
11
+ /**
12
+ * 调试接口
13
+ */
14
+ export interface Debug {
15
+ /**
16
+ * 是否开启调试
17
+ */
18
+ open: boolean
19
+ /**
20
+ * 调试日志类型
21
+ */
22
+ type: LogType
23
+ /**
24
+ * 是否JSON格式化打印
25
+ */
26
+ toJson: boolean
27
+ }
28
+
29
+ /**
30
+ * extConfig接口
31
+ */
32
+ export interface ExtConfig {
33
+ /**
34
+ * 字典属性配置项
35
+ */
36
+ dictProps: DictProps
37
+ /**
38
+ * 调试配置项
39
+ */
40
+ debug: Debug
41
+ }
@@ -0,0 +1,87 @@
1
+ import type { PropType } from 'vue'
2
+ import type { ConfigColumn } from './types'
3
+ import type { DictMap, DictProps } from '@/types'
4
+ import type { RenderConfig } from '@/types'
5
+
6
+ /**
7
+ * 组件props
8
+ */
9
+ export default {
10
+ /**
11
+ * 配置项 必传
12
+ */
13
+ configs: {
14
+ type: Array as PropType<ConfigColumn[]>,
15
+ required: true
16
+ },
17
+ /**
18
+ * 表单模型 必传
19
+ */
20
+ formModel: {
21
+ type: Object as PropType<Record<string, any>>,
22
+ required: true
23
+ },
24
+ /**
25
+ * 是否使用渲染器 默认否
26
+ */
27
+ useRender: {
28
+ type: [Boolean, Object] as PropType<boolean | RenderConfig>,
29
+ default: false
30
+ },
31
+ /**
32
+ * 字典映射 数据结构为{ configs[][label | useDict | useDict.data]: Array<{ label: string, value: any }> }
33
+ */
34
+ dictMap: {
35
+ type: Object as PropType<DictMap>,
36
+ default: () => ({})
37
+ },
38
+ /**
39
+ * 字典属性 默认为{ value: 'value', label: 'label', children: 'children' },可通过全局配置进行设置,为适配全局配置此处不再设置默认值
40
+ */
41
+ dictProps: {
42
+ type: Object as PropType<DictProps>,
43
+ default: () => ({})
44
+ },
45
+ /**
46
+ * 一行 Descriptions Item 的数量 默认2
47
+ */
48
+ column: {
49
+ type: Number,
50
+ default: 2
51
+ },
52
+ /**
53
+ * 是否带有边框 默认是
54
+ */
55
+ border: {
56
+ type: Boolean,
57
+ default: true
58
+ },
59
+ /**
60
+ * 每一列的标签宽度
61
+ */
62
+ labelWidth: {
63
+ type: [String, Number],
64
+ default: '25%'
65
+ },
66
+ /**
67
+ * 是否让标题居中并且header具有背景色 默认否
68
+ */
69
+ useTitleCenterWithBg: {
70
+ type: Boolean,
71
+ default: true
72
+ },
73
+ /**
74
+ * 标签包裹类名
75
+ */
76
+ labelClass: {
77
+ type: String,
78
+ default: ''
79
+ },
80
+ /**
81
+ * 默认内容包裹类名
82
+ */
83
+ defaultClass: {
84
+ type: String,
85
+ default: ''
86
+ }
87
+ }
@@ -0,0 +1,38 @@
1
+ import type { Component, ExtractPropTypes } from 'vue'
2
+ import type { EditAttrs, RenderConfig, UseDict } from '@/types'
3
+ import componentProps from './props'
4
+
5
+ /**
6
+ * props类型
7
+ */
8
+ export type Props = ExtractPropTypes<typeof componentProps>
9
+
10
+ /**
11
+ * emits接口
12
+ */
13
+ export interface Emits {
14
+ // dictKeys事件
15
+ (e: 'onDictKeys', value?: string[]): void
16
+ }
17
+
18
+ /**
19
+ * 组件配置接口
20
+ */
21
+ export interface ComponentConfig {
22
+ is: Component
23
+ attrs?: EditAttrs
24
+ }
25
+
26
+ /**
27
+ * 配置列接口
28
+ */
29
+ export interface ConfigColumn {
30
+ label: string
31
+ prop: string
32
+ span?: number
33
+ useDict?: boolean | string | UseDict
34
+ defaultClass?: string
35
+ slot?: boolean | string
36
+ componentConfig?: ComponentConfig
37
+ renderConfig?: RenderConfig
38
+ }