kui-vue 4.0.0 → 4.0.1
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/button/styles/index.less +1 -0
- package/components/checkbox/demo/info.md +5 -8
- package/components/colorPicker/paint.jsx +1 -1
- package/components/components.js +4 -1
- package/components/form/formitem.jsx +1 -1
- package/components/grid/demo/align-white-space.md +30 -0
- package/components/grid/demo/architecture.md +152 -0
- package/components/grid/demo/auto-fill-min-width.md +27 -0
- package/components/grid/demo/basic.md +23 -19
- package/components/grid/demo/bento.md +160 -0
- package/components/grid/demo/breakpoint-fallback.md +28 -0
- package/components/grid/demo/fixed-rows-areas.md +55 -0
- package/components/grid/demo/footer-strategy.md +38 -0
- package/components/grid/demo/hero-section.md +37 -0
- package/components/grid/demo/index.jsx +21 -12
- package/components/grid/demo/info.md +23 -9
- package/components/grid/demo/suffix-display-none.md +27 -0
- package/components/grid/grid.jsx +73 -0
- package/components/grid/gridItem.jsx +55 -0
- package/components/grid/index.js +3 -3
- package/components/grid/index.md +30 -13
- package/components/grid/styles/index.less +6 -67
- package/components/grid/useBreakpoint.js +46 -0
- package/components/icon/demo/search.vue +9 -11
- package/components/input/styles/index.less +3 -0
- package/components/menu/styles/index.less +6 -2
- package/components/rowCol/demo/basic.md +30 -0
- package/components/rowCol/demo/index.jsx +24 -0
- package/components/rowCol/demo/info.md +14 -0
- package/components/rowCol/index.js +4 -0
- package/components/rowCol/index.md +16 -0
- package/components/rowCol/styles/index.less +70 -0
- package/components/statCard/demo/card.md +40 -7
- package/components/statCard/index.md +8 -7
- package/components/statCard/statCard.jsx +6 -2
- package/components/statCard/statNumber.jsx +9 -5
- package/components/statCard/styles/index.less +6 -3
- package/components/styles/index.less +1 -0
- package/components/styles/less-css-var.less +1 -0
- package/components/styles/less-var.less +1 -0
- package/components/table/demo/table-check.md +1 -1
- package/components/tabs/demo/info.md +6 -11
- package/components/tree/demo/info.md +3 -8
- package/components/tree/tree.jsx +1 -1
- package/dist/k-ui.cjs.js +2 -2
- package/dist/k-ui.css +2 -2
- package/dist/k-ui.d.ts +80 -43
- 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/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 +1 -1
- package/test/i18n@6.x.html +3 -3
- package/types/grid/Grid.d.ts +24 -0
- package/types/grid/GridItem.d.ts +18 -0
- package/types/index.d.ts +12 -8
- package/types/statCard/StatCard.d.ts +1 -0
- package/components/styles/color.less +0 -209
- /package/components/{grid → rowCol}/col.jsx +0 -0
- /package/components/{grid → rowCol}/demo/align.md +0 -0
- /package/components/{grid → rowCol}/demo/fill.md +0 -0
- /package/components/{grid → rowCol}/demo/flex.md +0 -0
- /package/components/{grid → rowCol}/demo/gutter.md +0 -0
- /package/components/{grid → rowCol}/demo/offset.md +0 -0
- /package/components/{grid → rowCol}/row.jsx +0 -0
- /package/types/{grid → rowCol}/Col.d.ts +0 -0
- /package/types/{grid → rowCol}/Row.d.ts +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@import "../../styles/less-css-var.less";
|
|
2
|
+
|
|
3
|
+
.k-row {
|
|
4
|
+
display: flex;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
flex-flow: row wrap;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.k-col {
|
|
10
|
+
position: relative;
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
min-height: 1px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@fix: ~"k-col";
|
|
16
|
+
@counts: 24;
|
|
17
|
+
|
|
18
|
+
.make_col(@index) when(@index>0) {
|
|
19
|
+
.@{fix}-@{index} {
|
|
20
|
+
display: block;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
max-width: percentage((@index / @counts));
|
|
23
|
+
flex: 0 0 percentage((@index / @counts));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.@{fix}-offset-@{index} {
|
|
27
|
+
margin-left: percentage((@index / @counts));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.make_col((@index - 1));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.make_col(@counts);
|
|
34
|
+
|
|
35
|
+
.k-row-flex {
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-flow: row wrap;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.k-row-flex-top {
|
|
41
|
+
align-items: flex-start;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.k-row-flex-middle {
|
|
45
|
+
align-items: center;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.k-row-flex-bottom {
|
|
49
|
+
align-items: flex-end;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.k-row-flex-start {
|
|
53
|
+
justify-content: flex-start;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.k-row-flex-end {
|
|
57
|
+
justify-content: flex-end;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.k-row-flex-center {
|
|
61
|
+
justify-content: center;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.k-row-flex-space-around {
|
|
65
|
+
justify-content: space-around;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.k-row-flex-space-between {
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
}
|
|
@@ -1,24 +1,52 @@
|
|
|
1
1
|
<cn>
|
|
2
2
|
### 卡片展示
|
|
3
|
-
用于 Dashboard 场景
|
|
3
|
+
用于 Dashboard 场景 , 结合 `Grid` 可以很好的适配多种设备.
|
|
4
4
|
</cn>
|
|
5
5
|
|
|
6
6
|
```vue
|
|
7
7
|
<template>
|
|
8
8
|
<Space vertical block>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
<StatCard statNumberType="rollup" title="媒体数据" :items="items2" :bordered="bordered">
|
|
14
|
-
</StatCard>
|
|
9
|
+
<Space>
|
|
10
|
+
<Checkbox v-model="showTitle">Show Title</Checkbox>
|
|
11
|
+
<Checkbox v-model="bordered">Show border</Checkbox>
|
|
12
|
+
<Checkbox v-model="reverse">Reverse</Checkbox>
|
|
15
13
|
</Space>
|
|
14
|
+
<Grid :cols="{ xs: 1, sm: 2, md: 3 }" :xGap="16" :yGap="16">
|
|
15
|
+
<GridItem>
|
|
16
|
+
<StatCard
|
|
17
|
+
:title="showTitle ? '今日订单' : null"
|
|
18
|
+
:reverse="reverse"
|
|
19
|
+
:items="items"
|
|
20
|
+
:bordered="bordered"
|
|
21
|
+
/>
|
|
22
|
+
</GridItem>
|
|
23
|
+
<GridItem>
|
|
24
|
+
<StatCard
|
|
25
|
+
statNumberType="rollup"
|
|
26
|
+
:title="showTitle ? '今日进账' : null"
|
|
27
|
+
:items="items1"
|
|
28
|
+
:bordered="bordered"
|
|
29
|
+
:reverse="reverse"
|
|
30
|
+
/>
|
|
31
|
+
</GridItem>
|
|
32
|
+
<GridItem :span="{ xs: 1, sm: 2, md: 1 }">
|
|
33
|
+
<StatCard
|
|
34
|
+
:reverse="reverse"
|
|
35
|
+
statNumberType="rollup"
|
|
36
|
+
:title="showTitle ? '媒体数据' : null"
|
|
37
|
+
:items="items2"
|
|
38
|
+
:bordered="bordered"
|
|
39
|
+
/>
|
|
40
|
+
</GridItem>
|
|
41
|
+
</Grid>
|
|
16
42
|
</Space>
|
|
17
43
|
</template>
|
|
18
44
|
<script setup>
|
|
19
45
|
import { ref, h } from "vue";
|
|
20
46
|
import { Icon } from "kui-vue";
|
|
21
47
|
import { Star, Heart } from "kui-icons";
|
|
48
|
+
const showTitle = ref(true);
|
|
49
|
+
const reverse = ref(false);
|
|
22
50
|
const bordered = ref(false);
|
|
23
51
|
const items = [
|
|
24
52
|
{ value: 5872, desc: "订单数" },
|
|
@@ -42,4 +70,9 @@ const items2 = [
|
|
|
42
70
|
},
|
|
43
71
|
];
|
|
44
72
|
</script>
|
|
73
|
+
<style scoped>
|
|
74
|
+
.k-stat-card {
|
|
75
|
+
/* min-width: 330px; */
|
|
76
|
+
}
|
|
77
|
+
</style>
|
|
45
78
|
```
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
## StatCard API
|
|
2
2
|
|
|
3
|
-
| 属性 | 说明
|
|
4
|
-
| -------------- |
|
|
5
|
-
| title | 卡片标题
|
|
6
|
-
| items | 展示的数据
|
|
7
|
-
| precision | 数值精度
|
|
8
|
-
| statNumberType | 数值变化类型
|
|
9
|
-
| separator | 分隔符
|
|
3
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
4
|
+
| -------------- | ------------------------- | ----------------- | --------- |
|
|
5
|
+
| title | 卡片标题 | String | - |
|
|
6
|
+
| items | 展示的数据 | Array | [] |
|
|
7
|
+
| precision | 数值精度 | Number | 0 |
|
|
8
|
+
| statNumberType | 数值变化类型 | `rollup, countup` | 'countup' |
|
|
9
|
+
| separator | 分隔符 | String | - |
|
|
10
|
+
| reverse | 数值/数值描述是否反相排列 | Boolean | false |
|
|
10
11
|
|
|
11
12
|
### items Options
|
|
12
13
|
|
|
@@ -10,17 +10,21 @@ const StatCard = defineComponent({
|
|
|
10
10
|
items: { type: Array, default: () => [] },
|
|
11
11
|
separator: String,
|
|
12
12
|
statNumberType: String,
|
|
13
|
+
reverse: Boolean,
|
|
13
14
|
bordered: { type: Boolean, default: false },
|
|
14
15
|
},
|
|
15
16
|
setup(props, { slots }) {
|
|
16
17
|
return () => {
|
|
17
18
|
return (
|
|
18
19
|
<div class={["k-stat-card", { "k-stat-card-bordered": props.bordered }]}>
|
|
19
|
-
<div class="k-stat-card-title">{props.title}</div>
|
|
20
|
+
{props.title && <div class="k-stat-card-title">{props.title}</div>}
|
|
20
21
|
<div class="k-stat-card-items">
|
|
21
22
|
{(props.items || []).map((item, index) => {
|
|
22
23
|
return (
|
|
23
|
-
<div
|
|
24
|
+
<div
|
|
25
|
+
key={index}
|
|
26
|
+
class={["k-stat-card-item", { "k-stat-card-item-reverse": props.reverse }]}
|
|
27
|
+
>
|
|
24
28
|
<div class="k-stat-card-item-value">
|
|
25
29
|
<StatNumber
|
|
26
30
|
v-slots={{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
1
|
+
import { defineComponent, computed } from "vue";
|
|
2
2
|
import { withInstall } from "../utils/vue.js";
|
|
3
|
+
import { getChildren } from "../utils/vnode.jsx";
|
|
3
4
|
import CountUp from "./countup.jsx";
|
|
4
5
|
import RollUp from "./rollup.jsx";
|
|
5
6
|
const StatNumber = defineComponent({
|
|
@@ -24,6 +25,9 @@ const StatNumber = defineComponent({
|
|
|
24
25
|
suffix: String,
|
|
25
26
|
},
|
|
26
27
|
setup(props, { slots }) {
|
|
28
|
+
const prefixNode = props.prefix || getChildren(slots.prefix?.());
|
|
29
|
+
const suffixNode = props.suffix || getChildren(slots.suffix?.());
|
|
30
|
+
console.log(prefixNode);
|
|
27
31
|
return () => {
|
|
28
32
|
const items = {
|
|
29
33
|
modelValue: props.modelValue,
|
|
@@ -31,13 +35,13 @@ const StatNumber = defineComponent({
|
|
|
31
35
|
duration: props.duration,
|
|
32
36
|
precision: props.precision,
|
|
33
37
|
};
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
|
|
39
|
+
console.log(prefixNode);
|
|
36
40
|
return (
|
|
37
41
|
<div class="k-stat-number">
|
|
38
|
-
{prefixNode && <span class="k-stat-number-prefix">{prefixNode}</span>}
|
|
42
|
+
{prefixNode?.length > 0 && <span class="k-stat-number-prefix">{prefixNode}</span>}
|
|
39
43
|
{props.type === "rollup" ? <RollUp {...items} /> : <CountUp {...items} />}
|
|
40
|
-
{suffixNode && <span class="k-stat-number-suffix">{suffixNode}</span>}
|
|
44
|
+
{suffixNode?.length > 0 && <span class="k-stat-number-suffix">{suffixNode}</span>}
|
|
41
45
|
</div>
|
|
42
46
|
);
|
|
43
47
|
};
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
border: 1px solid transparent;
|
|
10
10
|
}
|
|
11
11
|
.k-stat-card-title {
|
|
12
|
-
margin-bottom:
|
|
12
|
+
margin-bottom: 20px;
|
|
13
13
|
font-size: 16px;
|
|
14
14
|
font-weight: 600;
|
|
15
15
|
}
|
|
16
16
|
.k-stat-card-items {
|
|
17
17
|
display: flex;
|
|
18
|
-
flex-wrap: wrap;
|
|
19
|
-
gap:
|
|
18
|
+
// flex-wrap: wrap;
|
|
19
|
+
gap: 12px;
|
|
20
20
|
}
|
|
21
21
|
.k-stat-card-item {
|
|
22
22
|
display: flex;
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
gap: 8px;
|
|
25
25
|
flex: 1;
|
|
26
26
|
}
|
|
27
|
+
.k-stat-card-item-reverse {
|
|
28
|
+
flex-direction: column-reverse;
|
|
29
|
+
}
|
|
27
30
|
.k-stat-card-item-value {
|
|
28
31
|
font-size: 20px;
|
|
29
32
|
font-weight: 600;
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
@import "../empty/styles/index.less";
|
|
20
20
|
@import "../form/styles/index.less";
|
|
21
21
|
@import "../flex/styles/index.less";
|
|
22
|
+
@import "../rowCol/styles/index.less";
|
|
22
23
|
@import "../grid/styles/index.less";
|
|
23
24
|
@import "../icon/styles/index.less";
|
|
24
25
|
@import "../input/styles/index.less";
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
# Tabs 标签页
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
### Tabs
|
|
5
|
-
Tab switching component.
|
|
3
|
+
选项卡切换组件。
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
## 何时使用
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
提供平级的区域将大块内容进行收纳和展现,保持界面整洁。
|
|
10
8
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
9
|
+
- 卡片式的页签,提供可关闭的样式,常用于容器顶部。
|
|
10
|
+
- 标准线条式页签,用于容器内部的主功能切换,这是最常用的 Tabs。
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
</en>
|
|
17
|
-
## Code Demos
|
|
12
|
+
## 代码演示
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
# Tree 树形控件
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
### Tree
|
|
3
|
+
## 何时使用
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
文件夹、组织架构、生物分类、国家地区等等,世间万物的大多数结构都是树形结构。使用`树控件` 可以完整展现其中的层级关系并具有展开收起选择等交互功能。
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
### Demos
|
|
11
|
-
|
|
12
|
-
</en>
|
|
7
|
+
## 代码演示
|
package/components/tree/tree.jsx
CHANGED
|
@@ -52,7 +52,7 @@ const Tree = defineComponent({
|
|
|
52
52
|
targetNode.loading = false;
|
|
53
53
|
targetNode.expanded = true;
|
|
54
54
|
|
|
55
|
-
//
|
|
55
|
+
// 这里通常不需要手动把数据 push 进 children。
|
|
56
56
|
// 因为外部数据变更会触发 watch(() => ps.data),
|
|
57
57
|
// 从而触发 buildTree 重新渲染整个树。
|
|
58
58
|
// 只需要确保 expandedKeys 里有这个 key 即可。
|