@wyfex/ivue 0.7.0 → 0.9.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,144 @@
1
+ import type { PropType } from 'vue'
2
+
3
+ /**
4
+ * 组件props
5
+ */
6
+ export default {
7
+ /**
8
+ * el-dialog的标题
9
+ */
10
+ title: {
11
+ type: String,
12
+ default: '欢迎使用wyfex-ivue对话框组件'
13
+ },
14
+ /**
15
+ * el-dialog自身是否插入至body元素上。嵌套的el-dialog必须指定该属性并赋值为 true 默认是
16
+ */
17
+ appendToBody: {
18
+ type: Boolean,
19
+ default: true
20
+ },
21
+ /**
22
+ * el-dialog头部区域样式配置
23
+ */
24
+ headerStyleConfig: {
25
+ type: Object as PropType<Record<string, any>>,
26
+ default: () => ({ bgColor: 'var(--theme-color)', color: '#fff' })
27
+ },
28
+ /**
29
+ * el-dialog内容区域最大高度
30
+ */
31
+ maxHeight: {
32
+ type: [String, Number],
33
+ default: ''
34
+ },
35
+ /**
36
+ * el-scrollbar不响应容器尺寸变化,如果容器尺寸不会发生变化,最好设置它可以优化性能
37
+ */
38
+ noresize: {
39
+ type: Boolean,
40
+ default: true
41
+ },
42
+ /**
43
+ * 是否可以通过点击modal关闭el-dialog 默认否
44
+ */
45
+ closeOnClickModal: {
46
+ type: Boolean,
47
+ default: false
48
+ },
49
+ /**
50
+ * 控制是否在关闭el-dialog后将子元素全部销毁 默认是
51
+ */
52
+ destroyOnClose: {
53
+ type: Boolean,
54
+ default: true
55
+ },
56
+ /**
57
+ * 是否显示全屏图标 默认是
58
+ */
59
+ showFullScreenIcon: {
60
+ type: Boolean,
61
+ default: true
62
+ },
63
+ /**
64
+ * 是否显示footer 默认显示,可通过<template #footer></template>插槽自定义footer内容
65
+ */
66
+ showFooter: {
67
+ type: Boolean,
68
+ default: true
69
+ },
70
+ /**
71
+ * 是否显示footer顶部border
72
+ */
73
+ showFooterBorder: {
74
+ type: Boolean,
75
+ default: false
76
+ },
77
+ /**
78
+ * 底部定位 默认right
79
+ */
80
+ footerPosition: {
81
+ type: String,
82
+ default: 'right',
83
+ validator: (val: string) => ['left', 'center', 'right'].includes(val)
84
+ },
85
+ /**
86
+ * 是否严格区分close事件 默认否 和onClose事件二选一设置一个即可
87
+ */
88
+ strictCloseEvent: {
89
+ type: Boolean,
90
+ default: false
91
+ },
92
+ /**
93
+ * 抽屉关闭图标事件 若未设置且未开启strictCloseEvent则默认执行onCancel事件
94
+ */
95
+ onClose: {
96
+ type: Function,
97
+ default: () => {}
98
+ },
99
+ /**
100
+ * 确定按钮文本
101
+ */
102
+ confirmBtnText: {
103
+ type: String,
104
+ default: '保存'
105
+ },
106
+ /**
107
+ * 取消按钮文本
108
+ */
109
+ cancelBtnText: {
110
+ type: String,
111
+ default: '取消'
112
+ },
113
+ /**
114
+ * 取消按钮类型
115
+ */
116
+ cancelBtnType: {
117
+ type: String,
118
+ default: '',
119
+ validator: (val: string) =>
120
+ [
121
+ '',
122
+ 'default',
123
+ 'primary',
124
+ 'success',
125
+ 'warning',
126
+ 'danger',
127
+ 'info'
128
+ ].includes(val)
129
+ },
130
+ /**
131
+ * 确定按钮事件
132
+ */
133
+ onConfirm: {
134
+ type: Function,
135
+ default: () => {}
136
+ },
137
+ /**
138
+ * 取消按钮事件
139
+ */
140
+ onCancel: {
141
+ type: Function,
142
+ default: () => {}
143
+ }
144
+ }
@@ -0,0 +1,7 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import componentProps from './props'
3
+
4
+ /**
5
+ * props类型
6
+ */
7
+ export type Props = ExtractPropTypes<typeof componentProps>
@@ -0,0 +1,121 @@
1
+ /**
2
+ * 组件props
3
+ */
4
+ export default {
5
+ /**
6
+ * el-drawer的标题
7
+ */
8
+ title: {
9
+ type: String,
10
+ default: '欢迎使用wyfex-ivue抽屉组件'
11
+ },
12
+ /**
13
+ * el-drawer的窗体的大小, 当使用number类型时, 以像素为单位, 当使用string类型时, 请传入'xx%'、'xxxpx'等,否则便会以number类型解释 默认1100px
14
+ */
15
+ size: {
16
+ type: [Number, String],
17
+ default: 1100
18
+ },
19
+ /**
20
+ * el-drawer自身是否插入至body元素上。嵌套的el-drawer必须指定该属性并赋值为 true 默认是
21
+ */
22
+ appendToBody: {
23
+ type: Boolean,
24
+ default: true
25
+ },
26
+ /**
27
+ * 控制是否在关闭el-drawer后将子元素全部销毁 默认是
28
+ */
29
+ destroyOnClose: {
30
+ type: Boolean,
31
+ default: true
32
+ },
33
+ /**
34
+ * 是否可以通过点击modal关闭el-drawer 默认否
35
+ */
36
+ closeOnClickModal: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ /**
41
+ * 是否显示全屏图标 默认是
42
+ */
43
+ showFullScreenIcon: {
44
+ type: Boolean,
45
+ default: true
46
+ },
47
+ /**
48
+ * 是否显示footer 默认显示,可通过<template #footer></template>插槽自定义footer内容
49
+ */
50
+ showFooter: {
51
+ type: Boolean,
52
+ default: true
53
+ },
54
+ /**
55
+ * 底部定位 默认left
56
+ */
57
+ footerPosition: {
58
+ type: String,
59
+ default: 'left',
60
+ validator: (val: string) => ['left', 'center', 'right'].includes(val)
61
+ },
62
+ /**
63
+ * 是否严格区分close事件 默认否 和onClose事件二选一设置一个即可
64
+ */
65
+ strictCloseEvent: {
66
+ type: Boolean,
67
+ default: false
68
+ },
69
+ /**
70
+ * 抽屉关闭图标事件 若未设置且未开启strictCloseEvent则默认执行onCancel事件
71
+ */
72
+ onClose: {
73
+ type: Function,
74
+ default: () => {}
75
+ },
76
+ /**
77
+ * 确定按钮文本
78
+ */
79
+ confirmBtnText: {
80
+ type: String,
81
+ default: '保存'
82
+ },
83
+ /**
84
+ * 取消按钮文本
85
+ */
86
+ cancelBtnText: {
87
+ type: String,
88
+ default: '取消'
89
+ },
90
+ /**
91
+ * 取消按钮类型 同ElButton类型
92
+ */
93
+ cancelBtnType: {
94
+ type: String,
95
+ default: '',
96
+ validator: (val: string) =>
97
+ [
98
+ '',
99
+ 'default',
100
+ 'primary',
101
+ 'success',
102
+ 'warning',
103
+ 'danger',
104
+ 'info'
105
+ ].includes(val)
106
+ },
107
+ /**
108
+ * 确定按钮事件
109
+ */
110
+ onConfirm: {
111
+ type: Function,
112
+ default: () => {}
113
+ },
114
+ /**
115
+ * 取消按钮事件
116
+ */
117
+ onCancel: {
118
+ type: Function,
119
+ default: () => {}
120
+ }
121
+ }
@@ -0,0 +1,7 @@
1
+ import type { ExtractPropTypes } from 'vue'
2
+ import componentProps from './props'
3
+
4
+ /**
5
+ * props类型
6
+ */
7
+ export type Props = ExtractPropTypes<typeof componentProps>
@@ -20,9 +20,9 @@ export default {
20
20
  default: '、'
21
21
  },
22
22
  /**
23
- * content为对象数组时需要转为字符串的key 默认label
23
+ * content为对象数组或对象时需要转为字符串的key 默认label
24
24
  */
25
- convertKey: {
25
+ parseKey: {
26
26
  type: String,
27
27
  default: 'label'
28
28
  },
@@ -9,6 +9,7 @@ export type RenderContent =
9
9
  | number
10
10
  | boolean
11
11
  | unknown[]
12
+ | Record<string, any>
12
13
  | VNode
13
14
  | Component
14
15