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
|
@@ -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" />
|
package/components/card/card.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Icon from "../icon";
|
|
2
2
|
import { defineComponent } from "vue";
|
|
3
|
-
import { withInstall } from
|
|
3
|
+
import { withInstall } from "../utils/vue";
|
|
4
4
|
const Card = defineComponent({
|
|
5
5
|
name: "Card",
|
|
6
6
|
props: {
|
|
@@ -21,16 +21,26 @@ const Card = defineComponent({
|
|
|
21
21
|
// console.log(extraSlot)
|
|
22
22
|
const titleSlot = slots.title?.();
|
|
23
23
|
const selfSlot = slots.default?.();
|
|
24
|
-
const extraNode = extraSlot ?
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
const extraNode = extraSlot ? (
|
|
25
|
+
<div class="k-card-extra">{extraSlot}</div>
|
|
26
|
+
) : null;
|
|
27
|
+
const iconNode = icon ? (
|
|
28
|
+
<Icon type={icon} class="k-card-title-icon" />
|
|
29
|
+
) : null;
|
|
30
|
+
const titleNode = title ? (
|
|
31
|
+
<span class="k-card-title">{title}</span>
|
|
32
|
+
) : (
|
|
33
|
+
titleSlot || null
|
|
34
|
+
);
|
|
27
35
|
return (
|
|
28
36
|
<div class={classes}>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
{titleNode && (
|
|
38
|
+
<div class="k-card-head">
|
|
39
|
+
{iconNode}
|
|
40
|
+
{titleNode}
|
|
41
|
+
{extraNode}
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
34
44
|
{selfSlot ? <div class="k-card-body k-scroll">{selfSlot}</div> : null}
|
|
35
45
|
</div>
|
|
36
46
|
);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<div class="demo-
|
|
8
|
+
<div class="demo-back">
|
|
9
9
|
<Card title="卡片标题" :icon="Heart" :bordered="false">
|
|
10
10
|
<template #extra>
|
|
11
11
|
<a href="#">更多</a>
|
|
@@ -19,10 +19,4 @@
|
|
|
19
19
|
<script setup>
|
|
20
20
|
import { Heart } from "kui-icons";
|
|
21
21
|
</script>
|
|
22
|
-
<style scoped>
|
|
23
|
-
.demo-card {
|
|
24
|
-
padding: 20px;
|
|
25
|
-
background-color: #7f7f7f26;
|
|
26
|
-
}
|
|
27
|
-
</style>
|
|
28
22
|
```
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import Basic from
|
|
2
|
-
import Info from
|
|
3
|
-
import Border from
|
|
4
|
-
import
|
|
1
|
+
import Basic from "./basic.md";
|
|
2
|
+
import Info from "./info.md";
|
|
3
|
+
import Border from "./border.md";
|
|
4
|
+
import NoTitle from "./notitle.md";
|
|
5
|
+
import CN from "../index.md";
|
|
5
6
|
export default {
|
|
6
7
|
render() {
|
|
7
8
|
return (
|
|
@@ -9,8 +10,9 @@ export default {
|
|
|
9
10
|
<Info />
|
|
10
11
|
<Basic />
|
|
11
12
|
<Border />
|
|
13
|
+
<NoTitle />
|
|
12
14
|
<CN />
|
|
13
15
|
</div>
|
|
14
|
-
)
|
|
15
|
-
}
|
|
16
|
-
}
|
|
16
|
+
);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<cn>
|
|
2
|
+
### 很奇怪的卡片
|
|
3
|
+
</cn>
|
|
4
|
+
|
|
5
|
+
```vue
|
|
6
|
+
<template>
|
|
7
|
+
<Space vertical block class="demo-back">
|
|
8
|
+
<Card>
|
|
9
|
+
<div>card content</div>
|
|
10
|
+
<div>card content</div>
|
|
11
|
+
<div>card content</div>
|
|
12
|
+
</Card>
|
|
13
|
+
<Card :bordered="false">
|
|
14
|
+
<div>card content</div>
|
|
15
|
+
<div>card content</div>
|
|
16
|
+
<div>card content</div>
|
|
17
|
+
</Card>
|
|
18
|
+
</Space>
|
|
19
|
+
</template>
|
|
20
|
+
<script setup>
|
|
21
|
+
import { Heart } from "kui-icons";
|
|
22
|
+
</script>
|
|
23
|
+
```
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
.k-card {
|
|
4
4
|
background: var(--kui-color-back);
|
|
5
5
|
position: relative;
|
|
6
|
-
border-radius: var(--kui-border-radius);
|
|
6
|
+
border-radius: var(--kui-border-card-radius);
|
|
7
7
|
color: var(--kui-color-font);
|
|
8
8
|
|
|
9
9
|
.k-card-head {
|
|
10
10
|
position: relative;
|
|
11
|
-
|
|
12
|
-
padding: 14px 16px;
|
|
11
|
+
padding: 16px;
|
|
13
12
|
line-height: 1;
|
|
14
13
|
display: flex;
|
|
15
14
|
align-items: center;
|
|
@@ -42,4 +41,7 @@
|
|
|
42
41
|
|
|
43
42
|
.k-card-bordered {
|
|
44
43
|
border: 1px solid var(--kui-color-border);
|
|
44
|
+
.k-card-head {
|
|
45
|
+
border-bottom: 1px solid var(--kui-color-border);
|
|
46
|
+
}
|
|
45
47
|
}
|
|
@@ -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
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
.k-collapse {
|
|
3
3
|
background-color: var(--kui-color-back);
|
|
4
4
|
border: 1px solid var(--kui-color-border);
|
|
5
|
-
border-radius: var(--kui-border-radius);
|
|
5
|
+
border-radius: var(--kui-border-card-radius);
|
|
6
6
|
// border-bottom: 0;
|
|
7
7
|
overflow: hidden;
|
|
8
8
|
color: var(--kui-color-font);
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
background: var(--kui-color-gray-90);
|
|
65
65
|
border: none;
|
|
66
66
|
margin-bottom: 10px;
|
|
67
|
-
border-radius: var(--kui-border-radius);
|
|
67
|
+
border-radius: var(--kui-border-card-radius);
|
|
68
68
|
overflow: hidden;
|
|
69
69
|
.k-collapse-header {
|
|
70
70
|
border: none;
|
|
@@ -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
|
```
|
|
@@ -48,7 +48,7 @@ export default defineComponent({
|
|
|
48
48
|
};
|
|
49
49
|
const valueChange = (e, type) => {
|
|
50
50
|
// console.log(e.target.value, type);
|
|
51
|
-
const value = parseInt(e
|
|
51
|
+
const value = parseInt(e);
|
|
52
52
|
let color = Color(currentColor.value);
|
|
53
53
|
switch (type) {
|
|
54
54
|
case "r":
|
package/components/components.js
CHANGED
|
@@ -110,6 +110,9 @@ export { Rate };
|
|
|
110
110
|
import { Select, Option } from "./select";
|
|
111
111
|
export { Select, Option };
|
|
112
112
|
|
|
113
|
+
import { StatCard, StatNumber } from "./statCard";
|
|
114
|
+
export { StatCard, StatNumber };
|
|
115
|
+
|
|
113
116
|
import ConfigProvider from "./config";
|
|
114
117
|
export { ConfigProvider };
|
|
115
118
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
|
-
<Space>
|
|
8
|
+
<Space wrap>
|
|
9
9
|
<RadioGroup v-model="placement" type="button">
|
|
10
10
|
<RadioButton label="left" value="left" />
|
|
11
11
|
<RadioButton label="top" value="top" />
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
</Flex>
|
|
22
22
|
<Drawer
|
|
23
23
|
v-model="show"
|
|
24
|
-
width="
|
|
24
|
+
width="50%"
|
|
25
25
|
:footer="null"
|
|
26
26
|
:placement="placement"
|
|
27
27
|
:target="() => refTarget"
|
|
@@ -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);
|