kui-vue 3.6.1 → 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/components/button/demo/size.md +1 -1
- package/components/checkbox/checkbox.jsx +17 -16
- package/components/checkbox/checkboxGroup.jsx +1 -1
- 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/demo/basic.md +14 -2
- package/components/colorPicker/demo/index.jsx +0 -8
- package/components/colorPicker/demo/size.md +24 -10
- package/components/datePicker/demo/size.md +1 -1
- 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 +2 -2
- package/components/form/form.jsx +1 -1
- 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 +7 -5
- package/components/input/inputBox.jsx +2 -2
- 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/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 +24 -5
- package/components/select/demo/size.md +1 -1
- package/components/select/select.jsx +0 -1
- package/components/space/styles/index.less +3 -1
- package/components/spin/index.md +6 -5
- package/components/switch/switch.jsx +1 -3
- package/components/table/demo/size.md +1 -1
- package/components/tabs/tabs.jsx +1 -1
- 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/upload/upload.jsx +0 -1
- package/components/utils/placement.js +58 -31
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +187 -186
- 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 +1 -1
- package/types/checkbox/Checkbox.d.ts +1 -1
- package/types/collapse/Collapse.d.ts +1 -1
- package/types/index.d.ts +16 -16
- 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 +1 -2
- 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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<Space vertical align="start">
|
|
9
|
-
<RadioGroup v-model="size">
|
|
9
|
+
<RadioGroup v-model="size" type="button">
|
|
10
10
|
<RadioButton value="large" label="Large" @click="()=>{}"/>
|
|
11
11
|
<RadioButton value="default" label="Default" />
|
|
12
12
|
<RadioButton value="small" label="Small" />
|
|
@@ -18,7 +18,7 @@ const Checkbox = defineComponent({
|
|
|
18
18
|
|
|
19
19
|
// [Vue 3 Upgrade]: Vue 2 use checked & model
|
|
20
20
|
checked: {
|
|
21
|
-
type: Boolean,
|
|
21
|
+
type: [Boolean, Number],
|
|
22
22
|
default: false,
|
|
23
23
|
},
|
|
24
24
|
|
|
@@ -43,27 +43,28 @@ const Checkbox = defineComponent({
|
|
|
43
43
|
isChecked.value = v;
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (props.disabled) return;
|
|
49
|
-
|
|
50
|
-
const targetChecked = e.target.checked;
|
|
51
|
-
|
|
52
|
-
isChecked.value = targetChecked;
|
|
53
|
-
// [Vue 3 Upgrade]: emit("update:modelValue", targetChecked);
|
|
46
|
+
const emitValue = (checked) => {
|
|
47
|
+
isChecked.value = checked;
|
|
54
48
|
emit("change", {
|
|
55
|
-
checked:
|
|
49
|
+
checked: checked,
|
|
56
50
|
value: props.value,
|
|
57
|
-
label: props.label,
|
|
51
|
+
label: props.label || slots.default?.(),
|
|
58
52
|
});
|
|
59
|
-
emit("input",
|
|
53
|
+
emit("input", checked);
|
|
54
|
+
};
|
|
55
|
+
const onChange = (e) => {
|
|
56
|
+
if (props.disabled) return;
|
|
57
|
+
const checked = e.target.checked;
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
e.stopPropagation();
|
|
60
|
+
emitValue(checked);
|
|
60
61
|
};
|
|
61
|
-
const
|
|
62
|
-
// onChange({ target: { checked: isChecked.value } });
|
|
62
|
+
const triggerCheck = (e) => {
|
|
63
63
|
if (e.code == "Space") {
|
|
64
|
-
onChange({ target: { checked: !isChecked.value } });
|
|
65
64
|
e.preventDefault();
|
|
66
65
|
e.stopPropagation();
|
|
66
|
+
if (props.disabled) return;
|
|
67
|
+
emitValue(!isChecked.value);
|
|
67
68
|
}
|
|
68
69
|
};
|
|
69
70
|
return () => {
|
|
@@ -86,7 +87,7 @@ const Checkbox = defineComponent({
|
|
|
86
87
|
const labelNode = props.label || slots.default?.();
|
|
87
88
|
|
|
88
89
|
return (
|
|
89
|
-
<label class={wpClasses} onKeydown={
|
|
90
|
+
<label class={wpClasses} onKeydown={triggerCheck} tabindex="0">
|
|
90
91
|
<span class="k-checkbox-symbol">
|
|
91
92
|
<input
|
|
92
93
|
type="checkbox"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Checkbox from "./checkbox";
|
|
2
2
|
import { defineComponent, watch, toRefs, computed } from "vue";
|
|
3
3
|
import { withInstall } from "../utils/vue";
|
|
4
|
-
import { getChildren } from "../utils/
|
|
4
|
+
import { getChildren } from "../utils/vnode";
|
|
5
5
|
|
|
6
6
|
const CheckboxGroup = defineComponent({
|
|
7
7
|
name: "CheckboxGroup",
|
|
@@ -4,23 +4,23 @@ import { withInstall, cloneVNode } from "../utils/vue";
|
|
|
4
4
|
const Collapse = defineComponent({
|
|
5
5
|
name: "Collapse",
|
|
6
6
|
props: {
|
|
7
|
-
|
|
7
|
+
openKeys: Array,
|
|
8
8
|
accordion: Boolean,
|
|
9
9
|
sample: Boolean,
|
|
10
10
|
},
|
|
11
11
|
setup(ps, { slots, emit }) {
|
|
12
|
-
const
|
|
12
|
+
const defaultOpenKeys = ref(ps.openKeys || []);
|
|
13
13
|
|
|
14
14
|
watch(
|
|
15
|
-
() => ps.
|
|
15
|
+
() => ps.openKeys,
|
|
16
16
|
(nv, no) => {
|
|
17
|
-
|
|
17
|
+
defaultOpenKeys.value = nv;
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
|
|
21
21
|
const change = (key) => {
|
|
22
22
|
if (!key) return;
|
|
23
|
-
let value =
|
|
23
|
+
let value = defaultOpenKeys.value;
|
|
24
24
|
let index = value.indexOf(key);
|
|
25
25
|
|
|
26
26
|
if (index >= 0) {
|
|
@@ -28,10 +28,9 @@ const Collapse = defineComponent({
|
|
|
28
28
|
} else {
|
|
29
29
|
ps.accordion ? (value = [key]) : value.push(key);
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
emit("change", key);
|
|
33
|
-
|
|
34
|
-
emit("input", value); //for 3
|
|
31
|
+
defaultOpenKeys.value = value;
|
|
32
|
+
emit("change", key, value);
|
|
33
|
+
emit("update:openKeys", value);
|
|
35
34
|
};
|
|
36
35
|
|
|
37
36
|
return () => {
|
|
@@ -46,7 +45,7 @@ const Collapse = defineComponent({
|
|
|
46
45
|
return (
|
|
47
46
|
<div class={classes}>
|
|
48
47
|
{children?.map((child) => {
|
|
49
|
-
let active =
|
|
48
|
+
let active = defaultOpenKeys.value.includes(child.key);
|
|
50
49
|
// return cloneVNode(child, { active, onExpand: change }); //for 3
|
|
51
50
|
return cloneVNode(
|
|
52
51
|
child,
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div class="demo-collapse">
|
|
9
|
-
<Collapse :
|
|
9
|
+
<Collapse :openKeys="openKeys" accordion>
|
|
10
10
|
<CollapsePanel title="Panel title" key="1">
|
|
11
11
|
<div>{{ text }}</div>
|
|
12
12
|
</CollapsePanel>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
<script setup>
|
|
23
23
|
import { ref } from "vue";
|
|
24
|
-
const
|
|
24
|
+
const openKeys = ref(["1"]);
|
|
25
25
|
const text = `A long time ago, In a beautiful kingdom,
|
|
26
26
|
there lived a young king and queen,
|
|
27
27
|
the people loved them so much; `;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div class="demo-collapse">
|
|
9
|
-
<Collapse :
|
|
9
|
+
<Collapse :openKeys="openKeys">
|
|
10
10
|
<CollapsePanel title="Panel title" key="1">
|
|
11
11
|
<div>{{ text }}</div>
|
|
12
12
|
</CollapsePanel>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
<script setup>
|
|
23
23
|
import { ref } from "vue";
|
|
24
|
-
const
|
|
24
|
+
const openKeys = ref(["1"]);
|
|
25
25
|
const text = `A long time ago, In a beautiful kingdom,
|
|
26
26
|
there lived a young king and queen,
|
|
27
27
|
the people loved them so much; `;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div class="demo-collapse">
|
|
9
|
-
<Collapse :
|
|
9
|
+
<Collapse :openKeys="openKeys">
|
|
10
10
|
<CollapsePanel title="Panel title" key="1">
|
|
11
11
|
<template #extra>
|
|
12
12
|
<Icon :type="SettingsOutline" />
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</template>
|
|
31
31
|
<script setup>
|
|
32
32
|
import { ref } from "vue";
|
|
33
|
-
const
|
|
33
|
+
const openKeys = ref(["1","2"]);
|
|
34
34
|
import { SettingsOutline } from "kui-icons";
|
|
35
35
|
const text = `A long time ago, In a beautiful kingdom,
|
|
36
36
|
there lived a young king and queen,
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div class="demo-collapse">
|
|
9
|
-
<Collapse :
|
|
9
|
+
<Collapse :openKeys="openKeys">
|
|
10
10
|
<CollapsePanel title="Panel title" key="1">
|
|
11
|
-
<Collapse :
|
|
11
|
+
<Collapse :openKeys="openKeys2">
|
|
12
12
|
<CollapsePanel title="Panel title" key="1-1">
|
|
13
13
|
<div>{{ text }}</div>
|
|
14
14
|
</CollapsePanel>
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
<script setup>
|
|
30
30
|
import { ref } from "vue";
|
|
31
|
-
const
|
|
32
|
-
const
|
|
31
|
+
const openKeys = ref(["1"]);
|
|
32
|
+
const openKeys2 = ref(["1-1"]);
|
|
33
33
|
const text = `A long time ago, In a beautiful kingdom,
|
|
34
34
|
there lived a young king and queen,
|
|
35
35
|
the people loved them so much; `;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<div class="demo-collapse">
|
|
9
|
-
<Collapse :
|
|
9
|
+
<Collapse :openKeys="openKeys" sample>
|
|
10
10
|
<CollapsePanel title="Panel title" key="1">
|
|
11
11
|
<div>{{ text }}</div>
|
|
12
12
|
</CollapsePanel>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</template>
|
|
22
22
|
<script setup>
|
|
23
23
|
import { ref } from "vue";
|
|
24
|
-
const
|
|
24
|
+
const openKeys = ref(["1"]);
|
|
25
25
|
const text = `A long time ago, In a beautiful kingdom,
|
|
26
26
|
there lived a young king and queen,
|
|
27
27
|
the people loved them so much; `;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
## API
|
|
2
2
|
|
|
3
|
-
| 属性 | 说明
|
|
4
|
-
| --------- |
|
|
5
|
-
|
|
|
6
|
-
| accordion | 是否开启手风琴模式,开启后每次至多展开一个面板
|
|
7
|
-
| sample | 是否开启简洁模式
|
|
8
|
-
| change | 切换面板时触发回调,返回当前选项卡的 `name`
|
|
3
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
4
|
+
| --------- | ---------------------------------------------- | -------- | ------ |
|
|
5
|
+
| openKeys | 当前展开的面板的 `key` | Array | - |
|
|
6
|
+
| accordion | 是否开启手风琴模式,开启后每次至多展开一个面板 | Boolean | false |
|
|
7
|
+
| sample | 是否开启简洁模式 | Boolean | false |
|
|
8
|
+
| change | 切换面板时触发回调,返回当前选项卡的 `name` | Function | - |
|
|
9
9
|
|
|
10
10
|
## Panel
|
|
11
11
|
|
|
@@ -5,12 +5,24 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<
|
|
8
|
+
<Space vertical>
|
|
9
|
+
<code>v-model: {{ color }}</code>
|
|
9
10
|
<ColorPicker v-model="color" />
|
|
10
|
-
|
|
11
|
+
<code>mode = hex ,v-model: {{ hexColor }}</code>
|
|
12
|
+
<ColorPicker v-model="hexColor" />
|
|
13
|
+
<code>mode = rgb,v-model: {{ rgbColor }}</code>
|
|
14
|
+
<ColorPicker mode="rgb" v-model="rgbColor" />
|
|
15
|
+
<code>mode = hsl,v-model: {{ hslColor }}</code>
|
|
16
|
+
<ColorPicker mode="hsl" v-model="hslColor" />
|
|
17
|
+
<code>showText = true</code>
|
|
18
|
+
<ColorPicker showText v-model="color" />
|
|
19
|
+
</Space>
|
|
11
20
|
</template>
|
|
12
21
|
<script setup>
|
|
13
22
|
import { ref } from "vue";
|
|
14
23
|
const color = ref("#3a95ff");
|
|
24
|
+
const hexColor = ref("#3a95ff");
|
|
25
|
+
const rgbColor = ref("rgba(0, 188, 212, 0.72)");
|
|
26
|
+
const hslColor = ref("hsl(207, 90%, 54%)");
|
|
15
27
|
</script>
|
|
16
28
|
```
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import Info from './info.md'
|
|
2
2
|
import Basic from './basic.md'
|
|
3
|
-
import Mode from './mode.md'
|
|
4
3
|
import Size from './size.md'
|
|
5
|
-
import Disabled from './disabled.md'
|
|
6
|
-
import DisabledAlpha from './disabledAlpha.md'
|
|
7
4
|
import CustomTrigger from './customTrigger.md'
|
|
8
5
|
import Placement from './placement.md'
|
|
9
|
-
import Presets from './presets.md'
|
|
10
6
|
import CN from '../index.md'
|
|
11
7
|
export default {
|
|
12
8
|
render() {
|
|
@@ -15,12 +11,8 @@ export default {
|
|
|
15
11
|
<Info />
|
|
16
12
|
<Basic />
|
|
17
13
|
<Size />
|
|
18
|
-
<Disabled />
|
|
19
|
-
<DisabledAlpha />
|
|
20
14
|
<CustomTrigger />
|
|
21
15
|
<Placement />
|
|
22
|
-
<Mode />
|
|
23
|
-
<Presets />
|
|
24
16
|
<CN />
|
|
25
17
|
</div>
|
|
26
18
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<cn>
|
|
2
|
-
### 尺寸大小
|
|
2
|
+
### 尺寸大小 / 不可用
|
|
3
3
|
`small` 为小尺寸, `large` 为大尺寸
|
|
4
4
|
</cn>
|
|
5
5
|
|
|
@@ -7,16 +7,29 @@
|
|
|
7
7
|
<template>
|
|
8
8
|
<Space vertical>
|
|
9
9
|
<Space>
|
|
10
|
-
<
|
|
11
|
-
|
|
10
|
+
<Space vertical>
|
|
11
|
+
<ColorPicker :value="color3" size="small" />
|
|
12
|
+
<ColorPicker :value="color2" />
|
|
13
|
+
<ColorPicker :value="color1" size="large" />
|
|
14
|
+
</Space>
|
|
15
|
+
<Space vertical>
|
|
16
|
+
<ColorPicker showText :value="color3" size="small" />
|
|
17
|
+
<ColorPicker showText :value="color2" />
|
|
18
|
+
<ColorPicker showText :value="color1" size="large" />
|
|
19
|
+
</Space>
|
|
12
20
|
</Space>
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
<br />
|
|
22
|
+
<Space vertical>
|
|
23
|
+
<code>disabled</code>
|
|
24
|
+
<Space>
|
|
25
|
+
<ColorPicker :value="color2" disabled />
|
|
26
|
+
<ColorPicker showText :value="color2" disabled />
|
|
27
|
+
</Space>
|
|
28
|
+
<br />
|
|
29
|
+
<code>disabledAlpha</code>
|
|
30
|
+
<ColorPicker showText disabledAlpha :value="color2" />
|
|
31
|
+
<code>presets colors</code>
|
|
32
|
+
<ColorPicker v-model="color1" :presets="presetsColors" />
|
|
20
33
|
</Space>
|
|
21
34
|
</Space>
|
|
22
35
|
</template>
|
|
@@ -24,5 +37,6 @@
|
|
|
24
37
|
const color1 = "#3a95ff";
|
|
25
38
|
const color2 = "#3a95ff";
|
|
26
39
|
const color3 = "#3a95ff";
|
|
40
|
+
const presetsColors = ["#9c27b0", "red", "blue"];
|
|
27
41
|
</script>
|
|
28
42
|
```
|
|
@@ -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" />
|
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
|
|