kui-vue 3.6.5 → 3.6.8
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/alert/alert.jsx +26 -7
- package/components/alert/demo/basic.md +4 -4
- package/components/alert/demo/icon.md +15 -6
- package/components/alert/styles/index.less +42 -14
- package/components/avatar/styles/index.less +5 -5
- package/components/backtop/styles/index.less +10 -14
- package/components/badge/styles/index.less +7 -13
- package/components/breadcrumb/index.md +7 -6
- package/components/breadcrumb/styles/index.less +7 -21
- package/components/button/demo/color.md +0 -1
- package/components/button/demo/disabled.md +6 -0
- package/components/button/demo/light.md +1 -1
- package/components/button/styles/index.less +165 -111
- package/components/card/card.jsx +1 -1
- package/components/card/demo/basic.md +1 -1
- package/components/card/demo/border.md +1 -1
- package/components/card/demo/notitle.md +1 -1
- package/components/card/styles/index.less +5 -4
- package/components/carousel/carousel.jsx +186 -175
- package/components/carousel/styles/index.less +11 -16
- package/components/checkbox/checkbox.jsx +2 -2
- package/components/checkbox/styles/index.less +21 -29
- package/components/collapse/styles/index.less +7 -11
- package/components/colorPicker/styles/index.less +83 -71
- package/components/config/context.js +21 -0
- package/components/config/index.js +10 -2
- package/components/datePicker/datepicker.jsx +6 -7
- package/components/datePicker/styles/index.less +54 -57
- package/components/descriptions/styles/index.less +8 -17
- package/components/divider/styles/index.less +20 -18
- package/components/drawer/styles/animal.less +0 -1
- package/components/drawer/styles/index.less +8 -11
- package/components/dropdown/styles/index.less +26 -34
- package/components/empty/index.md +3 -2
- package/components/empty/styles/index.less +2 -2
- package/components/flex/demo/align.md +1 -1
- package/components/flex/demo/basic.md +1 -2
- package/components/flex/index.md +1 -1
- package/components/form/demo/dynamicvalid.md +1 -3
- package/components/form/demo/info.md +22 -12
- package/components/form/demo/valid.md +6 -6
- package/components/form/demo/withmodal.md +2 -2
- package/components/form/styles/index.less +10 -11
- package/components/grid/index.md +4 -1
- package/components/grid/styles/index.less +1 -1
- package/components/icon/demo/search.vue +44 -21
- package/components/icon/index.md +1 -1
- package/components/icon/styles/index.less +7 -8
- package/components/image/index.md +7 -1
- package/components/image/preview.jsx +17 -4
- package/components/image/styles/index.less +36 -42
- package/components/index.js +9 -9
- package/components/input/demo/icon.md +0 -1
- package/components/input/demo/suffix.md +2 -7
- package/components/input/input.jsx +31 -29
- package/components/input/inputBox.jsx +13 -0
- package/components/input/inputGroup.jsx +2 -0
- package/components/input/styles/index.less +47 -53
- package/components/input/textarea.jsx +1 -1
- package/components/inputNumber/demo/basic.md +3 -3
- package/components/inputNumber/demo/ffix.md +2 -2
- package/components/inputNumber/inputNumber.jsx +2 -2
- package/components/inputNumber/styles/index.less +36 -42
- package/components/layout/demo/basic.md +5 -5
- package/components/layout/demo/info.md +1 -34
- package/components/layout/demo/layout1.md +7 -7
- package/components/layout/demo/layout2.md +6 -7
- package/components/layout/demo/layout3.md +5 -5
- package/components/layout/demo/layout4.md +12 -8
- package/components/layout/demo/layout5.md +6 -2
- package/components/layout/styles/index.less +1 -18
- package/components/loading/demo/info.md +3 -3
- package/components/loading/styles/index.less +31 -31
- package/components/menu/index.md +14 -3
- package/components/menu/menu.jsx +1 -1
- package/components/menu/recursiveMenu.jsx +1 -0
- package/components/menu/styles/index.less +43 -55
- package/components/message/demo/basic.md +0 -7
- package/components/message/index.js +0 -4
- package/components/message/index.md +0 -1
- package/components/message/inner.jsx +15 -2
- package/components/message/styles/index.less +12 -17
- package/components/modal/demo/confirm.md +6 -6
- package/components/modal/demo/global.md +0 -15
- package/components/modal/demo/info.md +0 -1
- package/components/modal/index.js +5 -34
- package/components/modal/index.md +1 -2
- package/components/modal/modal.jsx +2 -1
- package/components/modal/styles/index.less +14 -21
- package/components/notice/demo/basic.md +0 -9
- package/components/notice/demo/close.md +4 -0
- package/components/notice/demo/types.md +1 -2
- package/components/notice/index.js +1 -19
- package/components/notice/styles/index.less +16 -22
- package/components/page/page.jsx +5 -4
- package/components/page/styles/index.less +49 -50
- package/components/popconfirm/demo/basic.md +11 -18
- package/components/popconfirm/demo/info.md +3 -1
- package/components/popconfirm/demo/local.md +14 -20
- package/components/popconfirm/demo/placement.md +3 -9
- package/components/popconfirm/index.md +3 -2
- package/components/popconfirm/styles/index.less +9 -15
- package/components/poptip/styles/index.less +44 -49
- package/components/progress/progress.jsx +23 -5
- package/components/progress/styles/index.less +20 -19
- package/components/radio/index.md +7 -7
- package/components/radio/radio.jsx +5 -1
- package/components/radio/styles/index.less +26 -32
- package/components/rate/index.md +11 -11
- package/components/rate/styles/index.less +4 -7
- package/components/select/select.jsx +1 -1
- package/components/select/styles/index.less +38 -51
- package/components/skeleton/index.md +5 -1
- package/components/skeleton/styles/index.less +21 -19
- package/components/slider/slider.jsx +25 -13
- package/components/slider/styles/index.less +13 -12
- package/components/space/space.jsx +2 -1
- package/components/spin/styles/index.less +25 -40
- package/components/statCard/countup.jsx +8 -0
- package/components/statCard/demo/card.md +20 -6
- package/components/statCard/index.md +17 -12
- package/components/statCard/statCard.jsx +16 -1
- package/components/statCard/styles/index.less +9 -6
- package/components/styles/less-css-var.less +309 -0
- package/components/styles/less-var.less +296 -0
- package/components/styles/sys.less +19 -15
- package/components/switch/styles/index.less +9 -24
- package/components/table/index.md +1 -1
- package/components/table/styles/index.less +63 -59
- package/components/tabs/styles/index.less +22 -24
- package/components/tag/demo/basic.md +0 -8
- package/components/tag/index.md +2 -1
- package/components/tag/styles/index.less +40 -41
- package/components/tag/tag.jsx +2 -2
- package/components/timeline/styles/index.less +8 -14
- package/components/tooltip/styles/index.less +35 -40
- package/components/tree/index.md +15 -15
- package/components/tree/styles/index.less +36 -56
- package/components/tree/tree.jsx +1 -0
- package/components/treeselect/index.md +1 -1
- package/components/treeselect/styles/index.less +26 -32
- package/components/treeselect/treeselect.jsx +1 -1
- package/components/upload/demo/forms.md +0 -1
- package/components/upload/fileList.jsx +6 -3
- package/components/upload/styles/index.less +33 -29
- package/components/upload/upload.jsx +5 -1
- package/components/utils/vue.js +4 -2
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +92 -74
- 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 +15 -16
- package/types/alert/Alert.d.ts +2 -0
- package/types/card/Card.d.ts +1 -1
- package/types/checkbox/Checkbox.d.ts +1 -0
- package/types/datePicker/DatePicker.d.ts +1 -0
- package/types/index.d.ts +8 -8
- package/types/input/Input.d.ts +1 -0
- package/types/input/InputGroup.d.ts +2 -0
- package/types/input/TextArea.d.ts +1 -0
- package/types/inputNumber/InputNumber.d.ts +1 -0
- package/types/page/Page.d.ts +1 -0
- package/types/select/Select.d.ts +1 -0
- package/types/statCard/StatCard.d.ts +5 -0
- package/types/tag/Tag.d.ts +1 -0
- package/types/treeselect/TreeSelect.d.ts +1 -0
- package/components/dropdown/demo/custom.md +0 -31
- package/components/icon/lib/dist.json +0 -1
- package/components/icon/lib/kui-icons.js +0 -1
- package/components/icon/lib/sprite.svg +0 -1
- package/components/styles/color.less +0 -209
- package/components/styles/var.less +0 -207
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Icon from "../icon";
|
|
2
|
+
import { Button } from "../button";
|
|
2
3
|
import {
|
|
3
4
|
Close,
|
|
4
5
|
InformationCircle,
|
|
@@ -51,14 +52,26 @@ export default defineComponent({
|
|
|
51
52
|
children.push(<span>{content}</span>);
|
|
52
53
|
if (closable) {
|
|
53
54
|
children.push(
|
|
54
|
-
<
|
|
55
|
+
<Button
|
|
56
|
+
class="k-message-close"
|
|
57
|
+
size="small"
|
|
58
|
+
type="text"
|
|
59
|
+
icon={Close}
|
|
60
|
+
onClick={onClose}
|
|
61
|
+
/>
|
|
55
62
|
);
|
|
56
63
|
}
|
|
57
64
|
} else {
|
|
58
65
|
children.push(<div class="k-notice-title">{title}</div>);
|
|
59
66
|
children.push(<div class="k-notice-desc">{content}</div>);
|
|
60
67
|
children.push(
|
|
61
|
-
<
|
|
68
|
+
<Button
|
|
69
|
+
class="k-notice-close"
|
|
70
|
+
size="small"
|
|
71
|
+
type="text"
|
|
72
|
+
icon={Close}
|
|
73
|
+
onClick={onClose}
|
|
74
|
+
/>
|
|
62
75
|
);
|
|
63
76
|
}
|
|
64
77
|
return (
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import "../../styles/less-css-var.less";
|
|
2
2
|
|
|
3
3
|
.k-message {
|
|
4
4
|
font-size: 14px;
|
|
5
5
|
line-height: 1.5;
|
|
6
|
-
color: var(--kui-color-
|
|
6
|
+
color: var(--kui-color-text);
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
margin: 0;
|
|
9
9
|
padding: 0;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
box-sizing: content-box;
|
|
19
19
|
padding: 0 12px 14px 12px;
|
|
20
20
|
text-align: center;
|
|
21
|
-
transition: all .3s;
|
|
21
|
+
transition: all 0.3s;
|
|
22
22
|
// margin-top: -8px;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -26,9 +26,11 @@
|
|
|
26
26
|
box-sizing: content-box;
|
|
27
27
|
line-height: 1;
|
|
28
28
|
padding: 10px 12px;
|
|
29
|
-
border-radius: var(--kui-border-radius);
|
|
30
|
-
box-shadow:
|
|
31
|
-
|
|
29
|
+
border-radius: var(--kui-border-radius-card);
|
|
30
|
+
box-shadow: var(--kui-pop-shadow);
|
|
31
|
+
|
|
32
|
+
background: var(--kui-color-bg-pop);
|
|
33
|
+
border: 1px solid var(--kui-color-pop-border);
|
|
32
34
|
display: inline-flex;
|
|
33
35
|
align-items: center;
|
|
34
36
|
pointer-events: all;
|
|
@@ -42,16 +44,10 @@
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
.k-message-close {
|
|
45
|
-
overflow: hidden;
|
|
46
47
|
cursor: pointer;
|
|
47
48
|
margin-left: 15px;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
border-radius: var(--kui-border-radius);
|
|
51
|
-
padding: 2px;
|
|
52
|
-
|
|
53
|
-
&:hover {
|
|
54
|
-
background-color: var(--kui-color-gray-80);
|
|
49
|
+
.k-icon {
|
|
50
|
+
font-size: 16px;
|
|
55
51
|
}
|
|
56
52
|
}
|
|
57
53
|
}
|
|
@@ -65,7 +61,7 @@
|
|
|
65
61
|
}
|
|
66
62
|
|
|
67
63
|
.k-message-info .k-message-icon {
|
|
68
|
-
color: var(--kui-color-
|
|
64
|
+
color: var(--kui-color-primary);
|
|
69
65
|
}
|
|
70
66
|
|
|
71
67
|
.k-message-warning .k-message-icon {
|
|
@@ -84,7 +80,6 @@
|
|
|
84
80
|
}
|
|
85
81
|
}
|
|
86
82
|
|
|
87
|
-
|
|
88
83
|
.k-message-slide-enter-active,
|
|
89
84
|
.k-message-slide-leave-active {
|
|
90
85
|
animation: k-message-slide 0.3s ease;
|
|
@@ -93,4 +88,4 @@
|
|
|
93
88
|
|
|
94
89
|
.k-message-slide-leave-active {
|
|
95
90
|
animation-direction: reverse; /* ✅ 比写 reverse 简洁可控 */
|
|
96
|
-
}
|
|
91
|
+
}
|
|
@@ -18,13 +18,13 @@ import { modal, message } from "kui-vue";
|
|
|
18
18
|
|
|
19
19
|
const confirm = () => {
|
|
20
20
|
modal.confirm({
|
|
21
|
-
title: "
|
|
22
|
-
content: "
|
|
21
|
+
title: "Please confirm",
|
|
22
|
+
content: "This operation is irreversible, caution!!!!",
|
|
23
23
|
onOk: () => {
|
|
24
|
-
message.success("
|
|
24
|
+
message.success("OK");
|
|
25
25
|
},
|
|
26
26
|
onCancel: () => {
|
|
27
|
-
message.info("
|
|
27
|
+
message.info("cancel");
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
};
|
|
@@ -38,8 +38,8 @@ const custom = () => {
|
|
|
38
38
|
};
|
|
39
39
|
const Async = () => {
|
|
40
40
|
modal.confirm({
|
|
41
|
-
title: "
|
|
42
|
-
content: "
|
|
41
|
+
title: "Please confirm",
|
|
42
|
+
content: "This operation is irreversible, caution!!!!",
|
|
43
43
|
onOk: () => {
|
|
44
44
|
return new Promise((resolve, reject) => {
|
|
45
45
|
setTimeout(resolve, 2000);
|
|
@@ -12,26 +12,11 @@
|
|
|
12
12
|
<Button @click="info" type="primary">Info</Button>
|
|
13
13
|
<Button @click="show" :icon="Moon">Custom icon</Button>
|
|
14
14
|
</Space>
|
|
15
|
-
<p>
|
|
16
|
-
<Button @click="useModalShow">useModal</Button>
|
|
17
|
-
</p>
|
|
18
15
|
</template>
|
|
19
16
|
<script setup>
|
|
20
17
|
import { Moon } from "kui-icons";
|
|
21
18
|
import { modal, message } from "kui-vue";
|
|
22
19
|
|
|
23
|
-
// 使用 useModal
|
|
24
|
-
const useModal = modal.useModal();
|
|
25
|
-
const useModalShow = () => {
|
|
26
|
-
useModal.success({
|
|
27
|
-
title: "操作成功",
|
|
28
|
-
content: "恭喜你操作成功!",
|
|
29
|
-
onOk: () => {
|
|
30
|
-
message.info("success");
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
|
|
35
20
|
//
|
|
36
21
|
const success = () => {
|
|
37
22
|
modal.success({
|
|
@@ -2,16 +2,11 @@ import Modal from "./modal.jsx";
|
|
|
2
2
|
import Toast from "./toast";
|
|
3
3
|
// import { /*createVNode, render,*/ inject } from "vue"; // for 3
|
|
4
4
|
import { createVNode, render } from "../utils/vue"; //for 2
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { recordMousePoint } from "../config/context";
|
|
7
6
|
let modalList = [];
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
window.__kui__point = { x: e.clientX, y: e.clientY };
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
let createInstance = (props = {}, context = null) => {
|
|
8
|
+
recordMousePoint();
|
|
9
|
+
let showModal = (props = {}, context = null) => {
|
|
15
10
|
const container = document.createElement("div");
|
|
16
11
|
document.body.appendChild(container);
|
|
17
12
|
const vm = createVNode(
|
|
@@ -41,22 +36,17 @@ let createInstance = (props = {}, context = null) => {
|
|
|
41
36
|
document.body.contains(container) && document.body.removeChild(container);
|
|
42
37
|
}, 300);
|
|
43
38
|
};
|
|
44
|
-
return instance;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
let getModal = (props = {}, context = null) => {
|
|
48
|
-
let instance = createInstance(props, context);
|
|
49
39
|
instance.show();
|
|
50
40
|
modalList.push(instance);
|
|
51
41
|
return instance;
|
|
52
42
|
};
|
|
53
43
|
|
|
54
44
|
["info", "success", "warning", "error", "confirm"].forEach((type) => {
|
|
55
|
-
Modal[type] = (props = {}) =>
|
|
45
|
+
Modal[type] = (props = {}) => showModal(Object.assign({ type }, props));
|
|
56
46
|
});
|
|
57
47
|
|
|
58
48
|
Modal.show = (props = {}) => {
|
|
59
|
-
return
|
|
49
|
+
return showModal(props);
|
|
60
50
|
};
|
|
61
51
|
|
|
62
52
|
Modal.destroyAll = () => {
|
|
@@ -69,23 +59,4 @@ Modal.install = (app) => {
|
|
|
69
59
|
// app.config.globalProperties.$modal = Modal;
|
|
70
60
|
app.prototype.$modal = Modal;
|
|
71
61
|
};
|
|
72
|
-
|
|
73
|
-
Modal.useModal = () => {
|
|
74
|
-
// return inject("modal"); //for 3
|
|
75
|
-
const instance = getCurrentInstance();
|
|
76
|
-
const proxy = instance ? instance.proxy : null;
|
|
77
|
-
// console.log(proxy);
|
|
78
|
-
const modalWrapper = {};
|
|
79
|
-
|
|
80
|
-
["info", "success", "warning", "error", "confirm", "show"].forEach((type) => {
|
|
81
|
-
modalWrapper[type] = (props = {}) => {
|
|
82
|
-
const config = type === "show" ? props : Object.assign({ type }, props);
|
|
83
|
-
return getModal(config, proxy);
|
|
84
|
-
};
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
modalWrapper.destroyAll = Modal.destroyAll;
|
|
88
|
-
|
|
89
|
-
return modalWrapper;
|
|
90
|
-
};
|
|
91
62
|
export default Modal;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
| centered | 窗口是否可以居中 , confirm 模式不可用 | Boolean | false |
|
|
12
12
|
| maximized | 弹框是否可以最大化显示 , confirm 模式不可用 | Boolean | false |
|
|
13
13
|
| mask-closable | 是否点击遮罩关闭弹窗, 为否时 Esc 键将失效 | Boolean | true |
|
|
14
|
-
| ok | 点击确定的回调,`注意:不会关闭 Modal
|
|
14
|
+
| ok | 点击确定的回调,`注意:不会关闭 Modal` | Function | - |
|
|
15
15
|
| cancel | 点击取消的回调 | Function | - |
|
|
16
16
|
| close | 窗口关闭的回调 | Function | - |
|
|
17
17
|
| escKey | 是否支持按 Esc 关闭 | Boolean | true |
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
- modal.success(options)
|
|
25
25
|
- modal.warning(options)
|
|
26
26
|
- modal.error(options)
|
|
27
|
-
- modal.show(options)
|
|
28
27
|
- modal.confirm(options)
|
|
29
28
|
|
|
30
29
|
另外提供了全局配置和全局销毁的方法:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Button } from "../button";
|
|
2
2
|
import transfer from "../directives/transfer";
|
|
3
3
|
import { Close } from "kui-icons";
|
|
4
|
+
import { getMousePoint } from "../config/context";
|
|
4
5
|
import {
|
|
5
6
|
defineComponent,
|
|
6
7
|
ref,
|
|
@@ -120,7 +121,7 @@ const Modal = defineComponent({
|
|
|
120
121
|
};
|
|
121
122
|
const updateOrigin = () => {
|
|
122
123
|
if (refModal.value) {
|
|
123
|
-
let { x, y } =
|
|
124
|
+
let { x, y } = getMousePoint();
|
|
124
125
|
let { left, top } = getOffset(refModal.value);
|
|
125
126
|
refModal.value.style["transform-origin"] = `${x - left}px ${y - top}px`;
|
|
126
127
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
@import "../../styles/var.less";
|
|
1
|
+
@import "../../styles/less-css-var.less";
|
|
2
2
|
|
|
3
3
|
.k-modal {
|
|
4
|
-
color: var(--kui-color-
|
|
4
|
+
color: var(--kui-color-text);
|
|
5
5
|
|
|
6
6
|
.k-modal-wrap {
|
|
7
7
|
position: fixed;
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
z-index: 1001;
|
|
13
13
|
overflow: auto;
|
|
14
14
|
outline: 0;
|
|
15
|
-
-webkit-overflow-scrolling: touch;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
.k-modal-mask {
|
|
@@ -21,7 +20,7 @@
|
|
|
21
20
|
bottom: 0;
|
|
22
21
|
left: 0;
|
|
23
22
|
right: 0;
|
|
24
|
-
background-color:
|
|
23
|
+
background-color: var(--kui-color-mask);
|
|
25
24
|
height: 100%;
|
|
26
25
|
z-index: 1001;
|
|
27
26
|
overflow: hidden;
|
|
@@ -29,16 +28,17 @@
|
|
|
29
28
|
|
|
30
29
|
.k-modal-inner {
|
|
31
30
|
position: relative;
|
|
32
|
-
background-color: var(--kui-color-
|
|
33
|
-
border: 1px solid var(--kui-color-
|
|
31
|
+
background-color: var(--kui-color-bg-pop);
|
|
32
|
+
border: 1px solid var(--kui-color-pop-border);
|
|
34
33
|
z-index: 1001;
|
|
35
34
|
outline: 0;
|
|
36
35
|
border-radius: 12px;
|
|
37
36
|
top: 100px;
|
|
38
37
|
overflow: hidden;
|
|
39
38
|
margin: 0 auto;
|
|
40
|
-
box-shadow:
|
|
41
|
-
|
|
39
|
+
box-shadow: var(--kui-pop-shadow);
|
|
40
|
+
|
|
41
|
+
width: 480px;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
.k-modal-content {
|
|
@@ -51,8 +51,6 @@
|
|
|
51
51
|
|
|
52
52
|
.k-modal-close {
|
|
53
53
|
position: absolute;
|
|
54
|
-
cursor: pointer;
|
|
55
|
-
color: var(--kui-color-font);
|
|
56
54
|
top: 20px;
|
|
57
55
|
right: 20px;
|
|
58
56
|
transition: all 0.3s ease-in-out;
|
|
@@ -61,17 +59,14 @@
|
|
|
61
59
|
}
|
|
62
60
|
&:hover {
|
|
63
61
|
color: var(--kui-color-danger);
|
|
64
|
-
border-radius: var(--kui-border-radius);
|
|
65
|
-
background-color: var(--kui-color-gray-80);
|
|
66
|
-
// transform: rotate(360deg);
|
|
67
62
|
}
|
|
68
63
|
}
|
|
69
64
|
|
|
70
65
|
.k-modal-header {
|
|
71
|
-
// border-bottom: 1px solid var(--kui-color-gray-80);
|
|
72
66
|
padding: 20px 0;
|
|
73
67
|
line-height: 1;
|
|
74
68
|
font-size: 14px;
|
|
69
|
+
-webkit-user-select: none;
|
|
75
70
|
user-select: none;
|
|
76
71
|
|
|
77
72
|
.k-modal-header-inner {
|
|
@@ -86,17 +81,14 @@
|
|
|
86
81
|
}
|
|
87
82
|
|
|
88
83
|
.k-modal-body {
|
|
89
|
-
// padding:20px 0;
|
|
90
84
|
margin-bottom: 20px;
|
|
91
85
|
font-size: 14px;
|
|
92
86
|
line-height: 1.5;
|
|
93
|
-
// height: calc(100% - 43px - 45px);
|
|
94
87
|
overflow: auto;
|
|
95
88
|
box-sizing: border-box;
|
|
96
89
|
}
|
|
97
90
|
|
|
98
91
|
.k-modal-footer {
|
|
99
|
-
// border-top: 1px solid var(--kui-color-gray-80);
|
|
100
92
|
padding: 0 0 20px 0;
|
|
101
93
|
text-align: right;
|
|
102
94
|
display: inline-block;
|
|
@@ -166,7 +158,6 @@
|
|
|
166
158
|
width: 100%;
|
|
167
159
|
bottom: 0;
|
|
168
160
|
left: 0;
|
|
169
|
-
background: var(--kui-color-back-10);
|
|
170
161
|
box-sizing: border-box;
|
|
171
162
|
padding-right: 20px;
|
|
172
163
|
}
|
|
@@ -176,7 +167,7 @@
|
|
|
176
167
|
.k-toast {
|
|
177
168
|
.k-modal-inner {
|
|
178
169
|
width: 416px;
|
|
179
|
-
background: var(--kui-color-
|
|
170
|
+
background: var(--kui-color-bg-pop);
|
|
180
171
|
border-radius: var(--kui-border-radius);
|
|
181
172
|
padding: 20px;
|
|
182
173
|
border-radius: 12px;
|
|
@@ -184,6 +175,8 @@
|
|
|
184
175
|
}
|
|
185
176
|
|
|
186
177
|
.k-toast-header {
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
187
180
|
.k-toast-icon {
|
|
188
181
|
font-size: 28px;
|
|
189
182
|
margin-right: 12px;
|
|
@@ -200,7 +193,7 @@
|
|
|
200
193
|
|
|
201
194
|
.k-toast-content {
|
|
202
195
|
padding-left: 40px;
|
|
203
|
-
|
|
196
|
+
margin-top: 8px;
|
|
204
197
|
font-size: 14px;
|
|
205
198
|
}
|
|
206
199
|
|
|
@@ -227,7 +220,7 @@
|
|
|
227
220
|
}
|
|
228
221
|
|
|
229
222
|
.k-toast-info .k-toast-icon {
|
|
230
|
-
color: var(--kui-color-
|
|
223
|
+
color: var(--kui-color-primary);
|
|
231
224
|
}
|
|
232
225
|
|
|
233
226
|
.k-toast-confirm .k-toast-icon {
|
|
@@ -7,19 +7,10 @@
|
|
|
7
7
|
<template>
|
|
8
8
|
<Space vertical>
|
|
9
9
|
<Button @click="info" type="primary">普通提示</Button>
|
|
10
|
-
<Button @click="useNotice" type="primary">useNotice</Button>
|
|
11
10
|
</Space>
|
|
12
11
|
</template>
|
|
13
12
|
<script setup>
|
|
14
13
|
import { notice } from "kui-vue";
|
|
15
|
-
const api = notice.useNotice();
|
|
16
|
-
const useNotice = () => {
|
|
17
|
-
api.open({
|
|
18
|
-
title: "通知的标题",
|
|
19
|
-
content: "通知的描述",
|
|
20
|
-
duration: 5,
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
14
|
const info = () => {
|
|
24
15
|
notice.open({
|
|
25
16
|
title: "通知的标题",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
<Button @click="config">10秒后关闭</Button>
|
|
10
10
|
<Button @click="config2" type="primary">5秒后关闭</Button>
|
|
11
11
|
<Button @click="config3" type="primary">手动关闭</Button>
|
|
12
|
+
<Button @click="destroy" type="primary">destroy</Button>
|
|
12
13
|
</Space>
|
|
13
14
|
</template>
|
|
14
15
|
<script setup>
|
|
@@ -41,5 +42,8 @@ const config3 = () => {
|
|
|
41
42
|
},
|
|
42
43
|
});
|
|
43
44
|
};
|
|
45
|
+
const destroy = () => {
|
|
46
|
+
notice.destroy();
|
|
47
|
+
};
|
|
44
48
|
</script>
|
|
45
49
|
```
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// import { inject } from "vue";
|
|
2
2
|
import newInstance from "../message/instance";
|
|
3
3
|
import { withInstall } from "../utils/vue";
|
|
4
|
-
import { getCurrentInstance } from "vue";
|
|
5
4
|
let noticeInstance;
|
|
6
5
|
|
|
7
6
|
let Notice = {
|
|
@@ -20,27 +19,10 @@ let Notice = {
|
|
|
20
19
|
destroy() {
|
|
21
20
|
if (noticeInstance) {
|
|
22
21
|
noticeInstance.destroy();
|
|
22
|
+
document.body.removeChild(noticeInstance.$el);
|
|
23
23
|
noticeInstance = null;
|
|
24
|
-
document.body.removeChild(document.querySelector(".k-notice"));
|
|
25
24
|
}
|
|
26
25
|
},
|
|
27
|
-
useNotice() {
|
|
28
|
-
// return inject("notice"); //for 3
|
|
29
|
-
const instance = getCurrentInstance();
|
|
30
|
-
const proxy = instance ? instance.proxy : null;
|
|
31
|
-
// console.log(proxy);
|
|
32
|
-
const noticeWrapper = {};
|
|
33
|
-
|
|
34
|
-
["info", "success", "warning", "error", "open"].forEach((type) => {
|
|
35
|
-
noticeWrapper[type] = (props = {}) => {
|
|
36
|
-
return Notice.open({ type, ...props }, proxy);
|
|
37
|
-
};
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
noticeWrapper.destroy = noticeWrapper.destroy;
|
|
41
|
-
|
|
42
|
-
return noticeWrapper;
|
|
43
|
-
},
|
|
44
26
|
install(app) {
|
|
45
27
|
// app.provide("notice", Notice);
|
|
46
28
|
// 可选:同时挂到 globalProperties 兼容 this.$notice
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import "../../styles/less-css-var.less";
|
|
2
2
|
|
|
3
3
|
.k-notice {
|
|
4
4
|
font-size: 14px;
|
|
5
5
|
line-height: 1.5;
|
|
6
|
-
color: var(--kui-color-
|
|
6
|
+
color: var(--kui-color-text);
|
|
7
7
|
-webkit-box-sizing: border-box;
|
|
8
8
|
box-sizing: border-box;
|
|
9
9
|
margin: 0;
|
|
@@ -20,12 +20,13 @@
|
|
|
20
20
|
|
|
21
21
|
.k-notice-box {
|
|
22
22
|
box-sizing: content-box;
|
|
23
|
-
transition: all .3s ease-in-out;
|
|
23
|
+
transition: all 0.3s ease-in-out;
|
|
24
24
|
padding: 16px 35px 16px 16px;
|
|
25
|
-
border-radius: var(--kui-border-radius);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
background: var(--kui-color-
|
|
25
|
+
border-radius: var(--kui-border-radius-card);
|
|
26
|
+
box-shadow: var(--kui-pop-shadow);
|
|
27
|
+
|
|
28
|
+
background: var(--kui-color-bg-pop);
|
|
29
|
+
border: 1px solid var(--kui-color-pop-border);
|
|
29
30
|
line-height: 1.5;
|
|
30
31
|
position: relative;
|
|
31
32
|
margin-bottom: 16px;
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
|
|
39
40
|
.k-notice-title {
|
|
40
41
|
font-size: 16px;
|
|
41
|
-
color: var(--kui-color-title);
|
|
42
|
+
color: var(--kui-color-text-title);
|
|
42
43
|
margin-bottom: 8px;
|
|
43
44
|
line-height: 22px;
|
|
44
45
|
vertical-align: middle;
|
|
@@ -64,20 +65,13 @@
|
|
|
64
65
|
right: 8px;
|
|
65
66
|
top: 13px;
|
|
66
67
|
outline: none;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
font-size: 20px;
|
|
70
|
-
padding: 3px;
|
|
71
|
-
display: block;
|
|
72
|
-
border-radius: var(--kui-border-radius);
|
|
73
|
-
|
|
74
|
-
&:hover {
|
|
75
|
-
background-color: var(--kui-color-gray-80);
|
|
68
|
+
.k-icon {
|
|
69
|
+
font-size: 16px;
|
|
76
70
|
}
|
|
77
71
|
}
|
|
78
72
|
|
|
79
73
|
.k-notice-info .k-notice-icon {
|
|
80
|
-
color: var(--kui-color-
|
|
74
|
+
color: var(--kui-color-primary);
|
|
81
75
|
}
|
|
82
76
|
|
|
83
77
|
.k-notice-error .k-notice-icon {
|
|
@@ -111,14 +105,14 @@
|
|
|
111
105
|
|
|
112
106
|
to {
|
|
113
107
|
opacity: 0;
|
|
114
|
-
transform: scaleY(.5);
|
|
108
|
+
transform: scaleY(0.5);
|
|
115
109
|
}
|
|
116
110
|
}
|
|
117
111
|
|
|
118
112
|
.k-notice-slide-enter-active {
|
|
119
|
-
animation: k-notice-slide-in .3s ease;
|
|
113
|
+
animation: k-notice-slide-in 0.3s ease;
|
|
120
114
|
}
|
|
121
115
|
|
|
122
116
|
.k-notice-slide-leave-active {
|
|
123
|
-
animation: k-notice-slide-out .3s ease;
|
|
124
|
-
}
|
|
117
|
+
animation: k-notice-slide-out 0.3s ease;
|
|
118
|
+
}
|
package/components/page/page.jsx
CHANGED
|
@@ -18,7 +18,7 @@ const Page = defineComponent({
|
|
|
18
18
|
showSizer: Boolean,
|
|
19
19
|
showTotal: { type: Boolean, default: true },
|
|
20
20
|
showElevator: Boolean,
|
|
21
|
-
theme: String,
|
|
21
|
+
theme: { type: String, default: "light" },
|
|
22
22
|
sizeData: { type: Array, default: () => [10, 15, 20, 30, 40] },
|
|
23
23
|
size: {
|
|
24
24
|
default: "default",
|
|
@@ -48,13 +48,13 @@ const Page = defineComponent({
|
|
|
48
48
|
(v) => {
|
|
49
49
|
defaultPageSize.value = v;
|
|
50
50
|
resetPage();
|
|
51
|
-
}
|
|
51
|
+
},
|
|
52
52
|
);
|
|
53
53
|
watch(
|
|
54
54
|
() => ps.total,
|
|
55
55
|
(v) => {
|
|
56
56
|
resetPage();
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
58
|
);
|
|
59
59
|
|
|
60
60
|
watch(
|
|
@@ -62,7 +62,7 @@ const Page = defineComponent({
|
|
|
62
62
|
(v) => {
|
|
63
63
|
defaultPage.value = v;
|
|
64
64
|
resetPage();
|
|
65
|
-
}
|
|
65
|
+
},
|
|
66
66
|
);
|
|
67
67
|
|
|
68
68
|
const resetPage = () => {
|
|
@@ -262,6 +262,7 @@ const Page = defineComponent({
|
|
|
262
262
|
size,
|
|
263
263
|
theme: ps.theme,
|
|
264
264
|
disabled: ps.disabled,
|
|
265
|
+
clearable: false,
|
|
265
266
|
},
|
|
266
267
|
// value: defaultPage.value,
|
|
267
268
|
on: {
|