@elementplus-kit/uikit 1.8.0 → 1.10.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.
- package/components/button/index.ts +1 -1
- package/components/dialog/index.ts +1 -1
- package/components/dictLabel/index.ts +1 -4
- package/components/dictLabel/src/index.vue +17 -7
- package/components/drawer/index.ts +1 -1
- package/components/form/index.ts +1 -1
- package/components/form/src/FormItem.ts +10 -8
- package/components/index.ts +1 -17
- package/components/pagination/index.ts +1 -1
- package/components/search/index.ts +1 -1
- package/components/table/index.ts +1 -1
- package/components/table/src/index.ts +10 -9
- package/components/table/src/tableDictLabel.vue +2 -3
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./src/type.ts";
|
|
2
|
-
export default "./src/index.ts";
|
|
2
|
+
export { default as CButton } from "./src/index.ts";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./src/type.ts";
|
|
2
|
-
export default "./src/index.ts";
|
|
2
|
+
export { default as CDialog } from "./src/index.ts";
|
|
@@ -2,20 +2,30 @@
|
|
|
2
2
|
{{ label }}
|
|
3
3
|
</template>
|
|
4
4
|
<script setup lang="ts">
|
|
5
|
-
import { computed, PropType } from 'vue'
|
|
5
|
+
import { computed, type PropType } from 'vue'
|
|
6
6
|
const props = defineProps({
|
|
7
|
+
// 字典选项
|
|
7
8
|
options: {
|
|
8
|
-
type: Array
|
|
9
|
+
type: Array as PropType<{ value: string; label: string }[]>,
|
|
9
10
|
default: () => []
|
|
10
11
|
},
|
|
12
|
+
// 字典值
|
|
11
13
|
value: {
|
|
12
|
-
type: String as PropType<any>,
|
|
13
14
|
default: ''
|
|
14
15
|
},
|
|
16
|
+
// 是否将value转换为字符串进行匹配
|
|
17
|
+
stringify: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
}
|
|
15
21
|
})
|
|
16
22
|
const label = computed(() => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
23
|
+
const item = props.options?.find((item) => {
|
|
24
|
+
if (!props.stringify) {
|
|
25
|
+
return item.value === props.value
|
|
26
|
+
}
|
|
27
|
+
return item.value === props.value?.toString()
|
|
28
|
+
})
|
|
29
|
+
return item?.label || props.value
|
|
30
|
+
})
|
|
21
31
|
</script>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./src/type.ts";
|
|
2
|
-
export default "./src/index.ts";
|
|
2
|
+
export { default as CDrawer } from "./src/index.ts";
|
package/components/form/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./src/type.ts";
|
|
2
|
-
export default "./src/index.ts";
|
|
2
|
+
export { default as CForm } from "./src/index.ts";
|
|
@@ -192,15 +192,17 @@ export default defineComponent({
|
|
|
192
192
|
...handleAttrs(),
|
|
193
193
|
...handleEvents(),
|
|
194
194
|
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
195
|
+
{
|
|
196
|
+
default: () => {
|
|
197
|
+
return options?.value?.map((item) => {
|
|
198
|
+
return h(ElOption, {
|
|
199
|
+
...item,
|
|
200
|
+
label: item.label,
|
|
201
|
+
value: item.value,
|
|
202
|
+
key: item.value,
|
|
203
|
+
});
|
|
202
204
|
});
|
|
203
|
-
}
|
|
205
|
+
},
|
|
204
206
|
},
|
|
205
207
|
);
|
|
206
208
|
},
|
package/components/index.ts
CHANGED
|
@@ -1,24 +1,8 @@
|
|
|
1
|
-
|
|
2
1
|
export * from "./table/index.ts";
|
|
3
|
-
export { default as CTable } from "./table/index.ts";
|
|
4
|
-
|
|
5
2
|
export * from "./form/index.ts";
|
|
6
|
-
export { default as CForm } from "./form/index.ts";
|
|
7
|
-
|
|
8
3
|
export * from "./pagination/index.ts";
|
|
9
|
-
export { default as CPagination } from "./pagination/index.ts";
|
|
10
|
-
|
|
11
|
-
export { default as CDialog } from "./dialog/index.ts";
|
|
12
4
|
export * from "./dialog/index.ts";
|
|
13
|
-
|
|
14
|
-
export { default as CDrawer } from "./drawer/index.ts";
|
|
15
5
|
export * from "./drawer/index.ts";
|
|
16
|
-
|
|
17
|
-
export { default as CSearch } from "./search/index.ts";
|
|
18
6
|
export * from "./search/index.ts";
|
|
19
|
-
|
|
20
|
-
export { default as CButton } from "./button/index.ts";
|
|
21
7
|
export * from "./button/index.ts";
|
|
22
|
-
|
|
23
|
-
// export { default as Table2 } from "./table2/index.ts";
|
|
24
|
-
// export * from "./table2/index.ts";
|
|
8
|
+
export * from "./dictLabel/index.ts";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./src/type.ts";
|
|
2
|
-
export default "./src/index.ts";
|
|
2
|
+
export { default as CPagination } from "./src/index.ts";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./src/type.ts";
|
|
2
|
-
export default "./src/index.tsx";
|
|
2
|
+
export { default as CSearch } from "./src/index.tsx";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./src/type.ts";
|
|
2
|
-
export default "./src/index.ts";
|
|
2
|
+
export { default as CTable } from "./src/index.ts";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
type ExtractPropTypes,
|
|
6
6
|
} from "vue";
|
|
7
7
|
import { ElTable, ElTableColumn } from "element-plus";
|
|
8
|
-
import
|
|
8
|
+
import { CDictLabel } from "@elementplus-kit/uikit";
|
|
9
9
|
import {
|
|
10
10
|
defaultAttrs,
|
|
11
11
|
tableSlots,
|
|
@@ -115,7 +115,7 @@ export default defineComponent({
|
|
|
115
115
|
type: "selection",
|
|
116
116
|
width: 50,
|
|
117
117
|
align: "center",
|
|
118
|
-
})
|
|
118
|
+
}),
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
if (props.showIndex) {
|
|
@@ -125,7 +125,7 @@ export default defineComponent({
|
|
|
125
125
|
type: "index",
|
|
126
126
|
width: 60,
|
|
127
127
|
align: "center",
|
|
128
|
-
})
|
|
128
|
+
}),
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -167,9 +167,10 @@ export default defineComponent({
|
|
|
167
167
|
} else if (isArray(item.options)) {
|
|
168
168
|
// column 字典数组
|
|
169
169
|
itemSlot["default"] = (scope: any) =>
|
|
170
|
-
h(
|
|
170
|
+
h(CDictLabel, {
|
|
171
171
|
options: item.options,
|
|
172
172
|
value: scope.row[item.prop],
|
|
173
|
+
stringify: true, // value 转换为字符串
|
|
173
174
|
});
|
|
174
175
|
}
|
|
175
176
|
|
|
@@ -188,8 +189,8 @@ export default defineComponent({
|
|
|
188
189
|
h(
|
|
189
190
|
ElTableColumn,
|
|
190
191
|
{ ...p, class: "c-table-column" },
|
|
191
|
-
getColumnContent()
|
|
192
|
-
)
|
|
192
|
+
getColumnContent(),
|
|
193
|
+
),
|
|
193
194
|
);
|
|
194
195
|
} else {
|
|
195
196
|
const getColumnContent = () => {
|
|
@@ -204,8 +205,8 @@ export default defineComponent({
|
|
|
204
205
|
h(
|
|
205
206
|
ElTableColumn,
|
|
206
207
|
{ ...p, class: "c-table-column" },
|
|
207
|
-
getColumnContent()
|
|
208
|
-
)
|
|
208
|
+
getColumnContent(),
|
|
209
|
+
),
|
|
209
210
|
);
|
|
210
211
|
}
|
|
211
212
|
});
|
|
@@ -241,7 +242,7 @@ export default defineComponent({
|
|
|
241
242
|
{
|
|
242
243
|
default: () => columnList,
|
|
243
244
|
...getSlots(),
|
|
244
|
-
}
|
|
245
|
+
},
|
|
245
246
|
);
|
|
246
247
|
};
|
|
247
248
|
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
{{ label }}
|
|
3
3
|
</template>
|
|
4
4
|
<script setup lang="ts">
|
|
5
|
-
import { computed, PropType } from 'vue'
|
|
5
|
+
import { computed, type PropType } from 'vue'
|
|
6
6
|
const props = defineProps({
|
|
7
7
|
options: {
|
|
8
|
-
type: Array
|
|
8
|
+
type: Array as PropType<{ value: string; label: string }[]>,
|
|
9
9
|
default: () => []
|
|
10
10
|
},
|
|
11
11
|
value: {
|
|
12
|
-
type: String as PropType<any>,
|
|
13
12
|
default: ''
|
|
14
13
|
},
|
|
15
14
|
})
|