@rockshin/tao-ui 0.0.44 → 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 +9 -1
- package/component-manifest.json +38 -4
- package/dist/components/alert/alert.js +20 -17
- package/dist/components/auto-complete/auto-complete.js +12 -3
- package/dist/components/avatar/avatar.js +2 -1
- package/dist/components/breadcrumb/breadcrumb.css +4 -0
- package/dist/components/breadcrumb/breadcrumb.js +82 -77
- package/dist/components/calendar/calendar.d.ts +1 -1
- package/dist/components/calendar/calendar.js +51 -33
- package/dist/components/card/card-tabs.js +204 -182
- package/dist/components/card/card.js +1 -1
- package/dist/components/carousel/carousel.js +11 -5
- package/dist/components/cascader/cascader.js +16 -4
- package/dist/components/collapse/collapse.css +8 -0
- package/dist/components/color-picker/color-picker.js +273 -269
- package/dist/components/context-menu/context-menu.d.ts +2 -1
- package/dist/components/context-menu/context-menu.js +57 -44
- package/dist/components/date-picker/calendar/calendar-grid.js +13 -6
- 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.css +4 -0
- package/dist/components/date-picker/date-picker.d.ts +1 -0
- package/dist/components/date-picker/date-picker.js +48 -30
- package/dist/components/date-picker/range-picker.d.ts +1 -0
- package/dist/components/date-picker/range-picker.js +41 -23
- package/dist/components/drawer/drawer.d.ts +2 -1
- package/dist/components/drawer/drawer.js +32 -20
- package/dist/components/dropdown/dropdown.d.ts +1 -0
- package/dist/components/dropdown/dropdown.js +160 -143
- 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/mentions/mentions.js +6 -2
- package/dist/components/modal/confirm-dialog.js +4 -2
- package/dist/components/modal/modal.d.ts +2 -1
- package/dist/components/modal/modal.js +387 -375
- package/dist/components/pagination/pagination.css +4 -0
- package/dist/components/pagination/pagination.js +115 -110
- package/dist/components/popconfirm/popconfirm.js +109 -107
- package/dist/components/popover/popover.d.ts +2 -1
- package/dist/components/popover/popover.js +185 -176
- package/dist/components/qr-code/qr-code.js +22 -21
- package/dist/components/rate/rate.js +114 -88
- package/dist/components/scroll-area/scroll-area.js +132 -120
- package/dist/components/segmented/segmented.js +52 -29
- package/dist/components/select/mobile-select.d.ts +3 -2
- package/dist/components/select/mobile-select.js +54 -48
- package/dist/components/select/select-types.d.ts +1 -0
- package/dist/components/select/select.js +19 -6
- package/dist/components/slider/slider.js +136 -133
- package/dist/components/sonner/sonner.js +10 -10
- package/dist/components/spinner/spinner.js +1 -1
- package/dist/components/splitter/splitter.css +4 -0
- package/dist/components/splitter/splitter.js +29 -24
- 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.css +29 -11
- package/dist/components/table/table.d.ts +1 -1
- package/dist/components/table/table.js +384 -547
- package/dist/components/tabs/tabs.js +3 -2
- 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 +160 -103
- package/dist/components/tooltip/tooltip.d.ts +2 -1
- package/dist/components/tooltip/tooltip.js +82 -71
- package/dist/components/transfer/transfer-list.js +224 -488
- package/dist/components/transfer/transfer-parts.js +14 -4
- package/dist/components/transfer/transfer-types.d.ts +1 -0
- package/dist/components/transfer/transfer.js +23 -20
- package/dist/components/tree/tree-keyboard.d.ts +6 -0
- package/dist/components/tree/tree-keyboard.js +27 -0
- package/dist/components/tree/tree.js +14 -3
- package/dist/components/tree-select/select-engine.d.ts +2 -1
- package/dist/components/tree-select/select-engine.js +23 -15
- package/dist/components/tree-select/tree-select.js +20 -10
- 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 +16 -3
- package/dist/docs/components/tooltip.doc.d.ts +2 -2
- package/dist/entries/provider.d.ts +2 -1
- package/dist/entries/provider.js +1 -0
- package/dist/index.d.ts +2 -1
- 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 +16 -5
- package/dist/provider/tao-provider.js +200 -92
- package/dist/utils/scroll-left.d.ts +3 -0
- package/dist/utils/scroll-left.js +7 -0
- package/llms.txt +3 -3
- package/package.json +5 -1
|
@@ -77,10 +77,11 @@ function Tabs(t0) {
|
|
|
77
77
|
const focusedKey = e.target.closest("[data-tao-tab-key]")?.getAttribute("data-tao-tab-key") ?? focusKey;
|
|
78
78
|
const idx = enabledItems.findIndex((item_3)=>item_3.key === focusedKey);
|
|
79
79
|
let next;
|
|
80
|
-
|
|
80
|
+
const rtl = "rtl" === getComputedStyle(e.currentTarget).direction;
|
|
81
|
+
if (e.key === (rtl ? "ArrowLeft" : "ArrowRight") || "ArrowDown" === e.key) {
|
|
81
82
|
e.preventDefault();
|
|
82
83
|
next = enabledItems[(idx + 1) % enabledItems.length];
|
|
83
|
-
} else if ("
|
|
84
|
+
} else if (e.key === (rtl ? "ArrowRight" : "ArrowLeft") || "ArrowUp" === e.key) {
|
|
84
85
|
e.preventDefault();
|
|
85
86
|
next = enabledItems[(idx - 1 + enabledItems.length) % enabledItems.length];
|
|
86
87
|
} else if ("Home" === e.key) {
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react-compiler-runtime";
|
|
3
3
|
import { cx } from "../../utils/semantic.js";
|
|
4
4
|
import "./tag.css";
|
|
5
|
+
import { useTaoConfig } from "../../provider/tao-provider.js";
|
|
5
6
|
function CloseIcon() {
|
|
6
7
|
const $ = c(1);
|
|
7
8
|
let t0;
|
|
@@ -26,11 +27,12 @@ function CloseIcon() {
|
|
|
26
27
|
return t0;
|
|
27
28
|
}
|
|
28
29
|
function Tag(t0) {
|
|
29
|
-
const $ = c(
|
|
30
|
+
const $ = c(41);
|
|
30
31
|
const { children, color: t1, variant: t2, icon, closeIcon, onClose, disabled: t3, className, style, classNames, styles } = t0;
|
|
31
32
|
const color = void 0 === t1 ? "default" : t1;
|
|
32
33
|
const variant = void 0 === t2 ? "filled" : t2;
|
|
33
34
|
const disabled = void 0 === t3 ? false : t3;
|
|
35
|
+
const { locale } = useTaoConfig();
|
|
34
36
|
let t4;
|
|
35
37
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
36
38
|
t4 = [
|
|
@@ -128,11 +130,11 @@ function Tag(t0) {
|
|
|
128
130
|
$[22] = t15;
|
|
129
131
|
} else t15 = $[22];
|
|
130
132
|
let t16;
|
|
131
|
-
if ($[23] !== classNames?.close || $[24] !== closeIcon || $[25] !== disabled || $[26] !== handleClose || $[27] !==
|
|
133
|
+
if ($[23] !== classNames?.close || $[24] !== closeIcon || $[25] !== disabled || $[26] !== handleClose || $[27] !== locale || $[28] !== showClose || $[29] !== styles?.close) {
|
|
132
134
|
t16 = showClose && /*#__PURE__*/ jsx("button", {
|
|
133
135
|
type: "button",
|
|
134
136
|
"data-tao-tag-close": "",
|
|
135
|
-
"aria-label":
|
|
137
|
+
"aria-label": locale.close,
|
|
136
138
|
disabled: disabled,
|
|
137
139
|
onClick: handleClose,
|
|
138
140
|
className: cx(classNames?.close),
|
|
@@ -143,12 +145,13 @@ function Tag(t0) {
|
|
|
143
145
|
$[24] = closeIcon;
|
|
144
146
|
$[25] = disabled;
|
|
145
147
|
$[26] = handleClose;
|
|
146
|
-
$[27] =
|
|
147
|
-
$[28] =
|
|
148
|
-
$[29] =
|
|
149
|
-
|
|
148
|
+
$[27] = locale;
|
|
149
|
+
$[28] = showClose;
|
|
150
|
+
$[29] = styles?.close;
|
|
151
|
+
$[30] = t16;
|
|
152
|
+
} else t16 = $[30];
|
|
150
153
|
let t17;
|
|
151
|
-
if ($[
|
|
154
|
+
if ($[31] !== t11 || $[32] !== t13 || $[33] !== t14 || $[34] !== t15 || $[35] !== t16 || $[36] !== t7 || $[37] !== t8 || $[38] !== t9 || $[39] !== variant) {
|
|
152
155
|
t17 = /*#__PURE__*/ jsxs("span", {
|
|
153
156
|
"data-tao-tag": "",
|
|
154
157
|
"data-tao-color": t7,
|
|
@@ -163,17 +166,17 @@ function Tag(t0) {
|
|
|
163
166
|
t16
|
|
164
167
|
]
|
|
165
168
|
});
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
} else t17 = $[
|
|
169
|
+
$[31] = t11;
|
|
170
|
+
$[32] = t13;
|
|
171
|
+
$[33] = t14;
|
|
172
|
+
$[34] = t15;
|
|
173
|
+
$[35] = t16;
|
|
174
|
+
$[36] = t7;
|
|
175
|
+
$[37] = t8;
|
|
176
|
+
$[38] = t9;
|
|
177
|
+
$[39] = variant;
|
|
178
|
+
$[40] = t17;
|
|
179
|
+
} else t17 = $[40];
|
|
177
180
|
return t17;
|
|
178
181
|
}
|
|
179
182
|
function CheckableTag(t0) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type PickerRef, type PickerProps as RcPickerProps, type RangePickerProps as RcRangePickerProps } from '@rc-component/picker';
|
|
2
2
|
import type { Locale, RangePickerRef } from '@rc-component/picker/interface';
|
|
3
3
|
import type { Dayjs } from 'dayjs';
|
|
4
|
-
import 'dayjs/locale/zh-cn';
|
|
5
4
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
6
5
|
import './time-picker.css';
|
|
7
6
|
export type TimePickerSemanticPart = 'root' | 'prefix' | 'input' | 'suffix' | 'popup';
|
|
@@ -3,12 +3,13 @@ import { c } from "react-compiler-runtime";
|
|
|
3
3
|
import picker, { RangePicker } from "@rc-component/picker";
|
|
4
4
|
import dayjs from "@rc-component/picker/generate/dayjs";
|
|
5
5
|
import en_US from "@rc-component/picker/locale/en_US";
|
|
6
|
-
import
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { forwardRef, useImperativeHandle, useMemo, useRef } from "react";
|
|
7
|
+
import { TaoPortalScope, useTaoConfig, useTaoDirection, useTaoInternalConfig } from "../../provider/tao-provider.js";
|
|
8
|
+
import { mergeRefs } from "../../utils/refs.js";
|
|
9
|
+
import { normalizeDigits, resolveNumberFormat } from "../../number-input/locale.js";
|
|
10
10
|
import { cx } from "../../utils/semantic.js";
|
|
11
11
|
import { Button } from "../button/button.js";
|
|
12
|
+
import { parsePickerDate } from "../date-picker/date-localization.js";
|
|
12
13
|
import "./time-picker.css";
|
|
13
14
|
function TimeIcon(t0) {
|
|
14
15
|
const $ = c(2);
|
|
@@ -73,128 +74,172 @@ function NowButton(props) {
|
|
|
73
74
|
return t0;
|
|
74
75
|
}
|
|
75
76
|
function useAppearance(props, classNames, styles) {
|
|
76
|
-
const $ = c(
|
|
77
|
+
const $ = c(46);
|
|
77
78
|
const config = useTaoConfig();
|
|
78
79
|
const { tokenStyle } = useTaoInternalConfig();
|
|
79
|
-
const baseLocale =
|
|
80
|
+
const baseLocale = config.locale.pickerLocale ?? en_US;
|
|
80
81
|
let t0;
|
|
81
|
-
if ($[0] !==
|
|
82
|
-
t0 = "
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
$[
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
82
|
+
if ($[0] !== config.locale.numberLocale || $[1] !== props.locale) {
|
|
83
|
+
t0 = props.locale?.lang.locale ? props.locale.lang.locale.replaceAll("_", "-") : config.locale.numberLocale;
|
|
84
|
+
$[0] = config.locale.numberLocale;
|
|
85
|
+
$[1] = props.locale;
|
|
86
|
+
$[2] = t0;
|
|
87
|
+
} else t0 = $[2];
|
|
88
|
+
const numberLocale = t0;
|
|
89
|
+
const dayjsLocale = config.locale.dayjsLocale;
|
|
90
|
+
let t1;
|
|
91
|
+
if ($[3] !== numberLocale) {
|
|
92
|
+
t1 = resolveNumberFormat(numberLocale);
|
|
93
|
+
$[3] = numberLocale;
|
|
94
|
+
$[4] = t1;
|
|
95
|
+
} else t1 = $[4];
|
|
96
|
+
const numberFormat = t1;
|
|
90
97
|
let t2;
|
|
91
|
-
if ($[
|
|
98
|
+
if ($[5] !== baseLocale.locale || $[6] !== dayjsLocale || $[7] !== numberFormat || $[8] !== numberLocale) {
|
|
92
99
|
t2 = {
|
|
100
|
+
...dayjs,
|
|
101
|
+
locale: {
|
|
102
|
+
...dayjs.locale,
|
|
103
|
+
parse: (locale, text, formats)=>{
|
|
104
|
+
if (locale === baseLocale.locale && dayjsLocale) {
|
|
105
|
+
for (const format of formats){
|
|
106
|
+
const parsed = parsePickerDate(text, format, dayjsLocale, numberLocale);
|
|
107
|
+
if (parsed.isValid()) return parsed;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
return dayjs.locale.parse(locale, normalizeDigits(text, numberFormat), formats);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
$[5] = baseLocale.locale;
|
|
116
|
+
$[6] = dayjsLocale;
|
|
117
|
+
$[7] = numberFormat;
|
|
118
|
+
$[8] = numberLocale;
|
|
119
|
+
$[9] = t2;
|
|
120
|
+
} else t2 = $[9];
|
|
121
|
+
const generateConfig = t2;
|
|
122
|
+
let t3;
|
|
123
|
+
if ($[10] !== classNames) {
|
|
124
|
+
t3 = "string" == typeof classNames?.popup ? {
|
|
125
|
+
root: classNames.popup
|
|
126
|
+
} : classNames?.popup;
|
|
127
|
+
$[10] = classNames;
|
|
128
|
+
$[11] = t3;
|
|
129
|
+
} else t3 = $[11];
|
|
130
|
+
const popup = t3;
|
|
131
|
+
const t4 = props.locale?.lang;
|
|
132
|
+
let t5;
|
|
133
|
+
if ($[12] !== baseLocale || $[13] !== config.locale.clear || $[14] !== config.locale.now || $[15] !== config.locale.ok || $[16] !== t4) {
|
|
134
|
+
t5 = {
|
|
93
135
|
...baseLocale,
|
|
94
136
|
now: config.locale.now,
|
|
95
137
|
ok: config.locale.ok,
|
|
96
138
|
clear: config.locale.clear,
|
|
97
|
-
...
|
|
139
|
+
...t4
|
|
98
140
|
};
|
|
99
|
-
$[
|
|
100
|
-
$[
|
|
101
|
-
$[
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
105
|
-
} else
|
|
106
|
-
const
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
let
|
|
110
|
-
if ($[
|
|
111
|
-
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
} else
|
|
117
|
-
let
|
|
118
|
-
if ($[
|
|
119
|
-
|
|
141
|
+
$[12] = baseLocale;
|
|
142
|
+
$[13] = config.locale.clear;
|
|
143
|
+
$[14] = config.locale.now;
|
|
144
|
+
$[15] = config.locale.ok;
|
|
145
|
+
$[16] = t4;
|
|
146
|
+
$[17] = t5;
|
|
147
|
+
} else t5 = $[17];
|
|
148
|
+
const t6 = "middle" === props.size ? "medium" : props.size ?? config.size;
|
|
149
|
+
const t7 = props.variant ?? (false === props.bordered ? "borderless" : config.variant);
|
|
150
|
+
const t8 = popup?.root;
|
|
151
|
+
let t9;
|
|
152
|
+
if ($[18] !== props.dropdownClassName || $[19] !== props.popupClassName || $[20] !== t8) {
|
|
153
|
+
t9 = cx(props.dropdownClassName, props.popupClassName, t8);
|
|
154
|
+
$[18] = props.dropdownClassName;
|
|
155
|
+
$[19] = props.popupClassName;
|
|
156
|
+
$[20] = t8;
|
|
157
|
+
$[21] = t9;
|
|
158
|
+
} else t9 = $[21];
|
|
159
|
+
let t10;
|
|
160
|
+
if ($[22] !== popup || $[23] !== t9) {
|
|
161
|
+
t10 = {
|
|
120
162
|
...popup,
|
|
121
|
-
root:
|
|
122
|
-
};
|
|
123
|
-
$[12] = popup;
|
|
124
|
-
$[13] = t6;
|
|
125
|
-
$[14] = t7;
|
|
126
|
-
} else t7 = $[14];
|
|
127
|
-
let t8;
|
|
128
|
-
if ($[15] !== classNames || $[16] !== t7) {
|
|
129
|
-
t8 = {
|
|
130
|
-
...classNames,
|
|
131
|
-
popup: t7
|
|
163
|
+
root: t9
|
|
132
164
|
};
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
} else
|
|
137
|
-
const t9 = styles?.popup;
|
|
138
|
-
const t10 = styles?.popup?.root;
|
|
165
|
+
$[22] = popup;
|
|
166
|
+
$[23] = t9;
|
|
167
|
+
$[24] = t10;
|
|
168
|
+
} else t10 = $[24];
|
|
139
169
|
let t11;
|
|
140
|
-
if ($[
|
|
170
|
+
if ($[25] !== classNames || $[26] !== t10) {
|
|
141
171
|
t11 = {
|
|
172
|
+
...classNames,
|
|
173
|
+
popup: t10
|
|
174
|
+
};
|
|
175
|
+
$[25] = classNames;
|
|
176
|
+
$[26] = t10;
|
|
177
|
+
$[27] = t11;
|
|
178
|
+
} else t11 = $[27];
|
|
179
|
+
const t12 = styles?.popup;
|
|
180
|
+
const t13 = styles?.popup?.root;
|
|
181
|
+
let t14;
|
|
182
|
+
if ($[28] !== props.popupStyle || $[29] !== t13 || $[30] !== tokenStyle) {
|
|
183
|
+
t14 = {
|
|
142
184
|
...tokenStyle,
|
|
143
185
|
position: "absolute",
|
|
144
186
|
width: "max-content",
|
|
145
187
|
maxWidth: "calc(100vw - 24px)",
|
|
146
188
|
zIndex: "calc(var(--tao-z-index-popup-base) + 50)",
|
|
147
189
|
...props.popupStyle,
|
|
148
|
-
...
|
|
190
|
+
...t13
|
|
149
191
|
};
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
} else
|
|
155
|
-
let
|
|
156
|
-
if ($[
|
|
157
|
-
|
|
158
|
-
...
|
|
159
|
-
root:
|
|
192
|
+
$[28] = props.popupStyle;
|
|
193
|
+
$[29] = t13;
|
|
194
|
+
$[30] = tokenStyle;
|
|
195
|
+
$[31] = t14;
|
|
196
|
+
} else t14 = $[31];
|
|
197
|
+
let t15;
|
|
198
|
+
if ($[32] !== t12 || $[33] !== t14) {
|
|
199
|
+
t15 = {
|
|
200
|
+
...t12,
|
|
201
|
+
root: t14
|
|
160
202
|
};
|
|
161
|
-
$[
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
} else
|
|
165
|
-
let
|
|
166
|
-
if ($[
|
|
167
|
-
|
|
203
|
+
$[32] = t12;
|
|
204
|
+
$[33] = t14;
|
|
205
|
+
$[34] = t15;
|
|
206
|
+
} else t15 = $[34];
|
|
207
|
+
let t16;
|
|
208
|
+
if ($[35] !== styles || $[36] !== t15) {
|
|
209
|
+
t16 = {
|
|
168
210
|
...styles,
|
|
169
|
-
popup:
|
|
211
|
+
popup: t15
|
|
170
212
|
};
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
} else
|
|
175
|
-
let
|
|
176
|
-
if ($[
|
|
177
|
-
|
|
213
|
+
$[35] = styles;
|
|
214
|
+
$[36] = t15;
|
|
215
|
+
$[37] = t16;
|
|
216
|
+
} else t16 = $[37];
|
|
217
|
+
let t17;
|
|
218
|
+
if ($[38] !== config || $[39] !== generateConfig || $[40] !== t11 || $[41] !== t16 || $[42] !== t5 || $[43] !== t6 || $[44] !== t7) {
|
|
219
|
+
t17 = {
|
|
178
220
|
config,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
221
|
+
generateConfig,
|
|
222
|
+
locale: t5,
|
|
223
|
+
size: t6,
|
|
224
|
+
variant: t7,
|
|
225
|
+
classNames: t11,
|
|
226
|
+
styles: t16
|
|
184
227
|
};
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
|
|
193
|
-
|
|
228
|
+
$[38] = config;
|
|
229
|
+
$[39] = generateConfig;
|
|
230
|
+
$[40] = t11;
|
|
231
|
+
$[41] = t16;
|
|
232
|
+
$[42] = t5;
|
|
233
|
+
$[43] = t6;
|
|
234
|
+
$[44] = t7;
|
|
235
|
+
$[45] = t17;
|
|
236
|
+
} else t17 = $[45];
|
|
237
|
+
return t17;
|
|
194
238
|
}
|
|
195
|
-
function scopedPanel(panel, render) {
|
|
239
|
+
function scopedPanel(panel, render, direction) {
|
|
196
240
|
return /*#__PURE__*/ jsx(TaoPortalScope, {
|
|
197
241
|
asChild: true,
|
|
242
|
+
direction: direction,
|
|
198
243
|
children: /*#__PURE__*/ jsx("div", {
|
|
199
244
|
"data-tao-time-popup": "",
|
|
200
245
|
children: render ? render(panel) : panel
|
|
@@ -203,6 +248,10 @@ function scopedPanel(panel, render) {
|
|
|
203
248
|
}
|
|
204
249
|
const SingleTimePicker = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
205
250
|
const rootRef = useRef(null);
|
|
251
|
+
const [direction, directionRef] = useTaoDirection(props.direction);
|
|
252
|
+
const mergedRootRef = useMemo(()=>mergeRefs(rootRef, directionRef), [
|
|
253
|
+
directionRef
|
|
254
|
+
]);
|
|
206
255
|
const pickerRef = useRef(null);
|
|
207
256
|
useImperativeHandle(ref, ()=>({
|
|
208
257
|
get nativeElement () {
|
|
@@ -227,7 +276,8 @@ const SingleTimePicker = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
227
276
|
...'object' == typeof allowClear ? allowClear : {}
|
|
228
277
|
};
|
|
229
278
|
return /*#__PURE__*/ jsx("div", {
|
|
230
|
-
ref:
|
|
279
|
+
ref: mergedRootRef,
|
|
280
|
+
dir: direction,
|
|
231
281
|
"data-tao-time-picker": "",
|
|
232
282
|
"data-tao-control": "",
|
|
233
283
|
"data-tao-size": appearance.size,
|
|
@@ -243,8 +293,9 @@ const SingleTimePicker = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
243
293
|
children: /*#__PURE__*/ jsx(picker, {
|
|
244
294
|
...rest,
|
|
245
295
|
ref: pickerRef,
|
|
296
|
+
direction: direction,
|
|
246
297
|
picker: "time",
|
|
247
|
-
generateConfig:
|
|
298
|
+
generateConfig: appearance.generateConfig,
|
|
248
299
|
locale: appearance.locale,
|
|
249
300
|
defaultValue: defaultValue ?? void 0,
|
|
250
301
|
disabled: disabled,
|
|
@@ -266,7 +317,7 @@ const SingleTimePicker = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
266
317
|
okButton: components?.button ?? ConfirmButton,
|
|
267
318
|
...components
|
|
268
319
|
},
|
|
269
|
-
panelRender: (panel)=>scopedPanel(panel, panelRender),
|
|
320
|
+
panelRender: (panel)=>scopedPanel(panel, panelRender, direction),
|
|
270
321
|
renderExtraFooter: renderExtraFooter ?? addon,
|
|
271
322
|
onChange: (date, text)=>onChange?.(date, text),
|
|
272
323
|
onOk: (date_0)=>onOk?.(date_0),
|
|
@@ -280,6 +331,10 @@ const SingleTimePicker = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
280
331
|
SingleTimePicker.displayName = 'TimePicker';
|
|
281
332
|
const TimeRangePicker = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
282
333
|
const rootRef = useRef(null);
|
|
334
|
+
const [direction, directionRef] = useTaoDirection(props.direction);
|
|
335
|
+
const mergedRootRef = useMemo(()=>mergeRefs(rootRef, directionRef), [
|
|
336
|
+
directionRef
|
|
337
|
+
]);
|
|
283
338
|
const pickerRef = useRef(null);
|
|
284
339
|
useImperativeHandle(ref, ()=>({
|
|
285
340
|
get nativeElement () {
|
|
@@ -304,7 +359,8 @@ const TimeRangePicker = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
304
359
|
...'object' == typeof allowClear ? allowClear : {}
|
|
305
360
|
};
|
|
306
361
|
return /*#__PURE__*/ jsx("div", {
|
|
307
|
-
ref:
|
|
362
|
+
ref: mergedRootRef,
|
|
363
|
+
dir: direction,
|
|
308
364
|
"data-tao-time-picker": "range",
|
|
309
365
|
"data-tao-control": "",
|
|
310
366
|
"data-tao-size": appearance.size,
|
|
@@ -320,8 +376,9 @@ const TimeRangePicker = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
320
376
|
children: /*#__PURE__*/ jsx(RangePicker, {
|
|
321
377
|
...rest,
|
|
322
378
|
ref: pickerRef,
|
|
379
|
+
direction: direction,
|
|
323
380
|
picker: "time",
|
|
324
|
-
generateConfig:
|
|
381
|
+
generateConfig: appearance.generateConfig,
|
|
325
382
|
locale: appearance.locale,
|
|
326
383
|
disabled: disabled,
|
|
327
384
|
placeholder: placeholder ?? locale?.timePickerLocale?.rangePlaceholder ?? locale?.lang.rangePlaceholder ?? [
|
|
@@ -345,7 +402,7 @@ const TimeRangePicker = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
345
402
|
okButton: components?.button ?? ConfirmButton,
|
|
346
403
|
...components
|
|
347
404
|
},
|
|
348
|
-
panelRender: (panel)=>scopedPanel(panel, panelRender)
|
|
405
|
+
panelRender: (panel)=>scopedPanel(panel, panelRender, direction)
|
|
349
406
|
})
|
|
350
407
|
});
|
|
351
408
|
});
|
|
@@ -4,6 +4,7 @@ import './tooltip.css';
|
|
|
4
4
|
export type TooltipSemanticPart = 'content' | 'arrow';
|
|
5
5
|
export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
6
6
|
export interface TooltipProps {
|
|
7
|
+
direction?: 'ltr' | 'rtl';
|
|
7
8
|
/** Tooltip content. Renders nothing (and disables the tooltip) when null/undefined/''. */
|
|
8
9
|
title?: ReactNode;
|
|
9
10
|
/** Popup side relative to the trigger. Defaults to 'top'. */
|
|
@@ -30,4 +31,4 @@ export interface TooltipProps {
|
|
|
30
31
|
/** Exactly one trigger element. */
|
|
31
32
|
children: ReactNode;
|
|
32
33
|
}
|
|
33
|
-
export declare function Tooltip({ title, placement, arrow, open, defaultOpen, onOpenChange, mouseEnterDelay, mouseLeaveDelay, color, className, style, classNames, styles, children, }: TooltipProps): import("react").JSX.Element;
|
|
34
|
+
export declare function Tooltip({ direction: directionProp, title, placement, arrow, open, defaultOpen, onOpenChange, mouseEnterDelay, mouseLeaveDelay, color, className, style, classNames, styles, children, }: TooltipProps): import("react").JSX.Element;
|