ct-component-plus 0.0.41 → 0.0.43
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/package.json +36 -36
- package/packages/components/button/index.js +8 -8
- package/packages/components/button/src/button.vue +171 -171
- package/packages/components/cascader/index.js +7 -7
- package/packages/components/cascader/src/cascader.vue +247 -247
- package/packages/components/cascader/src/ct-cascader.vue +260 -260
- package/packages/components/cascader/src/index.js +50 -50
- package/packages/components/checkbox/index.js +7 -7
- package/packages/components/checkbox/src/checkbox.vue +51 -51
- package/packages/components/checkbox/src/index.js +12 -12
- package/packages/components/date-picker/index.js +8 -8
- package/packages/components/date-picker/src/clear-icon.vue +2 -2
- package/packages/components/date-picker/src/date-icon.vue +2 -2
- package/packages/components/date-picker/src/date-picker.vue +77 -77
- package/packages/components/date-picker/src/index.js +33 -33
- package/packages/components/dialog/index.js +8 -8
- package/packages/components/dialog/src/dialog.vue +103 -103
- package/packages/components/empty/index.js +8 -8
- package/packages/components/empty/src/empty.vue +97 -97
- package/packages/components/index.js +81 -81
- package/packages/components/input/index.js +7 -7
- package/packages/components/input/src/index.js +13 -13
- package/packages/components/input/src/input.vue +106 -106
- package/packages/components/input-range/index.js +7 -7
- package/packages/components/input-range/src/index.js +29 -29
- package/packages/components/input-range/src/input-range.vue +233 -233
- package/packages/components/loading/index.js +7 -7
- package/packages/components/loading/src/CtLoading.vue +74 -74
- package/packages/components/loading/src/beating.vue +71 -71
- package/packages/components/loading/src/progress.vue +120 -120
- package/packages/components/loading/src/spinner.vue +38 -38
- package/packages/components/menu/index.js +7 -7
- package/packages/components/menu/src/item.vue +46 -46
- package/packages/components/menu/src/link.vue +28 -28
- package/packages/components/menu/src/logo.vue +25 -25
- package/packages/components/menu/src/menu-item.vue +103 -103
- package/packages/components/menu/src/menu.vue +191 -191
- package/packages/components/menu/src/utils/index.js +4 -4
- package/packages/components/message/icon/ErrorIcon.vue +25 -25
- package/packages/components/message/icon/InfoIcon.vue +25 -25
- package/packages/components/message/icon/SuccessIcon.vue +25 -25
- package/packages/components/message/icon/WarningIcon.vue +25 -25
- package/packages/components/message/index.js +8 -8
- package/packages/components/message/src/method.js +54 -54
- package/packages/components/message-box/index.js +7 -7
- package/packages/components/message-box/src/message-box.vue +107 -107
- package/packages/components/page/index.js +7 -7
- package/packages/components/page/src/modules/DownloadButton.vue +21 -21
- package/packages/components/page/src/modules/TableTitle.vue +151 -151
- package/packages/components/page/src/page.vue +382 -382
- package/packages/components/pagination/index.js +7 -7
- package/packages/components/pagination/src/pagination.vue +36 -36
- package/packages/components/radio/index.js +7 -7
- package/packages/components/radio/src/index.js +12 -12
- package/packages/components/radio/src/radio.vue +47 -47
- package/packages/components/search-box/index.js +24 -24
- package/packages/components/search-box/src/index.js +29 -29
- package/packages/components/search-box/src/search-box.vue +250 -251
- package/packages/components/search-box/src/slot.vue +4 -4
- package/packages/components/select/index.js +7 -7
- package/packages/components/select/src/arrow-down.vue +2 -2
- package/packages/components/select/src/clear-icon.vue +2 -2
- package/packages/components/select/src/empty.vue +13 -13
- package/packages/components/select/src/index.js +51 -51
- package/packages/components/select/src/select.vue +380 -380
- package/packages/components/table/index.js +7 -7
- package/packages/components/table/src/TableSort.vue +179 -179
- package/packages/components/table/src/index.js +70 -62
- package/packages/components/table/src/table.vue +287 -279
- package/packages/components/tabs/index.js +7 -7
- package/packages/components/tabs/src/tabs.vue +225 -225
- package/packages/components/year-select/index.js +7 -7
- package/packages/components/year-select/src/index.js +44 -44
- package/packages/components/year-select/src/year-select.vue +273 -273
- package/packages/echarts/bar/index.js +63 -63
- package/packages/echarts/base.js +99 -95
- package/packages/echarts/line/index.js +106 -106
- package/packages/hooks/index.js +5 -5
- package/packages/hooks/use-buried/index.js +46 -46
- package/packages/hooks/use-checked-all/index.js +37 -37
- package/packages/hooks/use-echarts/index.js +1 -1
- package/packages/hooks/use-echarts/use-bar/index.js +72 -72
- package/packages/hooks/use-echarts/use-line/index.js +88 -88
- package/packages/hooks/use-namespace/index.js +65 -65
- package/packages/hooks/use-search-component/index.js +28 -28
- package/packages/style/element.less +725 -724
- package/packages/style/index.js +2 -2
- package/packages/style/init.less +114 -114
- package/packages/utils/index.js +1 -1
- package/packages/utils/operate.js +77 -77
- package/packages/utils/types.js +35 -35
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
import { ElMessage } from "element-plus";
|
|
2
|
-
import SuccessIcon from "../icon/SuccessIcon.vue";
|
|
3
|
-
import InfoIcon from "../icon/InfoIcon.vue";
|
|
4
|
-
import WarningIcon from "../icon/WarningIcon.vue";
|
|
5
|
-
import ErrorIcon from "../icon/ErrorIcon.vue";
|
|
6
|
-
const success = (message, option) => {
|
|
7
|
-
ElMessage({
|
|
8
|
-
type: 'success',
|
|
9
|
-
customClass: 'ct-message--success',
|
|
10
|
-
message: message,
|
|
11
|
-
duration: 3000,
|
|
12
|
-
showClose: true,
|
|
13
|
-
icon: SuccessIcon,
|
|
14
|
-
...option
|
|
15
|
-
})
|
|
16
|
-
}
|
|
17
|
-
const info = (message, option) => {
|
|
18
|
-
ElMessage({
|
|
19
|
-
type: 'info',
|
|
20
|
-
customClass: 'ct-message--info',
|
|
21
|
-
message: message,
|
|
22
|
-
duration: 3000,
|
|
23
|
-
showClose: true,
|
|
24
|
-
icon: InfoIcon,
|
|
25
|
-
...option
|
|
26
|
-
})
|
|
27
|
-
}
|
|
28
|
-
const warning = (message, option) => {
|
|
29
|
-
ElMessage({
|
|
30
|
-
type: 'warning',
|
|
31
|
-
customClass: 'ct-message--warning',
|
|
32
|
-
message: message,
|
|
33
|
-
duration: 3000,
|
|
34
|
-
showClose: true,
|
|
35
|
-
icon: WarningIcon,
|
|
36
|
-
...option
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
const error = (message, option) => {
|
|
40
|
-
ElMessage({
|
|
41
|
-
type: 'error',
|
|
42
|
-
customClass: 'ct-message--error',
|
|
43
|
-
message: message,
|
|
44
|
-
duration: 3000,
|
|
45
|
-
showClose: true,
|
|
46
|
-
icon: ErrorIcon,
|
|
47
|
-
...option
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
export default {
|
|
51
|
-
success,
|
|
52
|
-
info,
|
|
53
|
-
warning,
|
|
54
|
-
error
|
|
1
|
+
import { ElMessage } from "element-plus";
|
|
2
|
+
import SuccessIcon from "../icon/SuccessIcon.vue";
|
|
3
|
+
import InfoIcon from "../icon/InfoIcon.vue";
|
|
4
|
+
import WarningIcon from "../icon/WarningIcon.vue";
|
|
5
|
+
import ErrorIcon from "../icon/ErrorIcon.vue";
|
|
6
|
+
const success = (message, option) => {
|
|
7
|
+
ElMessage({
|
|
8
|
+
type: 'success',
|
|
9
|
+
customClass: 'ct-message--success',
|
|
10
|
+
message: message,
|
|
11
|
+
duration: 3000,
|
|
12
|
+
showClose: true,
|
|
13
|
+
icon: SuccessIcon,
|
|
14
|
+
...option
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
const info = (message, option) => {
|
|
18
|
+
ElMessage({
|
|
19
|
+
type: 'info',
|
|
20
|
+
customClass: 'ct-message--info',
|
|
21
|
+
message: message,
|
|
22
|
+
duration: 3000,
|
|
23
|
+
showClose: true,
|
|
24
|
+
icon: InfoIcon,
|
|
25
|
+
...option
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
const warning = (message, option) => {
|
|
29
|
+
ElMessage({
|
|
30
|
+
type: 'warning',
|
|
31
|
+
customClass: 'ct-message--warning',
|
|
32
|
+
message: message,
|
|
33
|
+
duration: 3000,
|
|
34
|
+
showClose: true,
|
|
35
|
+
icon: WarningIcon,
|
|
36
|
+
...option
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
const error = (message, option) => {
|
|
40
|
+
ElMessage({
|
|
41
|
+
type: 'error',
|
|
42
|
+
customClass: 'ct-message--error',
|
|
43
|
+
message: message,
|
|
44
|
+
duration: 3000,
|
|
45
|
+
showClose: true,
|
|
46
|
+
icon: ErrorIcon,
|
|
47
|
+
...option
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
export default {
|
|
51
|
+
success,
|
|
52
|
+
info,
|
|
53
|
+
warning,
|
|
54
|
+
error
|
|
55
55
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import CtMessageBox from './src/message-box.vue';
|
|
2
|
-
|
|
3
|
-
/* istanbul ignore next */
|
|
4
|
-
CtMessageBox.install = function (Vue) {
|
|
5
|
-
Vue.component('CtMessageBox', CtMessageBox);
|
|
6
|
-
};
|
|
7
|
-
|
|
1
|
+
import CtMessageBox from './src/message-box.vue';
|
|
2
|
+
|
|
3
|
+
/* istanbul ignore next */
|
|
4
|
+
CtMessageBox.install = function (Vue) {
|
|
5
|
+
Vue.component('CtMessageBox', CtMessageBox);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
8
|
export default CtMessageBox;
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
:class="[ns.b()]"
|
|
4
|
-
v-model="dialogVisible"
|
|
5
|
-
:title="title"
|
|
6
|
-
:width="width"
|
|
7
|
-
:show-close="false"
|
|
8
|
-
:close-on-click-modal="false"
|
|
9
|
-
:close-on-press-escape="false"
|
|
10
|
-
append-to-body
|
|
11
|
-
>
|
|
12
|
-
<template #header="{ titleId, titleClass }">
|
|
13
|
-
<div :id="titleId" :class="[titleClass, ns.e('title')]">
|
|
14
|
-
<ct-icon
|
|
15
|
-
name="tip_solid"
|
|
16
|
-
:color="iconColor"
|
|
17
|
-
size="26"
|
|
18
|
-
:style="{ color: iconColor }"
|
|
19
|
-
></ct-icon>
|
|
20
|
-
{{ title }}
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
<slot></slot>
|
|
24
|
-
<template #footer>
|
|
25
|
-
<el-button :type="buttonType" @click="handleConfirm">确定</el-button>
|
|
26
|
-
</template>
|
|
27
|
-
</el-dialog>
|
|
28
|
-
</template>
|
|
29
|
-
|
|
30
|
-
<script setup>
|
|
31
|
-
import { ref, reactive, onMounted, computed } from "vue";
|
|
32
|
-
import { useNamespace } from "../../../hooks";
|
|
33
|
-
const ns = useNamespace("message-box");
|
|
34
|
-
|
|
35
|
-
const props = defineProps({
|
|
36
|
-
modelValue: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
required: true,
|
|
39
|
-
},
|
|
40
|
-
title: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: "登录异常通知",
|
|
43
|
-
},
|
|
44
|
-
width: {
|
|
45
|
-
type: [String, Number],
|
|
46
|
-
default: 480,
|
|
47
|
-
},
|
|
48
|
-
type: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: "info",
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
const emit = defineEmits(["update:modelValue", "handleConfirm"]);
|
|
54
|
-
|
|
55
|
-
const dialogVisible = computed({
|
|
56
|
-
get() {
|
|
57
|
-
return props.modelValue;
|
|
58
|
-
},
|
|
59
|
-
set(val) {
|
|
60
|
-
emit("update:modelValue", val);
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
const buttonType = computed(() => {
|
|
64
|
-
return props.type == "info"
|
|
65
|
-
? "primary"
|
|
66
|
-
: props.type == "error"
|
|
67
|
-
? "danger"
|
|
68
|
-
: "warning";
|
|
69
|
-
});
|
|
70
|
-
const iconColor = computed(() => {
|
|
71
|
-
return props.type == "info"
|
|
72
|
-
? "#4D64FF"
|
|
73
|
-
: props.type == "error"
|
|
74
|
-
? "#FF4D4D"
|
|
75
|
-
: "#FFAD2C";
|
|
76
|
-
});
|
|
77
|
-
const handleConfirm = () => {
|
|
78
|
-
emit("handleConfirm");
|
|
79
|
-
};
|
|
80
|
-
</script>
|
|
81
|
-
|
|
82
|
-
<style lang='less'>
|
|
83
|
-
.el-dialog.ct-message-box{
|
|
84
|
-
border-radius: var(--ct-border-radius-l);
|
|
85
|
-
@R: .el-dialog;
|
|
86
|
-
@{R}__header {
|
|
87
|
-
padding: 24px 40px !important;
|
|
88
|
-
margin-right: 0 !important;
|
|
89
|
-
position: relative;
|
|
90
|
-
}
|
|
91
|
-
@{R}__title{
|
|
92
|
-
display: flex;
|
|
93
|
-
align-items: center;
|
|
94
|
-
line-height: 26px;
|
|
95
|
-
.ct-icon{
|
|
96
|
-
margin-right: 14px;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
@{R}__body {
|
|
100
|
-
padding: 0 40px 32px !important;
|
|
101
|
-
font-size: 15px;
|
|
102
|
-
line-height: 28px;
|
|
103
|
-
}
|
|
104
|
-
@{R}__footer {
|
|
105
|
-
padding: 0 40px 32px !important;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
:class="[ns.b()]"
|
|
4
|
+
v-model="dialogVisible"
|
|
5
|
+
:title="title"
|
|
6
|
+
:width="width"
|
|
7
|
+
:show-close="false"
|
|
8
|
+
:close-on-click-modal="false"
|
|
9
|
+
:close-on-press-escape="false"
|
|
10
|
+
append-to-body
|
|
11
|
+
>
|
|
12
|
+
<template #header="{ titleId, titleClass }">
|
|
13
|
+
<div :id="titleId" :class="[titleClass, ns.e('title')]">
|
|
14
|
+
<ct-icon
|
|
15
|
+
name="tip_solid"
|
|
16
|
+
:color="iconColor"
|
|
17
|
+
size="26"
|
|
18
|
+
:style="{ color: iconColor }"
|
|
19
|
+
></ct-icon>
|
|
20
|
+
{{ title }}
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
<slot></slot>
|
|
24
|
+
<template #footer>
|
|
25
|
+
<el-button :type="buttonType" @click="handleConfirm">确定</el-button>
|
|
26
|
+
</template>
|
|
27
|
+
</el-dialog>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup>
|
|
31
|
+
import { ref, reactive, onMounted, computed } from "vue";
|
|
32
|
+
import { useNamespace } from "../../../hooks";
|
|
33
|
+
const ns = useNamespace("message-box");
|
|
34
|
+
|
|
35
|
+
const props = defineProps({
|
|
36
|
+
modelValue: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
title: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "登录异常通知",
|
|
43
|
+
},
|
|
44
|
+
width: {
|
|
45
|
+
type: [String, Number],
|
|
46
|
+
default: 480,
|
|
47
|
+
},
|
|
48
|
+
type: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "info",
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
const emit = defineEmits(["update:modelValue", "handleConfirm"]);
|
|
54
|
+
|
|
55
|
+
const dialogVisible = computed({
|
|
56
|
+
get() {
|
|
57
|
+
return props.modelValue;
|
|
58
|
+
},
|
|
59
|
+
set(val) {
|
|
60
|
+
emit("update:modelValue", val);
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
const buttonType = computed(() => {
|
|
64
|
+
return props.type == "info"
|
|
65
|
+
? "primary"
|
|
66
|
+
: props.type == "error"
|
|
67
|
+
? "danger"
|
|
68
|
+
: "warning";
|
|
69
|
+
});
|
|
70
|
+
const iconColor = computed(() => {
|
|
71
|
+
return props.type == "info"
|
|
72
|
+
? "#4D64FF"
|
|
73
|
+
: props.type == "error"
|
|
74
|
+
? "#FF4D4D"
|
|
75
|
+
: "#FFAD2C";
|
|
76
|
+
});
|
|
77
|
+
const handleConfirm = () => {
|
|
78
|
+
emit("handleConfirm");
|
|
79
|
+
};
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<style lang='less'>
|
|
83
|
+
.el-dialog.ct-message-box{
|
|
84
|
+
border-radius: var(--ct-border-radius-l);
|
|
85
|
+
@R: .el-dialog;
|
|
86
|
+
@{R}__header {
|
|
87
|
+
padding: 24px 40px !important;
|
|
88
|
+
margin-right: 0 !important;
|
|
89
|
+
position: relative;
|
|
90
|
+
}
|
|
91
|
+
@{R}__title{
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
line-height: 26px;
|
|
95
|
+
.ct-icon{
|
|
96
|
+
margin-right: 14px;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
@{R}__body {
|
|
100
|
+
padding: 0 40px 32px !important;
|
|
101
|
+
font-size: 15px;
|
|
102
|
+
line-height: 28px;
|
|
103
|
+
}
|
|
104
|
+
@{R}__footer {
|
|
105
|
+
padding: 0 40px 32px !important;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
108
|
</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import CtPage from './src/page.vue';
|
|
2
|
-
|
|
3
|
-
/* istanbul ignore next */
|
|
4
|
-
CtPage.install = function (Vue) {
|
|
5
|
-
Vue.component('CtPage', CtPage);
|
|
6
|
-
};
|
|
7
|
-
|
|
1
|
+
import CtPage from './src/page.vue';
|
|
2
|
+
|
|
3
|
+
/* istanbul ignore next */
|
|
4
|
+
CtPage.install = function (Vue) {
|
|
5
|
+
Vue.component('CtPage', CtPage);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
8
|
export default CtPage;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div type="border" class="download-button" @click="download">
|
|
3
|
-
<ct-icon name="download2_line"></ct-icon>
|
|
4
|
-
<span>下载</span>
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script setup>
|
|
9
|
-
import { inject, unref } from "vue";
|
|
10
|
-
const downloadLoading = inject("downloadLoading", false);
|
|
11
|
-
const emit = defineEmits(["download"]);
|
|
12
|
-
const download = () => {
|
|
13
|
-
if (unref(downloadLoading)) return;
|
|
14
|
-
emit("download");
|
|
15
|
-
};
|
|
16
|
-
</script>
|
|
17
|
-
<style lang='less' scoped>
|
|
18
|
-
.download-button {
|
|
19
|
-
display: inline-flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div type="border" class="download-button" @click="download">
|
|
3
|
+
<ct-icon name="download2_line"></ct-icon>
|
|
4
|
+
<span>下载</span>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import { inject, unref } from "vue";
|
|
10
|
+
const downloadLoading = inject("downloadLoading", false);
|
|
11
|
+
const emit = defineEmits(["download"]);
|
|
12
|
+
const download = () => {
|
|
13
|
+
if (unref(downloadLoading)) return;
|
|
14
|
+
emit("download");
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
<style lang='less' scoped>
|
|
18
|
+
.download-button {
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
22
|
</style>
|