kui-vue 3.6.2 → 3.6.4
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/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/styles/index.less +1 -0
- package/components/collapse/styles/index.less +2 -2
- package/components/colorPicker/mode.jsx +1 -1
- package/components/components.js +3 -0
- package/components/drawer/demo/target.md +2 -2
- package/components/drawer/drawer.jsx +48 -74
- package/components/drawer/styles/index.less +38 -67
- package/components/dropdown/demo/basic.md +1 -1
- package/components/dropdown/demo/rightmenu.md +1 -1
- package/components/dropdown/styles/index.less +181 -24
- package/components/flex/demo/size.md +14 -5
- 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 +10 -1
- package/components/form/form.jsx +1 -1
- package/components/grid/demo/align.md +5 -5
- package/components/grid/demo/basic.md +2 -2
- package/components/grid/demo/fill.md +8 -8
- package/components/grid/demo/flex.md +7 -7
- package/components/grid/demo/gutter.md +2 -4
- package/components/grid/demo/offset.md +5 -5
- package/components/input/demo/icon.md +9 -2
- package/components/input/demo/theme.md +1 -1
- package/components/input/input.jsx +12 -10
- 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/layout2.md +0 -12
- 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/menu/styles/index.less +229 -375
- package/components/message/group.jsx +11 -4
- package/components/rate/rate.jsx +7 -2
- package/components/rate/star.jsx +20 -5
- package/components/select/demo/filterable.md +1 -0
- package/components/select/demo/multiple.md +3 -0
- package/components/select/select.jsx +23 -19
- 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/spin/demo/container.md +1 -1
- package/components/spin/demo/mode.md +1 -1
- 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/table/demo/col-row-span.md +1 -1
- package/components/table/demo/custom-header.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 +1 -1
- 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 +6 -4
- package/components/treeselect/treeselect.jsx +17 -17
- 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 -116
- package/components/utils/number.js +79 -65
- package/components/utils/placement.js +4 -4
- package/components/utils/vnode.jsx +46 -25
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +242 -200
- 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/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/affix/Affix.d.ts +1 -1
- package/types/alert/Alert.d.ts +1 -1
- package/types/avatar/Avatar.d.ts +1 -1
- package/types/backtop/BackTop.d.ts +1 -1
- package/types/badge/Badge.d.ts +1 -1
- package/types/breadcrumb/Breadcrumb.d.ts +1 -1
- package/types/breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/types/button/Button.d.ts +1 -1
- package/types/button/ButtonGroup.d.ts +1 -1
- package/types/card/Card.d.ts +1 -1
- package/types/carousel/Carousel.d.ts +1 -1
- package/types/carousel/CarouselItem.d.ts +1 -1
- package/types/checkbox/Checkbox.d.ts +1 -1
- package/types/checkbox/CheckboxGroup.d.ts +1 -1
- package/types/collapse/Collapse.d.ts +1 -1
- package/types/collapse/CollapsePanel.d.ts +1 -1
- package/types/colorPicker/ColorPicker.d.ts +1 -1
- package/types/datePicker/DatePicker.d.ts +1 -1
- package/types/descriptions/Descriptions.d.ts +1 -1
- package/types/descriptions/DescriptionsItem.d.ts +1 -1
- package/types/divider/Divider.d.ts +1 -1
- package/types/drawer/Drawer.d.ts +2 -2
- package/types/dropdown/Dropdown.d.ts +1 -1
- package/types/dropdown/DropdownButton.d.ts +1 -1
- package/types/empty/Empty.d.ts +1 -1
- package/types/flex/Flex.d.ts +1 -1
- package/types/form/Form.d.ts +1 -1
- package/types/form/formitem.d.ts +1 -1
- package/types/grid/Col.d.ts +1 -1
- package/types/grid/Row.d.ts +1 -1
- package/types/icon/Icon.d.ts +1 -1
- package/types/image/ImageGroup.d.ts +1 -1
- package/types/image/KImage.d.ts +1 -1
- package/types/index.d.ts +16 -12
- package/types/input/Input.d.ts +1 -1
- package/types/input/InputGroup.d.ts +1 -1
- package/types/input/TextArea.d.ts +1 -1
- package/types/inputNumber/InputNumber.d.ts +1 -1
- package/types/layout/sider.d.ts +1 -1
- package/types/loading/loading.d.ts +1 -1
- package/types/menu/Menu.d.ts +1 -1
- package/types/menu/MenuDivider.d.ts +1 -1
- package/types/menu/MenuGroup.d.ts +1 -1
- package/types/menu/MenuItem.d.ts +1 -1
- package/types/menu/SubMenu.d.ts +1 -1
- package/types/modal/Modal.d.ts +1 -1
- package/types/page/Page.d.ts +1 -1
- package/types/popconfirm/Popconfirm.d.ts +1 -1
- package/types/poptip/Poptip.d.ts +1 -1
- package/types/progress/Progress.d.ts +1 -1
- package/types/radio/Radio.d.ts +1 -1
- package/types/radio/RadioButton.d.ts +1 -1
- package/types/radio/RadioGroup.d.ts +1 -1
- package/types/rate/Rate.d.ts +2 -2
- package/types/select/Option.d.ts +1 -1
- package/types/select/Select.d.ts +1 -1
- package/types/skeleton/Skeleton.d.ts +1 -1
- package/types/skeleton/SkeletonAvatar.d.ts +1 -1
- package/types/skeleton/SkeletonButton.d.ts +1 -1
- package/types/skeleton/SkeletonImage.d.ts +1 -1
- package/types/skeleton/SkeletonText.d.ts +1 -1
- package/types/slider/Slider.d.ts +8 -7
- package/types/space/Space.d.ts +1 -1
- package/types/spin/Spin.d.ts +1 -1
- package/types/statCard/StatCard.d.ts +20 -0
- package/types/statCard/StatNumber.d.ts +26 -0
- package/types/switch/Switch.d.ts +1 -1
- package/types/table/Table.d.ts +2 -1
- package/types/tabs/TabPanel.d.ts +1 -1
- package/types/tabs/Tabs.d.ts +1 -1
- package/types/tag/Tag.d.ts +1 -1
- package/types/timeline/TimeLine.d.ts +1 -1
- package/types/timeline/TimeLineItem.d.ts +1 -1
- package/types/tooltip/Tooltip.d.ts +1 -1
- package/types/tree/Tree.d.ts +1 -1
- package/types/treeselect/TreeSelect.d.ts +1 -1
- package/types/upload/Upload.d.ts +1 -1
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-view-fill">
|
|
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-view-fill">
|
|
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
|
}
|
|
@@ -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;
|
|
@@ -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"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Button } from "../button";
|
|
2
|
-
import Icon from "../icon";
|
|
3
2
|
import transfer from "../directives/transfer";
|
|
4
3
|
import { Close } from "kui-icons";
|
|
5
4
|
import {
|
|
@@ -14,16 +13,16 @@ import {
|
|
|
14
13
|
} from "vue";
|
|
15
14
|
import zhCN from "../locale/zh-CN";
|
|
16
15
|
import { withInstall } from "../utils/vue";
|
|
16
|
+
import { toggleContainerScroll } from "../utils/vnode";
|
|
17
17
|
|
|
18
18
|
const Drawer = defineComponent({
|
|
19
19
|
name: "Drawer",
|
|
20
20
|
directives: { transfer },
|
|
21
21
|
props: {
|
|
22
|
-
// show: Boolean, //for 3
|
|
23
22
|
value: Boolean,
|
|
24
23
|
title: { default: "Title", type: String },
|
|
25
24
|
width: { default: 520, type: [Number, String] },
|
|
26
|
-
height: { default:
|
|
25
|
+
height: { default: 520, type: [Number, String] },
|
|
27
26
|
okText: String,
|
|
28
27
|
cancelText: String,
|
|
29
28
|
placement: { type: String, default: "right" },
|
|
@@ -43,13 +42,10 @@ const Drawer = defineComponent({
|
|
|
43
42
|
? injectedLocale.value
|
|
44
43
|
: injectedLocale;
|
|
45
44
|
});
|
|
46
|
-
const rendered = ref(ps.value);
|
|
47
|
-
// const rendered = ref(ps.show); // for 3
|
|
45
|
+
const rendered = ref(ps.value);
|
|
48
46
|
const visible = ref(ps.value);
|
|
49
|
-
|
|
50
|
-
const opened = ref(ps.show);
|
|
47
|
+
const opened = ref(ps.value);
|
|
51
48
|
watch(
|
|
52
|
-
// () => ps.show, // for 3
|
|
53
49
|
() => ps.value,
|
|
54
50
|
(nv, ov) => {
|
|
55
51
|
if (nv) {
|
|
@@ -59,43 +55,32 @@ const Drawer = defineComponent({
|
|
|
59
55
|
);
|
|
60
56
|
|
|
61
57
|
onMounted(() => {
|
|
62
|
-
if (!window.__kui_body_style) {
|
|
63
|
-
window.__kui_body_style = {
|
|
64
|
-
overflowY: document.body.style.overflowY,
|
|
65
|
-
paddingRight: document.body.style.paddingRight,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
58
|
ps.escKey && document.addEventListener("keydown", escToClose);
|
|
69
59
|
});
|
|
70
60
|
onBeforeUnmount(() => {
|
|
71
61
|
ps.escKey && document.removeEventListener("keydown", escToClose);
|
|
62
|
+
toggleContainerScroll(ps.target(), false);
|
|
72
63
|
});
|
|
73
64
|
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
window.innerWidth - document.documentElement.clientWidth;
|
|
78
|
-
const hasScrollbar = scrollbarWidth > 0;
|
|
79
|
-
if (hasScrollbar) {
|
|
80
|
-
document.body.style.overflowY = "hidden";
|
|
81
|
-
document.body.style.paddingRight = `${scrollbarWidth}px`; // 防止布局跳动
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
let { overflowY, paddingRight } = window.__kui_body_style;
|
|
85
|
-
document.body.style.overflowY = overflowY || "";
|
|
86
|
-
document.body.style.paddingRight = paddingRight || "";
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const toggle = (v) => {
|
|
90
|
-
if (v && !rendered.value) {
|
|
65
|
+
const toggle = (value) => {
|
|
66
|
+
toggleContainerScroll(ps.target(), value);
|
|
67
|
+
if (!rendered.value && value) {
|
|
91
68
|
rendered.value = true;
|
|
92
|
-
|
|
93
|
-
visible.value = true;
|
|
94
|
-
openHandle();
|
|
95
|
-
});
|
|
69
|
+
toggle(true);
|
|
96
70
|
} else {
|
|
97
|
-
|
|
98
|
-
|
|
71
|
+
if (value) {
|
|
72
|
+
nextTick((e) => {
|
|
73
|
+
visible.value = value;
|
|
74
|
+
opened.value = value;
|
|
75
|
+
emit("input", true);
|
|
76
|
+
});
|
|
77
|
+
} else {
|
|
78
|
+
visible.value = false;
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
opened.value = false;
|
|
81
|
+
}, 300);
|
|
82
|
+
emit("input", false);
|
|
83
|
+
}
|
|
99
84
|
}
|
|
100
85
|
};
|
|
101
86
|
const escToClose = (event) => {
|
|
@@ -104,7 +89,7 @@ const Drawer = defineComponent({
|
|
|
104
89
|
}
|
|
105
90
|
};
|
|
106
91
|
|
|
107
|
-
const
|
|
92
|
+
const clickMaskToClose = () => {
|
|
108
93
|
if (ps.maskClosable) {
|
|
109
94
|
close();
|
|
110
95
|
}
|
|
@@ -112,27 +97,12 @@ const Drawer = defineComponent({
|
|
|
112
97
|
|
|
113
98
|
const cancel = () => {
|
|
114
99
|
emit("cancel");
|
|
115
|
-
|
|
116
|
-
openHandle();
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
const openHandle = () => {
|
|
120
|
-
if (visible.value) {
|
|
121
|
-
opened.value = true;
|
|
122
|
-
} else {
|
|
123
|
-
setTimeout(() => {
|
|
124
|
-
opened.value = false;
|
|
125
|
-
}, 300);
|
|
126
|
-
}
|
|
127
|
-
lockScroll(visible.value);
|
|
128
|
-
emit("update:show", visible.value); // for 3
|
|
129
|
-
emit("input", visible.value);
|
|
100
|
+
toggle(false);
|
|
130
101
|
};
|
|
131
102
|
|
|
132
103
|
const close = () => {
|
|
133
|
-
visible.value = false;
|
|
134
104
|
emit("close");
|
|
135
|
-
|
|
105
|
+
toggle(false);
|
|
136
106
|
};
|
|
137
107
|
|
|
138
108
|
const ok = () => {
|
|
@@ -168,9 +138,13 @@ const Drawer = defineComponent({
|
|
|
168
138
|
) : null;
|
|
169
139
|
|
|
170
140
|
const closeNode = closable ? (
|
|
171
|
-
<
|
|
172
|
-
|
|
173
|
-
|
|
141
|
+
<Button
|
|
142
|
+
class="k-drawer-close"
|
|
143
|
+
size="small"
|
|
144
|
+
type="text"
|
|
145
|
+
onClick={close}
|
|
146
|
+
icon={Close}
|
|
147
|
+
></Button>
|
|
174
148
|
) : null;
|
|
175
149
|
|
|
176
150
|
const transitionName = `k-drawer-${placement}`;
|
|
@@ -179,25 +153,23 @@ const Drawer = defineComponent({
|
|
|
179
153
|
const classes = [
|
|
180
154
|
"k-drawer",
|
|
181
155
|
`k-drawer-${placement}`,
|
|
182
|
-
{ "k-drawer-opened": opened.value },
|
|
183
156
|
{ "k-drawer-has-footer": hasFooter },
|
|
184
|
-
{ "k-drawer-
|
|
185
|
-
{ "k-drawer-
|
|
157
|
+
{ "k-drawer-to-body": isBody },
|
|
158
|
+
{ "k-drawer-no-mask": !ps.mask },
|
|
186
159
|
];
|
|
187
160
|
let styles = {};
|
|
188
161
|
if (placement == "left" || placement == "right")
|
|
189
162
|
styles.width = typeof width === "number" ? `${width}px` : width;
|
|
190
163
|
if (placement == "top" || placement == "bottom")
|
|
191
164
|
styles.height = typeof height === "number" ? `${height}px` : height;
|
|
192
|
-
|
|
193
165
|
let maskNode = null;
|
|
194
166
|
if (ps.mask) {
|
|
195
167
|
maskNode = (
|
|
196
168
|
<transition name="k-drawer-fade">
|
|
197
169
|
<div
|
|
198
|
-
class={["k-drawer-mask", { "k-drawer-mask-
|
|
170
|
+
class={["k-drawer-mask", { "k-drawer-mask-to-body": isBody }]}
|
|
199
171
|
v-show={visible.value}
|
|
200
|
-
onClick={
|
|
172
|
+
onClick={clickMaskToClose}
|
|
201
173
|
></div>
|
|
202
174
|
</transition>
|
|
203
175
|
);
|
|
@@ -205,18 +177,20 @@ const Drawer = defineComponent({
|
|
|
205
177
|
return rendered.value ? (
|
|
206
178
|
<div class={classes} v-transfer={target}>
|
|
207
179
|
{maskNode}
|
|
208
|
-
<
|
|
209
|
-
<
|
|
210
|
-
<div class="k-drawer-
|
|
211
|
-
<div class="k-drawer-
|
|
212
|
-
|
|
213
|
-
|
|
180
|
+
<div class="k-drawer-wrap" tabindex="-1" v-show={opened.value}>
|
|
181
|
+
<transition name={transitionName}>
|
|
182
|
+
<div class="k-drawer-box" v-show={visible.value} style={styles}>
|
|
183
|
+
<div class="k-drawer-content">
|
|
184
|
+
<div class="k-drawer-header">
|
|
185
|
+
{closeNode}
|
|
186
|
+
<div class="k-drawer-header-inner">{title}</div>
|
|
187
|
+
</div>
|
|
188
|
+
<div class="k-drawer-body">{slots.default?.()}</div>
|
|
189
|
+
{footNode}
|
|
214
190
|
</div>
|
|
215
|
-
<div class="k-drawer-body">{slots.default?.()}</div>
|
|
216
|
-
{footNode}
|
|
217
191
|
</div>
|
|
218
|
-
</
|
|
219
|
-
</
|
|
192
|
+
</transition>
|
|
193
|
+
</div>
|
|
220
194
|
</div>
|
|
221
195
|
) : null;
|
|
222
196
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
1
|
+
@import "../../styles/var.less";
|
|
2
|
+
@import "./animal.less";
|
|
3
3
|
|
|
4
4
|
.k-drawer {
|
|
5
|
-
position:
|
|
5
|
+
position: absolute;
|
|
6
6
|
z-index: 1002;
|
|
7
7
|
top: 0;
|
|
8
|
-
|
|
8
|
+
width: 100%;
|
|
9
|
+
pointer-events: none;
|
|
9
10
|
.k-drawer-mask {
|
|
10
|
-
position:
|
|
11
|
+
position: absolute;
|
|
11
12
|
top: 0;
|
|
12
13
|
bottom: 0;
|
|
13
14
|
left: 0;
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
width: 100%;
|
|
18
19
|
z-index: 1000; // animation: mmask .5s ease-in-out;
|
|
19
20
|
overflow: hidden;
|
|
20
|
-
pointer-events: all
|
|
21
|
+
pointer-events: all;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
.k-drawer-box {
|
|
@@ -39,28 +40,13 @@
|
|
|
39
40
|
flex-direction: column;
|
|
40
41
|
|
|
41
42
|
.k-drawer-close {
|
|
42
|
-
// position: absolute;
|
|
43
|
-
right: 16px;
|
|
44
43
|
cursor: pointer;
|
|
45
|
-
font-size: 20px;
|
|
46
|
-
display: flex;
|
|
47
|
-
color: var(--kui-color-font);
|
|
48
|
-
// line-height: 43px;
|
|
49
|
-
// width: 43px;
|
|
50
|
-
// right: 0;
|
|
51
|
-
text-align: center;
|
|
52
|
-
// top: 0;
|
|
53
|
-
transition: all .3s ease-in-out;
|
|
54
44
|
margin-right: 12px;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
.k-icon {
|
|
46
|
+
font-size: 20px;
|
|
47
|
+
&:hover {
|
|
58
48
|
color: var(--kui-color-danger);
|
|
59
|
-
background-color: var(--kui-color-gray-80);
|
|
60
|
-
border-radius: var(--kui-border-radius);
|
|
61
49
|
}
|
|
62
|
-
|
|
63
|
-
// transform: rotate(360deg);
|
|
64
50
|
}
|
|
65
51
|
}
|
|
66
52
|
|
|
@@ -111,35 +97,27 @@
|
|
|
111
97
|
}
|
|
112
98
|
}
|
|
113
99
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
&.k-drawer-top,
|
|
129
|
-
&.k-drawer-bottom {
|
|
130
|
-
height: 100%;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
&.k-drawer-bottom .k-drawer-box {
|
|
134
|
-
bottom: 0;
|
|
135
|
-
}
|
|
100
|
+
.k-drawer-wrap {
|
|
101
|
+
position: absolute;
|
|
102
|
+
top: 0;
|
|
103
|
+
right: 0;
|
|
104
|
+
bottom: 0;
|
|
105
|
+
left: 0;
|
|
106
|
+
z-index: 1000;
|
|
107
|
+
overflow: auto;
|
|
108
|
+
outline: 0;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
overflow: hidden;
|
|
136
113
|
}
|
|
137
114
|
|
|
138
115
|
.k-drawer-right {
|
|
139
|
-
// width: 100%;
|
|
140
116
|
height: 100%;
|
|
141
117
|
right: 0;
|
|
142
|
-
|
|
118
|
+
.k-drawer-wrap {
|
|
119
|
+
height: 100%;
|
|
120
|
+
}
|
|
143
121
|
.k-drawer-box {
|
|
144
122
|
top: 0;
|
|
145
123
|
bottom: 0;
|
|
@@ -148,7 +126,6 @@
|
|
|
148
126
|
}
|
|
149
127
|
|
|
150
128
|
.k-drawer-left {
|
|
151
|
-
// width: 0%;
|
|
152
129
|
height: 100%;
|
|
153
130
|
left: 0;
|
|
154
131
|
|
|
@@ -160,42 +137,36 @@
|
|
|
160
137
|
}
|
|
161
138
|
|
|
162
139
|
.k-drawer-top {
|
|
163
|
-
|
|
164
|
-
// height: 0;
|
|
140
|
+
height: 100%;
|
|
165
141
|
top: 0;
|
|
166
142
|
|
|
167
143
|
.k-drawer-box {
|
|
168
144
|
top: 0;
|
|
169
145
|
left: 0;
|
|
170
146
|
width: 100%;
|
|
171
|
-
// height: 0;
|
|
172
147
|
}
|
|
173
148
|
}
|
|
174
149
|
|
|
175
150
|
.k-drawer-bottom {
|
|
176
|
-
|
|
177
|
-
// height: 0;
|
|
178
|
-
// bottom: 0;
|
|
179
|
-
// right: 0;
|
|
180
|
-
// left: 0;
|
|
151
|
+
height: 100%;
|
|
181
152
|
|
|
182
153
|
.k-drawer-box {
|
|
183
154
|
width: 100%;
|
|
184
|
-
// height: 0;
|
|
185
155
|
left: 0;
|
|
186
156
|
bottom: 0;
|
|
187
157
|
}
|
|
188
158
|
}
|
|
189
159
|
|
|
190
|
-
.k-drawer-
|
|
191
|
-
position:
|
|
160
|
+
.k-drawer-to-body {
|
|
161
|
+
position: fixed;
|
|
192
162
|
pointer-events: none;
|
|
193
163
|
top: 0;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
164
|
+
height: auto;
|
|
165
|
+
.k-drawer-wrap {
|
|
166
|
+
position: fixed;
|
|
167
|
+
}
|
|
168
|
+
.k-drawer-mask-to-body {
|
|
169
|
+
position: fixed;
|
|
199
170
|
pointer-events: all;
|
|
200
171
|
}
|
|
201
172
|
|
|
@@ -204,6 +175,6 @@
|
|
|
204
175
|
}
|
|
205
176
|
}
|
|
206
177
|
|
|
207
|
-
.k-drawer-
|
|
178
|
+
.k-drawer-no-mask {
|
|
208
179
|
pointer-events: none;
|
|
209
|
-
}
|
|
180
|
+
}
|