@wyfex/ivue 0.17.0 → 0.19.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.
@@ -1,6 +1,6 @@
1
1
  declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
2
  formColumns: {
3
- type: import('vue').PropType<import('../types.js').FormColumn[]>;
3
+ type: import('vue').PropType<import('../types').FormColumn[]>;
4
4
  required: boolean;
5
5
  };
6
6
  formModel: {
@@ -8,15 +8,15 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
8
8
  required: boolean;
9
9
  };
10
10
  useRender: {
11
- type: import('vue').PropType<boolean | import('../../../types/index.js').RenderConfig>;
11
+ type: import('vue').PropType<boolean | import('../../../types').RenderConfig>;
12
12
  default: boolean;
13
13
  };
14
14
  dictMap: {
15
- type: import('vue').PropType<import('../../../types/index.js').DictMap>;
15
+ type: import('vue').PropType<import('../../../types').DictMap>;
16
16
  default: () => {};
17
17
  };
18
18
  dictProps: {
19
- type: import('vue').PropType<import('../../../types/index.js').DictProps>;
19
+ type: import('vue').PropType<import('../../../types').DictProps>;
20
20
  default: () => {};
21
21
  };
22
22
  formItemWidth: {
@@ -50,18 +50,17 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
50
50
  default: boolean;
51
51
  };
52
52
  queryConfig: {
53
- type: import('vue').PropType<import('../types.js').QueryConfig>;
53
+ type: import('vue').PropType<import('../types').QueryConfig>;
54
54
  default: () => {};
55
55
  };
56
56
  }>, {
57
57
  efRef: import('vue').Ref<null, null>;
58
- cascaderRef: import('vue').Ref<null, null>;
59
58
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
60
59
  onDictKeys: (value?: string[] | undefined) => any;
61
60
  "update:formModel": (value: Record<string, any>) => any;
62
61
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
63
62
  formColumns: {
64
- type: import('vue').PropType<import('../types.js').FormColumn[]>;
63
+ type: import('vue').PropType<import('../types').FormColumn[]>;
65
64
  required: boolean;
66
65
  };
67
66
  formModel: {
@@ -69,15 +68,15 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
69
68
  required: boolean;
70
69
  };
71
70
  useRender: {
72
- type: import('vue').PropType<boolean | import('../../../types/index.js').RenderConfig>;
71
+ type: import('vue').PropType<boolean | import('../../../types').RenderConfig>;
73
72
  default: boolean;
74
73
  };
75
74
  dictMap: {
76
- type: import('vue').PropType<import('../../../types/index.js').DictMap>;
75
+ type: import('vue').PropType<import('../../../types').DictMap>;
77
76
  default: () => {};
78
77
  };
79
78
  dictProps: {
80
- type: import('vue').PropType<import('../../../types/index.js').DictProps>;
79
+ type: import('vue').PropType<import('../../../types').DictProps>;
81
80
  default: () => {};
82
81
  };
83
82
  formItemWidth: {
@@ -111,16 +110,16 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
111
110
  default: boolean;
112
111
  };
113
112
  queryConfig: {
114
- type: import('vue').PropType<import('../types.js').QueryConfig>;
113
+ type: import('vue').PropType<import('../types').QueryConfig>;
115
114
  default: () => {};
116
115
  };
117
116
  }>> & Readonly<{
118
117
  onOnDictKeys?: ((value?: string[] | undefined) => any) | undefined;
119
118
  "onUpdate:formModel"?: ((value: Record<string, any>) => any) | undefined;
120
119
  }>, {
121
- dictMap: import('../../../types/index.js').DictMap;
122
- dictProps: import('../../../types/index.js').DictProps;
123
- useRender: boolean | import('../../../types/index.js').RenderConfig;
120
+ dictMap: import('../../../types').DictMap;
121
+ dictProps: import('../../../types').DictProps;
122
+ useRender: boolean | import('../../../types').RenderConfig;
124
123
  formItemWidth: string;
125
124
  labelSuffix: string;
126
125
  labelWidth: string;
@@ -128,7 +127,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
128
127
  rowGutter: number;
129
128
  colSpan: number;
130
129
  disabled: boolean;
131
- queryConfig: import('../types.js').QueryConfig;
130
+ queryConfig: import('../types').QueryConfig;
132
131
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
133
132
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
134
133
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,6 @@
1
1
  import { ComputedRef } from 'vue';
2
- import { Emits, FormColumn, Props } from './types';
3
- import { GlobalConfig } from '../../types';
2
+ import { Emits, FormColumn, Props } from '../types';
3
+ import { GlobalConfig } from '../../../types';
4
4
  export declare const useElForm: ({ props, emits, globalConfig }: {
5
5
  props: Props;
6
6
  emits: Emits;
@@ -4,7 +4,7 @@ import { GlobalConfig } from '../../../types';
4
4
  declare var __VLS_9: {
5
5
  label: string | undefined;
6
6
  prop: string | undefined;
7
- }, __VLS_24: string, __VLS_25: {
7
+ }, __VLS_24: `${string}-header`, __VLS_25: {
8
8
  item: TableColumn;
9
9
  column: any;
10
10
  $index: any;
@@ -21,11 +21,11 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
21
21
  validator: (val: string) => boolean;
22
22
  };
23
23
  dictMap: {
24
- type: import('vue').PropType<import('../../types/index.ts').DictMap>;
24
+ type: import('vue').PropType<import('../../types').DictMap>;
25
25
  default: () => {};
26
26
  };
27
27
  dictProps: {
28
- type: import('vue').PropType<import('../../types/index.ts').DictProps>;
28
+ type: import('vue').PropType<import('../../types').DictProps>;
29
29
  default: () => {};
30
30
  };
31
31
  showOverflowTooltip: {
@@ -74,11 +74,11 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
74
74
  validator: (val: string) => boolean;
75
75
  };
76
76
  dictMap: {
77
- type: import('vue').PropType<import('../../types/index.ts').DictMap>;
77
+ type: import('vue').PropType<import('../../types').DictMap>;
78
78
  default: () => {};
79
79
  };
80
80
  dictProps: {
81
- type: import('vue').PropType<import('../../types/index.ts').DictProps>;
81
+ type: import('vue').PropType<import('../../types').DictProps>;
82
82
  default: () => {};
83
83
  };
84
84
  showOverflowTooltip: {
@@ -106,8 +106,8 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
106
106
  tableHeight: string;
107
107
  tableLoading: boolean;
108
108
  tableColumnAlign: string;
109
- dictMap: import('../../types/index.ts').DictMap;
110
- dictProps: import('../../types/index.ts').DictProps;
109
+ dictMap: import('../../types').DictMap;
110
+ dictProps: import('../../types').DictProps;
111
111
  showOverflowTooltip: boolean;
112
112
  headerCellStyle: Record<string, string>;
113
113
  extConfig: import('./types').ExtConfig;
@@ -0,0 +1,41 @@
1
+ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ content: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ placement: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ validator: (value: string) => boolean;
10
+ };
11
+ spanClass: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
16
+ content: {
17
+ type: StringConstructor;
18
+ default: string;
19
+ };
20
+ placement: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ validator: (value: string) => boolean;
24
+ };
25
+ spanClass: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
29
+ }>> & Readonly<{}>, {
30
+ content: string;
31
+ placement: string;
32
+ spanClass: string;
33
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
34
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
37
+ type __VLS_WithSlots<T, S> = T & {
38
+ new (): {
39
+ $slots: S;
40
+ };
41
+ };
@@ -0,0 +1,16 @@
1
+ declare const _default: {
2
+ content: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ placement: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ validator: (value: string) => boolean;
10
+ };
11
+ spanClass: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ };
16
+ export default _default;
@@ -0,0 +1,21 @@
1
+ export declare const useElUpload: ({ props, emits }: any) => {
2
+ acceptComputed: import('vue').ComputedRef<any>;
3
+ state: any;
4
+ dialogState: import('vue').Ref<{
5
+ show: boolean;
6
+ src: string;
7
+ }, {
8
+ show: boolean;
9
+ src: string;
10
+ } | {
11
+ show: boolean;
12
+ src: string;
13
+ }>;
14
+ handlePreview: (uploadFile: any) => void;
15
+ handleSuccess: (res: any, uploadFile: any) => void;
16
+ handleError: (err: any) => void;
17
+ handleBeforeUpload: (file: any) => false | {
18
+ signal: AbortSignal;
19
+ };
20
+ handleBeforeRemove: (uploadFile: any) => Promise<boolean>;
21
+ };
@@ -0,0 +1,101 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
+ fileId: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ linkUrl: {
7
+ type: StringConstructor;
8
+ default: string;
9
+ };
10
+ uploadConfig: {
11
+ type: import('vue').PropType<Record<string, unknown>>;
12
+ default: () => {};
13
+ };
14
+ uploadType: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ validator: (value: string) => boolean;
18
+ };
19
+ uploadTip: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ uploadList: {
24
+ type: import('vue').PropType<Record<string, unknown>[]>;
25
+ default: () => never[];
26
+ };
27
+ limit: {
28
+ type: NumberConstructor;
29
+ default: number;
30
+ validator: (value: number) => boolean;
31
+ };
32
+ disabled: {
33
+ type: BooleanConstructor;
34
+ default: boolean;
35
+ };
36
+ maxSize: {
37
+ type: NumberConstructor;
38
+ default: number;
39
+ };
40
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
41
+ onError: (error: string | Error) => any;
42
+ onFileObj: (file: Record<string, any>) => any;
43
+ "update:fileId": (value: string | number) => any;
44
+ "update:linkUrl": (url: string) => any;
45
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
46
+ fileId: {
47
+ type: StringConstructor;
48
+ default: string;
49
+ };
50
+ linkUrl: {
51
+ type: StringConstructor;
52
+ default: string;
53
+ };
54
+ uploadConfig: {
55
+ type: import('vue').PropType<Record<string, unknown>>;
56
+ default: () => {};
57
+ };
58
+ uploadType: {
59
+ type: StringConstructor;
60
+ default: string;
61
+ validator: (value: string) => boolean;
62
+ };
63
+ uploadTip: {
64
+ type: StringConstructor;
65
+ default: string;
66
+ };
67
+ uploadList: {
68
+ type: import('vue').PropType<Record<string, unknown>[]>;
69
+ default: () => never[];
70
+ };
71
+ limit: {
72
+ type: NumberConstructor;
73
+ default: number;
74
+ validator: (value: number) => boolean;
75
+ };
76
+ disabled: {
77
+ type: BooleanConstructor;
78
+ default: boolean;
79
+ };
80
+ maxSize: {
81
+ type: NumberConstructor;
82
+ default: number;
83
+ };
84
+ }>> & Readonly<{
85
+ onOnError?: ((error: string | Error) => any) | undefined;
86
+ onOnFileObj?: ((file: Record<string, any>) => any) | undefined;
87
+ "onUpdate:fileId"?: ((value: string | number) => any) | undefined;
88
+ "onUpdate:linkUrl"?: ((url: string) => any) | undefined;
89
+ }>, {
90
+ disabled: boolean;
91
+ uploadConfig: Record<string, unknown>;
92
+ fileId: string;
93
+ linkUrl: string;
94
+ uploadType: string;
95
+ uploadTip: string;
96
+ uploadList: Record<string, unknown>[];
97
+ limit: number;
98
+ maxSize: number;
99
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
100
+ declare const _default: typeof __VLS_export;
101
+ export default _default;
@@ -0,0 +1,42 @@
1
+ import { PropType } from 'vue';
2
+ declare const _default: {
3
+ fileId: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ linkUrl: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ uploadConfig: {
12
+ type: PropType<Record<string, unknown>>;
13
+ default: () => {};
14
+ };
15
+ uploadType: {
16
+ type: StringConstructor;
17
+ default: string;
18
+ validator: (value: string) => boolean;
19
+ };
20
+ uploadTip: {
21
+ type: StringConstructor;
22
+ default: string;
23
+ };
24
+ uploadList: {
25
+ type: PropType<Record<string, unknown>[]>;
26
+ default: () => never[];
27
+ };
28
+ limit: {
29
+ type: NumberConstructor;
30
+ default: number;
31
+ validator: (value: number) => boolean;
32
+ };
33
+ disabled: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ maxSize: {
38
+ type: NumberConstructor;
39
+ default: number;
40
+ };
41
+ };
42
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { ExtractPropTypes } from 'vue';
2
+ import { default as componentProps } from './props';
3
+ export type Props = ExtractPropTypes<typeof componentProps>;
4
+ export interface Emits {
5
+ 'update:fileId': [value: string | number];
6
+ 'update:linkUrl': [url: string];
7
+ onFileObj: [file: Record<string, any>];
8
+ onError: [error: Error | string];
9
+ }
@@ -0,0 +1,3 @@
1
+ export declare const FILE_TYPE_CONFIG: any;
2
+ export declare const ACCEPT_MAP: any;
3
+ export declare const debounce: (fn: any, delay?: number) => any;
@@ -11,6 +11,8 @@ export { default as UseElInput } from './UseElInput/index.vue';
11
11
  export { default as UseElSelect } from './UseElSelect/index.vue';
12
12
  export { default as UseElSwitch } from './UseElSwitch/index.vue';
13
13
  export { default as UseElTable } from './UseElTable/index.vue';
14
+ export { default as UseElTooltip } from './UseElTooltip/index.vue';
15
+ export { default as UseElUpload } from './UseElUpload/index.vue';
14
16
  export { default as UseIconfont } from './UseIconfont/index.vue';
15
17
  export { default as UseLineTitle } from './UseLineTitle/index.vue';
16
18
  export { default as UseRender } from './UseRender/index.vue';
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@wyfex/ivue",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "万有前端 X 体系下基于 Vite8 + Vue3 + Typescript6 + ElementPlus2 构建的 iVue 组件库",
5
- "homepage": "https://wyfe.top/idocs/ivue",
5
+ "homepage": "https://wyfex.top/idocs/ivue",
6
6
  "type": "module",
7
7
  "main": "dist/index.umd.cjs",
8
8
  "module": "dist/index.es.js",
@@ -50,17 +50,18 @@
50
50
  "vue": ">=3.2.0 <4.0.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@types/node": "^26.0.1",
53
+ "@types/node": "^26.1.0",
54
54
  "@vitejs/plugin-vue": "^6.0.7",
55
55
  "@vue/tsconfig": "^0.9.1",
56
56
  "@wyfex/iutils": "^0.40.0",
57
+ "dayjs": "^1.11.21",
57
58
  "element-plus": "^2.14.2",
58
59
  "sass-embedded": "^1.100.0",
59
60
  "typescript": "~6.0.3",
60
61
  "unplugin-auto-import": "^21.0.0",
61
62
  "unplugin-dts": "^1.0.3",
62
63
  "unplugin-vue-components": "^32.1.0",
63
- "vite": "^8.1.2",
64
+ "vite": "^8.1.3",
64
65
  "vite-svg-loader": "^5.1.1",
65
66
  "vue": "^3.5.39",
66
67
  "vue-tsc": "^3.3.6"
@@ -35,7 +35,7 @@ export interface ExtConfig {
35
35
  */
36
36
  dictProps?: DictProps
37
37
  /**
38
- * 表格配置
38
+ * 表格配置项
39
39
  */
40
40
  table?: { bottomOffset: number; modalFooterHeight?: number }
41
41
  /**
@@ -0,0 +1,41 @@
1
+ /**
2
+ * 组件props
3
+ */
4
+ export default {
5
+ /**
6
+ * 显示的内容 也可被 slot#content 覆盖
7
+ */
8
+ content: {
9
+ type: String,
10
+ default: ''
11
+ },
12
+ /**
13
+ * Tooltip组件出现的位置 默认top
14
+ */
15
+ placement: {
16
+ type: String,
17
+ default: 'top',
18
+ validator: (value: string) =>
19
+ [
20
+ 'top',
21
+ 'top-start',
22
+ 'top-end',
23
+ 'bottom',
24
+ 'bottom-start',
25
+ 'bottom-end',
26
+ 'left',
27
+ 'left-start',
28
+ 'left-end',
29
+ 'right',
30
+ 'right-start',
31
+ 'right-end'
32
+ ].includes(value)
33
+ },
34
+ /**
35
+ * span元素的类名
36
+ */
37
+ spanClass: {
38
+ type: String,
39
+ default: ''
40
+ }
41
+ }
@@ -0,0 +1,84 @@
1
+ import type { PropType } from 'vue'
2
+
3
+ /**
4
+ * 组件props
5
+ */
6
+ export default {
7
+ /**
8
+ * 文件id
9
+ */
10
+ fileId: {
11
+ type: String,
12
+ default: ''
13
+ },
14
+ /**
15
+ * 链接地址
16
+ */
17
+ linkUrl: {
18
+ type: String,
19
+ default: ''
20
+ },
21
+ /**
22
+ * 上传配置
23
+ * action:请求URL,eg:'/api/file/upload'
24
+ * headers:设置上传的请求头部,eg:{ Authorization: `Bearer ${token}` }
25
+ * data:上传时附带的额外参数,eg:{ referer: window.location.href }
26
+ */
27
+ uploadConfig: {
28
+ type: Object as PropType<Record<string, unknown>>,
29
+ default: () => ({
30
+ // action: '/api/file/upload',
31
+ // headers: { Authorization: `Bearer ${token}` },
32
+ // data: { referer: window.location.href }
33
+ })
34
+ },
35
+ /**
36
+ * 上传类型
37
+ * 为ALL支持所有文件格式
38
+ * 为IMG仅可上传支持的图片格式且按照片墙形式展示
39
+ * 为VIDEO仅可上传支持的视频格式
40
+ * 为EXCLUDE_VIDEO可上传除视频格式外的所有支持的文件格式
41
+ */
42
+ uploadType: {
43
+ type: String,
44
+ default: 'ALL',
45
+ validator: (value: string) =>
46
+ ['ALL', 'IMG', 'VIDEO', 'EXCLUDE_VIDEO'].includes(value)
47
+ },
48
+ /**
49
+ * 上传提示
50
+ */
51
+ uploadTip: {
52
+ type: String,
53
+ default: ''
54
+ },
55
+ /**
56
+ * 上传列表 用于数据回显
57
+ */
58
+ uploadList: {
59
+ type: Array as PropType<Record<string, unknown>[]>,
60
+ default: () => []
61
+ },
62
+ /**
63
+ * 上传数量限制 默认1
64
+ */
65
+ limit: {
66
+ type: Number,
67
+ default: 1,
68
+ validator: (value: number) => value >= 1
69
+ },
70
+ /**
71
+ * 是否禁用上传 默认否
72
+ */
73
+ disabled: {
74
+ type: Boolean,
75
+ default: false
76
+ },
77
+ /**
78
+ * 最大文件大小 默认2GB
79
+ */
80
+ maxSize: {
81
+ type: Number,
82
+ default: 2
83
+ }
84
+ }
@@ -0,0 +1,17 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import componentProps from './props'
3
+
4
+ /**
5
+ * props类型
6
+ */
7
+ export type Props = ExtractPropTypes<typeof componentProps>
8
+
9
+ /**
10
+ * emits接口
11
+ */
12
+ export interface Emits {
13
+ 'update:fileId': [value: string | number]
14
+ 'update:linkUrl': [url: string]
15
+ onFileObj: [file: Record<string, any>]
16
+ onError: [error: Error | string]
17
+ }
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue'
2
- import { isArray } from '@wyfex/iutils'
2
+ import { isArray, isNumber } from '@wyfex/iutils'
3
3
  import { parseUnit, isValidUnit } from '@/utils'
4
4
 
5
5
  /**
@@ -20,7 +20,7 @@ export default {
20
20
  type: [Number, String],
21
21
  default: 28,
22
22
  validator(val: any) {
23
- if (typeof val === 'number') return val
23
+ if (isNumber(val)) return val
24
24
  return isValidUnit(parseUnit(val)) && val
25
25
  }
26
26
  },