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.
@@ -3,7 +3,7 @@
3
3
  .k-avatar {
4
4
  margin: 0;
5
5
  padding: 0;
6
- color: #fff;
6
+ color: var(--kui-color-text);
7
7
  background-color: var(--kui-color-bg-component);
8
8
  border-radius: 50%;
9
9
  height: 32px;
@@ -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
  // 面板显示的基准日期
@@ -64,7 +64,7 @@ export default defineComponent({
64
64
  // onInput: handleInput,
65
65
  };
66
66
 
67
- if (ps.autoComplete != "off") {
67
+ if (ps.htmlAttrs.autoComplete != "on") {
68
68
  props.attrs = {
69
69
  ...props.attrs,
70
70
  "data-1p-ignore": true,
@@ -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 '../utils/vue';
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 d={d} fill="none" stroke-width={strokeWidth} style={ds} class="k-progress-inner" />
112
- <path d={d} fill="none" stroke-width={strokeWidth} style={style} class="k-progress-bg" />
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 = ["k-progress", `k-progress-${type}`, `k-progress-${status}`, { "k-progress-sm": type == "line" && size == "small" }, { "k-progress-hide-info": !showInfo }];
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
- vertical-align: middle;
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-block;
23
- width: 30px;
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
  }
@@ -251,7 +251,7 @@
251
251
  -webkit-user-select: none;
252
252
  user-select: none;
253
253
  border-radius: var(--kui-border-radius);
254
- width: inherit;
254
+ width: auto;
255
255
  max-height: 200px;
256
256
  overflow: auto;
257
257
  background-color: var(--kui-color-bg-pop);
@@ -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 | 数值 | Number | - |
14
- | desc | 数值描述 | String | [] |
15
- | prefix | 数值的前置内容 | String | - |
16
- | suffix | 数值的后置内容 | String | - |
17
- | duration | 数值动态展示时间(秒) | Number | 1.2 |
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>
@@ -21,6 +21,10 @@
21
21
  .theme-dark-vars();
22
22
  }
23
23
 
24
+ [theme-mode="light"] {
25
+ .theme-light-vars();
26
+ }
27
+
24
28
  .theme-light-vars() {
25
29
  color-scheme: light;
26
30
  /* 文字色体系 */
@@ -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: true },
32
+ bordered: { type: Boolean, default: false },
33
33
  checkable: Boolean,
34
34
  loading: Boolean,
35
35
  emptyText: String,