@rockshin/tao-ui 0.0.45 → 0.0.46
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/README.md +3 -1
- package/component-manifest.json +32 -3
- package/dist/components/alert/alert.js +20 -17
- package/dist/components/avatar/avatar.js +2 -1
- package/dist/components/breadcrumb/breadcrumb.js +81 -77
- package/dist/components/calendar/calendar.d.ts +0 -1
- package/dist/components/calendar/calendar.js +41 -30
- package/dist/components/color-picker/color-picker.js +273 -269
- package/dist/components/date-picker/calendar/calendar-grid.js +10 -4
- package/dist/components/date-picker/calendar/use-calendar.d.ts +2 -2
- package/dist/components/date-picker/calendar/use-calendar.js +2 -3
- package/dist/components/date-picker/date-localization.d.ts +3 -0
- package/dist/components/date-picker/date-localization.js +76 -0
- package/dist/components/date-picker/date-picker.js +35 -27
- package/dist/components/date-picker/range-picker.js +28 -20
- package/dist/components/dropdown/dropdown.js +21 -20
- package/dist/components/float-button/float-button.js +3 -2
- package/dist/components/form/form.js +88 -103
- package/dist/components/image/image.js +202 -137
- package/dist/components/list/list-pagination.js +148 -147
- package/dist/components/modal/confirm-dialog.js +4 -2
- package/dist/components/modal/modal.js +385 -383
- package/dist/components/pagination/pagination.js +115 -110
- package/dist/components/popconfirm/popconfirm.js +109 -107
- package/dist/components/qr-code/qr-code.js +22 -21
- package/dist/components/scroll-area/scroll-area.js +41 -38
- package/dist/components/select/mobile-select.d.ts +1 -1
- package/dist/components/select/mobile-select.js +2 -1
- package/dist/components/sonner/sonner.js +10 -10
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/splitter/splitter.js +24 -21
- package/dist/components/statistic/statistic.d.ts +2 -0
- package/dist/components/statistic/statistic.js +203 -187
- package/dist/components/table/table-filter.js +61 -52
- package/dist/components/table/table-icons.js +3 -1
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +5 -4
- package/dist/components/tag/tag.js +22 -19
- package/dist/components/time-picker/time-picker.d.ts +0 -1
- package/dist/components/time-picker/time-picker.js +139 -96
- package/dist/components/transfer/transfer-list.js +224 -488
- package/dist/components/transfer/transfer-parts.js +2 -2
- package/dist/components/transfer/transfer-types.d.ts +1 -0
- package/dist/components/transfer/transfer.js +13 -16
- package/dist/components/upload/upload.js +30 -26
- package/dist/docs/component-docs.d.ts +13 -2
- package/dist/docs/components/headless-input-number.doc.d.ts +5 -0
- package/dist/docs/components/headless-input-number.doc.js +7 -0
- package/dist/docs/components/input-number.doc.d.ts +5 -0
- package/dist/docs/components/input-number.doc.js +7 -0
- package/dist/docs/components/statistic.doc.d.ts +5 -0
- package/dist/docs/components/statistic.doc.js +7 -0
- package/dist/docs/components/tao-provider.doc.d.ts +8 -2
- package/dist/docs/components/tao-provider.doc.js +10 -2
- package/dist/docs/components/tooltip.doc.d.ts +2 -2
- package/dist/entries/provider.d.ts +1 -0
- package/dist/entries/provider.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/locales/ar-EG.d.ts +3 -0
- package/dist/locales/ar-EG.js +199 -0
- package/dist/locales/create-locale.d.ts +41 -0
- package/dist/locales/create-locale.js +88 -0
- package/dist/locales/de-DE.d.ts +3 -0
- package/dist/locales/de-DE.js +195 -0
- package/dist/locales/en-US.d.ts +2 -0
- package/dist/locales/en-US.js +194 -0
- package/dist/locales/es-ES.d.ts +3 -0
- package/dist/locales/es-ES.js +195 -0
- package/dist/locales/fr-FR.d.ts +3 -0
- package/dist/locales/fr-FR.js +195 -0
- package/dist/locales/hi-IN.d.ts +3 -0
- package/dist/locales/hi-IN.js +194 -0
- package/dist/locales/id-ID.d.ts +3 -0
- package/dist/locales/id-ID.js +194 -0
- package/dist/locales/index.d.ts +18 -0
- package/dist/locales/index.js +17 -0
- package/dist/locales/it-IT.d.ts +3 -0
- package/dist/locales/it-IT.js +195 -0
- package/dist/locales/ja-JP.d.ts +3 -0
- package/dist/locales/ja-JP.js +194 -0
- package/dist/locales/ko-KR.d.ts +3 -0
- package/dist/locales/ko-KR.js +194 -0
- package/dist/locales/pt-BR.d.ts +3 -0
- package/dist/locales/pt-BR.js +195 -0
- package/dist/locales/ru-RU.d.ts +3 -0
- package/dist/locales/ru-RU.js +197 -0
- package/dist/locales/th-TH.d.ts +3 -0
- package/dist/locales/th-TH.js +194 -0
- package/dist/locales/tr-TR.d.ts +3 -0
- package/dist/locales/tr-TR.js +194 -0
- package/dist/locales/types.d.ts +176 -0
- package/dist/locales/types.js +0 -0
- package/dist/locales/vi-VN.d.ts +3 -0
- package/dist/locales/vi-VN.js +194 -0
- package/dist/locales/zh-CN.d.ts +3 -0
- package/dist/locales/zh-CN.js +194 -0
- package/dist/locales/zh-TW.d.ts +3 -0
- package/dist/locales/zh-TW.js +194 -0
- package/dist/number-input/format.d.ts +4 -3
- package/dist/number-input/format.js +9 -7
- package/dist/number-input/locale.d.ts +19 -0
- package/dist/number-input/locale.js +44 -0
- package/dist/number-input/number-input.js +1 -0
- package/dist/number-input/use-number-input.d.ts +2 -0
- package/dist/number-input/use-number-input.js +180 -176
- package/dist/provider/locale.d.ts +3 -65
- package/dist/provider/locale.js +2 -146
- package/dist/provider/merge-locale.d.ts +8 -0
- package/dist/provider/merge-locale.js +53 -0
- package/dist/provider/tao-provider.d.ts +6 -2
- package/dist/provider/tao-provider.js +2 -4
- package/llms.txt +1 -1
- package/package.json +5 -1
|
@@ -1,513 +1,249 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { c } from "react-compiler-runtime";
|
|
3
2
|
import { useState } from "react";
|
|
3
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
4
4
|
import { Checkbox } from "../checkbox/checkbox.js";
|
|
5
5
|
import { Dropdown } from "../dropdown/dropdown.js";
|
|
6
6
|
import { Empty } from "../empty/empty.js";
|
|
7
7
|
import { ListPaginationControl } from "../list/list-pagination.js";
|
|
8
8
|
import { TransferSearch } from "./transfer-parts.js";
|
|
9
9
|
function TransferList(props) {
|
|
10
|
-
const
|
|
11
|
-
const { prefixCls, style, classNames, styles, titleText, dataSource, filterOption, checkedKeys, handleFilter, handleClear, onItemSelect, onItemSelectAll, onItemRemove, render, showSearch, renderList, footer, onScroll, disabled, direction, showSelectAll
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const selectAll = void 0 === t2 ? "Select all" : t2;
|
|
15
|
-
const deselectAll = void 0 === t3 ? "Deselect all" : t3;
|
|
16
|
-
const selectCurrent = void 0 === t4 ? "Select current page" : t4;
|
|
17
|
-
const selectInvert = void 0 === t5 ? "Invert current selection" : t5;
|
|
18
|
-
const removeAll = void 0 === t6 ? "Remove all" : t6;
|
|
19
|
-
const removeCurrent = void 0 === t7 ? "Remove current page" : t7;
|
|
20
|
-
let t8;
|
|
21
|
-
if ($[0] !== showSearch) {
|
|
22
|
-
t8 = "object" == typeof showSearch ? showSearch : {};
|
|
23
|
-
$[0] = showSearch;
|
|
24
|
-
$[1] = t8;
|
|
25
|
-
} else t8 = $[1];
|
|
26
|
-
const searchOptions = t8;
|
|
27
|
-
const [search, setSearch] = useState(searchOptions.defaultValue ?? "");
|
|
10
|
+
const { locale } = useTaoConfig();
|
|
11
|
+
const { prefixCls, style, classNames, styles, titleText, dataSource, filterOption, checkedKeys, handleFilter, handleClear, onItemSelect, onItemSelectAll, onItemRemove, render, showSearch, renderList, footer, onScroll, disabled, direction, showSelectAll = true, selectAllLabel, showRemove, pagination, selectionsIcon, notFoundContent, searchPlaceholder, itemUnit, itemsUnit, itemCount, remove = locale.remove('').trim(), selectAll = locale.messages.selectAll, deselectAll = locale.messages.deselectAll, selectCurrent = locale.messages.selectCurrent, selectInvert = locale.messages.invertCurrent, removeAll = locale.messages.removeAll, removeCurrent = locale.messages.removeCurrent } = props;
|
|
12
|
+
const searchOptions = 'object' == typeof showSearch ? showSearch : {};
|
|
13
|
+
const [search, setSearch] = useState(searchOptions.defaultValue ?? '');
|
|
28
14
|
const [page, setPage] = useState(1);
|
|
29
15
|
const [internalPageSize, setPageSize] = useState(10);
|
|
30
|
-
|
|
31
|
-
if ($[2] !== pagination) {
|
|
32
|
-
t9 = "object" == typeof pagination ? pagination : {};
|
|
33
|
-
$[2] = pagination;
|
|
34
|
-
$[3] = t9;
|
|
35
|
-
} else t9 = $[3];
|
|
36
|
-
const paging = t9;
|
|
16
|
+
const paging = 'object' == typeof pagination ? pagination : {};
|
|
37
17
|
const pageSize = paging.pageSize ?? internalPageSize;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
$[60] = direction;
|
|
78
|
-
$[61] = filterOption;
|
|
79
|
-
$[62] = search;
|
|
80
|
-
$[63] = t21;
|
|
81
|
-
} else t21 = $[63];
|
|
82
|
-
const renderedItems = dataSource.map(t20).filter(t21);
|
|
83
|
-
filteredItems = renderedItems.map(_temp);
|
|
84
|
-
current = Math.max(1, Math.min(page, Math.ceil(renderedItems.length / pageSize)));
|
|
85
|
-
const pageItems = pagination ? renderedItems.slice((current - 1) * pageSize, current * pageSize) : renderedItems;
|
|
86
|
-
const enabled = filteredItems.filter(_temp2).map(_temp3);
|
|
87
|
-
const enabledPage = pageItems.filter(_temp4).map(_temp5);
|
|
88
|
-
let t22;
|
|
89
|
-
if ($[64] !== checkedKeys) {
|
|
90
|
-
t22 = (key)=>checkedKeys.includes(key);
|
|
91
|
-
$[64] = checkedKeys;
|
|
92
|
-
$[65] = t22;
|
|
93
|
-
} else t22 = $[65];
|
|
94
|
-
const selectedCount = enabled.filter(t22).length;
|
|
95
|
-
const allSelected = enabled.length > 0 && selectedCount === enabled.length;
|
|
96
|
-
const selectLabel = "function" == typeof selectAllLabel ? selectAllLabel({
|
|
97
|
-
selectedCount,
|
|
98
|
-
totalCount: filteredItems.length
|
|
99
|
-
}) : selectAllLabel ?? `${selectedCount ? `${selectedCount}/` : ""}${filteredItems.length} ${1 === filteredItems.length ? itemUnit : itemsUnit}`;
|
|
100
|
-
let t23;
|
|
101
|
-
if ($[66] !== handleClear) {
|
|
102
|
-
t23 = ()=>{
|
|
103
|
-
setSearch("");
|
|
104
|
-
setPage(1);
|
|
105
|
-
handleClear();
|
|
106
|
-
};
|
|
107
|
-
$[66] = handleClear;
|
|
108
|
-
$[67] = t23;
|
|
109
|
-
} else t23 = $[67];
|
|
110
|
-
const clear = t23;
|
|
111
|
-
customBody = renderList?.({
|
|
112
|
-
...props,
|
|
113
|
-
filteredItems,
|
|
114
|
-
filteredRenderItems: renderedItems,
|
|
115
|
-
selectedKeys: checkedKeys
|
|
18
|
+
const renderedItems = dataSource.map((item)=>{
|
|
19
|
+
const rendered = render ? render(item) : null;
|
|
20
|
+
if (null != rendered && 'object' == typeof rendered && 'value' in rendered) return {
|
|
21
|
+
item,
|
|
22
|
+
renderedEl: rendered.label,
|
|
23
|
+
renderedText: rendered.value
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
item,
|
|
27
|
+
renderedEl: rendered,
|
|
28
|
+
renderedText: 'string' == typeof rendered ? rendered : item.title ?? String(item.key)
|
|
29
|
+
};
|
|
30
|
+
}).filter(({ item: item_0, renderedText })=>!search || (filterOption ? filterOption(search, item_0, direction) : renderedText.includes(search)));
|
|
31
|
+
const filteredItems = renderedItems.map(({ item: item_1 })=>item_1);
|
|
32
|
+
const current = Math.max(1, Math.min(page, Math.ceil(renderedItems.length / pageSize)));
|
|
33
|
+
const pageItems = pagination ? renderedItems.slice((current - 1) * pageSize, current * pageSize) : renderedItems;
|
|
34
|
+
const enabled = filteredItems.filter((item_2)=>!item_2.disabled).map((item_3)=>item_3.key);
|
|
35
|
+
const enabledPage = pageItems.filter(({ item: item_4 })=>!item_4.disabled).map(({ item: item_5 })=>item_5.key);
|
|
36
|
+
const selectedCount = enabled.filter((key)=>checkedKeys.includes(key)).length;
|
|
37
|
+
const allSelected = enabled.length > 0 && selectedCount === enabled.length;
|
|
38
|
+
const selectLabel = 'function' == typeof selectAllLabel ? selectAllLabel({
|
|
39
|
+
selectedCount,
|
|
40
|
+
totalCount: filteredItems.length
|
|
41
|
+
}) : selectAllLabel ?? `${selectedCount ? `${new Intl.NumberFormat(locale.numberLocale).format(selectedCount)}/` : ''}${itemCount ? itemCount(filteredItems.length) : `${filteredItems.length} ${1 === filteredItems.length ? itemUnit : itemsUnit}`}`;
|
|
42
|
+
const clear = ()=>{
|
|
43
|
+
setSearch('');
|
|
44
|
+
setPage(1);
|
|
45
|
+
handleClear();
|
|
46
|
+
};
|
|
47
|
+
const customBody = renderList?.({
|
|
48
|
+
...props,
|
|
49
|
+
filteredItems,
|
|
50
|
+
filteredRenderItems: renderedItems,
|
|
51
|
+
selectedKeys: checkedKeys
|
|
52
|
+
});
|
|
53
|
+
const sectionName = 'string' == typeof titleText && titleText ? titleText : 'left' === direction ? locale.messages.source : locale.messages.target;
|
|
54
|
+
const semantic = (part)=>({
|
|
55
|
+
className: classNames?.[part],
|
|
56
|
+
style: styles?.[part]
|
|
116
57
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if ($[68] !== classNames || $[69] !== styles) {
|
|
120
|
-
t24 = (part)=>({
|
|
121
|
-
className: classNames?.[part],
|
|
122
|
-
style: styles?.[part]
|
|
123
|
-
});
|
|
124
|
-
$[68] = classNames;
|
|
125
|
-
$[69] = styles;
|
|
126
|
-
$[70] = t24;
|
|
127
|
-
} else t24 = $[70];
|
|
128
|
-
semantic = t24;
|
|
129
|
-
const menuItems = showRemove ? [
|
|
130
|
-
...pagination ? [
|
|
131
|
-
{
|
|
132
|
-
key: "removeCurrent",
|
|
133
|
-
label: removeCurrent,
|
|
134
|
-
onClick: ()=>onItemRemove?.(enabledPage)
|
|
135
|
-
}
|
|
136
|
-
] : [],
|
|
58
|
+
const menuItems = showRemove ? [
|
|
59
|
+
...pagination ? [
|
|
137
60
|
{
|
|
138
|
-
key:
|
|
139
|
-
label:
|
|
140
|
-
onClick: ()=>onItemRemove?.(
|
|
61
|
+
key: 'removeCurrent',
|
|
62
|
+
label: removeCurrent,
|
|
63
|
+
onClick: ()=>onItemRemove?.(enabledPage)
|
|
141
64
|
}
|
|
142
|
-
] : [
|
|
65
|
+
] : [],
|
|
66
|
+
{
|
|
67
|
+
key: 'removeAll',
|
|
68
|
+
label: removeAll,
|
|
69
|
+
onClick: ()=>onItemRemove?.(enabled)
|
|
70
|
+
}
|
|
71
|
+
] : [
|
|
72
|
+
{
|
|
73
|
+
key: 'selectAll',
|
|
74
|
+
label: allSelected ? deselectAll : selectAll,
|
|
75
|
+
onClick: ()=>onItemSelectAll(enabled, !allSelected)
|
|
76
|
+
},
|
|
77
|
+
...pagination ? [
|
|
143
78
|
{
|
|
144
|
-
key:
|
|
145
|
-
label:
|
|
146
|
-
onClick: ()=>onItemSelectAll(
|
|
147
|
-
},
|
|
148
|
-
...pagination ? [
|
|
149
|
-
{
|
|
150
|
-
key: "selectCurrent",
|
|
151
|
-
label: selectCurrent,
|
|
152
|
-
onClick: ()=>onItemSelectAll(enabledPage, true)
|
|
153
|
-
}
|
|
154
|
-
] : [],
|
|
155
|
-
{
|
|
156
|
-
key: "selectInvert",
|
|
157
|
-
label: selectInvert,
|
|
158
|
-
onClick: ()=>{
|
|
159
|
-
const selected = new Set(checkedKeys);
|
|
160
|
-
for (const key_0 of enabledPage)if (selected.has(key_0)) selected.delete(key_0);
|
|
161
|
-
else selected.add(key_0);
|
|
162
|
-
onItemSelectAll([
|
|
163
|
-
...selected
|
|
164
|
-
], "replace");
|
|
165
|
-
}
|
|
79
|
+
key: 'selectCurrent',
|
|
80
|
+
label: selectCurrent,
|
|
81
|
+
onClick: ()=>onItemSelectAll(enabledPage, true)
|
|
166
82
|
}
|
|
167
|
-
]
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
let t29;
|
|
200
|
-
if ($[79] !== semantic) {
|
|
201
|
-
t29 = semantic("title");
|
|
202
|
-
$[79] = semantic;
|
|
203
|
-
$[80] = t29;
|
|
204
|
-
} else t29 = $[80];
|
|
205
|
-
let t30;
|
|
206
|
-
if ($[81] !== t29 || $[82] !== titleText) {
|
|
207
|
-
t30 = /*#__PURE__*/ jsx("span", {
|
|
208
|
-
"data-tao-transfer-title": "",
|
|
209
|
-
...t29,
|
|
210
|
-
children: titleText
|
|
211
|
-
});
|
|
212
|
-
$[81] = t29;
|
|
213
|
-
$[82] = titleText;
|
|
214
|
-
$[83] = t30;
|
|
215
|
-
} else t30 = $[83];
|
|
216
|
-
t19 = /*#__PURE__*/ jsxs("div", {
|
|
217
|
-
"data-tao-transfer-header": "",
|
|
218
|
-
...t28,
|
|
219
|
-
children: [
|
|
220
|
-
showSelectAll && /*#__PURE__*/ jsxs(Fragment, {
|
|
221
|
-
children: [
|
|
222
|
-
!showRemove && !pagination && /*#__PURE__*/ jsx(Checkbox, {
|
|
223
|
-
"aria-label": `${selectAll} ${sectionName}`,
|
|
224
|
-
checked: allSelected,
|
|
225
|
-
indeterminate: selectedCount > 0 && !allSelected,
|
|
226
|
-
disabled: disabled || !enabled.length,
|
|
227
|
-
onChange: ()=>onItemSelectAll(enabled, !allSelected)
|
|
228
|
-
}),
|
|
229
|
-
/*#__PURE__*/ jsx(Dropdown, {
|
|
230
|
-
menu: {
|
|
231
|
-
items: menuItems
|
|
232
|
-
},
|
|
233
|
-
disabled: disabled || !enabled.length,
|
|
234
|
-
children: /*#__PURE__*/ jsx("button", {
|
|
235
|
-
"data-tao-transfer-selection": "",
|
|
236
|
-
type: "button",
|
|
237
|
-
"aria-label": `Selection actions ${sectionName}`,
|
|
238
|
-
disabled: disabled || !enabled.length,
|
|
239
|
-
children: selectionsIcon ?? "\u2304"
|
|
240
|
-
})
|
|
241
|
-
})
|
|
242
|
-
]
|
|
243
|
-
}),
|
|
244
|
-
/*#__PURE__*/ jsx("span", {
|
|
245
|
-
"data-tao-transfer-count": "",
|
|
246
|
-
children: selectLabel
|
|
247
|
-
}),
|
|
248
|
-
t30
|
|
249
|
-
]
|
|
250
|
-
});
|
|
251
|
-
t10 = "";
|
|
252
|
-
if ($[84] !== semantic) {
|
|
253
|
-
t11 = semantic("body");
|
|
254
|
-
$[84] = semantic;
|
|
255
|
-
$[85] = t11;
|
|
256
|
-
} else t11 = $[85];
|
|
257
|
-
if ($[86] !== clear || $[87] !== disabled || $[88] !== handleFilter || $[89] !== search || $[90] !== searchOptions.placeholder || $[91] !== searchPlaceholder || $[92] !== sectionName || $[93] !== showSearch) {
|
|
258
|
-
t12 = showSearch && /*#__PURE__*/ jsx("div", {
|
|
259
|
-
"data-tao-transfer-search": "",
|
|
260
|
-
children: /*#__PURE__*/ jsx(TransferSearch, {
|
|
261
|
-
placeholder: searchOptions.placeholder ?? searchPlaceholder,
|
|
262
|
-
"aria-label": `${sectionName} ${searchOptions.placeholder ?? searchPlaceholder}`,
|
|
263
|
-
value: search,
|
|
264
|
-
disabled: disabled,
|
|
265
|
-
onChange: (event)=>{
|
|
266
|
-
setSearch(event.target.value);
|
|
267
|
-
setPage(1);
|
|
268
|
-
handleFilter(event);
|
|
269
|
-
},
|
|
270
|
-
handleClear: clear
|
|
271
|
-
})
|
|
272
|
-
});
|
|
273
|
-
$[86] = clear;
|
|
274
|
-
$[87] = disabled;
|
|
275
|
-
$[88] = handleFilter;
|
|
276
|
-
$[89] = search;
|
|
277
|
-
$[90] = searchOptions.placeholder;
|
|
278
|
-
$[91] = searchPlaceholder;
|
|
279
|
-
$[92] = sectionName;
|
|
280
|
-
$[93] = showSearch;
|
|
281
|
-
$[94] = t12;
|
|
282
|
-
} else t12 = $[94];
|
|
283
|
-
t13 = customBody || /*#__PURE__*/ jsx("ul", {
|
|
284
|
-
"data-tao-transfer-list": "",
|
|
285
|
-
...semantic("list"),
|
|
286
|
-
onScroll: onScroll,
|
|
287
|
-
children: pageItems.length ? pageItems.map((t31)=>{
|
|
288
|
-
const { item: item_6, renderedEl, renderedText: renderedText_0 } = t31;
|
|
289
|
-
return /*#__PURE__*/ jsx("li", {
|
|
290
|
-
"data-tao-transfer-item": "",
|
|
291
|
-
"data-tao-disabled": disabled || item_6.disabled ? "" : void 0,
|
|
292
|
-
"data-tao-checked": checkedKeys.includes(item_6.key) ? "" : void 0,
|
|
293
|
-
...semantic("item"),
|
|
294
|
-
children: showRemove ? /*#__PURE__*/ jsxs(Fragment, {
|
|
83
|
+
] : [],
|
|
84
|
+
{
|
|
85
|
+
key: 'selectInvert',
|
|
86
|
+
label: selectInvert,
|
|
87
|
+
onClick: ()=>{
|
|
88
|
+
const selected = new Set(checkedKeys);
|
|
89
|
+
for (const key_0 of enabledPage)if (selected.has(key_0)) selected.delete(key_0);
|
|
90
|
+
else selected.add(key_0);
|
|
91
|
+
onItemSelectAll([
|
|
92
|
+
...selected
|
|
93
|
+
], 'replace');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
];
|
|
97
|
+
return /*#__PURE__*/ jsxs("section", {
|
|
98
|
+
"data-tao-transfer-section": "",
|
|
99
|
+
"data-tao-direction": direction,
|
|
100
|
+
"aria-label": sectionName,
|
|
101
|
+
className: [
|
|
102
|
+
prefixCls,
|
|
103
|
+
classNames?.section
|
|
104
|
+
].filter(Boolean).join(' '),
|
|
105
|
+
style: {
|
|
106
|
+
...style,
|
|
107
|
+
...styles?.section
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ jsxs("div", {
|
|
111
|
+
"data-tao-transfer-header": "",
|
|
112
|
+
...semantic('header'),
|
|
113
|
+
children: [
|
|
114
|
+
showSelectAll && /*#__PURE__*/ jsxs(Fragment, {
|
|
295
115
|
children: [
|
|
296
|
-
/*#__PURE__*/ jsx(
|
|
297
|
-
"
|
|
298
|
-
|
|
299
|
-
|
|
116
|
+
!showRemove && !pagination && /*#__PURE__*/ jsx(Checkbox, {
|
|
117
|
+
"aria-label": `${selectAll} ${sectionName}`,
|
|
118
|
+
checked: allSelected,
|
|
119
|
+
indeterminate: selectedCount > 0 && !allSelected,
|
|
120
|
+
disabled: disabled || !enabled.length,
|
|
121
|
+
onChange: ()=>onItemSelectAll(enabled, !allSelected)
|
|
300
122
|
}),
|
|
301
|
-
/*#__PURE__*/ jsx(
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
123
|
+
/*#__PURE__*/ jsx(Dropdown, {
|
|
124
|
+
menu: {
|
|
125
|
+
items: menuItems
|
|
126
|
+
},
|
|
127
|
+
disabled: disabled || !enabled.length,
|
|
128
|
+
children: /*#__PURE__*/ jsx("button", {
|
|
129
|
+
"data-tao-transfer-selection": "",
|
|
130
|
+
type: "button",
|
|
131
|
+
"aria-label": `${locale.messages.selectionActions} ${sectionName}`,
|
|
132
|
+
disabled: disabled || !enabled.length,
|
|
133
|
+
children: selectionsIcon ?? '⌄'
|
|
134
|
+
})
|
|
311
135
|
})
|
|
312
136
|
]
|
|
313
|
-
})
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
137
|
+
}),
|
|
138
|
+
/*#__PURE__*/ jsx("span", {
|
|
139
|
+
"data-tao-transfer-count": "",
|
|
140
|
+
children: selectLabel
|
|
141
|
+
}),
|
|
142
|
+
/*#__PURE__*/ jsx("span", {
|
|
143
|
+
"data-tao-transfer-title": "",
|
|
144
|
+
...semantic('title'),
|
|
145
|
+
children: titleText
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
}),
|
|
149
|
+
/*#__PURE__*/ jsxs("div", {
|
|
150
|
+
"data-tao-transfer-body": "",
|
|
151
|
+
...semantic('body'),
|
|
152
|
+
children: [
|
|
153
|
+
showSearch && /*#__PURE__*/ jsx("div", {
|
|
154
|
+
"data-tao-transfer-search": "",
|
|
155
|
+
children: /*#__PURE__*/ jsx(TransferSearch, {
|
|
156
|
+
placeholder: searchOptions.placeholder ?? searchPlaceholder,
|
|
157
|
+
"aria-label": `${sectionName} ${searchOptions.placeholder ?? searchPlaceholder}`,
|
|
158
|
+
value: search,
|
|
159
|
+
disabled: disabled,
|
|
160
|
+
onChange: (event)=>{
|
|
161
|
+
setSearch(event.target.value);
|
|
162
|
+
setPage(1);
|
|
163
|
+
handleFilter(event);
|
|
164
|
+
},
|
|
165
|
+
handleClear: clear
|
|
166
|
+
})
|
|
167
|
+
}),
|
|
168
|
+
customBody || /*#__PURE__*/ jsx("ul", {
|
|
169
|
+
"data-tao-transfer-list": "",
|
|
170
|
+
...semantic('list'),
|
|
171
|
+
onScroll: onScroll,
|
|
172
|
+
children: pageItems.length ? pageItems.map(({ item: item_6, renderedEl, renderedText: renderedText_0 })=>/*#__PURE__*/ jsx("li", {
|
|
173
|
+
"data-tao-transfer-item": "",
|
|
174
|
+
"data-tao-disabled": disabled || item_6.disabled ? '' : void 0,
|
|
175
|
+
"data-tao-checked": checkedKeys.includes(item_6.key) ? '' : void 0,
|
|
176
|
+
...semantic('item'),
|
|
177
|
+
children: showRemove ? /*#__PURE__*/ jsxs(Fragment, {
|
|
178
|
+
children: [
|
|
179
|
+
/*#__PURE__*/ jsx("span", {
|
|
180
|
+
"data-tao-transfer-content": "",
|
|
181
|
+
...semantic('itemContent'),
|
|
182
|
+
children: renderedEl
|
|
183
|
+
}),
|
|
184
|
+
/*#__PURE__*/ jsx("button", {
|
|
185
|
+
"data-tao-transfer-remove": "",
|
|
186
|
+
type: "button",
|
|
187
|
+
disabled: disabled || item_6.disabled,
|
|
188
|
+
"aria-label": `${remove} ${renderedText_0}`,
|
|
189
|
+
onClick: ()=>onItemRemove?.([
|
|
190
|
+
item_6.key
|
|
191
|
+
]),
|
|
192
|
+
...semantic('itemIcon'),
|
|
193
|
+
children: "\xd7"
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
}) : /*#__PURE__*/ jsx(Checkbox, {
|
|
197
|
+
"aria-label": renderedText_0,
|
|
198
|
+
checked: checkedKeys.includes(item_6.key),
|
|
199
|
+
disabled: disabled || item_6.disabled,
|
|
200
|
+
onChange: (event_0)=>onItemSelect(item_6.key, event_0.target.checked, {
|
|
201
|
+
shiftKey: event_0.nativeEvent.shiftKey
|
|
202
|
+
}, filteredItems),
|
|
203
|
+
classNames: {
|
|
204
|
+
indicator: classNames?.itemIcon,
|
|
205
|
+
label: classNames?.itemContent
|
|
206
|
+
},
|
|
207
|
+
styles: {
|
|
208
|
+
indicator: styles?.itemIcon,
|
|
209
|
+
label: styles?.itemContent
|
|
210
|
+
},
|
|
211
|
+
children: renderedEl
|
|
212
|
+
})
|
|
213
|
+
}, item_6.key)) : /*#__PURE__*/ jsx("li", {
|
|
214
|
+
"data-tao-transfer-empty": "",
|
|
215
|
+
children: (Array.isArray(notFoundContent) ? notFoundContent['left' === direction ? 0 : 1] : notFoundContent) ?? /*#__PURE__*/ jsx(Empty, {
|
|
216
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
217
|
+
})
|
|
218
|
+
})
|
|
219
|
+
}),
|
|
220
|
+
pagination && !customBody && /*#__PURE__*/ jsx("div", {
|
|
221
|
+
"data-tao-transfer-pagination": "",
|
|
222
|
+
children: /*#__PURE__*/ jsx(ListPaginationControl, {
|
|
223
|
+
size: "small",
|
|
224
|
+
...paging,
|
|
225
|
+
simple: paging.simple ?? true,
|
|
226
|
+
current: current,
|
|
227
|
+
pageSize: pageSize,
|
|
228
|
+
total: filteredItems.length,
|
|
229
|
+
showSizeChanger: paging.showSizeChanger ?? false,
|
|
230
|
+
disabled: disabled,
|
|
231
|
+
onChange: (next, nextSize)=>{
|
|
232
|
+
setPage(next);
|
|
233
|
+
setPageSize(nextSize);
|
|
234
|
+
}
|
|
235
|
+
})
|
|
329
236
|
})
|
|
330
|
-
|
|
331
|
-
})
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
237
|
+
]
|
|
238
|
+
}),
|
|
239
|
+
footer && /*#__PURE__*/ jsx("div", {
|
|
240
|
+
"data-tao-transfer-footer": "",
|
|
241
|
+
...semantic('footer'),
|
|
242
|
+
children: footer(props, {
|
|
243
|
+
direction
|
|
335
244
|
})
|
|
336
245
|
})
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
$[5] = classNames;
|
|
340
|
-
$[6] = dataSource;
|
|
341
|
-
$[7] = deselectAll;
|
|
342
|
-
$[8] = direction;
|
|
343
|
-
$[9] = disabled;
|
|
344
|
-
$[10] = filterOption;
|
|
345
|
-
$[11] = handleClear;
|
|
346
|
-
$[12] = handleFilter;
|
|
347
|
-
$[13] = itemUnit;
|
|
348
|
-
$[14] = itemsUnit;
|
|
349
|
-
$[15] = notFoundContent;
|
|
350
|
-
$[16] = onItemRemove;
|
|
351
|
-
$[17] = onItemSelect;
|
|
352
|
-
$[18] = onItemSelectAll;
|
|
353
|
-
$[19] = onScroll;
|
|
354
|
-
$[20] = page;
|
|
355
|
-
$[21] = pageSize;
|
|
356
|
-
$[22] = pagination;
|
|
357
|
-
$[23] = prefixCls;
|
|
358
|
-
$[24] = props;
|
|
359
|
-
$[25] = remove;
|
|
360
|
-
$[26] = removeAll;
|
|
361
|
-
$[27] = removeCurrent;
|
|
362
|
-
$[28] = render;
|
|
363
|
-
$[29] = renderList;
|
|
364
|
-
$[30] = search;
|
|
365
|
-
$[31] = searchOptions.placeholder;
|
|
366
|
-
$[32] = searchPlaceholder;
|
|
367
|
-
$[33] = selectAll;
|
|
368
|
-
$[34] = selectAllLabel;
|
|
369
|
-
$[35] = selectCurrent;
|
|
370
|
-
$[36] = selectInvert;
|
|
371
|
-
$[37] = selectionsIcon;
|
|
372
|
-
$[38] = showRemove;
|
|
373
|
-
$[39] = showSearch;
|
|
374
|
-
$[40] = showSelectAll;
|
|
375
|
-
$[41] = style;
|
|
376
|
-
$[42] = styles;
|
|
377
|
-
$[43] = titleText;
|
|
378
|
-
$[44] = current;
|
|
379
|
-
$[45] = customBody;
|
|
380
|
-
$[46] = filteredItems;
|
|
381
|
-
$[47] = semantic;
|
|
382
|
-
$[48] = t10;
|
|
383
|
-
$[49] = t11;
|
|
384
|
-
$[50] = t12;
|
|
385
|
-
$[51] = t13;
|
|
386
|
-
$[52] = t14;
|
|
387
|
-
$[53] = t15;
|
|
388
|
-
$[54] = t16;
|
|
389
|
-
$[55] = t17;
|
|
390
|
-
$[56] = t18;
|
|
391
|
-
$[57] = t19;
|
|
392
|
-
} else {
|
|
393
|
-
current = $[44];
|
|
394
|
-
customBody = $[45];
|
|
395
|
-
filteredItems = $[46];
|
|
396
|
-
semantic = $[47];
|
|
397
|
-
t10 = $[48];
|
|
398
|
-
t11 = $[49];
|
|
399
|
-
t12 = $[50];
|
|
400
|
-
t13 = $[51];
|
|
401
|
-
t14 = $[52];
|
|
402
|
-
t15 = $[53];
|
|
403
|
-
t16 = $[54];
|
|
404
|
-
t17 = $[55];
|
|
405
|
-
t18 = $[56];
|
|
406
|
-
t19 = $[57];
|
|
407
|
-
}
|
|
408
|
-
let t20;
|
|
409
|
-
if ($[95] !== current || $[96] !== customBody || $[97] !== disabled || $[98] !== filteredItems || $[99] !== pageSize || $[100] !== pagination || $[101] !== paging) {
|
|
410
|
-
t20 = pagination && !customBody && /*#__PURE__*/ jsx("div", {
|
|
411
|
-
"data-tao-transfer-pagination": "",
|
|
412
|
-
children: /*#__PURE__*/ jsx(ListPaginationControl, {
|
|
413
|
-
size: "small",
|
|
414
|
-
...paging,
|
|
415
|
-
simple: paging.simple ?? true,
|
|
416
|
-
current: current,
|
|
417
|
-
pageSize: pageSize,
|
|
418
|
-
total: filteredItems.length,
|
|
419
|
-
showSizeChanger: paging.showSizeChanger ?? false,
|
|
420
|
-
disabled: disabled,
|
|
421
|
-
onChange: (next, nextSize)=>{
|
|
422
|
-
setPage(next);
|
|
423
|
-
setPageSize(nextSize);
|
|
424
|
-
}
|
|
425
|
-
})
|
|
426
|
-
});
|
|
427
|
-
$[95] = current;
|
|
428
|
-
$[96] = customBody;
|
|
429
|
-
$[97] = disabled;
|
|
430
|
-
$[98] = filteredItems;
|
|
431
|
-
$[99] = pageSize;
|
|
432
|
-
$[100] = pagination;
|
|
433
|
-
$[101] = paging;
|
|
434
|
-
$[102] = t20;
|
|
435
|
-
} else t20 = $[102];
|
|
436
|
-
let t21;
|
|
437
|
-
if ($[103] !== t10 || $[104] !== t11 || $[105] !== t12 || $[106] !== t13 || $[107] !== t20) {
|
|
438
|
-
t21 = /*#__PURE__*/ jsxs("div", {
|
|
439
|
-
"data-tao-transfer-body": t10,
|
|
440
|
-
...t11,
|
|
441
|
-
children: [
|
|
442
|
-
t12,
|
|
443
|
-
t13,
|
|
444
|
-
t20
|
|
445
|
-
]
|
|
446
|
-
});
|
|
447
|
-
$[103] = t10;
|
|
448
|
-
$[104] = t11;
|
|
449
|
-
$[105] = t12;
|
|
450
|
-
$[106] = t13;
|
|
451
|
-
$[107] = t20;
|
|
452
|
-
$[108] = t21;
|
|
453
|
-
} else t21 = $[108];
|
|
454
|
-
let t22;
|
|
455
|
-
if ($[109] !== direction || $[110] !== footer || $[111] !== props || $[112] !== semantic) {
|
|
456
|
-
t22 = footer && /*#__PURE__*/ jsx("div", {
|
|
457
|
-
"data-tao-transfer-footer": "",
|
|
458
|
-
...semantic("footer"),
|
|
459
|
-
children: footer(props, {
|
|
460
|
-
direction
|
|
461
|
-
})
|
|
462
|
-
});
|
|
463
|
-
$[109] = direction;
|
|
464
|
-
$[110] = footer;
|
|
465
|
-
$[111] = props;
|
|
466
|
-
$[112] = semantic;
|
|
467
|
-
$[113] = t22;
|
|
468
|
-
} else t22 = $[113];
|
|
469
|
-
let t23;
|
|
470
|
-
if ($[114] !== t14 || $[115] !== t15 || $[116] !== t16 || $[117] !== t17 || $[118] !== t18 || $[119] !== t19 || $[120] !== t21 || $[121] !== t22) {
|
|
471
|
-
t23 = /*#__PURE__*/ jsxs("section", {
|
|
472
|
-
"data-tao-transfer-section": t14,
|
|
473
|
-
"data-tao-direction": t15,
|
|
474
|
-
"aria-label": t16,
|
|
475
|
-
className: t17,
|
|
476
|
-
style: t18,
|
|
477
|
-
children: [
|
|
478
|
-
t19,
|
|
479
|
-
t21,
|
|
480
|
-
t22
|
|
481
|
-
]
|
|
482
|
-
});
|
|
483
|
-
$[114] = t14;
|
|
484
|
-
$[115] = t15;
|
|
485
|
-
$[116] = t16;
|
|
486
|
-
$[117] = t17;
|
|
487
|
-
$[118] = t18;
|
|
488
|
-
$[119] = t19;
|
|
489
|
-
$[120] = t21;
|
|
490
|
-
$[121] = t22;
|
|
491
|
-
$[122] = t23;
|
|
492
|
-
} else t23 = $[122];
|
|
493
|
-
return t23;
|
|
494
|
-
}
|
|
495
|
-
function _temp5(t0) {
|
|
496
|
-
const { item: item_5 } = t0;
|
|
497
|
-
return item_5.key;
|
|
498
|
-
}
|
|
499
|
-
function _temp4(t0) {
|
|
500
|
-
const { item: item_4 } = t0;
|
|
501
|
-
return !item_4.disabled;
|
|
502
|
-
}
|
|
503
|
-
function _temp3(item_3) {
|
|
504
|
-
return item_3.key;
|
|
505
|
-
}
|
|
506
|
-
function _temp2(item_2) {
|
|
507
|
-
return !item_2.disabled;
|
|
508
|
-
}
|
|
509
|
-
function _temp(t0) {
|
|
510
|
-
const { item: item_1 } = t0;
|
|
511
|
-
return item_1;
|
|
246
|
+
]
|
|
247
|
+
});
|
|
512
248
|
}
|
|
513
249
|
export { TransferList };
|