x-next 1.16.1 → 1.17.0
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/AI_USAGE/catalog.md +3 -2
- package/AI_USAGE/components/alert-api.md +1 -1
- package/AI_USAGE/components/alert.md +1 -1
- package/AI_USAGE/components/bar-chart-api.md +1 -1
- package/AI_USAGE/components/bar-chart.md +1 -1
- package/AI_USAGE/components/boxicons.md +1 -1
- package/AI_USAGE/components/button-api.md +1 -1
- package/AI_USAGE/components/button.md +1 -1
- package/AI_USAGE/components/charts.md +1 -1
- package/AI_USAGE/components/checkbox-api.md +1 -1
- package/AI_USAGE/components/checkbox.md +1 -1
- package/AI_USAGE/components/color-picker-api.md +1 -1
- package/AI_USAGE/components/color-picker.md +1 -1
- package/AI_USAGE/components/config-provider-api.md +1 -1
- package/AI_USAGE/components/config-provider.md +1 -1
- package/AI_USAGE/components/date-picker-api.md +1 -1
- package/AI_USAGE/components/date-picker.md +1 -1
- package/AI_USAGE/components/dialog-api.md +1 -1
- package/AI_USAGE/components/dialog.md +1 -1
- package/AI_USAGE/components/draggable-api.md +1 -1
- package/AI_USAGE/components/draggable.md +1 -1
- package/AI_USAGE/components/drawer-api.md +1 -1
- package/AI_USAGE/components/drawer.md +1 -1
- package/AI_USAGE/components/dropdown-api.md +1 -1
- package/AI_USAGE/components/dropdown.md +1 -1
- package/AI_USAGE/components/empty-api.md +1 -1
- package/AI_USAGE/components/empty.md +1 -1
- package/AI_USAGE/components/finicon.md +1 -1
- package/AI_USAGE/components/form-api.md +1 -1
- package/AI_USAGE/components/form.md +1 -1
- package/AI_USAGE/components/grid-api.md +1 -1
- package/AI_USAGE/components/grid.md +1 -1
- package/AI_USAGE/components/heatmap-api.md +1 -1
- package/AI_USAGE/components/heatmap.md +1 -1
- package/AI_USAGE/components/icon-api.md +1 -1
- package/AI_USAGE/components/icon.md +1 -1
- package/AI_USAGE/components/image-api.md +1 -1
- package/AI_USAGE/components/image.md +1 -1
- package/AI_USAGE/components/input-api.md +1 -1
- package/AI_USAGE/components/input-number-api.md +1 -1
- package/AI_USAGE/components/input-number.md +1 -1
- package/AI_USAGE/components/input-tag-api.md +1 -1
- package/AI_USAGE/components/input-tag.md +1 -1
- package/AI_USAGE/components/input.md +1 -1
- package/AI_USAGE/components/layout-api.md +1 -1
- package/AI_USAGE/components/layout.md +1 -1
- package/AI_USAGE/components/line-chart-api.md +1 -1
- package/AI_USAGE/components/line-chart.md +1 -1
- package/AI_USAGE/components/link-api.md +1 -1
- package/AI_USAGE/components/link.md +1 -1
- package/AI_USAGE/components/menu-api.md +1 -1
- package/AI_USAGE/components/menu.md +1 -1
- package/AI_USAGE/components/message-api.md +1 -1
- package/AI_USAGE/components/message-box-api.md +1 -1
- package/AI_USAGE/components/message-box.md +1 -1
- package/AI_USAGE/components/message.md +1 -1
- package/AI_USAGE/components/network-api.md +1 -1
- package/AI_USAGE/components/network.md +1 -1
- package/AI_USAGE/components/notification-api.md +1 -1
- package/AI_USAGE/components/notification.md +1 -1
- package/AI_USAGE/components/pagination-api.md +1 -1
- package/AI_USAGE/components/pagination.md +1 -1
- package/AI_USAGE/components/pie-chart-api.md +1 -1
- package/AI_USAGE/components/pie-chart.md +1 -1
- package/AI_USAGE/components/popconfirm-api.md +1 -1
- package/AI_USAGE/components/popconfirm.md +1 -1
- package/AI_USAGE/components/popover-api.md +1 -1
- package/AI_USAGE/components/popover.md +1 -1
- package/AI_USAGE/components/popup-api.md +1 -1
- package/AI_USAGE/components/popup.md +1 -1
- package/AI_USAGE/components/progress-api.md +1 -1
- package/AI_USAGE/components/progress.md +1 -1
- package/AI_USAGE/components/radio-api.md +1 -1
- package/AI_USAGE/components/radio.md +1 -1
- package/AI_USAGE/components/rate-api.md +1 -1
- package/AI_USAGE/components/rate.md +1 -1
- package/AI_USAGE/components/resize-box-api.md +1 -1
- package/AI_USAGE/components/resize-box.md +1 -1
- package/AI_USAGE/components/scrollbar-api.md +1 -1
- package/AI_USAGE/components/scrollbar.md +1 -1
- package/AI_USAGE/components/select-api.md +1 -1
- package/AI_USAGE/components/select.md +1 -1
- package/AI_USAGE/components/skeleton-api.md +1 -1
- package/AI_USAGE/components/skeleton.md +1 -1
- package/AI_USAGE/components/slider-api.md +1 -1
- package/AI_USAGE/components/slider.md +1 -1
- package/AI_USAGE/components/space-api.md +1 -1
- package/AI_USAGE/components/space.md +1 -1
- package/AI_USAGE/components/spin-api.md +1 -1
- package/AI_USAGE/components/spin.md +1 -1
- package/AI_USAGE/components/steps-api.md +1 -1
- package/AI_USAGE/components/steps.md +1 -1
- package/AI_USAGE/components/switch-api.md +1 -1
- package/AI_USAGE/components/switch.md +1 -1
- package/AI_USAGE/components/table-api.md +1 -1
- package/AI_USAGE/components/table.md +1 -1
- package/AI_USAGE/components/tabs-api.md +1 -1
- package/AI_USAGE/components/tabs.md +1 -1
- package/AI_USAGE/components/tag-api.md +1 -1
- package/AI_USAGE/components/tag.md +1 -1
- package/AI_USAGE/components/textarea-api.md +1 -1
- package/AI_USAGE/components/textarea.md +1 -1
- package/AI_USAGE/components/time-picker-api.md +1 -1
- package/AI_USAGE/components/time-picker.md +1 -1
- package/AI_USAGE/components/time-range-selector-api.md +1 -1
- package/AI_USAGE/components/time-range-selector.md +1 -1
- package/AI_USAGE/components/timeline-api.md +1 -1
- package/AI_USAGE/components/timeline.md +1 -1
- package/AI_USAGE/components/tooltip-api.md +1 -1
- package/AI_USAGE/components/tooltip.md +1 -1
- package/AI_USAGE/components/transfer-api.md +165 -0
- package/AI_USAGE/components/transfer.md +515 -0
- package/AI_USAGE/components/tree-select-api.md +1 -1
- package/AI_USAGE/components/tree-select.md +1 -1
- package/AI_USAGE/components/trend-chart-api.md +1 -1
- package/AI_USAGE/components/trend-chart.md +1 -1
- package/AI_USAGE/components/trigger-api.md +1 -1
- package/AI_USAGE/components/trigger.md +1 -1
- package/AI_USAGE/components/upload-api.md +1 -1
- package/AI_USAGE/components/upload.md +1 -1
- package/AI_USAGE/components/watermark-api.md +1 -1
- package/AI_USAGE/components/watermark.md +1 -1
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +3 -2
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +663 -3
- package/CHANGELOG.md +20 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/transfer/Transfer.d.ts +211 -0
- package/dist/components/transfer/index.d.ts +299 -0
- package/dist/components/transfer/interface.d.ts +80 -0
- package/dist/components/transfer/transfer-panel.d.ts +82 -0
- package/dist/components/transfer/utils.d.ts +5 -0
- package/dist/es/components/index.js +47 -45
- package/dist/es/components/transfer/Transfer.js +267 -0
- package/dist/es/components/transfer/index.js +7 -0
- package/dist/es/components/transfer/transfer-panel.js +251 -0
- package/dist/es/components/transfer/utils.js +9 -0
- package/dist/es/index.js +46 -44
- package/dist/es/locale/en-US.js +16 -0
- package/dist/es/locale/zh-CN.js +16 -0
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/locale/interface.d.ts +16 -0
- package/dist/style/base.css +1 -1
- package/dist/style/dependencies.json +14 -0
- package/dist/style/transfer.css +1 -0
- package/dist/style/transfer.js +12 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +3 -1
- package/volar.d.ts +1 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { PropType, SlotsType } from 'vue';
|
|
2
|
+
import { VirtualListProps } from '../virtual-list-v2/interface';
|
|
3
|
+
import { TransferItem, TransferValue, TransferType, TransferPagination, TransferSlots } from './interface';
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
|
+
type: {
|
|
6
|
+
type: PropType<TransferType>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
data: {
|
|
10
|
+
type: PropType<TransferItem[]>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
selectedKeys: {
|
|
14
|
+
type: PropType<TransferValue[]>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
title: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
disabled: BooleanConstructor;
|
|
22
|
+
loading: BooleanConstructor;
|
|
23
|
+
simple: BooleanConstructor;
|
|
24
|
+
oneWay: BooleanConstructor;
|
|
25
|
+
showSearch: BooleanConstructor;
|
|
26
|
+
showSelectAll: BooleanConstructor;
|
|
27
|
+
searchPlaceholder: StringConstructor;
|
|
28
|
+
filterOption: PropType<(input: string, item: TransferItem, type: TransferType) => boolean>;
|
|
29
|
+
pagination: PropType<boolean | TransferPagination>;
|
|
30
|
+
virtualListProps: PropType<VirtualListProps>;
|
|
31
|
+
}>, () => VNode, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
32
|
+
select: (_values: TransferValue[], _checked: boolean) => true;
|
|
33
|
+
move: (_values: TransferValue[]) => true;
|
|
34
|
+
search: (_value: string) => true;
|
|
35
|
+
scroll: (_event: Event) => true;
|
|
36
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
37
|
+
type: {
|
|
38
|
+
type: PropType<TransferType>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
data: {
|
|
42
|
+
type: PropType<TransferItem[]>;
|
|
43
|
+
required: true;
|
|
44
|
+
};
|
|
45
|
+
selectedKeys: {
|
|
46
|
+
type: PropType<TransferValue[]>;
|
|
47
|
+
required: true;
|
|
48
|
+
};
|
|
49
|
+
title: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
required: true;
|
|
52
|
+
};
|
|
53
|
+
disabled: BooleanConstructor;
|
|
54
|
+
loading: BooleanConstructor;
|
|
55
|
+
simple: BooleanConstructor;
|
|
56
|
+
oneWay: BooleanConstructor;
|
|
57
|
+
showSearch: BooleanConstructor;
|
|
58
|
+
showSelectAll: BooleanConstructor;
|
|
59
|
+
searchPlaceholder: StringConstructor;
|
|
60
|
+
filterOption: PropType<(input: string, item: TransferItem, type: TransferType) => boolean>;
|
|
61
|
+
pagination: PropType<boolean | TransferPagination>;
|
|
62
|
+
virtualListProps: PropType<VirtualListProps>;
|
|
63
|
+
}>> & Readonly<{
|
|
64
|
+
onSearch?: ((_value: string) => any) | undefined;
|
|
65
|
+
onSelect?: ((_values: TransferValue[], _checked: boolean) => any) | undefined;
|
|
66
|
+
onScroll?: ((_event: Event) => any) | undefined;
|
|
67
|
+
onMove?: ((_values: TransferValue[]) => any) | undefined;
|
|
68
|
+
}>, {
|
|
69
|
+
disabled: boolean;
|
|
70
|
+
loading: boolean;
|
|
71
|
+
simple: boolean;
|
|
72
|
+
oneWay: boolean;
|
|
73
|
+
showSearch: boolean;
|
|
74
|
+
showSelectAll: boolean;
|
|
75
|
+
}, SlotsType<{
|
|
76
|
+
item?: TransferSlots["item"];
|
|
77
|
+
default?: TransferSlots["source"];
|
|
78
|
+
title?: TransferSlots["source-title"];
|
|
79
|
+
footer?: TransferSlots["footer"];
|
|
80
|
+
empty?: TransferSlots["empty"];
|
|
81
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
82
|
+
export default _default;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TransferItem, TransferValue } from './interface';
|
|
2
|
+
/** Typed keys also serve as stable Vue/VirtualList keys. */
|
|
3
|
+
export declare const transferKey: (value: TransferValue) => string;
|
|
4
|
+
export declare const uniqueValues: (values: TransferValue[]) => TransferValue[];
|
|
5
|
+
export declare const uniqueItems: (data: TransferItem[]) => TransferItem[];
|
|
@@ -5,7 +5,7 @@ import { Dialog as n } from "./dialog/index.js";
|
|
|
5
5
|
import { Drawer as u } from "./drawer/index.js";
|
|
6
6
|
import { Dropdown as c, DropdownButton as d, DropdownGroup as T, DropdownOption as S, DropdownSubmenu as P } from "./dropdown/index.js";
|
|
7
7
|
import { Empty as I } from "./empty/index.js";
|
|
8
|
-
import { DatePicker as
|
|
8
|
+
import { DatePicker as s, MonthPicker as w, QuarterPicker as L, RangePicker as b, WeekPicker as C, YearPicker as h } from "./date-picker/index.js";
|
|
9
9
|
import { Form as y, FormItem as G } from "./form/index.js";
|
|
10
10
|
import { Checkbox as B, CheckboxGroup as M } from "./form-checkbox/index.js";
|
|
11
11
|
import { Input as A, InputGroup as E, InputPassword as _, InputSearch as N } from "./form-input/index.js";
|
|
@@ -22,7 +22,7 @@ import { Draggable as xo } from "./draggable/index.js";
|
|
|
22
22
|
import { Col as no, Grid as io, GridItem as uo, Row as lo } from "./grid/index.js";
|
|
23
23
|
import { Heatmap as To } from "./heatmap/index.js";
|
|
24
24
|
import { Image as Po, ImagePreview as go, ImagePreviewAction as Io, ImagePreviewGroup as ko } from "./image/index.js";
|
|
25
|
-
import { Layout as
|
|
25
|
+
import { Layout as wo, LayoutContent as Lo, LayoutFooter as bo, LayoutHeader as Co, LayoutSidebar as ho } from "./layout/index.js";
|
|
26
26
|
import { LineChart as yo } from "./line-chart/index.js";
|
|
27
27
|
import { Link as vo } from "./link/index.js";
|
|
28
28
|
import { Menu as Mo, MenuItem as Ro, MenuItemGroup as Ao, MenuSubMenu as Eo } from "./menu/index.js";
|
|
@@ -43,28 +43,29 @@ import { Space as ur } from "./space/index.js";
|
|
|
43
43
|
import { Spin as cr } from "./spin/index.js";
|
|
44
44
|
import { Step as Tr, Steps as Sr } from "./steps/index.js";
|
|
45
45
|
import { Table as gr, TableColumn as Ir } from "./table/index.js";
|
|
46
|
-
import { TabPane as
|
|
47
|
-
import { Tag as
|
|
46
|
+
import { TabPane as sr, Tabs as wr } from "./tabs/index.js";
|
|
47
|
+
import { Tag as br } from "./tag/index.js";
|
|
48
48
|
import { TimePicker as hr } from "./time-picker/index.js";
|
|
49
49
|
import { TimeRangeSelector as yr } from "./time-range-selector/index.js";
|
|
50
50
|
import { Timeline as vr } from "./timeline/index.js";
|
|
51
51
|
import { TimelineItem as Mr } from "./timeline-item/index.js";
|
|
52
52
|
import { Tooltip as Ar } from "./tooltip/index.js";
|
|
53
53
|
import { TreeSelect as _r, TreeSelectDropdown as Nr } from "./tree-select/index.js";
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import { default as $r } from "./table/table-
|
|
61
|
-
import { default as re } from "./table/table-
|
|
62
|
-
import { default as te } from "./table/table-
|
|
63
|
-
import { default as me } from "./table/table-
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
54
|
+
import { Transfer as jr } from "./transfer/index.js";
|
|
55
|
+
import { TrendChart as Hr } from "./trend-chart/index.js";
|
|
56
|
+
import { Trigger as Wr } from "./trigger/index.js";
|
|
57
|
+
import { Upload as zr } from "./upload/index.js";
|
|
58
|
+
import { Watermark as Yr } from "./watermark/index.js";
|
|
59
|
+
import { TABLE_LOCALE_EN_US as qr, TABLE_LOCALE_ZH_CN as Jr, formatLocaleText as Vr } from "./table/locale.js";
|
|
60
|
+
import { default as $r } from "./table/table-tbody.js";
|
|
61
|
+
import { default as re } from "./table/table-td.js";
|
|
62
|
+
import { default as te } from "./table/table-th.js";
|
|
63
|
+
import { default as me } from "./table/table-thead.js";
|
|
64
|
+
import { default as xe } from "./table/table-tr.js";
|
|
65
|
+
import { configProviderInjectionKey as ne } from "./config-provider/context.js";
|
|
66
|
+
import { formInjectionKey as ue, formItemInjectionKey as le } from "./form/context.js";
|
|
67
|
+
import { vDraggable as de } from "./draggable/directive.js";
|
|
68
|
+
import { vWatermark as Se } from "./watermark/directive.js";
|
|
68
69
|
export {
|
|
69
70
|
e as Alert,
|
|
70
71
|
mo as BarChart,
|
|
@@ -75,7 +76,7 @@ export {
|
|
|
75
76
|
no as Col,
|
|
76
77
|
to as ColorPicker,
|
|
77
78
|
x as ConfigProvider,
|
|
78
|
-
|
|
79
|
+
s as DatePicker,
|
|
79
80
|
n as Dialog,
|
|
80
81
|
xo as Draggable,
|
|
81
82
|
u as Drawer,
|
|
@@ -100,9 +101,9 @@ export {
|
|
|
100
101
|
_ as InputPassword,
|
|
101
102
|
N as InputSearch,
|
|
102
103
|
H as InputTag,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
wo as Layout,
|
|
105
|
+
Lo as LayoutContent,
|
|
106
|
+
bo as LayoutFooter,
|
|
106
107
|
Co as LayoutHeader,
|
|
107
108
|
ho as LayoutSidebar,
|
|
108
109
|
yo as LineChart,
|
|
@@ -112,7 +113,7 @@ export {
|
|
|
112
113
|
Ao as MenuItemGroup,
|
|
113
114
|
Eo as MenuSubMenu,
|
|
114
115
|
No as Message,
|
|
115
|
-
|
|
116
|
+
w as MonthPicker,
|
|
116
117
|
jo as Network,
|
|
117
118
|
Ho as Notification,
|
|
118
119
|
Wo as Pagination,
|
|
@@ -121,10 +122,10 @@ export {
|
|
|
121
122
|
qo as Popover,
|
|
122
123
|
Vo as Popup,
|
|
123
124
|
$o as Progress,
|
|
124
|
-
|
|
125
|
+
L as QuarterPicker,
|
|
125
126
|
W as Radio,
|
|
126
127
|
U as RadioGroup,
|
|
127
|
-
|
|
128
|
+
b as RangePicker,
|
|
128
129
|
rr as Rate,
|
|
129
130
|
tr as ResizeBox,
|
|
130
131
|
lo as Row,
|
|
@@ -142,36 +143,37 @@ export {
|
|
|
142
143
|
Tr as Step,
|
|
143
144
|
Sr as Steps,
|
|
144
145
|
$ as Switch,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
qr as TABLE_LOCALE_EN_US,
|
|
147
|
+
Jr as TABLE_LOCALE_ZH_CN,
|
|
148
|
+
sr as TabPane,
|
|
148
149
|
gr as Table,
|
|
149
150
|
Ir as TableColumn,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
wr as Tabs,
|
|
152
|
+
br as Tag,
|
|
153
|
+
$r as Tbody,
|
|
154
|
+
re as Td,
|
|
154
155
|
ro as Textarea,
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
te as Th,
|
|
157
|
+
me as Thead,
|
|
157
158
|
hr as TimePicker,
|
|
158
159
|
yr as TimeRangeSelector,
|
|
159
160
|
vr as Timeline,
|
|
160
161
|
Mr as TimelineItem,
|
|
161
162
|
Ar as Tooltip,
|
|
162
|
-
|
|
163
|
+
xe as Tr,
|
|
164
|
+
jr as Transfer,
|
|
163
165
|
_r as TreeSelect,
|
|
164
166
|
Nr as TreeSelectDropdown,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
Hr as TrendChart,
|
|
168
|
+
Wr as Trigger,
|
|
169
|
+
zr as Upload,
|
|
170
|
+
Yr as Watermark,
|
|
169
171
|
C as WeekPicker,
|
|
170
172
|
h as YearPicker,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
ne as configProviderInjectionKey,
|
|
174
|
+
ue as formInjectionKey,
|
|
175
|
+
le as formItemInjectionKey,
|
|
176
|
+
Vr as formatLocaleText,
|
|
177
|
+
de as vDraggable,
|
|
178
|
+
Se as vWatermark
|
|
177
179
|
};
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { defineComponent as R, toRefs as G, provide as J, ref as L, computed as d, watch as D, createVNode as g, mergeProps as Q } from "vue";
|
|
2
|
+
import { Button as E } from "../button/index.js";
|
|
3
|
+
import U from "./transfer-panel.js";
|
|
4
|
+
import { Icon as M } from "../../icons/index.js";
|
|
5
|
+
import { useLocale as X } from "../../locale/index.js";
|
|
6
|
+
import { useFormItem as Y, useFormItemControl as Z } from "../../_hooks/use-form-item.js";
|
|
7
|
+
import { formItemInjectionKey as k } from "../form/context.js";
|
|
8
|
+
import { uniqueValues as i, uniqueItems as p } from "./utils.js";
|
|
9
|
+
const oe = /* @__PURE__ */ R({
|
|
10
|
+
name: "Transfer",
|
|
11
|
+
inheritAttrs: !1,
|
|
12
|
+
props: {
|
|
13
|
+
/** @zh 穿梭框数据,value 在数据内唯一 @en Transfer data with unique values */
|
|
14
|
+
data: {
|
|
15
|
+
type: Array,
|
|
16
|
+
default: () => []
|
|
17
|
+
},
|
|
18
|
+
/** @zh 目标列表的值 @en Target values @vModel */
|
|
19
|
+
modelValue: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
23
|
+
/** @zh 非受控目标默认值 @en Default target values */
|
|
24
|
+
defaultValue: {
|
|
25
|
+
type: Array,
|
|
26
|
+
default: () => []
|
|
27
|
+
},
|
|
28
|
+
/** @zh 两侧临时勾选值 @en Checked values in both panels @vModel */
|
|
29
|
+
selectedKeys: {
|
|
30
|
+
type: Array,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
/** @zh 非受控默认勾选值 @en Default checked values */
|
|
34
|
+
defaultSelectedKeys: {
|
|
35
|
+
type: Array,
|
|
36
|
+
default: () => []
|
|
37
|
+
},
|
|
38
|
+
/** @zh 禁用整个穿梭框 @en Disable transfer */
|
|
39
|
+
disabled: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
/** @zh 加载中,阻止勾选和移动 @en Loading, blocks selection and moves */
|
|
44
|
+
loading: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
/** @zh 错误状态 @en Error state */
|
|
49
|
+
error: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !1
|
|
52
|
+
},
|
|
53
|
+
/** @zh 点击选项立即移动 @en Move items immediately when clicked */
|
|
54
|
+
simple: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: !1
|
|
57
|
+
},
|
|
58
|
+
/** @zh 单向模式,目标侧通过移除按钮返回 @en One-way mode with target remove buttons */
|
|
59
|
+
oneWay: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
/** @zh 显示两侧搜索 @en Show search inputs */
|
|
64
|
+
showSearch: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !1
|
|
67
|
+
},
|
|
68
|
+
/** @zh 显示全选,搜索/分页时仅当前可见项 @en Select all visible items */
|
|
69
|
+
showSelectAll: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: !0
|
|
72
|
+
},
|
|
73
|
+
/** @zh 源、目标列表标题 @en Source and target titles */
|
|
74
|
+
title: Array,
|
|
75
|
+
/** @zh 向右、向左操作文案 @en Move right and left operation labels */
|
|
76
|
+
operations: {
|
|
77
|
+
type: Array,
|
|
78
|
+
default: () => []
|
|
79
|
+
},
|
|
80
|
+
/** @zh 搜索占位文案 @en Search placeholder */
|
|
81
|
+
searchPlaceholder: String,
|
|
82
|
+
/** @zh 自定义搜索过滤 @en Custom search filter */
|
|
83
|
+
filterOption: Function,
|
|
84
|
+
/** @zh 目标排序:数据源顺序或模型追加顺序 @en Target ordering */
|
|
85
|
+
targetOrder: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: "original"
|
|
88
|
+
},
|
|
89
|
+
/** @zh 两侧面板样式 @en Panel style */
|
|
90
|
+
listStyle: Object,
|
|
91
|
+
/** @zh 分页配置,优先于虚拟列表 @en Pagination takes precedence over virtual list */
|
|
92
|
+
pagination: {
|
|
93
|
+
type: [Boolean, Object],
|
|
94
|
+
default: !1
|
|
95
|
+
},
|
|
96
|
+
/** @zh 虚拟滚动配置 @en Virtual list options */
|
|
97
|
+
virtualListProps: Object
|
|
98
|
+
},
|
|
99
|
+
emits: {
|
|
100
|
+
"update:modelValue": (a) => !0,
|
|
101
|
+
"update:selectedKeys": (a) => !0,
|
|
102
|
+
/** @zh 移动完成时报告目标值、移动方向及实际移动值 @en Target values, destination and moved values */
|
|
103
|
+
change: (a, u, s) => !0,
|
|
104
|
+
/** @zh 临时勾选变化,分别报告源侧和目标侧 @en Source and target checked values */
|
|
105
|
+
select: (a, u) => !0,
|
|
106
|
+
/** @zh 搜索输入变化 @en Search input changes */
|
|
107
|
+
search: (a, u) => !0,
|
|
108
|
+
/** @zh 列表滚动 @en List scroll */
|
|
109
|
+
scroll: (a, u) => !0
|
|
110
|
+
},
|
|
111
|
+
slots: Object,
|
|
112
|
+
setup(a, {
|
|
113
|
+
attrs: u,
|
|
114
|
+
emit: s,
|
|
115
|
+
slots: r
|
|
116
|
+
}) {
|
|
117
|
+
const {
|
|
118
|
+
t: y
|
|
119
|
+
} = X(), {
|
|
120
|
+
disabled: q,
|
|
121
|
+
error: z
|
|
122
|
+
} = G(a), {
|
|
123
|
+
formItemCtx: j,
|
|
124
|
+
mergedDisabled: b,
|
|
125
|
+
mergedError: P,
|
|
126
|
+
eventHandlers: B
|
|
127
|
+
} = Y({
|
|
128
|
+
disabled: q,
|
|
129
|
+
error: z
|
|
130
|
+
}), I = Z(j, () => ({
|
|
131
|
+
...Object.fromEntries(Object.entries(u).filter(([e]) => e === "id" || e.startsWith("aria-"))),
|
|
132
|
+
"aria-label": u["aria-label"] ?? (j.labelId ? void 0 : y("transfer.label"))
|
|
133
|
+
}), {
|
|
134
|
+
labelable: !1
|
|
135
|
+
});
|
|
136
|
+
J(k, {});
|
|
137
|
+
const K = L(i(a.modelValue ?? a.defaultValue)), T = L(i(a.selectedKeys ?? a.defaultSelectedKeys)), S = d(() => i(a.modelValue ?? K.value)), c = d(() => i(a.selectedKeys ?? T.value)), f = d(() => new Set(S.value)), _ = d(() => p(a.data)), v = d(() => new Map(_.value.map((e) => [e.value, e]))), N = d(() => _.value.filter((e) => !f.value.has(e.value))), $ = d(() => a.targetOrder === "append" ? S.value.map((e) => v.value.get(e)).filter((e) => !!e) : _.value.filter((e) => f.value.has(e.value))), O = d(() => b.value || a.loading), V = (e) => c.value.filter((l) => {
|
|
138
|
+
var t;
|
|
139
|
+
return v.value.has(l) && !((t = v.value.get(l)) != null && t.disabled) && e === "target" === f.value.has(l);
|
|
140
|
+
});
|
|
141
|
+
D(() => a.modelValue, (e) => {
|
|
142
|
+
e !== void 0 && (K.value = i(e));
|
|
143
|
+
}, {
|
|
144
|
+
deep: !0
|
|
145
|
+
}), D(() => a.selectedKeys, (e) => {
|
|
146
|
+
e !== void 0 && (T.value = i(e));
|
|
147
|
+
}, {
|
|
148
|
+
deep: !0
|
|
149
|
+
});
|
|
150
|
+
const W = (e) => {
|
|
151
|
+
if (e = i(e), e.length === c.value.length && e.every((t, n) => t === c.value[n])) return;
|
|
152
|
+
a.selectedKeys === void 0 && (T.value = e), s("update:selectedKeys", [...e]);
|
|
153
|
+
const l = e.filter((t) => {
|
|
154
|
+
var n;
|
|
155
|
+
return v.value.has(t) && !((n = v.value.get(t)) != null && n.disabled);
|
|
156
|
+
});
|
|
157
|
+
s("select", l.filter((t) => !f.value.has(t)), l.filter((t) => f.value.has(t)));
|
|
158
|
+
}, H = (e, l, t) => {
|
|
159
|
+
if (O.value || a.simple || a.oneWay && e === "target") return;
|
|
160
|
+
const n = i(l).filter((o) => {
|
|
161
|
+
const m = v.value.get(o);
|
|
162
|
+
return m && !m.disabled && e === "target" === f.value.has(o);
|
|
163
|
+
}), A = new Set(n);
|
|
164
|
+
W(t ? [...c.value, ...n] : c.value.filter((o) => !A.has(o)));
|
|
165
|
+
}, w = (e, l, t) => {
|
|
166
|
+
var m, C;
|
|
167
|
+
if (O.value) return;
|
|
168
|
+
const n = i(l).filter((h) => {
|
|
169
|
+
const F = v.value.get(h);
|
|
170
|
+
return F && !F.disabled && e === "target" === f.value.has(h);
|
|
171
|
+
});
|
|
172
|
+
if (!n.length) return;
|
|
173
|
+
const A = new Set(n), o = e === "source" ? i([...S.value, ...n]) : S.value.filter((h) => !A.has(h));
|
|
174
|
+
a.modelValue === void 0 && (K.value = o), s("update:modelValue", [...o]), s("change", [...o], e === "source" ? "target" : "source", [...n]), W(c.value.filter((h) => !A.has(h))), (C = (m = B.value) == null ? void 0 : m.onChange) == null || C.call(m, t);
|
|
175
|
+
}, x = (e) => {
|
|
176
|
+
var l;
|
|
177
|
+
return g(U, {
|
|
178
|
+
type: e,
|
|
179
|
+
data: e === "source" ? N.value : $.value,
|
|
180
|
+
title: ((l = a.title) == null ? void 0 : l[e === "source" ? 0 : 1]) ?? y(e === "source" ? "transfer.sourceTitle" : "transfer.targetTitle"),
|
|
181
|
+
selectedKeys: c.value,
|
|
182
|
+
disabled: !!b.value,
|
|
183
|
+
loading: a.loading,
|
|
184
|
+
simple: a.simple,
|
|
185
|
+
oneWay: a.oneWay,
|
|
186
|
+
showSearch: a.showSearch,
|
|
187
|
+
showSelectAll: a.showSelectAll,
|
|
188
|
+
searchPlaceholder: a.searchPlaceholder,
|
|
189
|
+
filterOption: a.filterOption,
|
|
190
|
+
pagination: a.pagination,
|
|
191
|
+
virtualListProps: a.virtualListProps,
|
|
192
|
+
style: a.listStyle,
|
|
193
|
+
onSelect: (t, n) => H(e, t, n),
|
|
194
|
+
onMove: (t) => w(e, t),
|
|
195
|
+
onSearch: (t) => s("search", t, e),
|
|
196
|
+
onScroll: (t) => s("scroll", t, e)
|
|
197
|
+
}, {
|
|
198
|
+
...r.item ? {
|
|
199
|
+
item: r.item
|
|
200
|
+
} : {},
|
|
201
|
+
...r[e] ? {
|
|
202
|
+
default: r[e]
|
|
203
|
+
} : {},
|
|
204
|
+
...r[`${e}-title`] ? {
|
|
205
|
+
title: r[`${e}-title`]
|
|
206
|
+
} : {},
|
|
207
|
+
...r.footer ? {
|
|
208
|
+
footer: r.footer
|
|
209
|
+
} : {},
|
|
210
|
+
...r.empty ? {
|
|
211
|
+
empty: r.empty
|
|
212
|
+
} : {}
|
|
213
|
+
});
|
|
214
|
+
};
|
|
215
|
+
return () => g("div", Q(Object.fromEntries(Object.entries(u).filter(([e]) => e !== "class" && e !== "style" && e !== "id" && !e.startsWith("aria-"))), I.value, {
|
|
216
|
+
role: "group",
|
|
217
|
+
tabindex: u.tabindex === void 0 ? -1 : Number(u.tabindex),
|
|
218
|
+
class: ["x-transfer", {
|
|
219
|
+
"x-transfer-disabled": b.value,
|
|
220
|
+
"x-transfer-loading": a.loading,
|
|
221
|
+
"x-transfer-error": P.value,
|
|
222
|
+
"x-transfer-simple": a.simple
|
|
223
|
+
}, u.class],
|
|
224
|
+
style: u.style,
|
|
225
|
+
"aria-disabled": b.value || void 0,
|
|
226
|
+
"aria-invalid": P.value || I.value["aria-invalid"],
|
|
227
|
+
"aria-busy": a.loading,
|
|
228
|
+
onFocusin: (e) => {
|
|
229
|
+
var l, t;
|
|
230
|
+
e.currentTarget.contains(e.relatedTarget) || (t = (l = B.value) == null ? void 0 : l.onFocus) == null || t.call(l, e);
|
|
231
|
+
},
|
|
232
|
+
onFocusout: (e) => {
|
|
233
|
+
var l, t;
|
|
234
|
+
e.currentTarget.contains(e.relatedTarget) || (t = (l = B.value) == null ? void 0 : l.onBlur) == null || t.call(l, e);
|
|
235
|
+
}
|
|
236
|
+
}), [x("source"), !a.simple && g("div", {
|
|
237
|
+
class: "x-transfer--operations"
|
|
238
|
+
}, [g(E, {
|
|
239
|
+
size: "small",
|
|
240
|
+
disabled: O.value || !V("source").length,
|
|
241
|
+
"aria-label": y("transfer.moveToTarget"),
|
|
242
|
+
onClick: (e) => w("source", V("source"), e)
|
|
243
|
+
}, {
|
|
244
|
+
default: () => {
|
|
245
|
+
var e;
|
|
246
|
+
return [((e = r["to-target-icon"]) == null ? void 0 : e.call(r)) ?? g(M, {
|
|
247
|
+
name: "chevron-right"
|
|
248
|
+
}, null), a.operations[0]];
|
|
249
|
+
}
|
|
250
|
+
}), !a.oneWay && g(E, {
|
|
251
|
+
size: "small",
|
|
252
|
+
disabled: O.value || !V("target").length,
|
|
253
|
+
"aria-label": y("transfer.moveToSource"),
|
|
254
|
+
onClick: (e) => w("target", V("target"), e)
|
|
255
|
+
}, {
|
|
256
|
+
default: () => {
|
|
257
|
+
var e;
|
|
258
|
+
return [((e = r["to-source-icon"]) == null ? void 0 : e.call(r)) ?? g(M, {
|
|
259
|
+
name: "chevron-left"
|
|
260
|
+
}, null), a.operations[1]];
|
|
261
|
+
}
|
|
262
|
+
})]), x("target")]);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
export {
|
|
266
|
+
oe as default
|
|
267
|
+
};
|