kui-vue 3.6.1 → 3.6.3
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/demo/size.md +1 -1
- package/components/card/card.jsx +19 -9
- package/components/card/demo/basic.md +3 -3
- package/components/card/demo/border.md +1 -7
- package/components/card/demo/index.jsx +9 -7
- package/components/card/demo/notitle.md +23 -0
- package/components/card/styles/index.less +5 -3
- package/components/checkbox/checkbox.jsx +17 -16
- package/components/checkbox/checkboxGroup.jsx +1 -1
- package/components/checkbox/styles/index.less +1 -0
- package/components/collapse/collapse.jsx +9 -10
- package/components/collapse/demo/accordion.md +2 -2
- package/components/collapse/demo/basic.md +2 -2
- package/components/collapse/demo/extra.md +2 -2
- package/components/collapse/demo/nesting.md +4 -4
- package/components/collapse/demo/sample.md +2 -2
- package/components/collapse/index.md +6 -6
- package/components/collapse/styles/index.less +2 -2
- package/components/colorPicker/demo/basic.md +14 -2
- package/components/colorPicker/demo/index.jsx +0 -8
- package/components/colorPicker/demo/size.md +24 -10
- package/components/colorPicker/mode.jsx +1 -1
- package/components/components.js +3 -0
- package/components/datePicker/demo/size.md +1 -1
- package/components/drawer/demo/target.md +2 -2
- package/components/dropdown/demo/basic.md +1 -1
- package/components/dropdown/dropdownButton.jsx +18 -7
- package/components/dropdown/styles/index.less +1 -0
- package/components/empty/demo/basic.md +1 -3
- package/components/empty/demo/nodesc.md +1 -3
- package/components/empty/demo/used.md +4 -6
- package/components/empty/empty.jsx +19 -17
- package/components/empty/styles/index.less +18 -5
- package/components/flex/demo/size.md +14 -5
- package/components/form/demo/align.md +10 -10
- package/components/form/demo/customvalid.md +1 -1
- package/components/form/demo/dynamicvalid.md +1 -1
- package/components/form/demo/length.md +1 -13
- package/components/form/demo/valid.md +11 -3
- package/components/form/form.jsx +2 -2
- package/components/form/formitem.jsx +1 -1
- package/components/image/preview.jsx +1 -1
- package/components/input/demo/basic.md +1 -1
- package/components/input/demo/group.md +1 -1
- package/components/input/input.jsx +19 -15
- package/components/input/inputBox.jsx +2 -2
- package/components/inputNumber/demo/basic.md +1 -0
- package/components/inputNumber/demo/format.md +3 -8
- package/components/inputNumber/inputNumber.jsx +116 -139
- package/components/inputNumber/styles/index.less +3 -3
- package/components/layout/demo/layout5.md +0 -1
- package/components/locale/de.js +1 -0
- package/components/locale/el.js +1 -0
- package/components/locale/en.js +1 -0
- package/components/locale/fr.js +1 -0
- package/components/locale/it.js +1 -0
- package/components/locale/ja.js +1 -0
- package/components/locale/ko.js +1 -0
- package/components/locale/ru.js +1 -0
- package/components/locale/th.js +1 -0
- package/components/locale/uk.js +1 -0
- package/components/locale/vi.js +1 -0
- package/components/locale/zh-CN.js +1 -0
- package/components/locale/zh-TW.js +1 -0
- package/components/menu/demo/collapsed.md +9 -9
- package/components/menu/index.md +1 -0
- package/components/message/demo/close.md +1 -1
- package/components/message/group.jsx +13 -6
- package/components/message/index.md +1 -1
- package/components/message/inner.jsx +26 -7
- package/components/notice/demo/close.md +1 -1
- package/components/notice/index.md +1 -1
- package/components/page/styles/index.less +7 -1
- package/components/popconfirm/popconfirm.jsx +14 -16
- package/components/progress/progress.jsx +1 -1
- package/components/radio/radio.jsx +14 -11
- package/components/radio/radioButton.jsx +1 -1
- package/components/radio/radioGroup.jsx +1 -1
- package/components/rate/demo/basic.md +12 -2
- package/components/rate/demo/character.md +16 -2
- package/components/rate/demo/index.jsx +0 -8
- package/components/rate/demo/tips.md +15 -5
- package/components/rate/rate.jsx +30 -6
- package/components/rate/star.jsx +20 -5
- package/components/select/demo/size.md +1 -1
- package/components/select/select.jsx +5 -4
- package/components/slider/demo/vertical.md +2 -1
- package/components/slider/demo/withNumber.md +0 -2
- package/components/slider/index.md +2 -3
- package/components/slider/slider.jsx +296 -291
- package/components/slider/styles/index.less +11 -12
- package/components/slider/thumb.jsx +70 -148
- package/components/space/styles/index.less +3 -1
- package/components/spin/demo/container.md +1 -1
- package/components/spin/demo/mode.md +1 -1
- package/components/spin/index.md +6 -5
- package/components/statCard/countup.js +254 -0
- package/components/statCard/countup.jsx +45 -0
- package/components/statCard/demo/basic.md +31 -0
- package/components/statCard/demo/card.md +40 -0
- package/components/statCard/demo/index.jsx +19 -0
- package/components/statCard/demo/info.md +9 -0
- package/components/statCard/demo/with-card.md +43 -0
- package/components/statCard/index.js +3 -0
- package/components/statCard/index.md +28 -0
- package/components/statCard/rollup.jsx +64 -0
- package/components/statCard/statCard.jsx +42 -0
- package/components/statCard/statNumber.jsx +53 -0
- package/components/statCard/styles/index.less +76 -0
- package/components/styles/color.less +4 -2
- package/components/styles/index.less +1 -0
- package/components/styles/sys.less +2 -3
- package/components/styles/var.less +1 -0
- package/components/switch/switch.jsx +1 -3
- package/components/table/demo/col-row-span.md +1 -1
- package/components/table/demo/fixed-col-head.md +1 -1
- package/components/table/demo/head-span.md +2 -2
- package/components/table/demo/size.md +2 -2
- package/components/table/demo/table-check.md +11 -1
- package/components/table/index.md +13 -12
- package/components/table/styles/index.less +67 -58
- package/components/table/table.jsx +7 -5
- package/components/tabs/demo/sample.md +1 -8
- package/components/tabs/index.md +9 -9
- package/components/tabs/tabs.jsx +7 -5
- package/components/tooltip/tooltip.jsx +13 -8
- package/components/treeselect/demo/basic.md +11 -8
- package/components/treeselect/demo/size.md +4 -3
- package/components/treeselect/demo/theme.md +0 -1
- package/components/treeselect/treeselect.jsx +5 -3
- package/components/upload/demo/custom.md +5 -2
- package/components/upload/demo/exceed.md +1 -1
- package/components/upload/demo/pictures.md +14 -0
- package/components/upload/fileList.jsx +24 -47
- package/components/upload/index.md +13 -4
- package/components/upload/selector.jsx +37 -117
- package/components/upload/styles/index.less +2 -3
- package/components/upload/upload.jsx +189 -117
- package/components/utils/number.js +79 -65
- package/components/utils/placement.js +62 -35
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +172 -129
- package/dist/k-ui.esm.js +2 -2
- package/dist/k-ui.umd.js +2 -2
- package/dist/locale/de.js +2 -2
- package/dist/locale/el.js +2 -2
- package/dist/locale/en.js +2 -2
- package/dist/locale/fr.js +2 -2
- package/dist/locale/it.js +2 -2
- package/dist/locale/ja.js +2 -2
- package/dist/locale/ko.js +2 -2
- package/dist/locale/ru.js +2 -2
- package/dist/locale/th.js +2 -2
- package/dist/locale/ua.js +1 -1
- package/dist/locale/uk.js +2 -2
- package/dist/locale/vi.js +2 -2
- package/dist/locale/zh-CN.js +2 -2
- package/dist/locale/zh-TW.js +2 -2
- package/package.json +3 -1
- package/types/checkbox/Checkbox.d.ts +1 -1
- package/types/collapse/Collapse.d.ts +1 -1
- package/types/index.d.ts +14 -10
- package/types/popconfirm/Popconfirm.d.ts +1 -0
- package/types/radio/Radio.d.ts +1 -1
- package/types/radio/RadioButton.d.ts +1 -1
- package/types/rate/Rate.d.ts +1 -1
- package/types/slider/Slider.d.ts +7 -6
- package/types/statCard/StatCard.d.ts +20 -0
- package/types/statCard/StatNumber.d.ts +26 -0
- package/types/switch/Switch.d.ts +1 -2
- package/types/table/Table.d.ts +1 -0
- package/types/tooltip/Tooltip.d.ts +1 -0
- package/components/base/collapse.jsx +0 -15
- package/components/base/input.jsx +0 -210
- package/components/colorPicker/demo/disabled.md +0 -16
- package/components/colorPicker/demo/disabledAlpha.md +0 -13
- package/components/colorPicker/demo/mode.md +0 -21
- package/components/colorPicker/demo/presets.md +0 -17
- package/components/rate/demo/clear.md +0 -13
- package/components/rate/demo/custom.md +0 -23
- package/components/rate/demo/disabled.md +0 -12
- package/components/rate/demo/half.md +0 -12
- package/components/utils/element.js +0 -122
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
9
|
-
Select:
|
|
8
|
+
<Space vertical block>
|
|
9
|
+
Select:
|
|
10
10
|
<Select :width="220" />
|
|
11
|
-
|
|
12
|
-
<br />
|
|
13
|
-
Table: <br /><br />
|
|
11
|
+
Table:
|
|
14
12
|
<Table :data="[]" :columns="columns" />
|
|
15
|
-
</
|
|
13
|
+
</Space>
|
|
16
14
|
</template>
|
|
17
15
|
<script setup>
|
|
18
16
|
const columns = [{ title: "Name" }, { title: "Age" }];
|
|
@@ -23,23 +23,25 @@ const Empty = defineComponent({
|
|
|
23
23
|
let { image, imageStyle, description } = ps;
|
|
24
24
|
return (
|
|
25
25
|
<div class="k-empty">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
slots.image(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
<div class="k-empty-content">
|
|
27
|
+
{!image && !slots.image ? (
|
|
28
|
+
<Icon type={FileTrayOutline} class="k-empty-icon" />
|
|
29
|
+
) : slots.image ? (
|
|
30
|
+
slots.image()
|
|
31
|
+
) : (
|
|
32
|
+
<img src={image} class="k-empty-image" style={imageStyle} />
|
|
33
|
+
)}
|
|
34
|
+
{description !== null ? (
|
|
35
|
+
<p class="k-empty-description">
|
|
36
|
+
{description ||
|
|
37
|
+
slots.description?.() ||
|
|
38
|
+
locale?.value.k.empty.description}
|
|
39
|
+
</p>
|
|
40
|
+
) : null}
|
|
41
|
+
{slots.default ? (
|
|
42
|
+
<div class="k-empty-footer">{slots.default()}</div>
|
|
43
|
+
) : null}
|
|
44
|
+
</div>
|
|
43
45
|
</div>
|
|
44
46
|
);
|
|
45
47
|
};
|
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import "../../styles/var.less";
|
|
2
2
|
|
|
3
3
|
.k-empty {
|
|
4
4
|
text-align: center;
|
|
5
5
|
color: var(--kui-color-gray-60);
|
|
6
6
|
font-size: 13px;
|
|
7
|
-
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
.k-empty-content {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: 10px;
|
|
17
|
+
margin: 20px 0;
|
|
18
|
+
}
|
|
8
19
|
// cursor: not-allowed;
|
|
9
20
|
.k-empty-icon {
|
|
10
21
|
font-size: 40px;
|
|
11
|
-
padding:
|
|
22
|
+
padding: 0;
|
|
23
|
+
margin: 0;
|
|
12
24
|
|
|
13
25
|
path {
|
|
14
26
|
stroke-width: 15px !important;
|
|
@@ -16,12 +28,13 @@
|
|
|
16
28
|
}
|
|
17
29
|
|
|
18
30
|
.k-empty-description {
|
|
19
|
-
padding
|
|
31
|
+
padding: 0;
|
|
20
32
|
line-height: 1.5;
|
|
33
|
+
margin: 0;
|
|
21
34
|
}
|
|
22
35
|
|
|
23
36
|
.k-empty-footer {
|
|
24
37
|
margin-top: 20px;
|
|
25
38
|
text-align: center;
|
|
26
39
|
}
|
|
27
|
-
}
|
|
40
|
+
}
|
|
@@ -6,13 +6,19 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<Flex vertical size="middle">
|
|
9
|
-
<RadioGroup v-model="flexSize">
|
|
9
|
+
<RadioGroup v-model="flexSize" @change="changeSize">
|
|
10
10
|
<Radio value="small" label="small" />
|
|
11
11
|
<Radio value="middle" label="middle" />
|
|
12
12
|
<Radio value="large" label="large" />
|
|
13
13
|
</RadioGroup>
|
|
14
|
-
<Checkbox v-model="
|
|
15
|
-
<Slider
|
|
14
|
+
<Checkbox v-model="isCustomize" label="customize" />
|
|
15
|
+
<Slider
|
|
16
|
+
v-model="customize"
|
|
17
|
+
:step="1"
|
|
18
|
+
:max="50"
|
|
19
|
+
v-if="isCustomize"
|
|
20
|
+
@change="changeSize"
|
|
21
|
+
/>
|
|
16
22
|
<Flex :size="flexSize">
|
|
17
23
|
<Button type="primary">Primary</Button>
|
|
18
24
|
<Button>Default</Button>
|
|
@@ -24,7 +30,10 @@
|
|
|
24
30
|
<script setup>
|
|
25
31
|
import { ref } from "vue";
|
|
26
32
|
const flexSize = ref("small");
|
|
27
|
-
const
|
|
28
|
-
const
|
|
33
|
+
const customize = ref(8);
|
|
34
|
+
const isCustomize = ref(false);
|
|
35
|
+
const changeSize = (value) => {
|
|
36
|
+
flexSize.value = value;
|
|
37
|
+
};
|
|
29
38
|
</script>
|
|
30
39
|
```
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div>
|
|
9
|
-
<Form :layout="layout" :labelCol="{span:5}" :wrapperCol="{span:6}">
|
|
9
|
+
<Form :layout="layout" :labelCol="{ span: 5 }" :wrapperCol="{ span: 6 }">
|
|
10
10
|
<FormItem label="Layout">
|
|
11
|
-
<RadioGroup v-model="layout">
|
|
11
|
+
<RadioGroup v-model="layout" type="button">
|
|
12
12
|
<RadioButton value="horizontal" label="horizontal" />
|
|
13
13
|
<RadioButton value="vertical" label="vertical" />
|
|
14
14
|
<RadioButton value="inline" label="inline" />
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<Input />
|
|
19
19
|
</FormItem>
|
|
20
20
|
<FormItem label="Select">
|
|
21
|
-
<Select
|
|
21
|
+
<Select style="width:100%">
|
|
22
22
|
<Option value="0" label="Apple" />
|
|
23
23
|
<Option value="1" label="Banana" />
|
|
24
24
|
<Option value="2" label="Orange" />
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
<FormItem label="DatePicker">
|
|
28
28
|
<DatePicker />
|
|
29
29
|
</FormItem>
|
|
30
|
-
<FormItem :wrapperCol="{offset:5}">
|
|
30
|
+
<FormItem :wrapperCol="{ offset: 5 }">
|
|
31
31
|
<Button type="primary">Submit</Button>
|
|
32
32
|
</FormItem>
|
|
33
33
|
</Form>
|
|
34
34
|
</div>
|
|
35
35
|
</template>
|
|
36
36
|
<script>
|
|
37
|
-
export default{
|
|
37
|
+
export default {
|
|
38
38
|
data() {
|
|
39
39
|
return {
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
40
|
+
layout: "horizontal",
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
44
|
</script>
|
|
45
|
-
```
|
|
45
|
+
```
|
|
@@ -78,7 +78,7 @@ const rules = {
|
|
|
78
78
|
};
|
|
79
79
|
const submit = () => {
|
|
80
80
|
formRef.value.validate((valid) => {
|
|
81
|
-
message[valid ? "success" : "error"](valid ? "success" : "
|
|
81
|
+
message[valid ? "success" : "error"](valid ? "success" : "failed");
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
const reset = () => {
|
|
@@ -97,7 +97,7 @@ form.value.webs.splice(index, 1);
|
|
|
97
97
|
};
|
|
98
98
|
const submit = () => {
|
|
99
99
|
formRef.value.validate((valid) => {
|
|
100
|
-
message[valid ? "success" : "error"](valid ? "success" : "
|
|
100
|
+
message[valid ? "success" : "error"](valid ? "success" : "failed");
|
|
101
101
|
});
|
|
102
102
|
};
|
|
103
103
|
const reset = () => {
|
|
@@ -144,20 +144,8 @@ const setValue = () => {
|
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
const sendCode = () => {
|
|
148
|
-
message.success("验证码发送成功,请注意查收");
|
|
149
|
-
clearInterval(timer.value);
|
|
150
|
-
timer.value = setInterval((e) => {
|
|
151
|
-
if (time.value < 1) {
|
|
152
|
-
clearInterval(timer.value);
|
|
153
|
-
time.value = 60;
|
|
154
|
-
} else {
|
|
155
|
-
time.value -= 1;
|
|
156
|
-
}
|
|
157
|
-
}, 1000);
|
|
158
|
-
};
|
|
159
147
|
const submit = ({ valid, model }) => {
|
|
160
|
-
message[valid ? "success" : "error"](valid ? "success" : "
|
|
148
|
+
message[valid ? "success" : "error"](valid ? "success" : "failed");
|
|
161
149
|
console.log(model);
|
|
162
150
|
};
|
|
163
151
|
</script>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
:wrapperCol="wrapperCol"
|
|
16
16
|
>
|
|
17
17
|
<FormItem label="Size">
|
|
18
|
-
<RadioGroup v-model="size">
|
|
18
|
+
<RadioGroup v-model="size" type="button">
|
|
19
19
|
<RadioButton value="large" label="Large" />
|
|
20
20
|
<RadioButton value="default" label="Default" />
|
|
21
21
|
<RadioButton value="small" label="Small" />
|
|
@@ -69,6 +69,9 @@
|
|
|
69
69
|
<FormItem label="Slider" prop="slider">
|
|
70
70
|
<Slider />
|
|
71
71
|
</FormItem>
|
|
72
|
+
<FormItem label="Rate" prop="rate">
|
|
73
|
+
<Rate />
|
|
74
|
+
</FormItem>
|
|
72
75
|
<FormItem label="Gender" prop="gender">
|
|
73
76
|
<RadioGroup>
|
|
74
77
|
<Radio value="0" label="Girl" />
|
|
@@ -79,7 +82,7 @@
|
|
|
79
82
|
<Radio label="Only One?" />
|
|
80
83
|
</FormItem>
|
|
81
84
|
<FormItem label="System" prop="system">
|
|
82
|
-
<RadioGroup>
|
|
85
|
+
<RadioGroup type="button">
|
|
83
86
|
<RadioButton value="0" label="Mac OS" />
|
|
84
87
|
<RadioButton value="1" label="Windows" />
|
|
85
88
|
<RadioButton value="2" label="Linux" />
|
|
@@ -152,6 +155,7 @@ const form = ref({
|
|
|
152
155
|
phone: "",
|
|
153
156
|
captcha: "",
|
|
154
157
|
slider: 5,
|
|
158
|
+
rate: 0,
|
|
155
159
|
tree: "",
|
|
156
160
|
gender: "",
|
|
157
161
|
one: false,
|
|
@@ -199,6 +203,10 @@ const rules = {
|
|
|
199
203
|
{ max: 50, message: "最大值为50" },
|
|
200
204
|
],
|
|
201
205
|
gender: [{ required: true, message: "请选择性别" }],
|
|
206
|
+
rate: [
|
|
207
|
+
{ required: true, message: "请选择评分" },
|
|
208
|
+
{ min: 1, message: "评分最小1分" },
|
|
209
|
+
],
|
|
202
210
|
one: [{ required: true, message: "霸王选项" }],
|
|
203
211
|
system: [{ required: true, message: "请选择系统类型" }],
|
|
204
212
|
hardcore: [{ required: true, message: "霸王选项" }],
|
|
@@ -250,7 +258,7 @@ const sendCode = () => {
|
|
|
250
258
|
};
|
|
251
259
|
const submit = () => {
|
|
252
260
|
formRef.value.validate((valid) => {
|
|
253
|
-
message[valid ? "success" : "error"](valid ? "success" : "
|
|
261
|
+
message[valid ? "success" : "error"](valid ? "success" : "failed");
|
|
254
262
|
});
|
|
255
263
|
};
|
|
256
264
|
const reset = () => {
|
package/components/form/form.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// form.vue 或 form.jsx
|
|
2
2
|
import { defineComponent, ref, provide, watch, toRefs, reactive } from "vue";
|
|
3
|
-
import { getChildren } from "../utils/
|
|
3
|
+
import { getChildren } from "../utils/vnode";
|
|
4
4
|
import { cloneVNode, withInstall } from "../utils/vue";
|
|
5
5
|
|
|
6
6
|
const Form = defineComponent({
|
|
@@ -39,7 +39,7 @@ const Form = defineComponent({
|
|
|
39
39
|
const { model, rules, size, shape, theme, disabled, layout, name } =
|
|
40
40
|
toRefs(props);
|
|
41
41
|
|
|
42
|
-
const updateMode = (prop, value =
|
|
42
|
+
const updateMode = (prop, value = null) => {
|
|
43
43
|
const keys = prop
|
|
44
44
|
.replace(/\[(\w+)\]/g, ".$1")
|
|
45
45
|
.replace(/^\./, "")
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
computed,
|
|
10
10
|
} from "vue";
|
|
11
11
|
import { Row, Col } from "../grid";
|
|
12
|
-
import { getChildren } from "../utils/
|
|
12
|
+
import { getChildren } from "../utils/vnode";
|
|
13
13
|
import { cloneVNode, isVNode } from "../utils/vue";
|
|
14
14
|
import zhCN from "../locale/zh-CN";
|
|
15
15
|
|
|
@@ -6,6 +6,7 @@ import { defineComponent, ref, nextTick, watch, inject, provide } from "vue";
|
|
|
6
6
|
import { withInstall } from "../utils/vue";
|
|
7
7
|
import InputBox from "./inputBox";
|
|
8
8
|
import { sizeMap, filterSize } from "../utils/size";
|
|
9
|
+
import { getChildren } from "../utils/vnode";
|
|
9
10
|
|
|
10
11
|
const Input = defineComponent({
|
|
11
12
|
name: "Input",
|
|
@@ -86,8 +87,8 @@ const Input = defineComponent({
|
|
|
86
87
|
const togglePassword = (e) => {
|
|
87
88
|
if (ps.disabled) return;
|
|
88
89
|
showPassword.value = !showPassword.value;
|
|
89
|
-
let type = showPassword.value ? "text" : "password";
|
|
90
|
-
inputRef.value.type = type;
|
|
90
|
+
// let type = showPassword.value ? "text" : "password";
|
|
91
|
+
// inputRef.value.type = type;
|
|
91
92
|
};
|
|
92
93
|
|
|
93
94
|
const searchEvent = (e) => {
|
|
@@ -132,19 +133,20 @@ const Input = defineComponent({
|
|
|
132
133
|
shape,
|
|
133
134
|
inputType,
|
|
134
135
|
} = ps;
|
|
135
|
-
const slotSuffix = slots.suffix?.();
|
|
136
|
-
const slotPrefix = slots.prefix?.();
|
|
136
|
+
const slotSuffix = getChildren(slots.suffix?.());
|
|
137
|
+
const slotPrefix = getChildren(slots.prefix?.());
|
|
138
|
+
const slotControls = getChildren(slots.controls?.());
|
|
137
139
|
let multiple =
|
|
138
140
|
(icon ||
|
|
139
141
|
// attrs.onSearch ||
|
|
140
142
|
"search" in listeners ||
|
|
141
|
-
slotSuffix ||
|
|
143
|
+
slotSuffix.length > 0 ||
|
|
142
144
|
suffix ||
|
|
143
|
-
slotPrefix ||
|
|
145
|
+
slotPrefix.length > 0 ||
|
|
144
146
|
prefix ||
|
|
145
147
|
type == "password" ||
|
|
146
148
|
clearable ||
|
|
147
|
-
|
|
149
|
+
slotControls.length > 0) &&
|
|
148
150
|
type !== "hidden";
|
|
149
151
|
const inputProps = {
|
|
150
152
|
attrs: { ...attrs },
|
|
@@ -158,7 +160,7 @@ const Input = defineComponent({
|
|
|
158
160
|
inputRef: inputRef,
|
|
159
161
|
inputType,
|
|
160
162
|
value: currentValue.value,
|
|
161
|
-
showPassword:
|
|
163
|
+
showPassword: showPassword.value,
|
|
162
164
|
},
|
|
163
165
|
on: {
|
|
164
166
|
...listeners,
|
|
@@ -180,9 +182,11 @@ const Input = defineComponent({
|
|
|
180
182
|
let textInput = <InputBox {...inputProps} />;
|
|
181
183
|
|
|
182
184
|
if (!multiple) return textInput;
|
|
183
|
-
|
|
184
185
|
let clearableShow =
|
|
185
|
-
clearable &&
|
|
186
|
+
clearable &&
|
|
187
|
+
!isEmpty(currentValue.value) &&
|
|
188
|
+
type != "password" &&
|
|
189
|
+
attrs.readonly === undefined;
|
|
186
190
|
const props = {
|
|
187
191
|
class: {
|
|
188
192
|
[`k-${inputType}`]: true,
|
|
@@ -197,9 +201,9 @@ const Input = defineComponent({
|
|
|
197
201
|
};
|
|
198
202
|
// const prefixNode = prefix ? <div class={`k-input-prefix`}>{prefix}</div> : null;
|
|
199
203
|
|
|
200
|
-
if (slotPrefix || slotSuffix) {
|
|
204
|
+
if (slotPrefix.length || slotSuffix.length) {
|
|
201
205
|
const preChildren = [];
|
|
202
|
-
if (slotPrefix)
|
|
206
|
+
if (slotPrefix.length)
|
|
203
207
|
preChildren.push(
|
|
204
208
|
<div class="k-input-group-prefix">{slotPrefix}</div>
|
|
205
209
|
);
|
|
@@ -229,12 +233,12 @@ const Input = defineComponent({
|
|
|
229
233
|
/>
|
|
230
234
|
);
|
|
231
235
|
const sufChildren = [];
|
|
232
|
-
if (slotSuffix)
|
|
236
|
+
if (slotSuffix.length)
|
|
233
237
|
sufChildren.push(
|
|
234
238
|
<div class="k-input-group-suffix">{slotSuffix}</div>
|
|
235
239
|
);
|
|
236
240
|
|
|
237
|
-
if (
|
|
241
|
+
if (slotControls.length) innerChildren.push(slotControls);
|
|
238
242
|
return (
|
|
239
243
|
<InputGroup size={size}>
|
|
240
244
|
{preChildren}
|
|
@@ -270,7 +274,7 @@ const Input = defineComponent({
|
|
|
270
274
|
/>
|
|
271
275
|
);
|
|
272
276
|
if (suffixNode) children.push(suffixNode);
|
|
273
|
-
if (
|
|
277
|
+
if (slotControls.length) children.push(slotControls);
|
|
274
278
|
|
|
275
279
|
return (
|
|
276
280
|
<div {...props} mult>
|
|
@@ -60,8 +60,8 @@ export default defineComponent({
|
|
|
60
60
|
// onBlur: handleBlur,
|
|
61
61
|
// onInput: handleInput,
|
|
62
62
|
};
|
|
63
|
-
if (
|
|
64
|
-
props.type = "text";
|
|
63
|
+
if (ps.showPassword === true && type == "password") {
|
|
64
|
+
props.attrs.type = "text";
|
|
65
65
|
}
|
|
66
66
|
return <input {...props} single />;
|
|
67
67
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<cn>
|
|
2
|
-
### 高精度小数/格式化展示
|
|
3
|
-
通过 formatter 格式化数字,以展示具有具体含义的数据,往往需要配合 parser 一起使用。
|
|
2
|
+
### 高精度小数/格式化展示
|
|
3
|
+
通过 formatter 格式化数字,以展示具有具体含义的数据,往往需要配合 parser 一起使用。
|
|
4
4
|
</cn>
|
|
5
5
|
|
|
6
6
|
```vue
|
|
@@ -9,12 +9,7 @@
|
|
|
9
9
|
<code> 0.1+0.2 = 0.3 (yes) ,输出:{{ n }}</code>
|
|
10
10
|
<InputNumber :step="0.2" v-model="n" />
|
|
11
11
|
<code>步长为 0.00000000000001 ,输出:{{ n1 }}</code>
|
|
12
|
-
<InputNumber
|
|
13
|
-
v-model="n1"
|
|
14
|
-
:min="0"
|
|
15
|
-
:max="10"
|
|
16
|
-
:step="0.00000000000001"
|
|
17
|
-
/>
|
|
12
|
+
<InputNumber v-model="n1" :min="0" :max="10" :step="0.00000000000001" />
|
|
18
13
|
<code>保留2位小数, 输出:{{ n3 }}</code>
|
|
19
14
|
<InputNumber :precision="2" v-model="n3" />
|
|
20
15
|
<code> 货币,千分位,输出: {{ n4 }}</code>
|