yc-design-vue 2.1.4 → 2.1.6
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/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/es/Dropdown/Dsubmenu.vue.js +3 -1
- package/es/ResizeBox/index.vue.js +9 -10
- package/es/Scrollbar/index.css +1 -1
- package/es/Transfer/Transfer.vue.d.ts +2 -2
- package/es/Transfer/Transfer.vue.js +48 -3
- package/es/Transfer/TransferPanel.vue.d.ts +25 -2
- package/es/Transfer/TransferPanel.vue.js +68 -75
- package/es/Transfer/hooks/useContext.d.ts +1 -1
- package/es/Transfer/hooks/useContext.js +8 -9
- package/es/Transfer/index.d.ts +1 -1
- package/es/style.css +1 -1
- package/lib/Dropdown/Dsubmenu.vue.js +1 -1
- package/lib/ResizeBox/index.vue.js +1 -1
- package/lib/Scrollbar/index.css +1 -1
- package/lib/Transfer/Transfer.vue.d.ts +2 -2
- package/lib/Transfer/Transfer.vue.js +1 -1
- package/lib/Transfer/TransferPanel.vue.d.ts +25 -2
- package/lib/Transfer/TransferPanel.vue.js +1 -1
- package/lib/Transfer/hooks/useContext.d.ts +1 -1
- package/lib/Transfer/hooks/useContext.js +1 -1
- package/lib/Transfer/index.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
@@ -106,6 +106,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
106
106
|
disabled: _ctx.disabled,
|
107
107
|
"mouse-enter-delay": 150,
|
108
108
|
"mouse-leave-delay": 150,
|
109
|
+
class: ["yc-dropdown-popup", _ctx.$attrs.class],
|
110
|
+
style: _ctx.$attrs.style,
|
109
111
|
"on-trigger-mouseenter": handleCalcStyle,
|
110
112
|
"on-trigger-mouseclick": handleCalcStyle,
|
111
113
|
"need-transform-origin": "",
|
@@ -152,7 +154,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
152
154
|
}, 8, ["disabled", "class", "style"])
|
153
155
|
]),
|
154
156
|
_: 3
|
155
|
-
}, 16, ["popup-visible", "trigger", "position", "disabled"]);
|
157
|
+
}, 16, ["popup-visible", "trigger", "position", "disabled", "class", "style"]);
|
156
158
|
};
|
157
159
|
}
|
158
160
|
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, toRefs, reactive, ref, watch, nextTick, createBlock, openBlock, resolveDynamicComponent,
|
1
|
+
import { defineComponent, toRefs, reactive, ref, watch, nextTick, createBlock, openBlock, resolveDynamicComponent, withCtx, renderSlot, createElementBlock, Fragment, renderList, normalizeClass, createElementVNode, createVNode, unref } from "vue";
|
2
2
|
import { valueToPx } from "../_shared/utils/dom.js";
|
3
3
|
import { useEventListener, useResizeObserver } from "../node_modules/@vueuse/core/index.js";
|
4
4
|
import "../node_modules/b-tween/dist/b-tween.es.js";
|
@@ -64,28 +64,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
64
64
|
document.body.style.cursor = ["left", "right"].includes(dir) ? "col-resize" : "row-resize";
|
65
65
|
emits("moving-start", e);
|
66
66
|
};
|
67
|
-
const handleMoving =
|
67
|
+
const handleMoving = (e) => {
|
68
68
|
if (!dragDirection.value || !boxRef.value) {
|
69
69
|
return;
|
70
70
|
}
|
71
71
|
const { clientX, clientY } = e;
|
72
72
|
const movementX = dragDirection.value == "left" ? x - clientX : clientX - x;
|
73
73
|
const movementY = dragDirection.value == "top" ? y - clientY : clientY - y;
|
74
|
+
const minWidth = triggerSize.left + triggerSize.right;
|
75
|
+
const minHeight = triggerSize.bottom + triggerSize.top;
|
74
76
|
x = clientX;
|
75
77
|
y = clientY;
|
76
78
|
if (["left", "right"].includes(dragDirection.value)) {
|
77
79
|
computedWidth.value += movementX;
|
78
|
-
boxRef.value.style.width = `${valueToPx(computedWidth.value)}`;
|
80
|
+
boxRef.value.style.width = `${valueToPx(computedWidth.value <= minWidth ? minWidth : computedWidth.value)}`;
|
79
81
|
} else {
|
80
82
|
computedHeight.value += movementY;
|
81
|
-
boxRef.value.style.height = `${valueToPx(computedHeight.value)}`;
|
83
|
+
boxRef.value.style.height = `${valueToPx(computedHeight.value <= minHeight ? minHeight : computedHeight.value)}`;
|
82
84
|
}
|
83
85
|
const { width, height } = boxRef.value.getBoundingClientRect();
|
84
86
|
if (width != computedWidth.value) {
|
85
87
|
computedWidth.value = width;
|
86
88
|
}
|
87
89
|
if (height != computedHeight.value) {
|
88
|
-
computedHeight.value =
|
90
|
+
computedHeight.value = height;
|
89
91
|
}
|
90
92
|
emits(
|
91
93
|
"moving",
|
@@ -125,6 +127,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
125
127
|
[computedWidth, computedHeight],
|
126
128
|
async () => {
|
127
129
|
if (dragDirection.value) return;
|
130
|
+
console.log("函数触发了");
|
128
131
|
await nextTick();
|
129
132
|
boxRef.value.style.width = computedWidth.value ? `${valueToPx(computedWidth.value)}` : "";
|
130
133
|
boxRef.value.style.height = computedHeight.value ? `${valueToPx(computedHeight.value)}` : "";
|
@@ -135,10 +138,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
135
138
|
);
|
136
139
|
return (_ctx, _cache) => {
|
137
140
|
return openBlock(), createBlock(resolveDynamicComponent(_ctx.component), {
|
138
|
-
style: normalizeStyle({
|
139
|
-
minWidth: unref(valueToPx)(triggerSize.left + triggerSize.right),
|
140
|
-
minHeight: unref(valueToPx)(triggerSize.top + triggerSize.bottom)
|
141
|
-
}),
|
142
141
|
class: "yc-resizebox",
|
143
142
|
ref_key: "boxRef",
|
144
143
|
ref: boxRef
|
@@ -171,7 +170,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
171
170
|
}), 128))
|
172
171
|
]),
|
173
172
|
_: 3
|
174
|
-
},
|
173
|
+
}, 512);
|
175
174
|
};
|
176
175
|
}
|
177
176
|
});
|
package/es/Scrollbar/index.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.yc-scrollbar{position:relative;overflow:hidden}.yc-scrollbar:hover .yc-scrollbar-track .yc-scrollbar-thumb-bar{opacity:1}.yc-scrollbar .yc-scrollbar-container{overflow:auto}.yc-scrollbar .yc-scrollbar-container .yc-scrollbar-content{height:fit-content;width:fit-content;min-width:100%}.yc-scrollbar:not(.yc-scrollbar-real) .yc-scrollbar-container::-webkit-scrollbar{width:0;height:0}.yc-scrollbar-both-track::before{z-index:
|
1
|
+
.yc-scrollbar{position:relative;overflow:hidden}.yc-scrollbar:hover .yc-scrollbar-track .yc-scrollbar-thumb-bar{opacity:1}.yc-scrollbar .yc-scrollbar-container{overflow:auto}.yc-scrollbar .yc-scrollbar-container .yc-scrollbar-content{height:fit-content;width:fit-content;min-width:100%}.yc-scrollbar:not(.yc-scrollbar-real) .yc-scrollbar-container::-webkit-scrollbar{width:0;height:0}.yc-scrollbar-both-track::before{z-index:9999;position:absolute;right:0;bottom:0;content:'';width:15px;height:15px;background-color:var(--color-neutral-1);border-right:1px solid var(--color-neutral-3);border-bottom:1px solid var(--color-neutral-3)}.yc-scrollbar-vertical-track .yc-scrollbar-container{padding-right:15px}.yc-scrollbar-vertical-track .yc-scrollbar-track-direction-vertical{background-color:var(--color-neutral-1);border-left:1px solid var(--color-neutral-3);border-right:1px solid var(--color-neutral-3)}.yc-scrollbar-horizontal-track .yc-scrollbar-container{padding-bottom:15px}.yc-scrollbar-horizontal-track .yc-scrollbar-track-direction-horizontal{background-color:var(--color-neutral-1);border-top:1px solid var(--color-neutral-3);border-bottom:1px solid var(--color-neutral-3)}.yc-scrollbar-track{z-index:11;position:absolute}.yc-scrollbar-track .yc-scrollbar-thumb{position:absolute;display:flex;justify-content:center;align-items:center}.yc-scrollbar-track .yc-scrollbar-thumb .yc-scrollbar-thumb-bar{user-select:none;border-radius:5px;background-color:var(--color-neutral-4);opacity:0;transition:opacity .2s ease}.yc-scrollbar-track .yc-scrollbar-thumb .yc-scrollbar-thumb-bar:hover{background-color:var(--color-neutral-6);opacity:.8}.yc-scrollbar-track .yc-scrollbar-thumb .yc-scrollbar-thumb-bar.yc-scrollbar-thumb-bar-dragging{background-color:var(--color-neutral-6);opacity:.8}.yc-scrollbar-track .yc-scrollbar-thumb .yc-scrollbar-thumb-bar.yc-scrollbar-thumb-bar-hover{opacity:1}.yc-scrollbar-track-direction-vertical{width:15px;top:0;bottom:0;right:0;display:flex;justify-content:center}.yc-scrollbar-track-direction-vertical .yc-scrollbar-thumb-direction-vertical{width:100%}.yc-scrollbar-track-direction-vertical .yc-scrollbar-thumb-direction-vertical .yc-scrollbar-thumb-bar{height:100%;width:9px}.yc-scrollbar-track-direction-horizontal{height:15px;left:0;right:0;bottom:0;display:flex;align-items:center}.yc-scrollbar-track-direction-horizontal .yc-scrollbar-thumb-direction-horizontal{height:100%}.yc-scrollbar-track-direction-horizontal .yc-scrollbar-thumb-direction-horizontal .yc-scrollbar-thumb-bar{width:100%;height:9px}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { TransferProps
|
1
|
+
import { TransferProps } from './type';
|
2
2
|
declare function __VLS_template(): {
|
3
3
|
attrs: Partial<{}>;
|
4
|
-
slots:
|
4
|
+
slots: any;
|
5
5
|
refs: {};
|
6
6
|
rootEl: HTMLDivElement;
|
7
7
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, normalizeClass, createVNode, createCommentVNode,
|
1
|
+
import { defineComponent, useSlots, createElementBlock, openBlock, normalizeClass, createVNode, createCommentVNode, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps, createBlock, unref } from "vue";
|
2
2
|
import useTransferContext from "./hooks/useContext.js";
|
3
3
|
import "../_shared/utils/dom.js";
|
4
4
|
import "../node_modules/b-tween/dist/b-tween.es.js";
|
@@ -47,6 +47,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
47
47
|
},
|
48
48
|
emits: ["update:selected", "update:modelValue", "change", "select", "search"],
|
49
49
|
setup(__props, { emit: __emit }) {
|
50
|
+
const $slots = useSlots();
|
50
51
|
const props = __props;
|
51
52
|
const emits = __emit;
|
52
53
|
const { computedValue, targetChecked, computedSelected, sourceChecked } = useTransferContext().provide(props, emits);
|
@@ -76,7 +77,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
76
77
|
}
|
77
78
|
])
|
78
79
|
}, [
|
79
|
-
createVNode(_sfc_main$1, { type: "source" }
|
80
|
+
createVNode(_sfc_main$1, { type: "source" }, createSlots({ _: 2 }, [
|
81
|
+
$slots["source-title"] ? {
|
82
|
+
name: "source-title",
|
83
|
+
fn: withCtx((scope) => [
|
84
|
+
renderSlot(_ctx.$slots, "source-title", normalizeProps(guardReactiveProps(scope)))
|
85
|
+
]),
|
86
|
+
key: "0"
|
87
|
+
} : void 0,
|
88
|
+
$slots["source"] ? {
|
89
|
+
name: "source",
|
90
|
+
fn: withCtx((scope) => [
|
91
|
+
renderSlot(_ctx.$slots, "source", normalizeProps(guardReactiveProps(scope)))
|
92
|
+
]),
|
93
|
+
key: "1"
|
94
|
+
} : void 0,
|
95
|
+
$slots["item"] ? {
|
96
|
+
name: "item",
|
97
|
+
fn: withCtx((scope) => [
|
98
|
+
renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps(scope)))
|
99
|
+
]),
|
100
|
+
key: "2"
|
101
|
+
} : void 0
|
102
|
+
]), 1024),
|
80
103
|
!_ctx.simple ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
81
104
|
createVNode(unref(Button), {
|
82
105
|
disabled: !unref(sourceChecked).length || _ctx.disabled,
|
@@ -104,7 +127,29 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
104
127
|
_: 3
|
105
128
|
}, 8, ["disabled"])) : createCommentVNode("", true)
|
106
129
|
])) : createCommentVNode("", true),
|
107
|
-
createVNode(_sfc_main$1, { type: "target" }
|
130
|
+
createVNode(_sfc_main$1, { type: "target" }, createSlots({ _: 2 }, [
|
131
|
+
$slots["target-title"] ? {
|
132
|
+
name: "target-title",
|
133
|
+
fn: withCtx((scope) => [
|
134
|
+
renderSlot(_ctx.$slots, "source-title", normalizeProps(guardReactiveProps(scope)))
|
135
|
+
]),
|
136
|
+
key: "0"
|
137
|
+
} : void 0,
|
138
|
+
$slots["target"] ? {
|
139
|
+
name: "target",
|
140
|
+
fn: withCtx((scope) => [
|
141
|
+
renderSlot(_ctx.$slots, "source", normalizeProps(guardReactiveProps(scope)))
|
142
|
+
]),
|
143
|
+
key: "1"
|
144
|
+
} : void 0,
|
145
|
+
$slots["item"] ? {
|
146
|
+
name: "item",
|
147
|
+
fn: withCtx((scope) => [
|
148
|
+
renderSlot(_ctx.$slots, "item", normalizeProps(guardReactiveProps(scope)))
|
149
|
+
]),
|
150
|
+
key: "2"
|
151
|
+
} : void 0
|
152
|
+
]), 1024)
|
108
153
|
], 2);
|
109
154
|
};
|
110
155
|
}
|
@@ -1,10 +1,33 @@
|
|
1
|
-
import {
|
1
|
+
import { TransferItem, TransferItemValue } from './type';
|
2
2
|
type __VLS_Props = {
|
3
3
|
type: 'source' | 'target';
|
4
4
|
};
|
5
5
|
declare function __VLS_template(): {
|
6
6
|
attrs: Partial<{}>;
|
7
|
-
slots:
|
7
|
+
slots: Partial<Record<NonNullable<"target-title" | "source-title">, (_: {
|
8
|
+
countTotal: number;
|
9
|
+
countSelected: number;
|
10
|
+
searchValue: string;
|
11
|
+
checked: boolean;
|
12
|
+
indeterminate: boolean;
|
13
|
+
onSelectAllChange: (v: boolean) => void;
|
14
|
+
onClear: () => void;
|
15
|
+
}) => any>> & Partial<Record<NonNullable<"target" | "source">, (_: {
|
16
|
+
selectedKeys: TransferItemValue[];
|
17
|
+
data: TransferItem[];
|
18
|
+
onSelect: (val: TransferItemValue[]) => void;
|
19
|
+
}) => any>> & {
|
20
|
+
item?(_: {
|
21
|
+
label?: string;
|
22
|
+
value?: TransferItemValue;
|
23
|
+
disabled?: boolean;
|
24
|
+
}): any;
|
25
|
+
item?(_: {
|
26
|
+
label?: string;
|
27
|
+
value?: TransferItemValue;
|
28
|
+
disabled?: boolean;
|
29
|
+
}): any;
|
30
|
+
};
|
8
31
|
refs: {};
|
9
32
|
rootEl: HTMLDivElement;
|
10
33
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, toRefs, ref, computed, createElementBlock, openBlock, createElementVNode, createCommentVNode,
|
1
|
+
import { defineComponent, toRefs, ref, computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, renderSlot, unref, normalizeProps, guardReactiveProps, createBlock, withCtx, createTextVNode, toDisplayString, Fragment, createVNode, mergeProps, renderList, normalizeClass } from "vue";
|
2
2
|
import _sfc_main$1 from "../_shared/components/IconButton/index.vue.js";
|
3
3
|
/* empty css */
|
4
4
|
import "../_shared/utils/dom.js";
|
@@ -31,7 +31,6 @@ const _hoisted_5 = {
|
|
31
31
|
};
|
32
32
|
const _hoisted_6 = { class: "yc-transfer-view-body" };
|
33
33
|
const _hoisted_7 = {
|
34
|
-
key: 1,
|
35
34
|
role: "list",
|
36
35
|
class: "yc-transfer-list"
|
37
36
|
};
|
@@ -80,6 +79,28 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
80
79
|
const title = computed(() => {
|
81
80
|
return type.value == "source" ? _title.value[0] : _title.value[1];
|
82
81
|
});
|
82
|
+
const titleParams = computed(() => {
|
83
|
+
return {
|
84
|
+
countTotal: type.value == "source" ? sourceOptions.value.length : targetOptions.value.length,
|
85
|
+
countSelected: type.value == "source" ? sourceChecked.value.length : targetChecked.value.length,
|
86
|
+
searchValue: keywords.value,
|
87
|
+
checked: selectedAll.value,
|
88
|
+
indeterminate: indeterminate.value,
|
89
|
+
onSelectAllChange: (v) => {
|
90
|
+
selectedAll.value = v;
|
91
|
+
},
|
92
|
+
onClear: handleClear
|
93
|
+
};
|
94
|
+
});
|
95
|
+
const listParams = computed(() => {
|
96
|
+
return {
|
97
|
+
selectedKeys: curSeleced.value,
|
98
|
+
data: curData.value,
|
99
|
+
onSelect: (val) => {
|
100
|
+
computedSelected.value = val;
|
101
|
+
}
|
102
|
+
};
|
103
|
+
});
|
83
104
|
const selectedAll = computed({
|
84
105
|
get() {
|
85
106
|
return !!curSeleced.value.length && curSeleced.value.length == curData.value.length;
|
@@ -121,40 +142,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
121
142
|
if (disabled.value || !computedValue.value.length) return;
|
122
143
|
computedValue.value = [];
|
123
144
|
};
|
124
|
-
const renderTitle = () => {
|
125
|
-
var _a;
|
126
|
-
return (_a = slots[type.value == "source" ? "source-title" : "target-title"]) == null ? void 0 : _a.call(slots, {
|
127
|
-
countTotal: type.value == "source" ? sourceOptions.value.length : targetOptions.value.length,
|
128
|
-
countSelected: type.value == "source" ? sourceChecked.value.length : targetChecked.value.length,
|
129
|
-
searchValue: keywords.value,
|
130
|
-
checked: selectedAll.value,
|
131
|
-
indeterminate: indeterminate.value,
|
132
|
-
onSelectAllChange: (v) => {
|
133
|
-
selectedAll.value = v;
|
134
|
-
},
|
135
|
-
onClear: handleClear
|
136
|
-
});
|
137
|
-
};
|
138
|
-
const renderList$1 = () => {
|
139
|
-
var _a;
|
140
|
-
return (_a = slots[type.value]) == null ? void 0 : _a.call(slots, {
|
141
|
-
selectedKeys: curSeleced.value,
|
142
|
-
data: curData.value,
|
143
|
-
onSelect: (val) => {
|
144
|
-
computedSelected.value = val;
|
145
|
-
}
|
146
|
-
});
|
147
|
-
};
|
148
|
-
const renderItem = (item) => {
|
149
|
-
return () => {
|
150
|
-
var _a;
|
151
|
-
return (_a = slots.item) == null ? void 0 : _a.call(slots, item);
|
152
|
-
};
|
153
|
-
};
|
154
145
|
return (_ctx, _cache) => {
|
155
146
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
156
147
|
createElementVNode("div", _hoisted_2, [
|
157
|
-
|
148
|
+
renderSlot(_ctx.$slots, `${unref(type)}-title`, normalizeProps(guardReactiveProps(titleParams.value)), () => [
|
158
149
|
createElementVNode("span", _hoisted_3, [
|
159
150
|
unref(showSelectAll) && !unref(simple) && (!unref(oneWay) || unref(type) != "target") ? (openBlock(), createBlock(unref(Checkbox), {
|
160
151
|
key: 0,
|
@@ -185,7 +176,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
185
176
|
_: 1
|
186
177
|
})) : createCommentVNode("", true)
|
187
178
|
])
|
188
|
-
]
|
179
|
+
])
|
189
180
|
]),
|
190
181
|
unref(showSearch) ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
191
182
|
createVNode(unref(Input), mergeProps({
|
@@ -203,54 +194,56 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
203
194
|
createElementVNode("div", _hoisted_6, [
|
204
195
|
curData.value.length ? (openBlock(), createBlock(unref(Scrollbar), { key: 0 }, {
|
205
196
|
default: withCtx(() => [
|
206
|
-
|
207
|
-
(
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
onClick: ($event) => handleClick(item)
|
218
|
-
}, [
|
219
|
-
(!unref(oneWay) || unref(oneWay) && unref(type) == "source") && !unref(simple) ? (openBlock(), createBlock(unref(Checkbox), {
|
220
|
-
key: 0,
|
221
|
-
"model-value": curSeleced.value.includes(item.value),
|
222
|
-
disabled: item.disabled || unref(disabled),
|
223
|
-
onChange: (isSelected) => handleCheck(isSelected, item.value)
|
224
|
-
}, {
|
225
|
-
default: withCtx(() => [
|
226
|
-
unref(slots).item ? (openBlock(), createBlock(resolveDynamicComponent(renderItem(item)), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
227
|
-
createTextVNode(toDisplayString(item.label), 1)
|
228
|
-
], 64))
|
229
|
-
]),
|
230
|
-
_: 2
|
231
|
-
}, 1032, ["model-value", "disabled", "onChange"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
232
|
-
createElementVNode("span", _hoisted_9, [
|
233
|
-
unref(slots).item ? (openBlock(), createBlock(resolveDynamicComponent(renderItem(item)), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
234
|
-
createTextVNode(toDisplayString(item.label), 1)
|
235
|
-
], 64))
|
197
|
+
renderSlot(_ctx.$slots, unref(type), normalizeProps(guardReactiveProps(listParams.value)), () => [
|
198
|
+
createElementVNode("div", _hoisted_7, [
|
199
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(curData.value, (item) => {
|
200
|
+
return openBlock(), createElementBlock("div", {
|
201
|
+
key: item.value,
|
202
|
+
role: "listitem",
|
203
|
+
class: normalizeClass([
|
204
|
+
"yc-transfer-list-item",
|
205
|
+
{
|
206
|
+
"yc-transfer-list-item-disabled": item.disabled || unref(disabled)
|
207
|
+
}
|
236
208
|
]),
|
237
|
-
|
209
|
+
onClick: ($event) => handleClick(item)
|
210
|
+
}, [
|
211
|
+
(!unref(oneWay) || unref(oneWay) && unref(type) == "source") && !unref(simple) ? (openBlock(), createBlock(unref(Checkbox), {
|
238
212
|
key: 0,
|
239
|
-
"
|
213
|
+
"model-value": curSeleced.value.includes(item.value),
|
214
|
+
disabled: item.disabled || unref(disabled),
|
215
|
+
onChange: (isSelected) => handleCheck(isSelected, item.value)
|
240
216
|
}, {
|
241
217
|
default: withCtx(() => [
|
242
|
-
|
218
|
+
renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, item), () => [
|
219
|
+
createTextVNode(toDisplayString(item.label), 1)
|
220
|
+
])
|
243
221
|
]),
|
244
|
-
_:
|
245
|
-
})) :
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
222
|
+
_: 2
|
223
|
+
}, 1032, ["model-value", "disabled", "onChange"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
224
|
+
createElementVNode("span", _hoisted_9, [
|
225
|
+
renderSlot(_ctx.$slots, "item", mergeProps({ ref_for: true }, item), () => [
|
226
|
+
createTextVNode(toDisplayString(item.label), 1)
|
227
|
+
])
|
228
|
+
]),
|
229
|
+
unref(type) == "target" && !unref(simple) ? (openBlock(), createBlock(unref(_sfc_main$1), {
|
230
|
+
key: 0,
|
231
|
+
"hover-size": 20
|
232
|
+
}, {
|
233
|
+
default: withCtx(() => [
|
234
|
+
createVNode(unref(_sfc_main$4))
|
235
|
+
]),
|
236
|
+
_: 1
|
237
|
+
})) : createCommentVNode("", true)
|
238
|
+
], 64))
|
239
|
+
], 10, _hoisted_8);
|
240
|
+
}), 128))
|
241
|
+
])
|
242
|
+
])
|
250
243
|
]),
|
251
|
-
_:
|
244
|
+
_: 3
|
252
245
|
})) : createCommentVNode("", true),
|
253
|
-
(
|
246
|
+
createVNode(unref(Empty))
|
254
247
|
])
|
255
248
|
]);
|
256
249
|
};
|
@@ -23,8 +23,8 @@ type TransferContext = {
|
|
23
23
|
export default function useTransferContext(): {
|
24
24
|
provide: (props: RecordType, emits: TransferEmits) => {
|
25
25
|
computedValue: import('vue').WritableComputedRef<TransferItemValue[], TransferItemValue[]>;
|
26
|
-
targetChecked: import('vue').ComputedRef<TransferItemValue[]>;
|
27
26
|
computedSelected: import('vue').WritableComputedRef<TransferItemValue[], TransferItemValue[]>;
|
27
|
+
targetChecked: import('vue').ComputedRef<TransferItemValue[]>;
|
28
28
|
sourceChecked: import('vue').ComputedRef<TransferItemValue[]>;
|
29
29
|
};
|
30
30
|
inject: () => TransferContext;
|
@@ -61,19 +61,18 @@ function useTransferContext() {
|
|
61
61
|
});
|
62
62
|
const targetOptions = computed(() => {
|
63
63
|
return computedValue.value.map((item) => {
|
64
|
-
|
65
|
-
return target;
|
64
|
+
return dataMap.value[item];
|
66
65
|
});
|
67
66
|
});
|
68
67
|
const sourceChecked = computed(() => {
|
69
|
-
return computedSelected.value.filter(
|
70
|
-
|
71
|
-
);
|
68
|
+
return computedSelected.value.filter((item) => {
|
69
|
+
return !computedValueMap.value.has(item);
|
70
|
+
});
|
72
71
|
});
|
73
72
|
const targetChecked = computed(() => {
|
74
|
-
return computedSelected.value.filter(
|
75
|
-
|
76
|
-
);
|
73
|
+
return computedSelected.value.filter((item) => {
|
74
|
+
return computedValueMap.value.has(item);
|
75
|
+
});
|
77
76
|
});
|
78
77
|
provide(TRANSFER_CONTEXT_KEY, {
|
79
78
|
computedValue,
|
@@ -95,8 +94,8 @@ function useTransferContext() {
|
|
95
94
|
});
|
96
95
|
return {
|
97
96
|
computedValue,
|
98
|
-
targetChecked,
|
99
97
|
computedSelected,
|
98
|
+
targetChecked,
|
100
99
|
sourceChecked
|
101
100
|
};
|
102
101
|
};
|
package/es/Transfer/index.d.ts
CHANGED
@@ -87,7 +87,7 @@ declare const Transfer: {
|
|
87
87
|
showSearch: boolean;
|
88
88
|
showSelectAll: boolean;
|
89
89
|
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
90
|
-
$slots:
|
90
|
+
$slots: any;
|
91
91
|
}) & {
|
92
92
|
install: (app: App) => void;
|
93
93
|
};
|