@expcat/tigercat-react 2.0.0-preview.2 → 2.0.0-preview.3
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/{chunk-2YDLAZTK.mjs → chunk-3O2WHF3U.mjs} +5 -2
- package/dist/{chunk-MZPKFMQC.mjs → chunk-44BPUG24.mjs} +13 -7
- package/dist/{chunk-7TVZTASQ.mjs → chunk-44CQTGAN.mjs} +22 -3
- package/dist/{chunk-7PP6RECM.mjs → chunk-532RNNPH.mjs} +3 -3
- package/dist/{chunk-533KLM7P.mjs → chunk-5IHOOP5A.mjs} +2 -2
- package/dist/{chunk-CR4QBH46.mjs → chunk-5RVLBNLI.mjs} +1 -1
- package/dist/{chunk-YCEH4N3Z.mjs → chunk-5XDRILPM.mjs} +3 -3
- package/dist/{chunk-UPQGB5NQ.mjs → chunk-6SEPT4C5.mjs} +22 -11
- package/dist/{chunk-GCOA4AO6.mjs → chunk-773LH7BK.mjs} +1 -1
- package/dist/{chunk-MZCGQED3.mjs → chunk-7EXOY7GD.mjs} +1 -1
- package/dist/{chunk-AF3N4GJJ.mjs → chunk-7KCQMXJA.mjs} +1 -1
- package/dist/{chunk-SNE3E22Q.mjs → chunk-A6JNS35U.mjs} +5 -2
- package/dist/{chunk-FWIYDMJA.mjs → chunk-AGTXDHQJ.mjs} +1 -1
- package/dist/{chunk-WTIEJCRV.mjs → chunk-AJJJ6HWC.mjs} +1 -1
- package/dist/{chunk-SHJNDDYK.mjs → chunk-ASLRAZZN.mjs} +54 -29
- package/dist/{chunk-WLFLQB4R.mjs → chunk-BEJZPJIK.mjs} +1 -1
- package/dist/{chunk-JNZHZVPW.mjs → chunk-CN3QXWK3.mjs} +1 -1
- package/dist/{chunk-OTRPN5ZG.mjs → chunk-CT36XD5I.mjs} +1 -1
- package/dist/{chunk-LJWQ7T57.mjs → chunk-CVYA3MI2.mjs} +10 -6
- package/dist/{chunk-6REMGSLS.mjs → chunk-D4LASFVY.mjs} +1 -1
- package/dist/{chunk-XHNR3A7A.mjs → chunk-DJ4PSDQS.mjs} +5 -2
- package/dist/{chunk-Z2NZ2XC5.mjs → chunk-EKESN747.mjs} +1 -1
- package/dist/{chunk-7S4TP4MZ.mjs → chunk-EW5EO7VE.mjs} +1 -1
- package/dist/{chunk-ZG2W4HS5.mjs → chunk-F2ITBDUS.mjs} +2 -1
- package/dist/chunk-F6T3OLTQ.mjs +12 -0
- package/dist/{chunk-NRWH5IWZ.mjs → chunk-F6WV53BS.mjs} +11 -4
- package/dist/{chunk-D524E52A.mjs → chunk-FDKWHP2K.mjs} +22 -6
- package/dist/{chunk-4R5YXNU4.mjs → chunk-FPQMJFFM.mjs} +20 -3
- package/dist/{chunk-YLVXXP7E.mjs → chunk-H64TM6UQ.mjs} +1 -1
- package/dist/{chunk-2UFTDDPW.mjs → chunk-HXD7KMRP.mjs} +1 -1
- package/dist/{chunk-GQPKHMHA.mjs → chunk-IBSOUQGB.mjs} +1 -1
- package/dist/{chunk-VBGJQPPI.mjs → chunk-IZYFETUS.mjs} +3 -3
- package/dist/{chunk-YTFQBXH4.mjs → chunk-JTFNGXOC.mjs} +1 -1
- package/dist/{chunk-TJDZFN2Z.mjs → chunk-K7MYQISG.mjs} +1 -1
- package/dist/{chunk-GFLKO46C.mjs → chunk-KFPQ6DIH.mjs} +1 -1
- package/dist/{chunk-I3SE5HMH.mjs → chunk-KMP5CVNK.mjs} +1 -1
- package/dist/{chunk-32PAZTVF.mjs → chunk-KVARQQAG.mjs} +64 -19
- package/dist/{chunk-B3O6MAC3.mjs → chunk-L55UK45A.mjs} +6 -4
- package/dist/{chunk-3HPDLIX3.mjs → chunk-LADKKOJT.mjs} +4 -2
- package/dist/{chunk-2PZICT2T.mjs → chunk-LZKBDQE4.mjs} +1 -1
- package/dist/{chunk-H4MPPCTB.mjs → chunk-MOWK7CND.mjs} +1 -1
- package/dist/{chunk-RCUL6RZU.mjs → chunk-MXXAJSRS.mjs} +28 -8
- package/dist/{chunk-KWVA2DN3.mjs → chunk-O5RAMCBV.mjs} +1 -1
- package/dist/{chunk-ZRZB3C5J.mjs → chunk-OIGEBCAS.mjs} +1 -1
- package/dist/{chunk-YN4FMZX5.mjs → chunk-ONMOHKT2.mjs} +4 -4
- package/dist/{chunk-4ZZ7YRTB.mjs → chunk-OO562MFD.mjs} +1 -1
- package/dist/{chunk-7RI5W465.mjs → chunk-OQLP452R.mjs} +1 -1
- package/dist/{chunk-BPQEM6AF.mjs → chunk-OTBXERJD.mjs} +1 -1
- package/dist/{chunk-LAKPYMBZ.mjs → chunk-PAS347EX.mjs} +1 -1
- package/dist/{chunk-V23KR23W.mjs → chunk-PGD5RPKF.mjs} +20 -3
- package/dist/{chunk-SHDQJ5BJ.mjs → chunk-PU3JY6RE.mjs} +1 -1
- package/dist/{chunk-R67HTROL.mjs → chunk-PXRZ6CKY.mjs} +3 -3
- package/dist/{chunk-Z6BDNV3S.mjs → chunk-QB5472NM.mjs} +1 -1
- package/dist/{chunk-BSXPB2V6.mjs → chunk-QGZ32NFQ.mjs} +1 -1
- package/dist/{chunk-2GSXSLGC.mjs → chunk-QOKITTSP.mjs} +5 -5
- package/dist/{chunk-MMWF2OPA.mjs → chunk-SHCBCM2W.mjs} +6 -3
- package/dist/{chunk-WKTIDYPD.mjs → chunk-SZBYEGKU.mjs} +1 -1
- package/dist/{chunk-QWOE4FGJ.mjs → chunk-TDFLUDRM.mjs} +78 -22
- package/dist/{chunk-4F3UTDFE.mjs → chunk-TFMEHUVZ.mjs} +1 -1
- package/dist/chunk-TGXBCKOU.mjs +35 -0
- package/dist/{chunk-3OBUJIJI.mjs → chunk-TO2URY7X.mjs} +3 -3
- package/dist/{chunk-VKIGZWRK.mjs → chunk-TORX7SG4.mjs} +1 -1
- package/dist/{chunk-LOM6NNQK.mjs → chunk-U7RLVY67.mjs} +1 -1
- package/dist/{chunk-XSAKD4MX.mjs → chunk-UHK2ISKR.mjs} +19 -9
- package/dist/{chunk-4SU6D2E7.mjs → chunk-UYQBXVFE.mjs} +1 -1
- package/dist/{chunk-5SX2M3LU.mjs → chunk-VA6PZWOH.mjs} +1 -1
- package/dist/{chunk-T6HNFCOW.mjs → chunk-VD55SSP7.mjs} +1 -1
- package/dist/{chunk-K6JLLCY7.mjs → chunk-VD62GD2E.mjs} +1 -1
- package/dist/{chunk-NJHZQBA7.mjs → chunk-W7BC4I2Y.mjs} +1 -1
- package/dist/{chunk-MOLUSXVC.mjs → chunk-XIVU7TWX.mjs} +4 -4
- package/dist/{chunk-QAIBQHIO.mjs → chunk-YSIXURBW.mjs} +16 -1
- package/dist/{chunk-J4HCTYJG.mjs → chunk-Z3CRHC5F.mjs} +21 -2
- package/dist/{chunk-AMEH5EHB.mjs → chunk-ZEP7I6WB.mjs} +2 -2
- package/dist/{chunk-ZFGSZW7S.mjs → chunk-ZMRTETN2.mjs} +1 -1
- package/dist/components/ActivityFeed.d.mts +5 -5
- package/dist/components/ActivityFeed.mjs +8 -7
- package/dist/components/Affix.d.mts +4 -4
- package/dist/components/Alert.d.mts +7 -7
- package/dist/components/Anchor.d.mts +9 -9
- package/dist/components/AreaChart.d.mts +2 -2
- package/dist/components/AreaChart.mjs +2 -2
- package/dist/components/AutoComplete.d.mts +3 -3
- package/dist/components/AutoComplete.mjs +3 -2
- package/dist/components/Avatar.d.mts +4 -4
- package/dist/components/Avatar.mjs +4 -2
- package/dist/components/AvatarGroup.d.mts +10 -6
- package/dist/components/AvatarGroup.mjs +3 -1
- package/dist/components/BackTop.d.mts +5 -5
- package/dist/components/Badge.d.mts +4 -4
- package/dist/components/Badge.mjs +3 -2
- package/dist/components/BarChart.d.mts +2 -2
- package/dist/components/BarChart.mjs +2 -2
- package/dist/components/Breadcrumb.d.mts +10 -10
- package/dist/components/Button.d.mts +5 -5
- package/dist/components/ButtonGroup.d.mts +4 -4
- package/dist/components/Calendar.d.mts +2 -2
- package/dist/components/Calendar.mjs +3 -2
- package/dist/components/Card.d.mts +7 -7
- package/dist/components/Carousel.d.mts +9 -5
- package/dist/components/Carousel.mjs +3 -1
- package/dist/components/Cascader.d.mts +3 -3
- package/dist/components/Cascader.mjs +3 -2
- package/dist/components/ChartAxis.d.mts +3 -3
- package/dist/components/ChartCanvas.d.mts +3 -3
- package/dist/components/ChartGrid.d.mts +3 -3
- package/dist/components/ChartLegend.d.mts +3 -2
- package/dist/components/ChartLegend.mjs +1 -1
- package/dist/components/ChartSeries.d.mts +4 -4
- package/dist/components/ChartTooltip.d.mts +2 -2
- package/dist/components/ChatWindow.d.mts +4 -4
- package/dist/components/ChatWindow.mjs +8 -6
- package/dist/components/Checkbox.d.mts +5 -5
- package/dist/components/CheckboxGroup.d.mts +4 -4
- package/dist/components/Code.d.mts +3 -3
- package/dist/components/CodeEditor.d.mts +4 -4
- package/dist/components/Col.d.mts +3 -3
- package/dist/components/Collapse.d.mts +4 -4
- package/dist/components/CollapsePanel.d.mts +6 -6
- package/dist/components/ColorPicker.d.mts +2 -2
- package/dist/components/ColorPicker.mjs +1 -1
- package/dist/components/ColorSwatch.d.mts +2 -2
- package/dist/components/CommentThread.d.mts +3 -3
- package/dist/components/CommentThread.mjs +6 -5
- package/dist/components/ConfigProvider.d.mts +3 -3
- package/dist/components/ConfigProvider.mjs +2 -1
- package/dist/components/Container.d.mts +4 -4
- package/dist/components/Content.d.mts +4 -4
- package/dist/components/Countdown.d.mts +3 -3
- package/dist/components/CronEditor.d.mts +7 -3
- package/dist/components/CronEditor.mjs +3 -1
- package/dist/components/CropUpload.d.mts +3 -3
- package/dist/components/CropUpload.mjs +5 -4
- package/dist/components/DataTableWithToolbar.d.mts +6 -6
- package/dist/components/DataTableWithToolbar.mjs +8 -6
- package/dist/components/DatePicker.d.mts +3 -3
- package/dist/components/DatePicker.mjs +3 -2
- package/dist/components/Descriptions.d.mts +7 -7
- package/dist/components/Divider.d.mts +3 -3
- package/dist/components/DonutChart.d.mts +2 -2
- package/dist/components/DonutChart.mjs +3 -3
- package/dist/components/Drawer.d.mts +7 -7
- package/dist/components/Drawer.mjs +3 -2
- package/dist/components/Dropdown.d.mts +15 -15
- package/dist/components/Empty.d.mts +6 -6
- package/dist/components/Empty.mjs +3 -2
- package/dist/components/FileManager.d.mts +3 -3
- package/dist/components/FileManager.mjs +3 -2
- package/dist/components/FloatButton.d.mts +9 -9
- package/dist/components/Footer.d.mts +4 -4
- package/dist/components/Form.d.mts +3 -3
- package/dist/components/Form.mjs +3 -2
- package/dist/components/FormItem.d.mts +3 -3
- package/dist/components/FormItem.mjs +5 -3
- package/dist/components/FormItemContext.d.mts +12 -0
- package/dist/components/FormItemContext.mjs +8 -0
- package/dist/components/FormWizard.d.mts +5 -5
- package/dist/components/FormWizard.mjs +3 -2
- package/dist/components/FunnelChart.d.mts +2 -2
- package/dist/components/FunnelChart.mjs +2 -2
- package/dist/components/Gantt.d.mts +2 -2
- package/dist/components/GaugeChart.d.mts +2 -2
- package/dist/components/Header.d.mts +4 -4
- package/dist/components/HeatmapChart.d.mts +2 -2
- package/dist/components/Icon.d.mts +4 -4
- package/dist/components/Image.d.mts +5 -5
- package/dist/components/Image.mjs +5 -4
- package/dist/components/ImageAnnotation.d.mts +3 -3
- package/dist/components/ImageAnnotation.mjs +3 -2
- package/dist/components/ImageCropper.d.mts +3 -3
- package/dist/components/ImageCropper.mjs +3 -2
- package/dist/components/ImageGroup.d.mts +4 -4
- package/dist/components/ImageGroup.mjs +4 -3
- package/dist/components/ImagePreview.d.mts +2 -2
- package/dist/components/ImagePreview.mjs +3 -2
- package/dist/components/ImageViewer.d.mts +2 -2
- package/dist/components/ImageViewer.mjs +3 -2
- package/dist/components/InfiniteScroll.d.mts +5 -5
- package/dist/components/InfiniteScroll.mjs +3 -2
- package/dist/components/Input.d.mts +9 -9
- package/dist/components/Input.mjs +2 -1
- package/dist/components/InputGroup.d.mts +6 -6
- package/dist/components/InputNumber.d.mts +4 -4
- package/dist/components/InputNumber.mjs +1 -1
- package/dist/components/Kanban.d.mts +5 -5
- package/dist/components/Kanban.mjs +4 -3
- package/dist/components/Layout.d.mts +4 -4
- package/dist/components/LineChart.d.mts +2 -2
- package/dist/components/LineChart.mjs +2 -2
- package/dist/components/Link.d.mts +5 -5
- package/dist/components/List.d.mts +6 -6
- package/dist/components/List.mjs +3 -2
- package/dist/components/Loading.d.mts +3 -3
- package/dist/components/Loading.mjs +3 -2
- package/dist/components/MarkdownEditor.d.mts +8 -4
- package/dist/components/MarkdownEditor.mjs +3 -1
- package/dist/components/Mentions.d.mts +2 -2
- package/dist/components/Menu.d.mts +9 -9
- package/dist/components/Message.mjs +14 -1
- package/dist/components/MessageContainer.d.mts +2 -2
- package/dist/components/MessageContainer.mjs +1 -1
- package/dist/components/MessageRoot.mjs +1 -1
- package/dist/components/Modal.d.mts +6 -6
- package/dist/components/Modal.mjs +3 -2
- package/dist/components/Notification.mjs +14 -1
- package/dist/components/NotificationCenter.d.mts +3 -3
- package/dist/components/NotificationCenter.mjs +6 -5
- package/dist/components/NotificationContainer.d.mts +2 -2
- package/dist/components/NotificationContainer.mjs +1 -1
- package/dist/components/NotificationRoot.mjs +1 -1
- package/dist/components/NumberKeyboard.d.mts +3 -3
- package/dist/components/NumberKeyboard.mjs +3 -2
- package/dist/components/OrgChart.d.mts +2 -2
- package/dist/components/Pagination.d.mts +4 -4
- package/dist/components/Pagination.mjs +3 -2
- package/dist/components/PieChart.d.mts +2 -2
- package/dist/components/PieChart.mjs +2 -2
- package/dist/components/Popconfirm.d.mts +8 -8
- package/dist/components/Popover.d.mts +8 -8
- package/dist/components/PrintLayout.d.mts +8 -8
- package/dist/components/PrintLayout.mjs +1 -1
- package/dist/components/Progress.d.mts +3 -3
- package/dist/components/QRCode.d.mts +2 -2
- package/dist/components/QRCode.mjs +3 -2
- package/dist/components/RadarChart.d.mts +2 -2
- package/dist/components/RadarChart.mjs +2 -2
- package/dist/components/Radio.d.mts +4 -4
- package/dist/components/RadioGroup.d.mts +5 -5
- package/dist/components/Rate.d.mts +7 -3
- package/dist/components/Rate.mjs +3 -1
- package/dist/components/Resizable.d.mts +4 -4
- package/dist/components/Result.d.mts +6 -6
- package/dist/components/RichTextEditor.d.mts +8 -4
- package/dist/components/RichTextEditor.mjs +3 -1
- package/dist/components/Row.d.mts +4 -4
- package/dist/components/ScatterChart.d.mts +5 -3
- package/dist/components/ScatterChart.mjs +4 -2
- package/dist/components/ScrollSpy.d.mts +5 -5
- package/dist/components/Segmented.d.mts +2 -2
- package/dist/components/Select.d.mts +3 -3
- package/dist/components/Select.mjs +3 -2
- package/dist/components/Sidebar.d.mts +4 -4
- package/dist/components/Signature.d.mts +3 -3
- package/dist/components/Signature.mjs +3 -2
- package/dist/components/Skeleton.d.mts +3 -3
- package/dist/components/Slider.d.mts +3 -3
- package/dist/components/Space.d.mts +5 -5
- package/dist/components/Splitter.d.mts +4 -4
- package/dist/components/Spotlight.d.mts +3 -3
- package/dist/components/Spotlight.mjs +3 -2
- package/dist/components/Statistic.d.mts +2 -2
- package/dist/components/Stepper.d.mts +2 -2
- package/dist/components/Stepper.mjs +1 -1
- package/dist/components/Steps.d.mts +7 -7
- package/dist/components/SunburstChart.d.mts +2 -2
- package/dist/components/SunburstChart.mjs +2 -2
- package/dist/components/Switch.d.mts +3 -3
- package/dist/components/Table.d.mts +2 -2
- package/dist/components/Table.mjs +5 -4
- package/dist/components/Tabs.d.mts +15 -10
- package/dist/components/Tabs.mjs +3 -1
- package/dist/components/Tag.d.mts +5 -5
- package/dist/components/Tag.mjs +3 -2
- package/dist/components/TaskBoard.d.mts +8 -8
- package/dist/components/TaskBoard.mjs +3 -2
- package/dist/components/Text.d.mts +4 -4
- package/dist/components/Textarea.d.mts +7 -7
- package/dist/components/TimePicker.d.mts +3 -3
- package/dist/components/TimePicker.mjs +3 -2
- package/dist/components/Timeline.d.mts +7 -7
- package/dist/components/Timeline.mjs +3 -2
- package/dist/components/Tooltip.d.mts +6 -6
- package/dist/components/Tour.d.mts +2 -2
- package/dist/components/Tour.mjs +3 -2
- package/dist/components/Transfer.d.mts +6 -4
- package/dist/components/Transfer.mjs +3 -2
- package/dist/components/Tree.d.mts +4 -4
- package/dist/components/Tree.mjs +3 -2
- package/dist/components/TreeMapChart.d.mts +2 -2
- package/dist/components/TreeMapChart.mjs +2 -2
- package/dist/components/TreeSelect.d.mts +3 -3
- package/dist/components/TreeSelect.mjs +3 -2
- package/dist/components/Upload.d.mts +3 -3
- package/dist/components/Upload.mjs +3 -2
- package/dist/components/VirtualList.d.mts +3 -3
- package/dist/components/VirtualTable.d.mts +3 -3
- package/dist/components/VirtualTable.mjs +3 -2
- package/dist/components/Watermark.d.mts +4 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +29 -0
- package/package.json +2 -2
- /package/dist/{chunk-BPFKTAF2.mjs → chunk-L5KAXWQI.mjs} +0 -0
- /package/dist/{chunk-FNBTGIDG.mjs → chunk-Y3SGFGN6.mjs} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5XDRILPM.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Select
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-H64TM6UQ.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Popover
|
|
9
9
|
} from "./chunk-QWUDJC6K.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Input
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-F6WV53BS.mjs";
|
|
13
13
|
import {
|
|
14
14
|
Checkbox
|
|
15
15
|
} from "./chunk-EPWAROC2.mjs";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-5TE7KLE5.mjs";
|
|
19
19
|
import {
|
|
20
20
|
useTigerConfig
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-YSIXURBW.mjs";
|
|
22
22
|
|
|
23
23
|
// src/components/DataTableWithToolbar.tsx
|
|
24
24
|
import { useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -73,7 +73,7 @@ var MessageItem = ({ message, onClose }) => {
|
|
|
73
73
|
{
|
|
74
74
|
className: messageCloseButtonClasses,
|
|
75
75
|
onClick: handleClose,
|
|
76
|
-
"aria-label": MESSAGE_CLOSE_ARIA_LABEL,
|
|
76
|
+
"aria-label": message.closeAriaLabel ?? MESSAGE_CLOSE_ARIA_LABEL,
|
|
77
77
|
type: "button",
|
|
78
78
|
children: /* @__PURE__ */ jsx(StatusIcon, { path: messageCloseIconPath, className: "w-4 h-4" })
|
|
79
79
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-YSIXURBW.mjs";
|
|
4
|
+
|
|
1
5
|
// src/components/Rate.tsx
|
|
2
6
|
import { useState, useMemo, useCallback } from "react";
|
|
3
7
|
import {
|
|
@@ -8,7 +12,9 @@ import {
|
|
|
8
12
|
rateHoverColor,
|
|
9
13
|
starPathD,
|
|
10
14
|
starViewBox,
|
|
11
|
-
classNames
|
|
15
|
+
classNames,
|
|
16
|
+
mergeTigerLocale,
|
|
17
|
+
getRateLabels
|
|
12
18
|
} from "@expcat/tigercat-core";
|
|
13
19
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
14
20
|
var Rate = ({
|
|
@@ -20,10 +26,21 @@ var Rate = ({
|
|
|
20
26
|
allowClear = true,
|
|
21
27
|
character,
|
|
22
28
|
className,
|
|
29
|
+
locale,
|
|
30
|
+
labels: labelsOverride,
|
|
23
31
|
onChange,
|
|
24
32
|
onHoverChange
|
|
25
33
|
}) => {
|
|
34
|
+
const config = useTigerConfig();
|
|
26
35
|
const [hoverValue, setHoverValue] = useState(0);
|
|
36
|
+
const mergedLocale = useMemo(
|
|
37
|
+
() => mergeTigerLocale(config.locale, locale),
|
|
38
|
+
[config.locale, locale]
|
|
39
|
+
);
|
|
40
|
+
const labels = useMemo(
|
|
41
|
+
() => getRateLabels(mergedLocale, labelsOverride),
|
|
42
|
+
[mergedLocale, labelsOverride]
|
|
43
|
+
);
|
|
27
44
|
const displayValue = hoverValue > 0 ? hoverValue : value;
|
|
28
45
|
const isChar = !!character;
|
|
29
46
|
const getStarValue = useCallback((index, isHalf) => {
|
|
@@ -143,13 +160,13 @@ var Rate = ({
|
|
|
143
160
|
handleMouseMove,
|
|
144
161
|
handleMouseLeave
|
|
145
162
|
]);
|
|
146
|
-
const valueText =
|
|
163
|
+
const valueText = labels.valueText.replace("{value}", String(value)).replace("{plural}", value === 1 ? "" : "s");
|
|
147
164
|
return /* @__PURE__ */ jsx(
|
|
148
165
|
"div",
|
|
149
166
|
{
|
|
150
167
|
className: classNames(rateBaseClasses, className),
|
|
151
168
|
role: "slider",
|
|
152
|
-
"aria-label":
|
|
169
|
+
"aria-label": labels.ariaLabel,
|
|
153
170
|
"aria-valuemin": 0,
|
|
154
171
|
"aria-valuemax": count,
|
|
155
172
|
"aria-valuenow": value,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-Y5X3G2LD.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Input
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-F6WV53BS.mjs";
|
|
7
7
|
import {
|
|
8
8
|
Empty
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-W7BC4I2Y.mjs";
|
|
10
10
|
import {
|
|
11
11
|
Textarea
|
|
12
12
|
} from "./chunk-UYJJLHVA.mjs";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-5TE7KLE5.mjs";
|
|
16
16
|
import {
|
|
17
17
|
Avatar
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OO562MFD.mjs";
|
|
19
19
|
|
|
20
20
|
// src/components/ChatWindow.tsx
|
|
21
21
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-MEFARVQI.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useTigerConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YSIXURBW.mjs";
|
|
7
7
|
|
|
8
8
|
// src/components/DatePicker.tsx
|
|
9
9
|
import {
|
|
@@ -62,7 +62,6 @@ function useDatePickerState(props) {
|
|
|
62
62
|
format = "yyyy-MM-dd"
|
|
63
63
|
} = props;
|
|
64
64
|
const isRangeMode = isRangeDatePicker(props);
|
|
65
|
-
const placeholder = props.placeholder ?? (isRangeMode ? "Select date range" : "Select date");
|
|
66
65
|
const divProps = (({
|
|
67
66
|
value: _value,
|
|
68
67
|
defaultValue: _defaultValue,
|
|
@@ -165,6 +164,7 @@ function useDatePickerState(props) {
|
|
|
165
164
|
() => getDatePickerLabels(mergedLocale, props.labels),
|
|
166
165
|
[mergedLocale, props.labels]
|
|
167
166
|
);
|
|
167
|
+
const placeholder = props.placeholder ?? (isRangeMode ? labels.rangePlaceholder : labels.placeholder);
|
|
168
168
|
const mobileDate = useMemo(() => {
|
|
169
169
|
if (!isRangeMode) return selectedDate ?? normalizeDate(/* @__PURE__ */ new Date());
|
|
170
170
|
const [start, end] = selectedRange;
|
|
@@ -526,7 +526,7 @@ function renderDatePickerMobile(ctx) {
|
|
|
526
526
|
{
|
|
527
527
|
className: datePickerMobileWheelSelectClasses,
|
|
528
528
|
value: ctx.mobileDate.getFullYear(),
|
|
529
|
-
"aria-label":
|
|
529
|
+
"aria-label": ctx.labels.year,
|
|
530
530
|
onChange: (event) => ctx.updateMobileDate("year", Number(event.target.value)),
|
|
531
531
|
children: ctx.mobileYears.map((year) => /* @__PURE__ */ jsx("option", { value: year, children: year }, year))
|
|
532
532
|
}
|
|
@@ -536,7 +536,7 @@ function renderDatePickerMobile(ctx) {
|
|
|
536
536
|
{
|
|
537
537
|
className: datePickerMobileWheelSelectClasses,
|
|
538
538
|
value: ctx.mobileDate.getMonth(),
|
|
539
|
-
"aria-label":
|
|
539
|
+
"aria-label": ctx.labels.month,
|
|
540
540
|
onChange: (event) => ctx.updateMobileDate("month", Number(event.target.value)),
|
|
541
541
|
children: Array.from({ length: 12 }, (_, month) => /* @__PURE__ */ jsx("option", { value: month, children: month + 1 }, month))
|
|
542
542
|
}
|
|
@@ -546,7 +546,7 @@ function renderDatePickerMobile(ctx) {
|
|
|
546
546
|
{
|
|
547
547
|
className: datePickerMobileWheelSelectClasses,
|
|
548
548
|
value: ctx.mobileDate.getDate(),
|
|
549
|
-
"aria-label":
|
|
549
|
+
"aria-label": ctx.labels.day,
|
|
550
550
|
onChange: (event) => ctx.updateMobileDate("day", Number(event.target.value)),
|
|
551
551
|
children: ctx.mobileDays.map((day) => /* @__PURE__ */ jsx("option", { value: day, children: day }, day))
|
|
552
552
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useTigerConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YSIXURBW.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/Cascader.tsx
|
|
6
6
|
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
@@ -217,7 +217,7 @@ var Cascader = (props) => {
|
|
|
217
217
|
{
|
|
218
218
|
className: "flex items-center",
|
|
219
219
|
role: "button",
|
|
220
|
-
"aria-label": "Clear selection",
|
|
220
|
+
"aria-label": resolveLocaleText("Clear selection", mergedLocale?.common?.clearText),
|
|
221
221
|
onClick: handleClear,
|
|
222
222
|
children: /* @__PURE__ */ jsx(
|
|
223
223
|
"svg",
|
|
@@ -262,7 +262,10 @@ var Cascader = (props) => {
|
|
|
262
262
|
placeholder: resolveLocaleText("Search...", mergedLocale?.common?.searchPlaceholder),
|
|
263
263
|
value: searchQuery,
|
|
264
264
|
onChange: (e) => updateSearchValue(e.target.value),
|
|
265
|
-
"aria-label":
|
|
265
|
+
"aria-label": resolveLocaleText(
|
|
266
|
+
"Search options",
|
|
267
|
+
mergedLocale?.common?.searchPlaceholder
|
|
268
|
+
)
|
|
266
269
|
}
|
|
267
270
|
),
|
|
268
271
|
isSearchMode ? (
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-YSIXURBW.mjs";
|
|
4
|
+
|
|
1
5
|
// src/components/CronEditor.tsx
|
|
2
6
|
import { useMemo, useState } from "react";
|
|
3
7
|
import {
|
|
@@ -10,14 +14,15 @@ import {
|
|
|
10
14
|
cronEditorLabelClasses,
|
|
11
15
|
cronFieldMetas,
|
|
12
16
|
defaultCronExpression,
|
|
13
|
-
defaultCronPresets,
|
|
14
17
|
getCronEditorControlClasses,
|
|
18
|
+
getCronEditorLabels,
|
|
15
19
|
getCronFieldIssue,
|
|
16
20
|
getCronFieldValue,
|
|
21
|
+
mergeTigerLocale,
|
|
17
22
|
normalizeCronExpression,
|
|
18
23
|
parseCronFieldControl,
|
|
19
24
|
updateCronExpressionField,
|
|
20
|
-
|
|
25
|
+
validateCronExpressionWithLabels
|
|
21
26
|
} from "@expcat/tigercat-core";
|
|
22
27
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
28
|
var modeOptions = [
|
|
@@ -27,31 +32,82 @@ var modeOptions = [
|
|
|
27
32
|
{ label: "Range", value: "range" },
|
|
28
33
|
{ label: "Custom", value: "custom" }
|
|
29
34
|
];
|
|
35
|
+
function formatCronControlLabel(template, field) {
|
|
36
|
+
return template.replace("{field}", field);
|
|
37
|
+
}
|
|
30
38
|
var CronEditor = ({
|
|
31
39
|
value,
|
|
32
40
|
defaultValue = defaultCronExpression,
|
|
33
41
|
disabled = false,
|
|
34
42
|
readonly = false,
|
|
35
43
|
size = "md",
|
|
36
|
-
presets
|
|
37
|
-
ariaLabel
|
|
44
|
+
presets,
|
|
45
|
+
ariaLabel,
|
|
46
|
+
locale,
|
|
47
|
+
labels: labelsOverride,
|
|
38
48
|
className,
|
|
39
49
|
onChange,
|
|
40
50
|
onValidate
|
|
41
51
|
}) => {
|
|
52
|
+
const config = useTigerConfig();
|
|
53
|
+
const mergedLocale = useMemo(
|
|
54
|
+
() => mergeTigerLocale(config.locale, locale),
|
|
55
|
+
[config.locale, locale]
|
|
56
|
+
);
|
|
57
|
+
const labels = useMemo(
|
|
58
|
+
() => getCronEditorLabels(mergedLocale, labelsOverride),
|
|
59
|
+
[mergedLocale, labelsOverride]
|
|
60
|
+
);
|
|
61
|
+
const fieldLabels = useMemo(
|
|
62
|
+
() => ({
|
|
63
|
+
minute: labels.minuteLabel,
|
|
64
|
+
hour: labels.hourLabel,
|
|
65
|
+
dayOfMonth: labels.dayOfMonthLabel,
|
|
66
|
+
month: labels.monthLabel,
|
|
67
|
+
dayOfWeek: labels.dayOfWeekLabel
|
|
68
|
+
}),
|
|
69
|
+
[labels]
|
|
70
|
+
);
|
|
71
|
+
const localizedMetas = useMemo(
|
|
72
|
+
() => cronFieldMetas.map((meta) => ({ ...meta, label: fieldLabels[meta.key] })),
|
|
73
|
+
[fieldLabels]
|
|
74
|
+
);
|
|
75
|
+
const resolvedPresets = useMemo(
|
|
76
|
+
() => presets ?? [
|
|
77
|
+
{ label: labels.everyMinutePreset, value: "* * * * *" },
|
|
78
|
+
{ label: labels.hourlyPreset, value: "0 * * * *" },
|
|
79
|
+
{ label: labels.dailyPreset, value: "0 0 * * *" },
|
|
80
|
+
{ label: labels.weeklyPreset, value: "0 0 * * 1" },
|
|
81
|
+
{ label: labels.monthlyPreset, value: "0 0 1 * *" }
|
|
82
|
+
],
|
|
83
|
+
[labels, presets]
|
|
84
|
+
);
|
|
85
|
+
const modeLabels = useMemo(
|
|
86
|
+
() => ({
|
|
87
|
+
any: labels.modeAnyLabel,
|
|
88
|
+
every: labels.modeEveryLabel,
|
|
89
|
+
specific: labels.modeSpecificLabel,
|
|
90
|
+
range: labels.modeRangeLabel,
|
|
91
|
+
custom: labels.modeCustomLabel
|
|
92
|
+
}),
|
|
93
|
+
[labels]
|
|
94
|
+
);
|
|
42
95
|
const [innerValue, setInnerValue] = useState(defaultValue);
|
|
43
96
|
const expression = value ?? innerValue;
|
|
44
|
-
const validation = useMemo(
|
|
97
|
+
const validation = useMemo(
|
|
98
|
+
() => validateCronExpressionWithLabels(expression, labels, fieldLabels),
|
|
99
|
+
[expression, labels, fieldLabels]
|
|
100
|
+
);
|
|
45
101
|
const inactive = disabled || readonly;
|
|
46
102
|
function commit(nextValue) {
|
|
47
103
|
const normalized = normalizeCronExpression(nextValue);
|
|
48
|
-
const nextValidation =
|
|
104
|
+
const nextValidation = validateCronExpressionWithLabels(normalized, labels, fieldLabels);
|
|
49
105
|
if (value === void 0) setInnerValue(normalized);
|
|
50
106
|
onChange?.(normalized, nextValidation);
|
|
51
107
|
onValidate?.(nextValidation);
|
|
52
108
|
}
|
|
53
109
|
function handleRawExpressionChange(nextValue) {
|
|
54
|
-
const nextValidation =
|
|
110
|
+
const nextValidation = validateCronExpressionWithLabels(nextValue, labels, fieldLabels);
|
|
55
111
|
if (value === void 0) setInnerValue(nextValue);
|
|
56
112
|
onChange?.(nextValue, nextValidation);
|
|
57
113
|
onValidate?.(nextValidation);
|
|
@@ -82,7 +138,7 @@ var CronEditor = ({
|
|
|
82
138
|
className: getCronEditorControlClasses(size),
|
|
83
139
|
value: control.step ?? 1,
|
|
84
140
|
disabled: inactive,
|
|
85
|
-
"aria-label":
|
|
141
|
+
"aria-label": formatCronControlLabel(labels.stepAriaLabel, meta.label),
|
|
86
142
|
onChange: (event) => handleFieldRawChange(
|
|
87
143
|
meta,
|
|
88
144
|
buildCronFieldValue({ ...control, step: Number(event.target.value) }, meta)
|
|
@@ -100,7 +156,7 @@ var CronEditor = ({
|
|
|
100
156
|
className: getCronEditorControlClasses(size),
|
|
101
157
|
value: control.value ?? meta.min,
|
|
102
158
|
disabled: inactive,
|
|
103
|
-
"aria-label":
|
|
159
|
+
"aria-label": formatCronControlLabel(labels.valueAriaLabel, meta.label),
|
|
104
160
|
onChange: (event) => handleFieldRawChange(
|
|
105
161
|
meta,
|
|
106
162
|
buildCronFieldValue({ ...control, value: Number(event.target.value) }, meta)
|
|
@@ -119,7 +175,7 @@ var CronEditor = ({
|
|
|
119
175
|
className: getCronEditorControlClasses(size),
|
|
120
176
|
value: control.start ?? meta.min,
|
|
121
177
|
disabled: inactive,
|
|
122
|
-
"aria-label":
|
|
178
|
+
"aria-label": formatCronControlLabel(labels.rangeStartAriaLabel, meta.label),
|
|
123
179
|
onChange: (event) => handleFieldRawChange(
|
|
124
180
|
meta,
|
|
125
181
|
buildCronFieldValue({ ...control, start: Number(event.target.value) }, meta)
|
|
@@ -135,7 +191,7 @@ var CronEditor = ({
|
|
|
135
191
|
className: getCronEditorControlClasses(size),
|
|
136
192
|
value: control.end ?? meta.max,
|
|
137
193
|
disabled: inactive,
|
|
138
|
-
"aria-label":
|
|
194
|
+
"aria-label": formatCronControlLabel(labels.rangeEndAriaLabel, meta.label),
|
|
139
195
|
onChange: (event) => handleFieldRawChange(
|
|
140
196
|
meta,
|
|
141
197
|
buildCronFieldValue({ ...control, end: Number(event.target.value) }, meta)
|
|
@@ -151,7 +207,7 @@ var CronEditor = ({
|
|
|
151
207
|
className: getCronEditorControlClasses(size),
|
|
152
208
|
value: control.raw,
|
|
153
209
|
disabled: inactive,
|
|
154
|
-
"aria-label":
|
|
210
|
+
"aria-label": formatCronControlLabel(labels.customValueAriaLabel, meta.label),
|
|
155
211
|
onChange: (event) => handleFieldRawChange(meta, event.target.value)
|
|
156
212
|
}
|
|
157
213
|
);
|
|
@@ -161,7 +217,7 @@ var CronEditor = ({
|
|
|
161
217
|
{
|
|
162
218
|
className: classNames(cronEditorBaseClasses, className),
|
|
163
219
|
role: "group",
|
|
164
|
-
"aria-label": ariaLabel,
|
|
220
|
+
"aria-label": ariaLabel ?? labels.ariaLabel,
|
|
165
221
|
children: [
|
|
166
222
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
167
223
|
/* @__PURE__ */ jsx(
|
|
@@ -172,29 +228,29 @@ var CronEditor = ({
|
|
|
172
228
|
value: expression,
|
|
173
229
|
disabled,
|
|
174
230
|
readOnly: readonly,
|
|
175
|
-
"aria-label":
|
|
231
|
+
"aria-label": labels.expressionAriaLabel,
|
|
176
232
|
onChange: (event) => handleRawExpressionChange(event.target.value)
|
|
177
233
|
}
|
|
178
234
|
),
|
|
179
|
-
|
|
235
|
+
resolvedPresets.length > 0 && /* @__PURE__ */ jsxs(
|
|
180
236
|
"select",
|
|
181
237
|
{
|
|
182
238
|
className: getCronEditorControlClasses(size),
|
|
183
|
-
value:
|
|
239
|
+
value: resolvedPresets.some((preset) => preset.value === expression) ? expression : "",
|
|
184
240
|
disabled: inactive,
|
|
185
|
-
"aria-label":
|
|
241
|
+
"aria-label": labels.presetAriaLabel,
|
|
186
242
|
onChange: (event) => {
|
|
187
243
|
if (event.target.value) commit(event.target.value);
|
|
188
244
|
},
|
|
189
245
|
children: [
|
|
190
|
-
/* @__PURE__ */ jsx("option", { value: "", children:
|
|
191
|
-
|
|
246
|
+
/* @__PURE__ */ jsx("option", { value: "", children: labels.presetPlaceholder }),
|
|
247
|
+
resolvedPresets.map((preset) => /* @__PURE__ */ jsx("option", { value: preset.value, children: preset.label }, preset.value))
|
|
192
248
|
]
|
|
193
249
|
}
|
|
194
250
|
)
|
|
195
251
|
] }),
|
|
196
252
|
validation.issues.filter((issue) => issue.field === "expression").map((issue) => /* @__PURE__ */ jsx("div", { className: cronEditorErrorClasses, children: issue.message }, issue.message)),
|
|
197
|
-
/* @__PURE__ */ jsx("div", { className: cronEditorFieldsClasses, children:
|
|
253
|
+
/* @__PURE__ */ jsx("div", { className: cronEditorFieldsClasses, children: localizedMetas.map((meta) => {
|
|
198
254
|
const raw = getCronFieldValue(expression, meta.key);
|
|
199
255
|
const control = parseCronFieldControl(raw);
|
|
200
256
|
const issue = getCronFieldIssue(validation, meta.key);
|
|
@@ -206,9 +262,9 @@ var CronEditor = ({
|
|
|
206
262
|
className: getCronEditorControlClasses(size, !!issue),
|
|
207
263
|
value: control.mode,
|
|
208
264
|
disabled: inactive,
|
|
209
|
-
"aria-label":
|
|
265
|
+
"aria-label": formatCronControlLabel(labels.modeAriaLabel, meta.label),
|
|
210
266
|
onChange: (event) => handleModeChange(meta, control, event.target.value),
|
|
211
|
-
children: modeOptions.map((mode) => /* @__PURE__ */ jsx("option", { value: mode.value, children: mode.
|
|
267
|
+
children: modeOptions.map((mode) => /* @__PURE__ */ jsx("option", { value: mode.value, children: modeLabels[mode.value] }, mode.value))
|
|
212
268
|
}
|
|
213
269
|
),
|
|
214
270
|
renderFieldControl(meta, control),
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/utils/global-locale.ts
|
|
2
|
+
var nextGlobalTigerLocaleId = 0;
|
|
3
|
+
var globalTigerLocaleStack = [];
|
|
4
|
+
function createGlobalTigerLocaleHandle(locale) {
|
|
5
|
+
const entry = {
|
|
6
|
+
id: ++nextGlobalTigerLocaleId,
|
|
7
|
+
locale
|
|
8
|
+
};
|
|
9
|
+
globalTigerLocaleStack.push(entry);
|
|
10
|
+
return {
|
|
11
|
+
update(nextLocale) {
|
|
12
|
+
entry.locale = nextLocale;
|
|
13
|
+
},
|
|
14
|
+
dispose() {
|
|
15
|
+
const index = globalTigerLocaleStack.findIndex((item) => item.id === entry.id);
|
|
16
|
+
if (index !== -1) {
|
|
17
|
+
globalTigerLocaleStack.splice(index, 1);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function getGlobalTigerLocale() {
|
|
23
|
+
for (let index = globalTigerLocaleStack.length - 1; index >= 0; index -= 1) {
|
|
24
|
+
const locale = globalTigerLocaleStack[index]?.locale;
|
|
25
|
+
if (locale) {
|
|
26
|
+
return locale;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return void 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
createGlobalTigerLocaleHandle,
|
|
34
|
+
getGlobalTigerLocale
|
|
35
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useTigerConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YSIXURBW.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/TreeSelect.tsx
|
|
6
6
|
import { useState, useMemo, useRef, useEffect, useId } from "react";
|
|
@@ -197,7 +197,7 @@ var TreeSelect = (props) => {
|
|
|
197
197
|
"span",
|
|
198
198
|
{
|
|
199
199
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-[var(--tiger-treeselect-clear,var(--tiger-text-muted,#9ca3af))] hover:text-[var(--tiger-treeselect-clear-hover,var(--tiger-text,#111827))]",
|
|
200
|
-
"aria-label": "Clear selection",
|
|
200
|
+
"aria-label": resolveLocaleText("Clear selection", mergedLocale?.common?.clearText),
|
|
201
201
|
onClick: handleClear,
|
|
202
202
|
children: /* @__PURE__ */ jsx(
|
|
203
203
|
"svg",
|
|
@@ -231,7 +231,7 @@ var TreeSelect = (props) => {
|
|
|
231
231
|
className: treeSelectSearchClasses,
|
|
232
232
|
placeholder: resolveLocaleText("Search...", mergedLocale?.common?.searchPlaceholder),
|
|
233
233
|
value: searchQuery,
|
|
234
|
-
"aria-label": "Search tree",
|
|
234
|
+
"aria-label": resolveLocaleText("Search tree", mergedLocale?.common?.searchPlaceholder),
|
|
235
235
|
onChange: (e) => updateSearchValue(e.target.value)
|
|
236
236
|
}
|
|
237
237
|
),
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useTigerConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YSIXURBW.mjs";
|
|
4
4
|
|
|
5
5
|
// src/components/Transfer.tsx
|
|
6
6
|
import { useState, useMemo } from "react";
|
|
7
7
|
import {
|
|
8
8
|
resolveLocaleText,
|
|
9
9
|
mergeTigerLocale,
|
|
10
|
+
getTransferLabels,
|
|
10
11
|
transferBaseClasses,
|
|
11
12
|
transferPanelClasses,
|
|
12
13
|
transferPanelHeaderClasses,
|
|
@@ -55,14 +56,15 @@ var Transfer = (props) => {
|
|
|
55
56
|
searchable = false,
|
|
56
57
|
searchValue,
|
|
57
58
|
defaultSearchValue,
|
|
58
|
-
sourceTitle
|
|
59
|
-
targetTitle
|
|
59
|
+
sourceTitle,
|
|
60
|
+
targetTitle,
|
|
60
61
|
emptyText,
|
|
61
62
|
filterOption,
|
|
62
63
|
className,
|
|
63
64
|
onChange,
|
|
64
65
|
onSearchChange,
|
|
65
66
|
locale,
|
|
67
|
+
labels: labelsOverride,
|
|
66
68
|
...rest
|
|
67
69
|
} = props;
|
|
68
70
|
const resolvedValue = value ?? targetKeys ?? EMPTY_TRANSFER_VALUE;
|
|
@@ -71,6 +73,14 @@ var Transfer = (props) => {
|
|
|
71
73
|
() => mergeTigerLocale(config.locale, locale),
|
|
72
74
|
[config.locale, locale]
|
|
73
75
|
);
|
|
76
|
+
const labels = useMemo(
|
|
77
|
+
() => getTransferLabels(mergedLocale, {
|
|
78
|
+
...labelsOverride,
|
|
79
|
+
sourceTitle,
|
|
80
|
+
targetTitle
|
|
81
|
+
}),
|
|
82
|
+
[mergedLocale, labelsOverride, sourceTitle, targetTitle]
|
|
83
|
+
);
|
|
74
84
|
const divProps = {};
|
|
75
85
|
for (const key of Object.keys(rest)) {
|
|
76
86
|
if (!TRANSFER_KEYS.has(key)) {
|
|
@@ -165,7 +175,7 @@ var Transfer = (props) => {
|
|
|
165
175
|
className: transferSearchClasses,
|
|
166
176
|
placeholder: resolveLocaleText("Search...", mergedLocale?.common?.searchPlaceholder),
|
|
167
177
|
value: searchValue2,
|
|
168
|
-
"aria-label":
|
|
178
|
+
"aria-label": labels.searchAriaLabel.replace("{title}", title),
|
|
169
179
|
onChange: (e) => onSearchInput(e.target.value)
|
|
170
180
|
}
|
|
171
181
|
),
|
|
@@ -173,7 +183,7 @@ var Transfer = (props) => {
|
|
|
173
183
|
"div",
|
|
174
184
|
{
|
|
175
185
|
className: transferPanelBodyClasses,
|
|
176
|
-
...getPickerListboxAria({ label:
|
|
186
|
+
...getPickerListboxAria({ label: labels.itemsAriaLabel.replace("{title}", title) }),
|
|
177
187
|
children: items.length > 0 ? items.map((item) => {
|
|
178
188
|
const isSelected = selectedKeys.has(item.key);
|
|
179
189
|
const isDisabled = disabled || !!item.disabled;
|
|
@@ -207,7 +217,7 @@ var Transfer = (props) => {
|
|
|
207
217
|
}
|
|
208
218
|
return /* @__PURE__ */ jsxs("div", { className: classNames(transferBaseClasses, className), ...divProps, children: [
|
|
209
219
|
renderPanel(
|
|
210
|
-
sourceTitle,
|
|
220
|
+
labels.sourceTitle,
|
|
211
221
|
filteredSourceItems,
|
|
212
222
|
sourceSelectedKeys,
|
|
213
223
|
toggleSourceItem,
|
|
@@ -221,7 +231,7 @@ var Transfer = (props) => {
|
|
|
221
231
|
type: "button",
|
|
222
232
|
className: getTransferButtonClasses(!canMoveRight),
|
|
223
233
|
disabled: !canMoveRight,
|
|
224
|
-
"aria-label":
|
|
234
|
+
"aria-label": labels.moveToTargetAriaLabel,
|
|
225
235
|
onClick: moveRight,
|
|
226
236
|
children: /* @__PURE__ */ jsx(
|
|
227
237
|
"svg",
|
|
@@ -241,7 +251,7 @@ var Transfer = (props) => {
|
|
|
241
251
|
type: "button",
|
|
242
252
|
className: getTransferButtonClasses(!canMoveLeft),
|
|
243
253
|
disabled: !canMoveLeft,
|
|
244
|
-
"aria-label":
|
|
254
|
+
"aria-label": labels.moveToSourceAriaLabel,
|
|
245
255
|
onClick: moveLeft,
|
|
246
256
|
children: /* @__PURE__ */ jsx(
|
|
247
257
|
"svg",
|
|
@@ -257,7 +267,7 @@ var Transfer = (props) => {
|
|
|
257
267
|
)
|
|
258
268
|
] }),
|
|
259
269
|
renderPanel(
|
|
260
|
-
targetTitle,
|
|
270
|
+
labels.targetTitle,
|
|
261
271
|
filteredTargetItems,
|
|
262
272
|
targetSelectedKeys,
|
|
263
273
|
toggleTargetItem,
|