diff --git a/package/component/src/component/page/index.less b/package/component/src/component/page/index.less
index d8f25d80..d92b6e96 100644
--- a/package/component/src/component/page/index.less
+++ b/package/component/src/component/page/index.less
@@ -47,6 +47,33 @@
.layui-laypage a:hover {
color: var(--global-primary-color);
}
+.layui-laypage-a-red:hover{
+ color: #ff5722 !important;
+}
+
+.layui-laypage-a-orange:hover{
+ color: #ffb800 !important;
+}
+
+.layui-laypage-a-green:hover{
+ color: #009688 !important;
+}
+
+.layui-laypage-a-cyan:hover{
+ color: #2f4056 !important;
+}
+
+.layui-laypage-a-blue:hover{
+ color: #01aaed !important;
+}
+
+.layui-laypage-a-black:hover{
+ color: #000 !important;
+}
+
+.layui-laypage-a-gray:hover{
+ color: #c2c2c2 !important;
+}
.layui-laypage em {
font-style: normal;
diff --git a/package/component/src/component/page/index.vue b/package/component/src/component/page/index.vue
index ef11a1dd..23d6a21e 100644
--- a/package/component/src/component/page/index.vue
+++ b/package/component/src/component/page/index.vue
@@ -119,7 +119,7 @@ watch(currentPage, function () {
@@ -134,14 +134,14 @@ watch(currentPage, function () {
>
{{ index }}
- {{ index }}
+ {{ index }}
diff --git a/package/component/src/component/transfer/index.less b/package/component/src/component/transfer/index.less
index b48c12ef..681d1efb 100644
--- a/package/component/src/component/transfer/index.less
+++ b/package/component/src/component/transfer/index.less
@@ -5,6 +5,10 @@
--transfer-box-border-radius: var(--global-border-radius);
}
+.layui-transfer {
+ display: flex;
+}
+
.layui-transfer .layui-btn + .layui-btn {
margin-left: 0;
}
@@ -22,6 +26,8 @@
border-width: 1px;
width: 200px;
height: 360px;
+ display: flex;
+ flex-direction: column;
border-radius: var(--transfer-box-border-radius);
background-color: #fff;
}
@@ -36,12 +42,14 @@
line-height: 38px;
padding: 0 10px;
border-bottom-width: 1px;
+ flex: 0;
}
.layui-transfer-search {
position: relative;
padding: 10px;
border-bottom-width: 1px;
+ flex: 0;
}
.layui-transfer-search .layui-input {
@@ -86,6 +94,7 @@
.layui-transfer-data {
padding: 5px 0;
overflow: auto;
+ flex: 1;
}
.layui-transfer-data li {
@@ -105,8 +114,15 @@
color: #999;
}
-.layui-transfer-active,
-.layui-transfer-box {
- display: inline-block;
- vertical-align: middle;
+.layui-transfer-active {
+ display: flex;
+ align-items: center;
+ justify-items: center;
+}
+
+.layui-transfer-footer {
+ flex: 0;
+ height: 48px;
+ line-height: 48px;
+ padding: 0 10px;
}
diff --git a/package/component/src/component/transfer/index.vue b/package/component/src/component/transfer/index.vue
index 16f65c66..585b69da 100644
--- a/package/component/src/component/transfer/index.vue
+++ b/package/component/src/component/transfer/index.vue
@@ -12,7 +12,6 @@ import LayButton from "../button/index.vue";
import LayCheckbox from "../checkbox/index.vue";
import { computed, Ref, ref, useSlots, watch } from "vue";
import { BooleanOrString, Recordable } from "../../types";
-import { computedAsync } from "@vueuse/core";
export interface LayTransferProps {
id?: string;
@@ -24,7 +23,7 @@ export interface LayTransferProps {
selectedKeys?: Recordable[];
}
-const slot = useSlots();
+const slots = useSlots();
const props = withDefaults(defineProps(), {
id: "id",
@@ -38,17 +37,16 @@ const props = withDefaults(defineProps(), {
const leftDataSource: Ref = ref([...props.dataSource]);
const rightDataSource: Ref = ref([]);
-
const _leftDataSource: Ref = ref([...props.dataSource]);
const _rightDataSource: Ref = ref([]);
-
const leftSelectedKeys: Ref = ref([]);
const rightSelectedKeys: Ref = ref([]);
-
const allLeftChecked = ref(false);
const allRightChecked = ref(false);
+const hasLeftChecked = ref(false);
+const hasRightChecked = ref(false);
-const allLeftChange = function (checked: any) {
+const allLeftChange = (checked: any) => {
if (checked) {
const ids = leftDataSource.value.map((item: any) => {
return item[props.id];
@@ -70,11 +68,16 @@ watch(
} else {
allLeftChecked.value = false;
}
+ if (leftSelectedKeys.value.length > 0 && leftDataSource.value.length != 0) {
+ hasLeftChecked.value = true;
+ } else {
+ hasLeftChecked.value = false;
+ }
},
{ deep: true }
);
-const allRightChange = function (checked: any) {
+const allRightChange = (checked: any) => {
if (checked) {
const ids = rightDataSource.value.map((item: any) => {
return item[props.id];
@@ -90,17 +93,25 @@ watch(
() => {
if (
rightDataSource.value.length === rightSelectedKeys.value.length &&
- rightDataSource.value.length != 0
+ rightDataSource.value.length > 0
) {
allRightChecked.value = true;
} else {
allRightChecked.value = false;
}
+ if (
+ rightSelectedKeys.value.length > 0 &&
+ rightDataSource.value.length != 0
+ ) {
+ hasRightChecked.value = true;
+ } else {
+ hasRightChecked.value = false;
+ }
},
{ deep: true }
);
-const add = function () {
+const add = () => {
if (leftSelectedKeys.value.length === 0) {
return;
}
@@ -123,7 +134,7 @@ const add = function () {
leftSelectedKeys.value = [];
};
-const remove = function () {
+const remove = () => {
if (rightSelectedKeys.value.length === 0) {
return;
}
@@ -174,12 +185,6 @@ const boxStyle = computed(() => {
height: props.height,
};
});
-
-const dataStyle = computed(() => {
- return {
- height: props.showSearch ? "calc(100% - 97px)" : "calc(100% - 38px)",
- };
-});
@@ -188,7 +193,8 @@ const dataStyle = computed(() => {
-
+
-
-
+
{{ dataSource.title }}
+
-
+
-
-
+
{{ dataSource.title }}
+
diff --git a/package/document-component/src/document/zh-CN/components/page.md b/package/document-component/src/document/zh-CN/components/page.md
index 50fab408..f169644b 100644
--- a/package/document-component/src/document/zh-CN/components/page.md
+++ b/package/document-component/src/document/zh-CN/components/page.md
@@ -285,6 +285,7 @@ export default {
| showSkip | 显示跳转 | `false` |
| pages | 显示切页按钮数量 | `10` |
| limits | 切换每页数量的选择项 | `[10,20,30,40,50]` |
+| theme | 主题色 |`green`|
:::
diff --git a/package/document-component/src/document/zh-CN/components/transfer.md b/package/document-component/src/document/zh-CN/components/transfer.md
index 8c51f681..e9379ea4 100644
--- a/package/document-component/src/document/zh-CN/components/transfer.md
+++ b/package/document-component/src/document/zh-CN/components/transfer.md
@@ -98,7 +98,7 @@ export default {
::: demo
-
+
+
+:::
+
::: title Transfer 属性
:::
@@ -184,6 +238,8 @@ export default {
| Name | Description | Accepted Values |
| ---- | ----------- | --------------- |
| item | 列表项 | { data } |
+| leftFooter | 左侧盒子底部内容 | -- |
+| rightFooter | 右侧盒子底部内容 | -- |
:::
diff --git a/package/document-component/src/document/zh-CN/guide/changelog.md b/package/document-component/src/document/zh-CN/guide/changelog.md
index f88ca0ae..6039da4b 100644
--- a/package/document-component/src/document/zh-CN/guide/changelog.md
+++ b/package/document-component/src/document/zh-CN/guide/changelog.md
@@ -16,8 +16,11 @@
1.2.6 2022-07-01
+ - [新增] transfer 组件 leftFooter 与 rightFooter 插槽, 用于自定义穿梭框底部内容。by @Jmysy
- [修复] tooltip 组件设置isAutoShow 属性时,宽度设置max-width 时拖动浏览器时出现...时,tooltip不显示问题。 by @dingyongya
- [修复] table 组件设置 ellipsisTooltip 属性时 出现...时,tooltip不显示问题。by @dingyongya
+ - [优化] transfer 组件 selectedKeys 选中效果, 加入 checkbox 半选状态。by @Jmysy
+ - [优化] page 组件 hover状态下文字颜色跟当前设置的theme主题色保持一致。by @0o张不歪o0