kui-vue 3.6.0 → 3.6.2
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/{readme.md → README.md} +4 -10
- package/components/button/demo/group.md +1 -1
- package/components/button/demo/size.md +1 -1
- package/components/card/card.jsx +1 -1
- package/components/checkbox/checkbox.jsx +17 -16
- package/components/checkbox/checkboxGroup.jsx +5 -5
- package/components/checkbox/demo/group.md +17 -6
- package/components/checkbox/styles/index.less +4 -11
- 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/colorPicker/colorpicker.jsx +5 -6
- package/components/colorPicker/demo/basic.md +14 -2
- package/components/colorPicker/demo/customTrigger.md +2 -2
- package/components/colorPicker/demo/index.jsx +0 -8
- package/components/colorPicker/demo/size.md +24 -10
- package/components/datePicker/datepicker.jsx +19 -11
- package/components/datePicker/demo/basic.md +15 -6
- package/components/datePicker/demo/lang.md +2 -2
- package/components/datePicker/demo/size.md +1 -1
- package/components/drawer/drawer.jsx +2 -2
- package/components/dropdown/dropdown.jsx +9 -40
- package/components/dropdown/dropdownButton.jsx +18 -7
- 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/form/demo/align.md +10 -10
- package/components/form/demo/valid.md +3 -2
- package/components/form/form.jsx +1 -1
- package/components/form/formitem.jsx +1 -1
- package/components/image/image.jsx +1 -0
- 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/index.md +1 -1
- package/components/input/input.jsx +7 -5
- package/components/input/inputBox.jsx +2 -2
- package/components/inputNumber/demo/basic.md +12 -5
- package/components/inputNumber/demo/format.md +0 -5
- package/components/inputNumber/index.md +1 -1
- package/components/inputNumber/inputNumber.jsx +3 -5
- package/components/inputNumber/styles/index.less +64 -64
- package/components/menu/submenu.jsx +5 -5
- package/components/message/demo/close.md +1 -1
- package/components/message/group.jsx +2 -2
- 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/page.jsx +0 -1
- package/components/page/styles/index.less +7 -1
- package/components/popconfirm/popconfirm.jsx +18 -20
- package/components/poptip/poptip.jsx +4 -4
- package/components/progress/progress.jsx +1 -1
- package/components/radio/demo/group.md +16 -6
- package/components/radio/demo/radioButton.md +3 -8
- package/components/radio/radio.jsx +14 -11
- package/components/radio/radioButton.jsx +1 -1
- package/components/radio/radioGroup.jsx +9 -12
- package/components/radio/styles/index.less +10 -21
- 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 +24 -5
- package/components/select/demo/basic.md +16 -7
- package/components/select/demo/filterable.md +4 -2
- package/components/select/demo/size.md +1 -1
- package/components/select/index.md +23 -22
- package/components/select/option.jsx +7 -3
- package/components/select/select.jsx +43 -37
- package/components/select/styles/index.less +1 -0
- package/components/slider/demo/basic.md +2 -1
- package/components/slider/demo/withNumber.md +3 -3
- package/components/slider/slider.jsx +0 -25
- package/components/space/styles/index.less +5 -1
- package/components/spin/index.md +6 -5
- package/components/styles/sys.less +3 -0
- package/components/switch/switch.jsx +13 -5
- package/components/table/demo/size.md +1 -1
- package/components/table/styles/index.less +10 -5
- package/components/table/table.jsx +98 -69
- package/components/tabs/tabs.jsx +1 -1
- package/components/tooltip/tooltip.jsx +16 -11
- package/components/treeselect/demo/basic.md +11 -8
- package/components/treeselect/demo/size.md +6 -5
- package/components/treeselect/demo/theme.md +0 -1
- package/components/treeselect/treeselect.jsx +15 -20
- package/components/upload/upload.jsx +0 -1
- package/components/utils/placement.js +162 -124
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +131 -127
- package/dist/k-ui.esm.js +2 -2
- package/dist/k-ui.umd.js +2 -2
- package/dist/locale/de.js +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/ua.js +2 -2
- package/dist/locale/uk.js +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/zh-CN.js +1 -1
- package/dist/locale/zh-TW.js +1 -1
- package/package.json +5 -5
- package/test/i18n@8.x.html +6 -2
- package/types/checkbox/Checkbox.d.ts +1 -1
- package/types/collapse/Collapse.d.ts +1 -1
- package/types/image/KImage.d.ts +1 -0
- package/types/index.d.ts +12 -12
- 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/switch/Switch.d.ts +2 -1
- 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 -24
- 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/steps/index.js +0 -4
- package/components/steps/step.vue +0 -82
- package/components/steps/steps.vue +0 -68
- package/components/steps/styles/index.less +0 -198
- package/components/utils/element.js +0 -122
|
@@ -6,15 +6,24 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<Space wrap vertical>
|
|
9
|
-
<
|
|
10
|
-
<DatePicker mode="
|
|
11
|
-
<
|
|
12
|
-
<DatePicker mode="
|
|
13
|
-
<
|
|
9
|
+
<code>v-model : {{ year }}</code>
|
|
10
|
+
<DatePicker mode="year" v-model="year"/>
|
|
11
|
+
<code>v-model : {{ month }}</code>
|
|
12
|
+
<DatePicker mode="month" v-model="month"/>
|
|
13
|
+
<code>v-model : {{ date }}</code>
|
|
14
|
+
<DatePicker mode="date" v-model="date"/>
|
|
15
|
+
<code>v-model : {{ time }}</code>
|
|
16
|
+
<DatePicker mode="time" v-model="time" />
|
|
17
|
+
<code>v-model : {{ datetime }}</code>
|
|
18
|
+
<DatePicker mode="dateTime" v-model="datetime" />
|
|
14
19
|
</Space>
|
|
15
20
|
</template>
|
|
16
21
|
<script setup>
|
|
17
22
|
import { ref } from "vue";
|
|
18
|
-
const
|
|
23
|
+
const datetime = ref("2021-01-01 20:20:20");
|
|
24
|
+
const time = ref("20:20:20");
|
|
25
|
+
const year = ref("2025");
|
|
26
|
+
const month = ref("2025-10");
|
|
27
|
+
const date = ref("2025-12-12");
|
|
19
28
|
</script>
|
|
20
29
|
```
|
|
@@ -186,9 +186,9 @@ const Drawer = defineComponent({
|
|
|
186
186
|
];
|
|
187
187
|
let styles = {};
|
|
188
188
|
if (placement == "left" || placement == "right")
|
|
189
|
-
styles.width =
|
|
189
|
+
styles.width = typeof width === "number" ? `${width}px` : width;
|
|
190
190
|
if (placement == "top" || placement == "bottom")
|
|
191
|
-
styles.height =
|
|
191
|
+
styles.height = typeof height === "number" ? `${height}px` : height;
|
|
192
192
|
|
|
193
193
|
let maskNode = null;
|
|
194
194
|
if (ps.mask) {
|
|
@@ -55,7 +55,7 @@ const Dropdown = defineComponent({
|
|
|
55
55
|
|
|
56
56
|
setup(ps, { slots, emit, attrs, listeners }) {
|
|
57
57
|
const visible = ref(ps.show);
|
|
58
|
-
const
|
|
58
|
+
const refSelection = ref(null);
|
|
59
59
|
const currentPlacement = ref(ps.placement);
|
|
60
60
|
const transOrigin = ref("bottom");
|
|
61
61
|
const refPopper = ref();
|
|
@@ -90,7 +90,7 @@ const Dropdown = defineComponent({
|
|
|
90
90
|
);
|
|
91
91
|
|
|
92
92
|
const outsideClick = (e) => {
|
|
93
|
-
const ctx =
|
|
93
|
+
const ctx = refSelection.value?.$el || refSelection.value;
|
|
94
94
|
if (!refPopper.value) return;
|
|
95
95
|
if (
|
|
96
96
|
(!refPopper.value.contains(e.target) &&
|
|
@@ -101,10 +101,12 @@ const Dropdown = defineComponent({
|
|
|
101
101
|
visible.value = false;
|
|
102
102
|
}
|
|
103
103
|
};
|
|
104
|
-
const updatePosition = () => {
|
|
104
|
+
const updatePosition = (e) => {
|
|
105
|
+
const position = e ? { x: e.clientX, y: e.clientY } : null;
|
|
105
106
|
nextTick(() => {
|
|
106
107
|
setPlacement({
|
|
107
|
-
|
|
108
|
+
refSelection,
|
|
109
|
+
position,
|
|
108
110
|
refPopper,
|
|
109
111
|
currentPlacement,
|
|
110
112
|
transOrigin,
|
|
@@ -113,39 +115,6 @@ const Dropdown = defineComponent({
|
|
|
113
115
|
});
|
|
114
116
|
});
|
|
115
117
|
};
|
|
116
|
-
const showContextmenu = (e) => {
|
|
117
|
-
if (!refPopper.value) return;
|
|
118
|
-
// todo : when the menu is opened, then resize the window at this time, the position is not accurate.
|
|
119
|
-
let pickerHeight = refPopper.value.offsetHeight;
|
|
120
|
-
let pickerWidth = refPopper.value.offsetWidth;
|
|
121
|
-
let clientHeight = document.documentElement.clientHeight;
|
|
122
|
-
let clientWidth = document.documentElement.clientWidth;
|
|
123
|
-
|
|
124
|
-
let offsetTop =
|
|
125
|
-
document.body.scrollTop ||
|
|
126
|
-
document.documentElement.scrollTop ||
|
|
127
|
-
window.scrollY;
|
|
128
|
-
let offsetLeft =
|
|
129
|
-
document.body.scrollLeft ||
|
|
130
|
-
document.documentElement.scrollLeft ||
|
|
131
|
-
window.scrollX;
|
|
132
|
-
let x = e.clientX + offsetLeft;
|
|
133
|
-
let y = e.clientY + offsetTop;
|
|
134
|
-
let showInRight = clientWidth - e.clientX > pickerWidth;
|
|
135
|
-
let showInBottom = clientHeight - e.clientY > pickerHeight;
|
|
136
|
-
let transformOrigin = "top center";
|
|
137
|
-
|
|
138
|
-
if (!showInRight) {
|
|
139
|
-
x -= pickerWidth;
|
|
140
|
-
}
|
|
141
|
-
if (!showInBottom) {
|
|
142
|
-
y -= pickerHeight;
|
|
143
|
-
transformOrigin = "bottom center";
|
|
144
|
-
}
|
|
145
|
-
left.value = x;
|
|
146
|
-
top.value = y;
|
|
147
|
-
transOrigin.value = transformOrigin;
|
|
148
|
-
};
|
|
149
118
|
const toggle = (open, e) => {
|
|
150
119
|
if (open) {
|
|
151
120
|
if (!rendered.value) {
|
|
@@ -154,12 +123,12 @@ const Dropdown = defineComponent({
|
|
|
154
123
|
nextTick(() => {
|
|
155
124
|
visible.value = true;
|
|
156
125
|
emit("update:visible", true);
|
|
157
|
-
|
|
126
|
+
updatePosition(e);
|
|
158
127
|
});
|
|
159
128
|
} else {
|
|
160
129
|
visible.value = true;
|
|
161
130
|
emit("update:visible", true);
|
|
162
|
-
|
|
131
|
+
updatePosition(e);
|
|
163
132
|
}
|
|
164
133
|
} else {
|
|
165
134
|
visible.value = false;
|
|
@@ -298,7 +267,7 @@ const Dropdown = defineComponent({
|
|
|
298
267
|
const ctxNode = cloneVNode(
|
|
299
268
|
nodes.length == 1 ? nodes[0] : <span>{nodes}</span>,
|
|
300
269
|
{
|
|
301
|
-
ref:
|
|
270
|
+
ref: refSelection,
|
|
302
271
|
...pp,
|
|
303
272
|
},
|
|
304
273
|
true,
|
|
@@ -4,7 +4,7 @@ import Dropdown from "./dropdown";
|
|
|
4
4
|
import TriggerButton from "./trigger";
|
|
5
5
|
import { defineComponent, ref, inject } from "vue";
|
|
6
6
|
import { Ellipsis } from "kui-icons";
|
|
7
|
-
import { withInstall } from
|
|
7
|
+
import { withInstall } from "../utils/vue";
|
|
8
8
|
const DropdownButton = defineComponent({
|
|
9
9
|
name: "DropdownButton",
|
|
10
10
|
props: {
|
|
@@ -17,7 +17,8 @@ const DropdownButton = defineComponent({
|
|
|
17
17
|
arrow: Boolean,
|
|
18
18
|
placement: { type: String, default: "bottom-right" },
|
|
19
19
|
},
|
|
20
|
-
|
|
20
|
+
emits: ["click"],
|
|
21
|
+
setup(ps, { slots, emit }) {
|
|
21
22
|
const refTrigger = ref();
|
|
22
23
|
return () => {
|
|
23
24
|
return (
|
|
@@ -35,21 +36,31 @@ const DropdownButton = defineComponent({
|
|
|
35
36
|
size={ps.size}
|
|
36
37
|
theme={ps.theme}
|
|
37
38
|
dark={ps.dark}
|
|
38
|
-
shape={ps.shape}
|
|
39
|
-
|
|
39
|
+
shape={ps.shape}
|
|
40
|
+
>
|
|
41
|
+
<Button
|
|
42
|
+
disabled={ps.disabled}
|
|
43
|
+
onClick={(e) => {
|
|
44
|
+
emit("click", e);
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
{slots.default?.()}
|
|
48
|
+
</Button>
|
|
40
49
|
<TriggerButton
|
|
41
50
|
disabled={ps.disabled}
|
|
42
51
|
ref={refTrigger}
|
|
43
52
|
icon={!slots.icon ? Ellipsis : null}
|
|
44
|
-
class="k-dropdown-trigger"
|
|
53
|
+
class="k-dropdown-trigger"
|
|
54
|
+
>
|
|
45
55
|
{slots.icon?.()}
|
|
46
56
|
</TriggerButton>
|
|
47
57
|
</ButtonGroup>
|
|
48
58
|
),
|
|
49
59
|
overlay: () => slots.overlay?.(),
|
|
50
|
-
}}
|
|
60
|
+
}}
|
|
61
|
+
></Dropdown>
|
|
51
62
|
);
|
|
52
63
|
};
|
|
53
64
|
},
|
|
54
65
|
});
|
|
55
|
-
export default withInstall(DropdownButton);
|
|
66
|
+
export default withInstall(DropdownButton);
|
|
@@ -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,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
|
+
```
|
|
@@ -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" />
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
<Radio label="Only One?" />
|
|
80
80
|
</FormItem>
|
|
81
81
|
<FormItem label="System" prop="system">
|
|
82
|
-
<RadioGroup>
|
|
82
|
+
<RadioGroup type="button">
|
|
83
83
|
<RadioButton value="0" label="Mac OS" />
|
|
84
84
|
<RadioButton value="1" label="Windows" />
|
|
85
85
|
<RadioButton value="2" label="Linux" />
|
|
@@ -131,6 +131,7 @@ const validateReadme = (rule, value, callback) => {
|
|
|
131
131
|
const labelCol = { span: 6 };
|
|
132
132
|
const wrapperCol = { span: 16 };
|
|
133
133
|
const time = ref(60);
|
|
134
|
+
const timer = ref(null);
|
|
134
135
|
const size = ref("default");
|
|
135
136
|
const formRef = ref(null);
|
|
136
137
|
const treeData = [
|
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({
|
|
@@ -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
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
| prefix | 扩展前缀 | String,Slot | - |
|
|
10
10
|
| search | 搜索事件的回调 | Function | right |
|
|
11
11
|
| theme | theme='light' 时呈现浅色主题 | String | right |
|
|
12
|
-
| clearable |
|
|
12
|
+
| clearable | 是否显示清除按钮 | Boolean | false |
|
|
13
13
|
| visiblePassword | 密码出事化明文显示 | Boolean | false |
|
|
14
14
|
| visiblePasswordIcon | 是否显示切换按钮或者控制密码显隐 | Boolean | true |
|
|
15
15
|
|
|
@@ -86,8 +86,8 @@ const Input = defineComponent({
|
|
|
86
86
|
const togglePassword = (e) => {
|
|
87
87
|
if (ps.disabled) return;
|
|
88
88
|
showPassword.value = !showPassword.value;
|
|
89
|
-
let type = showPassword.value ? "text" : "password";
|
|
90
|
-
inputRef.value.type = type;
|
|
89
|
+
// let type = showPassword.value ? "text" : "password";
|
|
90
|
+
// inputRef.value.type = type;
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
const searchEvent = (e) => {
|
|
@@ -158,7 +158,7 @@ const Input = defineComponent({
|
|
|
158
158
|
inputRef: inputRef,
|
|
159
159
|
inputType,
|
|
160
160
|
value: currentValue.value,
|
|
161
|
-
showPassword:
|
|
161
|
+
showPassword: showPassword.value,
|
|
162
162
|
},
|
|
163
163
|
on: {
|
|
164
164
|
...listeners,
|
|
@@ -180,9 +180,11 @@ const Input = defineComponent({
|
|
|
180
180
|
let textInput = <InputBox {...inputProps} />;
|
|
181
181
|
|
|
182
182
|
if (!multiple) return textInput;
|
|
183
|
-
|
|
184
183
|
let clearableShow =
|
|
185
|
-
clearable &&
|
|
184
|
+
clearable &&
|
|
185
|
+
!isEmpty(currentValue.value) &&
|
|
186
|
+
type != "password" &&
|
|
187
|
+
attrs.readonly === undefined;
|
|
186
188
|
const props = {
|
|
187
189
|
class: {
|
|
188
190
|
[`k-${inputType}`]: true,
|
|
@@ -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
|
};
|
|
@@ -5,12 +5,19 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<Space style="font-size:12px;" vertical>
|
|
8
|
+
<Space style="font-size:12px;max-width:200px" block vertical>
|
|
9
9
|
<InputNumber v-model="value" />
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</
|
|
10
|
+
|
|
11
|
+
<code>readonly</code>
|
|
12
|
+
<InputNumber v-model="value" readonly />
|
|
13
|
+
<code>disabled</code>
|
|
14
|
+
<InputNumber v-model="value" disabled />
|
|
15
|
+
<code>group</code>
|
|
16
|
+
<InputGroup>
|
|
17
|
+
<Button @click="value -= 1" theme="outline">-</Button>
|
|
18
|
+
<InputNumber v-model="value" :controls="false" />
|
|
19
|
+
<Button @click="value += 1" theme="outline">+</Button>
|
|
20
|
+
</InputGroup>
|
|
14
21
|
</Space>
|
|
15
22
|
</template>
|
|
16
23
|
<script setup>
|
|
@@ -34,11 +34,6 @@
|
|
|
34
34
|
:formatter="(value) => `${value}%`"
|
|
35
35
|
:parser="(value) => value.replace('%', '')"
|
|
36
36
|
/>
|
|
37
|
-
<code>只能输入数字,输出: {{ n6 }}</code>
|
|
38
|
-
<InputNumber
|
|
39
|
-
v-model="n6"
|
|
40
|
-
:formatter="(value) => value.replace(/\D/g, '')"
|
|
41
|
-
/>
|
|
42
37
|
<code>自定义 ,输出:{{ n7 }}</code>
|
|
43
38
|
<InputNumber
|
|
44
39
|
v-model="n7"
|
|
@@ -103,7 +103,6 @@ const InputNumber = defineComponent({
|
|
|
103
103
|
: subtract(String(outputValue.value), String(step));
|
|
104
104
|
const { input, output } = getValue(value, true);
|
|
105
105
|
|
|
106
|
-
// console.log(input,output)
|
|
107
106
|
// return
|
|
108
107
|
inputValue.value = input;
|
|
109
108
|
outputValue.value = output;
|
|
@@ -125,7 +124,6 @@ const InputNumber = defineComponent({
|
|
|
125
124
|
const onUpdate = (e) => {
|
|
126
125
|
const v = e; //.target.value;
|
|
127
126
|
const { input, output } = getValue(v, false, false);
|
|
128
|
-
// console.log("update", `origin: ${v}`, `input: ${input}`, `output: ${output}`);
|
|
129
127
|
inputValue.value = input;
|
|
130
128
|
// e.target.value = input;
|
|
131
129
|
|
|
@@ -152,7 +150,7 @@ const InputNumber = defineComponent({
|
|
|
152
150
|
);
|
|
153
151
|
const blurHandle = (e) => {
|
|
154
152
|
const { input, output } = getValue(outputValue.value, true, true);
|
|
155
|
-
|
|
153
|
+
// console.log(input, output)
|
|
156
154
|
inputValue.value = input;
|
|
157
155
|
outputValue.value = output;
|
|
158
156
|
emit("input", output);
|
|
@@ -163,7 +161,7 @@ const InputNumber = defineComponent({
|
|
|
163
161
|
// const { suffix } = ps;
|
|
164
162
|
|
|
165
163
|
const props = {
|
|
166
|
-
attrs: { ...attrs },
|
|
164
|
+
attrs: { ...attrs, readonly: ps.readonly },
|
|
167
165
|
// ...ps,
|
|
168
166
|
props: {
|
|
169
167
|
inputType: "input-number",
|
|
@@ -200,7 +198,7 @@ const InputNumber = defineComponent({
|
|
|
200
198
|
suffix: () => slots.suffix?.(),
|
|
201
199
|
prefix: () => slots.prefix?.(),
|
|
202
200
|
controls: () =>
|
|
203
|
-
ps.controls ? (
|
|
201
|
+
ps.controls && !ps.readonly ? (
|
|
204
202
|
<div class="k-input-number-controls">
|
|
205
203
|
<span
|
|
206
204
|
class="k-input-number-control"
|