kui-vue 3.6.7 → 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/avatar/styles/index.less +1 -1
- package/components/datePicker/datepicker.jsx +0 -5
- package/components/input/inputBox.jsx +1 -1
- package/components/progress/progress.jsx +23 -5
- package/components/progress/styles/index.less +7 -6
- package/components/select/styles/index.less +1 -1
- package/components/statCard/countup.jsx +8 -0
- package/components/statCard/demo/card.md +2 -2
- package/components/statCard/index.md +12 -7
- package/components/statCard/statCard.jsx +12 -0
- package/components/styles/less-css-var.less +4 -0
- package/components/table/table.jsx +1 -1
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +56 -53
- 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 +2 -1
- package/types/index.d.ts +6 -6
- package/types/statCard/StatCard.d.ts +3 -0
- package/types/table/Table.d.ts +1 -1
|
@@ -3,10 +3,8 @@ import {
|
|
|
3
3
|
ref,
|
|
4
4
|
watch,
|
|
5
5
|
inject,
|
|
6
|
-
onMounted,
|
|
7
6
|
computed,
|
|
8
7
|
onUnmounted,
|
|
9
|
-
reactive,
|
|
10
8
|
nextTick,
|
|
11
9
|
} from "vue";
|
|
12
10
|
import dayjs from "dayjs";
|
|
@@ -113,7 +111,6 @@ const DatePicker = defineComponent({
|
|
|
113
111
|
return locale.value.name || "zh-cn";
|
|
114
112
|
});
|
|
115
113
|
|
|
116
|
-
// --- 状态定义 ---
|
|
117
114
|
const isVisible = ref(false);
|
|
118
115
|
const isFocus = ref(false);
|
|
119
116
|
const rendered = ref(false);
|
|
@@ -123,9 +120,7 @@ const DatePicker = defineComponent({
|
|
|
123
120
|
const transOrigin = ref("bottom");
|
|
124
121
|
const refPopper = ref(null);
|
|
125
122
|
const refSelection = ref(null);
|
|
126
|
-
// console.log(local);
|
|
127
123
|
|
|
128
|
-
// DOM 引用,用于滚动计算
|
|
129
124
|
const timeColRefs = ref({});
|
|
130
125
|
|
|
131
126
|
// 面板显示的基准日期
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Icon from "../icon";
|
|
2
2
|
import { CheckmarkCircle, CloseCircle, Close, Checkmark } from "kui-icons";
|
|
3
3
|
import { defineComponent, watch, ref } from "vue";
|
|
4
|
-
import { withInstall } from
|
|
4
|
+
import { withInstall } from "../utils/vue";
|
|
5
5
|
const Progress = defineComponent({
|
|
6
6
|
name: "Progress",
|
|
7
7
|
props: {
|
|
@@ -42,7 +42,7 @@ const Progress = defineComponent({
|
|
|
42
42
|
() => ps.percent,
|
|
43
43
|
(nv, no) => {
|
|
44
44
|
currentPercent.value = nv;
|
|
45
|
-
}
|
|
45
|
+
},
|
|
46
46
|
);
|
|
47
47
|
const currentPercent = ref(ps.percent);
|
|
48
48
|
const renderTip = () => {
|
|
@@ -108,8 +108,20 @@ const Progress = defineComponent({
|
|
|
108
108
|
|
|
109
109
|
return (
|
|
110
110
|
<svg viewBox={`0 0 ${50 * 2} ${50 * 2}`}>
|
|
111
|
-
<path
|
|
112
|
-
|
|
111
|
+
<path
|
|
112
|
+
d={d}
|
|
113
|
+
fill="none"
|
|
114
|
+
stroke-width={strokeWidth}
|
|
115
|
+
style={ds}
|
|
116
|
+
class="k-progress-inner"
|
|
117
|
+
/>
|
|
118
|
+
<path
|
|
119
|
+
d={d}
|
|
120
|
+
fill="none"
|
|
121
|
+
stroke-width={strokeWidth}
|
|
122
|
+
style={style}
|
|
123
|
+
class="k-progress-bg"
|
|
124
|
+
/>
|
|
113
125
|
</svg>
|
|
114
126
|
);
|
|
115
127
|
};
|
|
@@ -139,7 +151,13 @@ const Progress = defineComponent({
|
|
|
139
151
|
if (currentPercent.value == 100 && status != "exception") {
|
|
140
152
|
status = "success";
|
|
141
153
|
}
|
|
142
|
-
let classes = [
|
|
154
|
+
let classes = [
|
|
155
|
+
"k-progress",
|
|
156
|
+
`k-progress-${type}`,
|
|
157
|
+
`k-progress-${status}`,
|
|
158
|
+
{ "k-progress-sm": type == "line" && size == "small" },
|
|
159
|
+
{ "k-progress-hide-info": !showInfo },
|
|
160
|
+
];
|
|
143
161
|
let tipNode = renderTip();
|
|
144
162
|
let bar = renderBar(),
|
|
145
163
|
style = {};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
@import "../../styles/less-css-var.less";
|
|
2
2
|
.k-progress {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
width: 100%;
|
|
3
7
|
.k-progress-inner {
|
|
4
8
|
display: inline-block;
|
|
5
9
|
border-radius: 10px;
|
|
6
10
|
background-color: var(--kui-color-bg-component);
|
|
7
11
|
stroke: var(--kui-color-bg-component);
|
|
8
12
|
overflow: hidden;
|
|
9
|
-
|
|
10
|
-
width: calc(100% - 38px);
|
|
11
|
-
margin-right: 8px;
|
|
13
|
+
flex: 1;
|
|
12
14
|
}
|
|
13
15
|
.k-progress-bg {
|
|
14
16
|
height: 8px;
|
|
@@ -19,13 +21,12 @@
|
|
|
19
21
|
transition: all 0.3s ease-in-out;
|
|
20
22
|
}
|
|
21
23
|
.k-progress-text {
|
|
22
|
-
display: inline-
|
|
23
|
-
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
align-items: center;
|
|
24
26
|
font-size: 14px;
|
|
25
27
|
color: var(--kui-color-text);
|
|
26
28
|
line-height: 1;
|
|
27
29
|
white-space: nowrap;
|
|
28
|
-
vertical-align: middle;
|
|
29
30
|
.k-icon {
|
|
30
31
|
font-size: 20px;
|
|
31
32
|
}
|
|
@@ -37,6 +37,14 @@ const CountUpNumber = defineComponent({
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
|
+
watch(
|
|
41
|
+
() => props.precision,
|
|
42
|
+
(newVal) => {
|
|
43
|
+
if (countUp) {
|
|
44
|
+
countUp.options.decimalPlaces = newVal;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
);
|
|
40
48
|
|
|
41
49
|
return () => <span class="k-stat-countup-number" ref={el}></span>;
|
|
42
50
|
},
|
|
@@ -35,8 +35,8 @@ const items = [
|
|
|
35
35
|
];
|
|
36
36
|
|
|
37
37
|
const items1 = [
|
|
38
|
-
{ value: 5872, desc: "支付宝收入", prefix: "$" },
|
|
39
|
-
{ value: 9873672, desc: "微信收入", prefix: "¥" },
|
|
38
|
+
{ value: 5872, desc: "支付宝收入", prefix: "$", precision: 2 },
|
|
39
|
+
{ value: 9873672, desc: "微信收入", prefix: "¥", precision: 2 },
|
|
40
40
|
];
|
|
41
41
|
const items2 = [
|
|
42
42
|
{
|
|
@@ -4,17 +4,21 @@
|
|
|
4
4
|
| -------------- | ------------ | ----------------- | --------- |
|
|
5
5
|
| title | 卡片标题 | String | - |
|
|
6
6
|
| items | 展示的数据 | Array | [] |
|
|
7
|
+
| precision | 数值精度 | Number | 0 |
|
|
7
8
|
| statNumberType | 数值变化类型 | `rollup, countup` | 'countup' |
|
|
9
|
+
| separator | 分隔符 | String | - |
|
|
8
10
|
|
|
9
11
|
### items Options
|
|
10
12
|
|
|
11
|
-
| 属性
|
|
12
|
-
|
|
|
13
|
-
| value
|
|
14
|
-
| desc
|
|
15
|
-
| prefix
|
|
16
|
-
| suffix
|
|
17
|
-
|
|
|
13
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
14
|
+
| --------- | -------------------- | ------ | ------ |
|
|
15
|
+
| value | 数值 | Number | - |
|
|
16
|
+
| desc | 数值描述 | String | [] |
|
|
17
|
+
| prefix | 数值的前置内容 | String | - |
|
|
18
|
+
| suffix | 数值的后置内容 | String | - |
|
|
19
|
+
| precision | 数值精度 | Number | 0 |
|
|
20
|
+
| separator | 分隔符 | String | - |
|
|
21
|
+
| duration | 数值动态展示时间(秒) | Number | 1.2 |
|
|
18
22
|
|
|
19
23
|
## StatNumber API
|
|
20
24
|
|
|
@@ -26,3 +30,4 @@
|
|
|
26
30
|
| suffix | 数值的后置内容 | String | - |
|
|
27
31
|
| precision | 数值精度 | Number | 0 |
|
|
28
32
|
| type | 数值变化类型 | `rollup, countup` | 'countup' |
|
|
33
|
+
| separator | 分隔符 | String | - |
|
|
@@ -6,7 +6,9 @@ const StatCard = defineComponent({
|
|
|
6
6
|
name: "StatCard",
|
|
7
7
|
props: {
|
|
8
8
|
title: String,
|
|
9
|
+
precision: { type: Number, default: 0 },
|
|
9
10
|
items: { type: Array, default: () => [] },
|
|
11
|
+
separator: String,
|
|
10
12
|
statNumberType: String,
|
|
11
13
|
bordered: { type: Boolean, default: false },
|
|
12
14
|
},
|
|
@@ -29,6 +31,16 @@ const StatCard = defineComponent({
|
|
|
29
31
|
}}
|
|
30
32
|
value={item.value}
|
|
31
33
|
duration={item.duration}
|
|
34
|
+
precision={
|
|
35
|
+
item.precision !== undefined
|
|
36
|
+
? item.precision
|
|
37
|
+
: props.precision
|
|
38
|
+
}
|
|
39
|
+
separator={
|
|
40
|
+
item.separator !== undefined
|
|
41
|
+
? item.separator
|
|
42
|
+
: props.separator
|
|
43
|
+
}
|
|
32
44
|
type={props.statNumberType}
|
|
33
45
|
/>
|
|
34
46
|
</div>
|
|
@@ -29,7 +29,7 @@ const Table = defineComponent({
|
|
|
29
29
|
return ["small", "large", "default"].indexOf(value) >= 0;
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
bordered: { type: Boolean, default:
|
|
32
|
+
bordered: { type: Boolean, default: false },
|
|
33
33
|
checkable: Boolean,
|
|
34
34
|
loading: Boolean,
|
|
35
35
|
emptyText: String,
|